[1.12.2] Upgrading causes barrels to lose their content
ephys opened this issue · 2 comments
Hello!
I'm trying to update from 0.1.13 to 0.2.3.2
As doing that directly causes world corruption (#147), and because 0.2.3.2 has a problem where barrel contents aren't saved properly, I'm instead doing the following:
- go from 0.1.13 to 0.2.01 (the alpha version). Barrels contents are OK here
- go from 0.2.01 to 2.4.0pre. Barrels contents are now reset
I believe the problem is that during update 0.2.03, the NBT key under which the contents are saved has been renamed from items
to item
(https://github.com/thedarkcolour/Future-MC/blob/master/src/main/java/thedarkcolour/futuremc/tile/TileBarrel.java#L16)
This could be fixed by replacing the piece of code with this:
String key = compound.hasKey("item") ? "item" : "items";
if (compound.hasKey(key)) {
storage.deserializeNBT((NBTTagCompound) compound.getTag(key));
}