Posted October 24, 20205 yr One of the items in my mod is supposed to be syncing it's NBT data to the client using ItemStack::getShareTag and ItemStack::readShareTag. I've tried putting breakpoints in these methods, but they don't seem to be getting called at all. Is something wrong with my installation? My forge version is 1.15.2-31.2.31, in case that helps. Any help would be appreciated.
October 24, 20205 yr Author Forgot to post code: Item Class: https://github.com/Awsomekeldeo/RealisTech/blob/forge-support/src/main/java/awsome/realistech/items/CeramicMoldItem.java Capability Wrapper: https://github.com/Awsomekeldeo/RealisTech/blob/forge-support/src/main/java/awsome/realistech/capability/MoldCapabilityWrapper.java Capability: Interface: https://github.com/Awsomekeldeo/RealisTech/blob/forge-support/src/main/java/awsome/realistech/api/capability/energy/IHeat.java IStorage implementation: https://github.com/Awsomekeldeo/RealisTech/blob/forge-support/src/main/java/awsome/realistech/api/capability/energy/HeatCapability.java Implementation: https://github.com/Awsomekeldeo/RealisTech/blob/forge-support/src/main/java/awsome/realistech/api/capability/impl/HeatHandlerItemStack.java Edited October 24, 20205 yr by Awsome Accidentally hit save before posting all of the links
October 24, 20205 yr Author Ok, so I think I'll go into a little bit more detail: The item has a custom capability that stores the ItemStack's temperature. When the stack is placed into the output slot of one of the tile entities in my mod, it is supposed to keep the temperature of the stack the same as the tile entity. However, it only does this for the stack on the server side (I've checked with eclipse's debugger). Here's the code for the tile entity, in case that helps: https://github.com/Awsomekeldeo/RealisTech/blob/f45e7b906509c6171c3bb71384f8c64c2356117c/src/main/java/awsome/realistech/tileentity/CrucibleTileEntity.java
October 24, 20205 yr Author It appears as if ItemStack::readShareTag is only getting called once (on stack creation) and never again. I'll try poking around with the debugger a bit more.
October 24, 20205 yr Author I managed to fix it by serializing the NBT data inside the capability wrapper.
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.