Posted December 14, 20195 yr Hello, so I have this weird issue where if I change the 'cost' and 'amount' variable on the tile and restart the world the change will stay....but if I then change them again and restart the world they will revert back to the previous numbers. Anyone have any idea why this could be occuring? Tile Entity: https://github.com/Beardlessbrady/Currency-Mod/blob/master-2-1.12/src/main/java/beardlessbrady/modcurrency/block/vending/TileVending.java#L127-L194 Custom ItemHandler: https://github.com/Beardlessbrady/Currency-Mod/blob/master-2-1.12/src/main/java/beardlessbrady/modcurrency/block/vending/ItemVendorHandler.java#L44-L60 Custom Item: https://github.com/Beardlessbrady/Currency-Mod/blob/master-2-1.12/src/main/java/beardlessbrady/modcurrency/block/vending/ItemVendor.java#L133-L179
December 15, 20195 yr Author For the amount value I am changing it in the #setAmnt method here https://github.com/Beardlessbrady/Currency-Mod/blob/master-2-1.12/src/main/java/beardlessbrady/modcurrency/block/vending/GuiVending.java#L989-L1007 Its not even just the values...If I add a new item into the machine and restart it will revert back to how it was before. Odd how it will save nbt once but after that revert for some reason.. Any ideas? Edited December 15, 20195 yr by BeardlessBrady
December 15, 20195 yr Author I tried debugging the #toNBT and #fromNBT methods in my itemVendor class. It seems to only save the NBT when I pause the game for the very first time after first placing the block but when I quit the world it does not save the NBT nor does it do it when I pause any other time. It will however save NBT and load NBT on world startup... Any ideas? Edited December 15, 20195 yr by BeardlessBrady
December 15, 20195 yr Author I was not, I added it to all the places I change the data and it did not change the issue unfortunately.
December 16, 20195 yr Author I know it's pretty bad but do you think it's the causing the issue with the NBT?
December 16, 20195 yr Author I have a custom container that uses the methods at the beginning. It all works fine in game it just doesn't save correctly to NBT on world restart
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.