When copying inventory, the archetype changes from DOUBLE_CHEST to UNKNOWN.
How would I be able to change that in the Inventory object?
I get the new inventory from the event.getTargetInventory().first(), which returns opened double chest’s inventory, but sets it’s archetype to UNKNOWN.
I’m just taking the Inventory that I receive from the above command and store it, and I’m using the Inventory#first() because I believe that it returns the first inventory in the opened “inventory”, in this case first would be the chest’s and the second, next or last would be player’s inventories. Am I wrong in assuming that?
I don’t seem to understand how I’d be able to get the correct item from the QueryOperationTypes… I tried getting it like this e.getTargetInventory().query(QueryOperationTypes.INVENTORY_TYPE); but to no avail. It returns an inventory class org.spongepowered.common.item.inventory.EmptyInventoryImpl
I found that there exists this method e.getTargetInventory().query(QueryOperationTypes.INVENTORY_TYPE.of(Inventory.class)); but it only gets a CustomInventory class from it, which doesn’t help me at all… I have no idea which inventory that is.
There have been many issues ive replied to where they are trying to set an item into an inventory and its been classed as an empty inventory because of that issue. You learn to spot it XD