MrCrayfish's Furniture Mod

MrCrayfish's Furniture Mod

88M Downloads

MrCrayfishFurnitureMod is modifying the world off the main thread

Aaron1011 opened this issue ยท 5 comments

commented

In MessageMineBayBuy, World#spawnEntity is called to spawn in a new item. However, the onMessage callback is invoked from a Netty handler thread - not the main server thread.

While this may appear to work, it can easily lead to corrupted data or other difficult-to-reproduce issues. The Minecraft server expects all modifications to the game to be done from the main thread, and has essentially no thread-safe methods.

To fix this, the body of onMessage should be wrapped in a scheduled task (using MinecraftServer#addScheduledTask

commented

I hate my old code ๐Ÿ˜’ I will get a fix for this soon. For the 1.13 update, I plan to rewrite the mod from scratch.

commented

@MrCrayfish will you still update the mod for 1.12.2?

commented

"I will get a fix for this soon"

commented

I will get a fix for this soon For the 1.13 update,

commented

I can just about guarantee this is related to Issue #208.