Ckathode / archimedes-ships

Archimedes' Ships Minecraft mod
MIT License
49 stars 53 forks source link

Change to fix re-adding tile entities to ships #2

Closed Pyro93735 closed 10 years ago

Pyro93735 commented 10 years ago

This is a fix in response to my post on the forums: http://www.minecraftforum.net/forums/mapping-and-modding/minecraft-mods/1289952-archimedes-ships-v1-7-banking-ships?comment=3529

Tile entities were keeping some information after being re-added to ships during disassembly that was making them tick faster than they were supposed to. Re-building the tile entities from the NBT data instead of giving them the old tile entity seems to make it work as intended.

Ckathode commented 10 years ago

Thanks a lot for finding the bug and your contribution to the mod! This will probably work fine. Though I think it is because the old instance of the tile entity is not being removed properly from the world, and therefore it will be updated twice per tick once readded to the world. In the case of your solution, the new instance will only receive one update per tick, but the old one will still receive updates as well. I will look into the handling over of tile entities in both ways to see where it goes wrong.