Advanced Peripherals

Advanced Peripherals

29M Downloads

[Issue] items not stacking after using removeItemFromPlayer()

mrh0 opened this issue ยท 3 comments

commented

Describe

Items retrieved using removeItemFromPlayer() don't stack with items of the same type (items that should stack) that haven't passed through removeItemFromPlayer().

I bet it has something to do with nbt data.

Reproduce

Steps to reproduce the behavior:

  1. call removeItemFromPlayer() using any item and amount into a chest
  2. retrieve the items from the chest
  3. attempt to stack these items with another stack of the same type.

Screenshots/Videos

https://i.gyazo.com/17ff088ba75110f01d4f6e644d1a4c6a.mp4

Versions:

  • Forge version: 36.1.0
  • AdvancedPeripherals version: 0.6.5b
commented

Fixed in 0.7a

commented

This seems to be because the Function Definition doesn't contain logic for copying NBT. It gets the base item from the registry and makes a stack of count size.

Item item1 = ItemUtil.getRegistryEntry(item.get(), ForgeRegistries.ITEMS);    
stack = new ItemStack(item1, count);
commented

This seems to be because the Function Definition doesn't contain logic for copying NBT. It gets the base item from the registry and makes a stack of count size.

Nop, this is just the code where we define the item which the player wants to move.
We move the item at this line of code. We go through every item in the chest/player inventory and check if the item is equal to the item of the item parameter.