Posted May 9, 20196 yr Hello, so the inventory of my tile entity is not saving/or being loaded correctly on world save/load. https://github.com/BeardlessBrady/Currency-Mod/blob/433ebdf4e2cc72ad61ebc6ab8459351198eaed5a/src/main/java/beardlessbrady/modcurrency/block/vending/TileVending.java#L71-L164
May 9, 20196 yr Have you read this? https://mcforge.readthedocs.io/en/latest/datastorage/capabilities/#persisting-chunk-and-tileentity-capabilities
May 9, 20196 yr Author hmm, Ive never had to implement that before, I'd assume that its auto called with ItemStackHandlers?
May 9, 20196 yr You need to override the method onContentsChanged in your ItemStackHandlers and run markDirty. Edited May 9, 20196 yr by ItsWormy
May 9, 20196 yr // Line 37 to line 39 private ItemStackHandler inputStackHandler = new ItemStackHandler(TE_INPUT_SLOT_COUNT) { @Override protected void onContentsChanged(int slot) { super.onContentsChanged(slot); markDirty(); } }; private ItemStackHandler inventoryStackHandler = new ItemStackHandler(TE_INVENTORY_SLOT_COUNT) { @Override protected void onContentsChanged(int slot) { super.onContentsChanged(slot); markDirty(); } }; private ItemStackHandler outputStackHandler = new ItemStackHandler(TE_OUTPUT_SLOT_COUNT) { @Override protected void onContentsChanged(int slot) { super.onContentsChanged(slot); markDirty(); } }; This should do it. At least I hope it does.
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.