ConcurrentModificationException in LightningWeb
SettingDust opened this issue ยท 5 comments
Minecraft version: 1.12.2
Wizardry version: 4.2.11
Environment: Singleplayer
Issue details:
java.util.ConcurrentModificationException
at java.util.ArrayList$SubList$1.checkForComodification(ArrayList.java:1213)
at java.util.ArrayList$SubList$1.next(ArrayList.java:1114)
at electroblob.wizardry.spell.LightningWeb.onEntityHit(LightningWeb.java:73)
at electroblob.wizardry.spell.SpellRay.shootSpell(SpellRay.java:286)
at electroblob.wizardry.spell.SpellRay.cast(SpellRay.java:165)
at electroblob.wizardry.item.ItemScroll.cast(ItemScroll.java:177)
at electroblob.wizardry.item.ItemScroll.onUsingTick(ItemScroll.java:151)
Finally got round to looking at this, but I don't understand how this can possibly happen. Here's the bit of code where the exception happened:
Wizardry/src/main/java/electroblob/wizardry/spell/LightningWeb.java
Lines 63 to 94 in 378e19a
The list in question, secondaryTargets
, is a list I have created, and its scope is local to that method. I'm not modifying it inside the loop at all. The tertiaryTargets
list is completely separate from secondaryTargets
and a fresh one is created each loop iteration. This can't be client/server related because as I said, the scope is local to that method. Same goes for other mods interfering, this is within a single method in my code only so it's nothing to do with other mods. If this was a pure Java problem, it would be happening for everyone.
What gives?
Tried. Can't reproduce. Sorry T T.
Tested every mob that can be spawned by egg in vanilla and ebw.
Tested in openjdk8 232b09 & jdk8 231.
Same as #567