use of net.mcft.copy.betterstorage.inventory.InventoryBackpackEquipped in project BetterStorage by copygirl.
the class ItemBackpack method openBackpack.
/** Opens the carrier's equipped backpack for the player.
* Returns if it was successfully opened. */
public static boolean openBackpack(EntityPlayer player, EntityLivingBase carrier) {
ItemStack backpack = ItemBackpack.getBackpack(carrier);
if (backpack == null)
return false;
ItemBackpack backpackType = (ItemBackpack) backpack.getItem();
IInventory inventory = ItemBackpack.getBackpackItems(carrier, player);
inventory = new InventoryBackpackEquipped(carrier, player, inventory);
if (!inventory.isUseableByPlayer(player))
return false;
int columns = backpackType.getBackpackColumns();
int rows = backpackType.getBackpackRows();
Container container = new ContainerBetterStorage(player, inventory, columns, rows);
String title = StackUtils.get(backpack, "", "display", "Name");
PlayerUtils.openGui(player, inventory.getInventoryName(), columns, rows, title, container);
return true;
}
Aggregations