So I've created an item with a IEnergyStorage Capability via initCapability, and it can receive energy from other blocks and retains its stored energy. But when I attempt to add its currently stored energy to the tooltip via addInformation, the ItemStack supplied has no tag compound.
I've tried using getNBTShareTag to send the server-side storage data to the client, but either the NBT data I'm returning isn't being sent to the client or the ItemStack I'm being given via addInformation is wrong.
Here's the relevant code as it currently stands:
https://gitlab.com/snippets/1751590
When I update the ItemStack (i.e. move the stack, or transfer energy into its capability) the console outputs:
Share tag: {energy:910}
However, when I hover over the stack the console reads:
Stack missing tag compound
And the tooltip reads 0
Any help as to why this isn't work would be greatly appreciated.
Thanks