inventorySlot = new InventoryBackpackSlot(player);
} else {
inventorySlot = new InventoryBasic(Localizations.INVENTORY_PERSONAL, false, 1);
}
InventoryPickup inventoryPickup = new InventoryPickup();
ContainerAdvanced container = new ContainerPersonalSlot(inventorySlot, inventoryPickup);
int maxWidth = 160;
// set container width (needed for gui)
container.setWidth(maxWidth + 2 * X_SPACING);
int x = (int) Math.round(maxWidth / 2. - SLOT / 2.) + 1;
int y = 17; // initial space for label
container.addBoundary(Boundaries.BACKPACK);
// backpack slot
container.addSlot(new SlotBackpackOnly(inventorySlot, 0, x, y));
container.addBoundary(Boundaries.BACKPACK_END);
x = X_SPACING;
y += 15 + SLOT;
// pickup inventory
for(int i = 0; i < inventoryPickup.getSizeInventory(); i++) {
container.addSlot(new SlotPhantom(inventoryPickup, i, x, y));
x += SLOT;
}
container.addBoundary(Boundaries.INVENTORY);
x = X_SPACING;
y += 24;
// player inventory
for(int row = 0; row < 3; row++) {
for(int col = 0; col < 9; col++) {
container.addSlot(new Slot(inventories[0], col + row * 9 + 9, x, y));
x += SLOT;
}
y += SLOT;
x = X_SPACING;
}
container.addBoundary(Boundaries.INVENTORY_END);
container.addBoundary(Boundaries.HOTBAR);
y += 6;
// hotbar
for(int col = 0; col < 9; col++) {
container.addSlot(new Slot(inventories[0], col, x, y));
x += SLOT;
}
container.addBoundary(Boundaries.HOTBAR_END);
y += SLOT;
y += 7;
// set container height (needed for gui)
container.setHeight(y);
return container;
}