use of mekanism.common.capabilities.holder.slot.InventorySlotHelper in project Mekanism by mekanism.
the class TileEntityDigitalMiner method getInitialInventory.
@Nonnull
@Override
protected IInventorySlotHolder getInitialInventory() {
mainSlots = new ArrayList<>();
InventorySlotHelper builder = InventorySlotHelper.forSide(this::getDirection, side -> side == RelativeSide.TOP, side -> side == RelativeSide.BACK);
// Allow insertion manually or internally, or if it is a replace stack
BiPredicate<@NonNull ItemStack, @NonNull AutomationType> canInsert = (stack, automationType) -> automationType != AutomationType.EXTERNAL || isReplaceTarget(stack.getItem());
// Allow extraction if it is manual or if it is a replace stack
BiPredicate<@NonNull ItemStack, @NonNull AutomationType> canExtract = (stack, automationType) -> automationType == AutomationType.MANUAL || !isReplaceTarget(stack.getItem());
for (int slotY = 0; slotY < 3; slotY++) {
for (int slotX = 0; slotX < 9; slotX++) {
BasicInventorySlot slot = BasicInventorySlot.at(canExtract, canInsert, this, 8 + slotX * 18, 92 + slotY * 18);
builder.addSlot(slot, RelativeSide.BACK, RelativeSide.TOP);
mainSlots.add(slot);
}
}
builder.addSlot(energySlot = EnergyInventorySlot.fillOrConvert(energyContainer, this::getLevel, this, 152, 20));
return builder.build();
}
use of mekanism.common.capabilities.holder.slot.InventorySlotHelper in project Mekanism by mekanism.
the class TileEntityChemicalWasher method getInitialInventory.
@Nonnull
@Override
protected IInventorySlotHolder getInitialInventory() {
InventorySlotHelper builder = InventorySlotHelper.forSideWithConfig(this::getDirection, this::getConfig);
builder.addSlot(fluidSlot = FluidInventorySlot.fill(fluidTank, this, 180, 71));
// Output slot for the fluid container that was used as an input
builder.addSlot(fluidOutputSlot = OutputInventorySlot.at(this, 180, 102));
builder.addSlot(slurryOutputSlot = SlurryInventorySlot.drain(outputTank, this, 152, 56));
builder.addSlot(energySlot = EnergyInventorySlot.fillOrConvert(energyContainer, this::getLevel, this, 152, 14));
slurryOutputSlot.setSlotOverlay(SlotOverlay.MINUS);
fluidSlot.setSlotType(ContainerSlotType.INPUT);
return builder.build();
}
use of mekanism.common.capabilities.holder.slot.InventorySlotHelper in project Mekanism by mekanism.
the class TileEntityCombiner method getInitialInventory.
@Nonnull
@Override
protected IInventorySlotHolder getInitialInventory() {
InventorySlotHelper builder = InventorySlotHelper.forSideWithConfig(this::getDirection, this::getConfig);
builder.addSlot(mainInputSlot = InputInventorySlot.at(item -> containsRecipeAB(item, extraInputSlot.getStack()), this::containsRecipeA, recipeCacheLookupMonitor, 64, 17));
builder.addSlot(extraInputSlot = InputInventorySlot.at(item -> containsRecipeBA(mainInputSlot.getStack(), item), this::containsRecipeB, recipeCacheLookupMonitor, 64, 53));
builder.addSlot(outputSlot = OutputInventorySlot.at(this, 116, 35));
builder.addSlot(energySlot = EnergyInventorySlot.fillOrConvert(energyContainer, this::getLevel, this, 39, 35));
extraInputSlot.setSlotType(ContainerSlotType.EXTRA);
return builder.build();
}
use of mekanism.common.capabilities.holder.slot.InventorySlotHelper in project Mekanism by mekanism.
the class TileEntityChemicalCrystallizer method getInitialInventory.
@Nonnull
@Override
protected IInventorySlotHolder getInitialInventory() {
InventorySlotHelper builder = InventorySlotHelper.forSideWithConfig(this::getDirection, this::getConfig);
builder.addSlot(inputSlot = MergedChemicalInventorySlot.fill(inputTank, this, 8, 65));
builder.addSlot(outputSlot = OutputInventorySlot.at(this, 129, 57));
builder.addSlot(energySlot = EnergyInventorySlot.fillOrConvert(energyContainer, this::getLevel, this, 152, 5));
inputSlot.setSlotOverlay(SlotOverlay.PLUS);
return builder.build();
}
use of mekanism.common.capabilities.holder.slot.InventorySlotHelper in project Mekanism by mekanism.
the class TileEntityGasGenerator method getInitialInventory.
@Nonnull
@Override
protected IInventorySlotHolder getInitialInventory() {
InventorySlotHelper builder = InventorySlotHelper.forSide(this::getDirection);
builder.addSlot(fuelSlot = GasInventorySlot.fill(fuelTank, this, 17, 35), RelativeSide.FRONT, RelativeSide.LEFT, RelativeSide.BACK, RelativeSide.TOP, RelativeSide.BOTTOM);
builder.addSlot(energySlot = EnergyInventorySlot.drain(getEnergyContainer(), this, 143, 35), RelativeSide.RIGHT);
fuelSlot.setSlotOverlay(SlotOverlay.MINUS);
return builder.build();
}
Aggregations