XP From Harvest

XP From Harvest

16M Downloads

Error and crash on right click harvesting when a seed is dropped.

JaisDK opened this issue ยท 1 comments

commented

With simpleharvest enabled, the log gets filled with errors when harvesting. It happens when a seed is also dropped.
It's not safe to modify a list inside a foreach loop, you should use an iterator instead.
https://github.com/Real-Gecko/XPFromHarvest/blob/1.16.3/src/main/java/com/realgecko/xpfromharvest/SimpleHarvestHandler.java#L52

Normally this only produces an error, but if the right click event is fired by a fake player, the server crashes as well.

[02:39:43] [Server thread/ERROR] [ne.mi.ev.EventBus/EVENTBUS]: Exception caught during firing event: null
	Index: 1
	Listeners:
		0: HIGHEST
		1: ASM: com.realgecko.xpfromharvest.SimpleHarvestHandler@5f562688 handleRightClick(Lnet/minecraftforge/event/entity/player/PlayerInteractEvent$RightClickBlock;)V
		2: NORMAL
		3: ASM: class vazkii.patchouli.client.handler.BookRightClickHandler onRightClick(Lnet/minecraftforge/event/entity/player/PlayerInteractEvent$RightClickBlock;)V
		4: ASM: class vazkii.patchouli.client.handler.MultiblockVisualizationHandler onPlayerInteract(Lnet/minecraftforge/event/entity/player/PlayerInteractEvent$RightClickBlock;)V
		5: ASM: class com.buuz135.industrial.proxy.event.CocoaBeanRightClickHarvesting onPlayerRightClick(Lnet/minecraftforge/event/entity/player/PlayerInteractEvent$RightClickBlock;)V
		6: ASM: class com.simibubi.create.foundation.tileEntity.behaviour.linked.LinkHandler onBlockActivated(Lnet/minecraftforge/event/entity/player/PlayerInteractEvent$RightClickBlock;)V
		7: ASM: class com.simibubi.create.foundation.tileEntity.behaviour.filtering.FilteringHandler onBlockActivated(Lnet/minecraftforge/event/entity/player/PlayerInteractEvent$RightClickBlock;)V
		8: ASM: class com.simibubi.create.foundation.tileEntity.behaviour.edgeInteraction.EdgeInteractionHandler onBlockActivated(Lnet/minecraftforge/event/entity/player/PlayerInteractEvent$RightClickBlock;)V
		9: ASM: class com.simibubi.create.content.logistics.block.mechanicalArm.ArmInteractionPointHandler rightClickingBlocksSelectsThem(Lnet/minecraftforge/event/entity/player/PlayerInteractEvent$RightClickBlock;)V
		10: ASM: class com.simibubi.create.content.logistics.block.funnel.FunnelItem funnelItemAlwaysPlacesWhenUsed(Lnet/minecraftforge/event/entity/player/PlayerInteractEvent$RightClickBlock;)V
		11: ASM: class com.simibubi.create.content.contraptions.components.flywheel.engine.FurnaceEngineBlock usingFurnaceEngineOnFurnacePreventsGUI(Lnet/minecraftforge/event/entity/player/PlayerInteractEvent$RightClickBlock;)V
		12: ASM: mekanism.common.CommonPlayerTracker@6482ba01 rightClickEvent(Lnet/minecraftforge/event/entity/player/PlayerInteractEvent$RightClickBlock;)V
		13: ASM: vazkii.quark.content.building.module.BurnVinesModule@59f4b318 onRightClick(Lnet/minecraftforge/event/entity/player/PlayerInteractEvent$RightClickBlock;)V
		14: ASM: vazkii.quark.content.building.module.ShallowDirtModule@275e3043 onRightClick(Lnet/minecraftforge/event/entity/player/PlayerInteractEvent$RightClickBlock;)V
		15: ASM: vazkii.quark.content.building.module.TieLeadsToFencesModule@554f63f5 onRightClick(Lnet/minecraftforge/event/entity/player/PlayerInteractEvent$RightClickBlock;)V
		16: ASM: vazkii.quark.content.tweaks.module.DirtToPathModule@43295eba onRightClick(Lnet/minecraftforge/event/entity/player/PlayerInteractEvent$RightClickBlock;)V
		17: ASM: vazkii.quark.content.tweaks.module.EnhancedLaddersModule@711c5d6f onInteract(Lnet/minecraftforge/event/entity/player/PlayerInteractEvent$RightClickBlock;)V
		18: ASM: vazkii.quark.content.tweaks.module.ReplaceScaffoldingModule@26a51d59 onInteract(Lnet/minecraftforge/event/entity/player/PlayerInteractEvent$RightClickBlock;)V
		19: ASM: vazkii.quark.content.tweaks.module.SignEditingModule@6e8d8b28 onInteract(Lnet/minecraftforge/event/entity/player/PlayerInteractEvent$RightClickBlock;)V
		20: ASM: vazkii.quark.content.tweaks.module.ImprovedSleepingModule@463d69a4 onPlayerClick(Lnet/minecraftforge/event/entity/player/PlayerInteractEvent;)V
		21: LOWEST
		22: ASM: vazkii.quark.content.tweaks.module.DoubleDoorOpeningModule@4e78318d onPlayerInteract(Lnet/minecraftforge/event/entity/player/PlayerInteractEvent$RightClickBlock;)V
