Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
PacketSwapBlock#onMessage modifies the world asychronously #143
The packet handler PacketSwapBlock#onMessage is modifying the world directly from the handler method. Since this method is called from a Netty thread, the world is being modified asynchronously, causing problems with both Vanilla and other mods.
I recommend running this handler on the main thread, using
See the referenced commit for the code changes , i think this follows your idea
Ill do some testing and tidy up the code, maybe release tonight or tomorrow
Thanks a lot for the code advice, i didn't know about the addScheduledTask before.
This should be fixed in build 1.7.22 https://minecraft.curseforge.com/projects/cyclic/files/2340924
I thought about doing this to every single network packet, but im not sure if that is a good idea? I would love any other advice you have to improve things here.
For getblocks, that only happens when a player uses an item, so it SHOULD be on a loaded chunk. or if a tile entity is running update() , also loaded chunk.