GameLoop crash: ConcurrentModificationException in FloorItems.run()
FloorItems.run() (FloorItems.kt:39) throws a ConcurrentModificationException, killing the tick loop until restart.
java.util.ConcurrentModificationException
at world.gregs.voidps.engine.entity.item.floor.FloorItems.run(FloorItems.kt:39)
at world.gregs.voidps.engine.GameLoop.tick(GameLoop.kt:44)
Root cause
run() iterates removeQueue with a for-each loop and fires Despawn.floorItem(item) per entry. The only registered handler, FloorItemRespawn (FloorItemRespawn.kt:11-16), calls FloorItems.add(...). When the target tile is at the 128-item cap, that add cascades display() → full() → remove(min), which appends to the removeQueue we're still iterating. The iterator detects the comodification and throws.
The same shape exists on addQueue (line 43) for any future floorItemSpawn handler that calls add/remove.
Repro: a tile with ~128 items plus a nearby world-spawn item picked up on the same tick. The despawn handler re-adds, the full-tile path evicts, CME fires.
GameLoop crash:
ConcurrentModificationExceptioninFloorItems.run()FloorItems.run()(FloorItems.kt:39) throws aConcurrentModificationException, killing the tick loop until restart.Root cause
run()iteratesremoveQueuewith a for-each loop and firesDespawn.floorItem(item)per entry. The only registered handler,FloorItemRespawn(FloorItemRespawn.kt:11-16), callsFloorItems.add(...). When the target tile is at the 128-item cap, that add cascadesdisplay()→full()→remove(min), which appends to theremoveQueuewe're still iterating. The iterator detects the comodification and throws.The same shape exists on
addQueue(line 43) for any futurefloorItemSpawnhandler that callsadd/remove.Repro: a tile with ~128 items plus a nearby world-spawn item picked up on the same tick. The despawn handler re-adds, the full-tile path evicts, CME fires.