int index = 5 + armorType;
Slot slotBefore = player.inventoryContainer.getSlot(index);
if (slotBefore instanceof SlotArmorBackpack) return;
int slotIndex = player.inventory.getSizeInventory() - getChestSlotOffset(player) - armorType;
SlotArmorBackpack slot = new SlotArmorBackpack(player.inventory, slotIndex, 8, 8 + armorType * 18);
slot.slotNumber = index;
player.inventoryContainer.inventorySlots.set(index, slot);
}