CoreProtect

CoreProtect

1M Downloads

Hashmap concurrent modification

maglink opened this issue ยท 2 comments

commented

Hi there! I caught an exception

Seems like need to use CuncurrentHashMap somewhere

[15:49:53] [Region Scheduler Thread #3/ERROR]: Could not pass event ProjectileLaunchEvent to CoreProtect v21.3
java.util.ConcurrentModificationException: null
	at java.util.HashMap$HashIterator.nextNode(HashMap.java:1605) ~[?:?]
	at java.util.HashMap$EntryIterator.next(HashMap.java:1638) ~[?:?]
	at java.util.HashMap$EntryIterator.next(HashMap.java:1636) ~[?:?]
	at net.coreprotect.listener.player.ProjectileLaunchListener.onProjectileLaunch(ProjectileLaunchListener.java:68) ~[CoreProtect-21.3.jar:?]
	at com.destroystokyo.paper.event.executor.MethodHandleEventExecutor.execute(MethodHandleEventExecutor.java:40) ~[folia-api-1.20.1-R0.1-SNAPSHOT.jar:?]
	at co.aikar.timings.TimedEventExecutor.execute(TimedEventExecutor.java:77) ~[folia-api-1.20.1-R0.1-SNAPSHOT.jar:git-Folia-"801cff1"]
	at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:70) ~[folia-api-1.20.1-R0.1-SNAPSHOT.jar:?]
	at io.papermc.paper.plugin.manager.PaperEventManager.callEvent(PaperEventManager.java:54) ~[folia-1.20.1.jar:git-Folia-"801cff1"]
	at io.papermc.paper.plugin.manager.PaperPluginManagerImpl.callEvent(PaperPluginManagerImpl.java:126) ~[folia-1.20.1.jar:git-Folia-"801cff1"]
	at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:615) ~[folia-api-1.20.1-R0.1-SNAPSHOT.jar:?]
	at org.bukkit.craftbukkit.v1_20_R1.event.CraftEventFactory.callProjectileLaunchEvent(CraftEventFactory.java:1443) ~[folia-1.20.1.jar:git-Folia-"801cff1"]
	at org.bukkit.craftbukkit.v1_20_R1.event.CraftEventFactory.doEntityAddEventCalling(CraftEventFactory.java:669) ~[folia-1.20.1.jar:git-Folia-"801cff1"]
	at net.minecraft.server.level.ServerLevel.addEntity(ServerLevel.java:1709) ~[?:?]
	at net.minecraft.server.level.ServerLevel.addFreshEntity(ServerLevel.java:1617) ~[?:?]
	at net.minecraft.server.level.ServerLevel.addFreshEntity(ServerLevel.java:1612) ~[?:?]
	at net.minecraft.world.entity.monster.AbstractSkeleton.performRangedAttack(AbstractSkeleton.java:217) ~[?:?]
	at net.minecraft.world.entity.ai.goal.RangedBowAttackGoal.tick(RangedBowAttackGoal.java:133) ~[?:?]
	at net.minecraft.world.entity.ai.goal.WrappedGoal.tick(WrappedGoal.java:63) ~[?:?]
	at net.minecraft.world.entity.ai.goal.GoalSelector.tickRunningGoals(GoalSelector.java:154) ~[?:?]
	at net.minecraft.world.entity.ai.goal.GoalSelector.tick(GoalSelector.java:145) ~[?:?]
	at net.minecraft.world.entity.Mob.serverAiStep(Mob.java:938) ~[?:?]
	at net.minecraft.world.entity.LivingEntity.aiStep(LivingEntity.java:3371) ~[?:?]
	at net.minecraft.world.entity.Mob.aiStep(Mob.java:693) ~[?:?]
	at net.minecraft.world.entity.monster.Monster.aiStep(Monster.java:45) ~[?:?]
	at net.minecraft.world.entity.monster.AbstractSkeleton.aiStep(AbstractSkeleton.java:131) ~[?:?]
	at net.minecraft.world.entity.LivingEntity.tick(LivingEntity.java:3026) ~[?:?]
	at net.minecraft.world.entity.Mob.tick(Mob.java:455) ~[?:?]
	at net.minecraft.world.entity.monster.Skeleton.tick(Skeleton.java:69) ~[?:?]
	at net.minecraft.server.level.ServerLevel.tickNonPassenger(ServerLevel.java:1371) ~[?:?]
	at net.minecraft.world.level.Level.guardEntityTick(Level.java:958) ~[?:?]
	at net.minecraft.server.level.ServerLevel.lambda$tick$12(ServerLevel.java:848) ~[?:?]
	at io.papermc.paper.threadedregions.RegionizedWorldData.forEachTickingEntity(RegionizedWorldData.java:543) ~[folia-1.20.1.jar:git-Folia-"801cff1"]
	at net.minecraft.server.level.ServerLevel.tick(ServerLevel.java:827) ~[?:?]
	at net.minecraft.server.MinecraftServer.tickChildren(MinecraftServer.java:1676) ~[folia-1.20.1.jar:git-Folia-"801cff1"]
	at net.minecraft.server.dedicated.DedicatedServer.tickChildren(DedicatedServer.java:447) ~[folia-1.20.1.jar:git-Folia-"801cff1"]
	at net.minecraft.server.MinecraftServer.tickServer(MinecraftServer.java:1533) ~[folia-1.20.1.jar:git-Folia-"801cff1"]
	at io.papermc.paper.threadedregions.TickRegions$ConcreteRegionTickHandle.tickRegion(TickRegions.java:360) ~[folia-1.20.1.jar:git-Folia-"801cff1"]
	at io.papermc.paper.threadedregions.TickRegionScheduler$RegionScheduleHandle.runTick(TickRegionScheduler.java:385) ~[folia-1.20.1.jar:git-Folia-"801cff1"]
	at ca.spottedleaf.concurrentutil.scheduler.SchedulerThreadPool$TickThreadRunner.run(SchedulerThreadPool.java:525) ~[folia-1.20.1.jar:git-Folia-"801cff1"]
	at java.lang.Thread.run(Thread.java:1589) ~[?:?]
commented

Folia support will be added in next version, that is might be the issue (?)

commented

Fixed in 054beb7