Leather Works

Leather Works

368k Downloads

Leather chests don't retain orientation between loads

codetaylor opened this issue ยท 7 comments

commented

What

The leather chests don't retain their orientation between game loads.

To Reproduce:

  1. Load world
  2. Place 4 leather chests, each facing a different direction
  3. Save world
  4. Load world
  5. Notice the 4 leather chests are all facing the same direction

Versions

Forge: 1.12.2-14.23.2.2618
LeatherWorks: 1.12-1.69.2.25

commented

The main issue was getUpdateTag() wasn't overridden and that is the tag that is used to sync the server TE with the client TE on load.

The two loads you were seeing is one for the server, then one for the client when the server sends the data to the client. Since the client was receiving a tag that didn't contain the facing, the facing was being read as zero, hence the southern orientation.

commented

wait for another commit from me today, just to avoid any merging issues

Sure, just let me know when you're ready.

commented

Aight, go ahead :)

commented

Boy that's a nice bug report, I wish I could pin it.
Unfortunately, this has had me stumped for some time.
I'd welcome a PR if you want to take a look?

commented

[Server thread/INFO] [FML]: Loading dimension 0 (New World) (net.minecraft.server.integrated.IntegratedServer@c3996e2) [Server thread/INFO]: Loaded 488 advancements [Server thread/INFO] [FML]: Loading dimension 1 (New World) (net.minecraft.server.integrated.IntegratedServer@c3996e2) [Server thread/INFO] [FML]: Loading dimension -1 (New World) (net.minecraft.server.integrated.IntegratedServer@c3996e2) [Server thread/INFO]: Preparing start region for level 0 [Server thread/INFO] [leatherworks]: Loading: east [Server thread/INFO] [leatherworks]: Loading: north [Server thread/INFO] [leatherworks]: Loading: west [Server thread/INFO] [leatherworks]: Loading: south [Server thread/INFO]: Changing view distance to 12, from 10 [Netty Local Client IO #1/INFO] [FML]: Server protocol version 2 [Netty Server IO #3/INFO] [FML]: Client protocol version 2 [Netty Server IO #3/INFO] [FML]: Client attempting to join with 18 mods [Netty Local Client IO #1/INFO] [FML]: [Netty Local Client IO #1] Client side modded connection established [Server thread/INFO] [FML]: [Server thread] Server side modded connection established [Server thread/INFO]: Player629[local:E:abbc3bdc] logged in with entity id 6371 at (238.79890309077396, 71.0, 282.858397674549) [Server thread/INFO]: Player629 joined the game [Server thread/INFO]: Saving and pausing game... [Server thread/INFO]: Saving chunks for level 'New World'/overworld [main/INFO] [leatherworks]: Loading: south [main/INFO] [leatherworks]: Loading: south [main/INFO] [leatherworks]: Loading: south [main/INFO] [leatherworks]: Loading: south [Server thread/INFO] [leatherworks]: Saving: 2 [Server thread/INFO] [leatherworks]: Saving: 1 [Server thread/INFO] [leatherworks]: Saving: 0 [Server thread/INFO] [leatherworks]: Saving: 3 [Server thread/INFO]: Saving chunks for level 'New World'/the_nether [Server thread/INFO]: Saving chunks for level 'New World'/the_end
Putting print statements at the end of the readFromNBT and writeToNBT methods, I get this output.
It seems to load twice, the first time being correct and the second time defaulting to south. (1st value for horizontal index) And then when I save, it seems to save properly

commented

I'd welcome a PR if you want to take a look?

I'll take a look at it today. :)

commented

Kk, wait for another commit from me today, just to avoid any merging issues