java.util.ConcurrentModificationException
	at java.base/java.util.ArrayList$Itr.checkForComodification(ArrayList.java:1042)
	at java.base/java.util.ArrayList$Itr.next(ArrayList.java:996)
	at com.realgecko.xpfromharvest.SimpleHarvestHandler.handleHarvest(SimpleHarvestHandler.java:45)
	at com.realgecko.xpfromharvest.SimpleHarvestHandler.handleRightClick(SimpleHarvestHandler.java:37)
	at net.minecraftforge.eventbus.ASMEventHandler_235_SimpleHarvestHandler_handleRightClick_RightClickBlock.invoke(.dynamic)
	at net.minecraftforge.eventbus.ASMEventHandler.invoke(ASMEventHandler.java:85)
	at net.minecraftforge.eventbus.EventBus.post(EventBus.java:302)
	at net.minecraftforge.eventbus.EventBus.post(EventBus.java:283)
	at net.minecraftforge.common.ForgeHooks.onRightClickBlock(ForgeHooks.java:813)
	at net.minecraft.server.management.PlayerInteractionManager.func_219441_a(PlayerInteractionManager.java:318)
	at net.minecraft.network.play.ServerPlayNetHandler.processTryUseItemOnBlock(ServerPlayNetHandler.java:958)
	at net.minecraft.network.play.client.CPlayerTryUseItemOnBlockPacket.processPacket(SourceFile:36)
	at net.minecraft.network.play.client.CPlayerTryUseItemOnBlockPacket.processPacket(SourceFile:10)
	at net.minecraft.network.PacketThreadUtil.func_225383_a(SourceFile:21)
	at net.minecraft.util.concurrent.TickDelayedTask.run(SourceFile:18)
	at net.minecraft.util.concurrent.ThreadTaskExecutor.run(SourceFile:144)
	at net.minecraft.util.concurrent.RecursiveEventLoop.run(SourceFile:23)
	at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:733)
	at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:159)
	at net.minecraft.util.concurrent.ThreadTaskExecutor.driveOne(SourceFile:118)
	at net.minecraft.server.MinecraftServer.driveOneInternal(MinecraftServer.java:716)
	at net.minecraft.server.MinecraftServer.driveOne(MinecraftServer.java:710)
	at net.minecraft.util.concurrent.ThreadTaskExecutor.drainTasks(SourceFile:103)
	at net.minecraft.server.MinecraftServer.runScheduledTasks(MinecraftServer.java:695)
	at net.minecraft.server.MinecraftServer.func_240802_v_(MinecraftServer.java:645)
	at net.minecraft.server.MinecraftServer.lambda$startServer$0(MinecraftServer.java:232)
	at java.base/java.lang.Thread.run(Thread.java:834)

