use of mekanism.common.inventory.container.IEmptyContainer in project Mekanism by mekanism.
the class MekanismTileContainer method addSlots.
@Override
protected void addSlots() {
super.addSlots();
if (this instanceof IEmptyContainer) {
// Don't include the inventory slots
return;
}
if (tile.supportsUpgrades()) {
// Add the virtual slot for the upgrade (add them before the main inventory to make sure they take priority in targeting)
addSlot(upgradeSlot = tile.getComponent().getUpgradeSlot().createContainerSlot());
addSlot(upgradeOutputSlot = tile.getComponent().getUpgradeOutputSlot().createContainerSlot());
}
if (tile.hasInventory()) {
// Get all the inventory slots the tile has
List<IInventorySlot> inventorySlots = tile.getInventorySlots(null);
for (IInventorySlot inventorySlot : inventorySlots) {
Slot containerSlot = inventorySlot.createContainerSlot();
if (containerSlot != null) {
addSlot(containerSlot);
}
}
}
}
Aggregations