Dispenser can use cells. Closes #1948

This commit is contained in:
drcrazy 2020-01-10 16:09:03 +03:00
parent 8db5cea07c
commit a115fbd736
9 changed files with 165 additions and 81 deletions

View file

@ -35,7 +35,7 @@ import techreborn.config.TechRebornConfig;
import techreborn.init.ModRecipes;
import techreborn.init.TRContent;
import techreborn.init.TRBlockEntities;
import techreborn.items.ItemDynamicCell;
import techreborn.items.DynamicCellItem;
import techreborn.blockentity.machine.GenericMachineBlockEntity;
public class IndustrialElectrolyzerBlockEntity extends GenericMachineBlockEntity implements IContainerProvider {
@ -53,8 +53,8 @@ public class IndustrialElectrolyzerBlockEntity extends GenericMachineBlockEntity
public BuiltContainer createContainer(int syncID, final PlayerEntity player) {
return new ContainerBuilder("industrialelectrolyzer").player(player.inventory).inventory().hotbar()
.addInventory().blockEntity(this)
.filterSlot(1, 47, 72, stack -> ItemUtils.isItemEqual(stack, ItemDynamicCell.getEmptyCell(1), true, true))
.filterSlot(0, 81, 72, stack -> !ItemUtils.isItemEqual(stack, ItemDynamicCell.getEmptyCell(1), true, true))
.filterSlot(1, 47, 72, stack -> ItemUtils.isItemEqual(stack, DynamicCellItem.getEmptyCell(1), true, true))
.filterSlot(0, 81, 72, stack -> !ItemUtils.isItemEqual(stack, DynamicCellItem.getEmptyCell(1), true, true))
.outputSlot(2, 51, 24).outputSlot(3, 71, 24).outputSlot(4, 91, 24).outputSlot(5, 111, 24)
.energySlot(6, 8, 72).syncEnergyValue().syncCrafterValue().addInventory().create(this, syncID);
}

View file

@ -40,7 +40,7 @@ import techreborn.config.TechRebornConfig;
import techreborn.init.ModRecipes;
import techreborn.init.TRContent;
import techreborn.init.TRBlockEntities;
import techreborn.items.ItemDynamicCell;
import techreborn.items.DynamicCellItem;
import java.util.List;
@ -59,8 +59,8 @@ public class IndustrialCentrifugeBlockEntity extends GenericMachineBlockEntity i
public BuiltContainer createContainer(int syncID, final PlayerEntity player) {
return new ContainerBuilder("centrifuge").player(player.inventory).inventory().hotbar()
.addInventory().blockEntity(this)
.filterSlot(1, 40, 54, stack -> ItemUtils.isItemEqual(stack, ItemDynamicCell.getEmptyCell(1), true, true))
.filterSlot(0, 40, 34, stack -> !ItemUtils.isItemEqual(stack, ItemDynamicCell.getEmptyCell(1), true, true))
.filterSlot(1, 40, 54, stack -> ItemUtils.isItemEqual(stack, DynamicCellItem.getEmptyCell(1), true, true))
.filterSlot(0, 40, 34, stack -> !ItemUtils.isItemEqual(stack, DynamicCellItem.getEmptyCell(1), true, true))
.outputSlot(2, 82, 44).outputSlot(3, 101, 25)
.outputSlot(4, 120, 44).outputSlot(5, 101, 63).energySlot(6, 8, 72).syncEnergyValue()
.syncCrafterValue().addInventory().create(this, syncID);