[02:39:43] [Server thread/FATAL] [minecraft/ThreadTaskExecutor]: Error executing task on Server
java.util.ConcurrentModificationException: null
	at java.util.ArrayList$Itr.checkForComodification(ArrayList.java:1042) ~[?:?] {}
	at java.util.ArrayList$Itr.next(ArrayList.java:996) ~[?:?] {}
	at com.realgecko.xpfromharvest.SimpleHarvestHandler.handleHarvest(SimpleHarvestHandler.java:45) ~[XPFromHarvest-1.16.3-1.2.1_mapped_snapshot_20201028-1.16.3.jar:?] {re:classloading}
	at com.realgecko.xpfromharvest.SimpleHarvestHandler.handleRightClick(SimpleHarvestHandler.java:37) ~[XPFromHarvest-1.16.3-1.2.1_mapped_snapshot_20201028-1.16.3.jar:?] {re:classloading}
	at net.minecraftforge.eventbus.ASMEventHandler_235_SimpleHarvestHandler_handleRightClick_RightClickBlock.invoke(.dynamic) ~[?:?] {}
	at net.minecraftforge.eventbus.ASMEventHandler.invoke(ASMEventHandler.java:85) ~[eventbus-4.0.0.jar:?] {}
	at net.minecraftforge.eventbus.EventBus.post(EventBus.java:302) ~[eventbus-4.0.0.jar:?] {}
	at net.minecraftforge.eventbus.EventBus.post(EventBus.java:283) ~[eventbus-4.0.0.jar:?] {}
	at net.minecraftforge.common.ForgeHooks.onRightClickBlock(ForgeHooks.java:813) ~[forge:?] {re:classloading}
	at net.minecraft.server.management.PlayerInteractionManager.func_219441_a(PlayerInteractionManager.java:318) ~[forge:?] {re:classloading}
	at net.minecraft.network.play.ServerPlayNetHandler.processTryUseItemOnBlock(ServerPlayNetHandler.java:958) ~[forge:?] {re:classloading,pl:accesstransformer:B}
	at net.minecraft.network.play.client.CPlayerTryUseItemOnBlockPacket.processPacket(SourceFile:36) ~[forge:?] {re:classloading}
	at net.minecraft.network.play.client.CPlayerTryUseItemOnBlockPacket.processPacket(SourceFile:10) ~[forge:?] {re:classloading}
	at net.minecraft.network.PacketThreadUtil.func_225383_a(SourceFile:21) ~[forge:?] {re:classloading}
	at net.minecraft.util.concurrent.TickDelayedTask.run(SourceFile:18) ~[forge:?] {re:classloading}
	at net.minecraft.util.concurrent.ThreadTaskExecutor.run(SourceFile:144) ~[forge:?] {re:classloading,pl:accesstransformer:B}
	at net.minecraft.util.concurrent.RecursiveEventLoop.run(SourceFile:23) ~[forge:?] {re:classloading}
	at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:733) ~[forge:?] {re:classloading,pl:accesstransformer:B}
	at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:159) ~[forge:?] {re:classloading,pl:accesstransformer:B}
	at net.minecraft.util.concurrent.ThreadTaskExecutor.driveOne(SourceFile:118) ~[forge:?] {re:classloading,pl:accesstransformer:B}
	at net.minecraft.server.MinecraftServer.driveOneInternal(MinecraftServer.java:716) ~[forge:?] {re:classloading,pl:accesstransformer:B}
	at net.minecraft.server.MinecraftServer.driveOne(MinecraftServer.java:710) ~[forge:?] {re:classloading,pl:accesstransformer:B}
	at net.minecraft.util.concurrent.ThreadTaskExecutor.drainTasks(SourceFile:103) ~[forge:?] {re:classloading,pl:accesstransformer:B}
	at net.minecraft.server.MinecraftServer.runScheduledTasks(MinecraftServer.java:695) ~[forge:?] {re:classloading,pl:accesstransformer:B}
	at net.minecraft.server.MinecraftServer.func_240802_v_(MinecraftServer.java:645) ~[forge:?] {re:classloading,pl:accesstransformer:B}
	at net.minecraft.server.MinecraftServer.lambda$startServer$0(MinecraftServer.java:232) ~[forge:?] {re:classloading,pl:accesstransformer:B}
	at java.lang.Thread.run(Thread.java:834) [?:?] {}
commented

Try version 1.2.2 it has to be fixed now, get it from CurseForge and have some fun.