Growlith1223 / ArsMagica2

Ars Magica 2 Bug Tracker
65 stars 32 forks source link

AMPacketProcessorServer shouldn't access world object #274

Open LemADEC opened 7 years ago

LemADEC commented 7 years ago

As of ArsMagica2-1.10.2-1.5.0-17b, the mod is doing world access from the network handler which is in a different thread. Hence causing exceptions like this one:

[17:41:43] [Netty Epoll Server IO #4/INFO] [STDERR]: [java.lang.Thread:dumpStack:1333]:         at net.minecraft.server.management.PlayerChunkMap.checkConcurrentModification(SourceFile:612)
[17:41:43] [Netty Epoll Server IO #4/INFO] [STDERR]: [java.lang.Thread:dumpStack:1333]:         at net.minecraft.server.management.PlayerChunkMap.handler$onAddEntry$zho000(SourceFile:601)
[17:41:43] [Netty Epoll Server IO #4/INFO] [STDERR]: [java.lang.Thread:dumpStack:1333]:         at net.minecraft.server.management.PlayerChunkMap.func_187304_a(SourceFile)
[17:41:43] [Netty Epoll Server IO #4/INFO] [STDERR]: [java.lang.Thread:dumpStack:1333]:         at net.minecraft.server.management.PlayerChunkMapEntry.func_187265_a(PlayerChunkMapEntry.java:197)
[17:41:43] [Netty Epoll Server IO #4/INFO] [STDERR]: [java.lang.Thread:dumpStack:1333]:         at net.minecraft.server.management.PlayerChunkMap.func_180244_a(SourceFile:214)
[17:41:43] [Netty Epoll Server IO #4/INFO] [STDERR]: [java.lang.Thread:dumpStack:1333]:         at net.minecraft.world.ServerWorldEventHandler.func_184376_a(ServerWorldEventHandler.java:63)
[17:41:43] [Netty Epoll Server IO #4/INFO] [STDERR]: [java.lang.Thread:dumpStack:1333]:         at net.minecraft.world.World.func_184138_a(World.java:415)
[17:41:43] [Netty Epoll Server IO #4/INFO] [STDERR]: [java.lang.Thread:dumpStack:1333]:         at net.minecraft.world.World.markAndNotifyBlock(World.java:363)
[17:41:43] [Netty Epoll Server IO #4/INFO] [STDERR]: [java.lang.Thread:dumpStack:1333]:         at am2.packet.AMPacketProcessorServer.handleInscriptionTableUpdate(AMPacketProcessorServer.java:245)
[17:41:43] [Netty Epoll Server IO #4/INFO] [STDERR]: [java.lang.Thread:dumpStack:1333]:         at am2.packet.AMPacketProcessorServer.onServerPacketData(AMPacketProcessorServer.java:83)
[17:41:43] [Netty Epoll Server IO #4/INFO] [STDERR]: [java.lang.Thread:dumpStack:1333]:         at net.minecraftforge.fml.common.eventhandler.ASMEventHandler_40_AMPacketProcessorServer_onServerPacketData_ServerCustomPacketEvent.invoke(.dynamic)

From a quick code review, at least handleDecoBlockUpdate() probably have the same issue.