Baubles

Baubles

116M Downloads

Packet handlers not thread safe

williewillus opened this issue ยท 2 comments

commented

All of baubles' packet handlers currently process on the network thread. This is dangerous behaviour and will cause the classical host of threading issues associated with touching the game thread from elsewhere.

Everything needs to be wrapped into Minecraft.getMinecraft().addScheduledTask(new Runnable() { <actual handler here>)

This affects all versions for 1.8.0+

commented

The provided code doesn't actually work (causes a crash server side), but I get what you mean.

commented

Oh yeah the code in the comment is for client bound packets.
For server bound packets it's ctx.getServerHandler().playerEntity.mcServer.addScheduledTask()