Destroy

Destroy

110k Downloads

ExtendedInventory contains() method can return false even if it should return true

githubgarry73 opened this issue ยท 1 comments

commented

Describe the bug

The contains() method of ExtendedInventory can return false even when there are specified items in the inventory.
Noticed it when installed with Terramity (the mod guns use contains() to check if there is ammo in inventory, when installed with Destroy they couldn't be reloaded)

The culprit is the itemstack comparison in ExtendedInventory class, exchanging it for the vanilla ItemStack.isSameItemSameTags method fixed the issue.

To Reproduce

Steps to reproduce the behavior. For example:

  1. Install Terramity alongside Destroy
  2. Try to reload with ammo in inventory

Expected Behavior

Ammo found in inventory, successful reload

Screenshots

before and after
Image

System Information

  • Create 0.5.1.j
  • Destroy 0.1.1
  • Terramity 0.9.8
commented

Fixed in 0.1.2.