Because Inventory properties don’t seem to work at the moment (#1538 #1657), I’d like to find another way to check if two inventories are the same one. Ideally I’d like to use the Identifiable property, but as it can’t be retrieved that doesn’t seem possible. I need to check because I use custom inventories that acts as GUIs with buttons etc. and as .listener() doesn’t seem to work atm (#1646) I want to be able to check which inventory is which in ClickInventoryEvent.
Trying .equals() to compare doesn’t seem to work. I am not sure if this is intentional or a bug, so I am writing about it here on the forum first to get some feedback.
Inventory inventory = Inventory.builder()
.of(InventoryArchetypes.CHEST)
.build(plugin);
GridInventory grid1 = inventory.query(GridInventory.class);
GridInventory grid2 = inventory.query(GridInventory.class);
logger.info("equals? " + grid1.equals(grid2));
Outputs:
equals? false
- Is this intended or is it a bug?
- Is there another way to check if two inventories are the same one?
Any feedback or advice would be greatly appreciated ![]()
spongevanilla-1.12.2-7.0.0-BETA-345
EDIT:
The two issues I linked have now been fixed which is really great! I am leaving the thread open though because I am curious about if .equals() is meant to work or not