Bound shovel does not handle NBT drops properly
williewillus opened this issue ยท 0 comments
What happens:
Use bound shovel near botania flowers, and they lose all NBT data on drop.
What you expected to happen:
NBT data properly retained on drop
Steps to reproduce:
- Setup botania magical flower or floating flower
- Use bound shovel
- Observe drops
Code analysis
In the shovel[1], You are using a hashmultiset of ItemStackWrapper
, counting how many of each occur. However, the factory method that creates these wrappers completely ignores the NBT of the stack that is passed in[2], leading to any drops getting their NBT data completely wiped.
[1] https://github.com/WayofTime/BloodMagic/blob/1.11/src/main/java/WayofTime/bloodmagic/item/ItemBoundShovel.java#L71
[2] https://github.com/WayofTime/BloodMagic/blob/1.11/src/main/java/WayofTime/bloodmagic/api/ItemStackWrapper.java#L63
This issue may also be present in other places that use this class that I"m not aware of.