Blood Magic

Blood Magic

90M Downloads

Bound shovel does not handle NBT drops properly

williewillus opened this issue ยท 0 comments

commented

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:

  1. Setup botania magical flower or floating flower
  2. Use bound shovel
  3. 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.