TerraFirmaCraft

TerraFirmaCraft

2M Downloads

Switching between creative & suvival clears out all small vesals in your inventory;

dries007 opened this issue ยท 4 comments

commented

Describe the bug

Switching between creative & suvival clears out all small vesals in your inventory.

To Reproduce

  1. Put food in vessal
  2. Switch to creative
  3. Switch back
  4. No more food

Meta Info

  • TFC Version: 1.0.6.133

image

commented

This has been implemented as of 33449ac working around the aforementioned Forge bug, and seems to work fairly well for small vessels.

commented

I can't reproduce in build 142, not sure if the sync refactoring fixed this.

commented

I just did it again on master. It migth be a server only thing.

commented

This is likely due to the ass-backwards way that the creative inventory works. Unlike every other container in the game, it syncs it's contents client -> server rather than server -> client. This is in quite direct opposition to how capabilities work, as they only exist on server and have too by synced server -> client, regardless of game mode.

If you're familiar with our capability sync handling, we do a huge amount of management to even sync server -> client reliably (because once again, there is no standard system provided by forge to allow containers to sync capability changes of non mod items.). From the research I've done I don't believe it's practical or even possible to reverse this sync for creative players.

It may be possible to modify this for inventory containers specifically, but with the current implementation that would require a near rewrite of all places where we handle capability changes for those specific items as it would need to move from capability NBT -> stack tag, something I'm not inclined to do with the current state of "it seems to be working fairly well" of capability sync logic.

Edit: The root cause of this issue can be pointed to here: MinecraftForge/MinecraftForge#7359 Will have to revisit in 1.16+