}
// Load their inventory
ItemBackpack packItem = ((ItemBackpack) backpack.getItem());
ItemInventory backpackinventory = new ItemInventory(ItemBackpack.class, packItem.getBackpackSize(), backpack);
Event event = new BackpackResupplyEvent(player, packItem.getDefinition(), backpackinventory);
MinecraftForge.EVENT_BUS.post(event);
if (event.isCanceled())
continue;
boolean inventoryChanged = false;
// Cycle through their contents
for (int i = 0; i < backpackinventory.getSizeInventory(); i++) {