Search in sources :

Example 1 with ComponentTankContainer

use of binnie.core.machines.inventory.ComponentTankContainer in project Binnie by ForestryMC.

the class InfuserMachine method createMachine.

@Override
public void createMachine(final Machine machine) {
    new ExtraTreeMachine.ComponentExtraTreeGUI(machine, ExtraTreesGUID.INFUSER);
    final ComponentInventorySlots inventory = new ComponentInventorySlots(machine);
    final ComponentTankContainer tanks = new ComponentTankContainer(machine);
    final TankSlot input = tanks.addTank(Infuser.TANK_INPUT, "input", 5000);
    input.setValidator(new TankValidatorInfuserInput());
    input.forbidExtraction();
    final TankSlot output = tanks.addTank(Infuser.TANK_OUTPUT, "output", 5000);
    output.setValidator(new TankValidatorInfuserOutput());
    output.setReadOnly();
    new ComponentPowerReceptor(machine);
    new InfuserLogic(machine);
}
Also used : ComponentInventorySlots(binnie.core.machines.inventory.ComponentInventorySlots) ComponentTankContainer(binnie.core.machines.inventory.ComponentTankContainer) TankSlot(binnie.core.machines.inventory.TankSlot) ComponentPowerReceptor(binnie.core.machines.power.ComponentPowerReceptor)

Example 2 with ComponentTankContainer

use of binnie.core.machines.inventory.ComponentTankContainer in project Binnie by ForestryMC.

the class DistilleryMachine method createMachine.

@Override
public void createMachine(final Machine machine) {
    new ExtraTreeMachine.ComponentExtraTreeGUI(machine, ExtraTreesGUID.DISTILLERY);
    final ComponentInventorySlots inventory = new ComponentInventorySlots(machine);
    final ComponentTankContainer tanks = new ComponentTankContainer(machine);
    final TankSlot input = tanks.addTank(TANK_INPUT, "input", 5000);
    input.setValidator(new TankValidatorDistilleryInput());
    input.forbidExtraction();
    final TankSlot output = tanks.addTank(TANK_OUTPUT, "output", 5000);
    output.setValidator(new TankValidatorDistilleryOutput());
    output.setReadOnly();
    new ComponentPowerReceptor(machine);
    new DistilleryLogic(machine);
}
Also used : ComponentInventorySlots(binnie.core.machines.inventory.ComponentInventorySlots) ComponentTankContainer(binnie.core.machines.inventory.ComponentTankContainer) TankSlot(binnie.core.machines.inventory.TankSlot) TankValidatorDistilleryOutput(binnie.extratrees.machines.distillery.window.TankValidatorDistilleryOutput) TankValidatorDistilleryInput(binnie.extratrees.machines.distillery.window.TankValidatorDistilleryInput) ComponentPowerReceptor(binnie.core.machines.power.ComponentPowerReceptor)

Example 3 with ComponentTankContainer

use of binnie.core.machines.inventory.ComponentTankContainer in project Binnie by ForestryMC.

the class BreweryMachine method createMachine.

@Override
public void createMachine(final Machine machine) {
    new ExtraTreeMachine.ComponentExtraTreeGUI(machine, ExtraTreesGUID.BREWERY);
    final ComponentInventorySlots inventory = new ComponentInventorySlots(machine);
    for (final InventorySlot slot : inventory.addSlotArray(SLOT_RECIPE_GRAINS, new ResourceLocation(Constants.CORE_MOD_ID, "gui.slot.grain"))) {
        slot.setValidator(new SlotValidatorBreweryGrain());
        slot.setType(InventorySlot.Type.Recipe);
    }
    for (final InventorySlot slot : inventory.addSlotArray(SLOTS_INVENTORY, new ResourceLocation(Constants.CORE_MOD_ID, "gui.slot.inventory"))) {
        slot.forbidExtraction();
    }
    final InventorySlot yeast = inventory.addSlot(SLOT_YEAST, getSlotRL("yeast"));
    yeast.setValidator(new SlotValidatorBreweryYeast());
    yeast.setType(InventorySlot.Type.Recipe);
    final InventorySlot ingredient = inventory.addSlot(SLOT_RECIPE_INPUT, getSlotRL("ingredient"));
    ingredient.setValidator(new SlotValidatorBreweryIngredient());
    ingredient.setType(InventorySlot.Type.Recipe);
    final ComponentTankContainer tanks = new ComponentTankContainer(machine);
    TankSlot input = tanks.addTank(TANK_INPUT, "input", 5000);
    input.setValidator(new TankValidatorFermentInput());
    input.forbidExtraction();
    final TankSlot output = tanks.addTank(TANK_OUTPUT, "output", 5000);
    output.setValidator(new TankValidatorFermentOutput());
    output.setReadOnly();
    new ComponentPowerReceptor(machine);
    new BreweryLogic(machine);
}
Also used : SlotValidatorBreweryYeast(binnie.extratrees.machines.brewery.window.SlotValidatorBreweryYeast) ComponentInventorySlots(binnie.core.machines.inventory.ComponentInventorySlots) InventorySlot(binnie.core.machines.inventory.InventorySlot) SlotValidatorBreweryIngredient(binnie.extratrees.machines.brewery.window.SlotValidatorBreweryIngredient) SlotValidatorBreweryGrain(binnie.extratrees.machines.brewery.window.SlotValidatorBreweryGrain) ComponentTankContainer(binnie.core.machines.inventory.ComponentTankContainer) TankValidatorFermentInput(binnie.extratrees.machines.brewery.window.TankValidatorFermentInput) ResourceLocation(net.minecraft.util.ResourceLocation) TankSlot(binnie.core.machines.inventory.TankSlot) TankValidatorFermentOutput(binnie.extratrees.machines.brewery.window.TankValidatorFermentOutput) ComponentPowerReceptor(binnie.core.machines.power.ComponentPowerReceptor)

Example 4 with ComponentTankContainer

use of binnie.core.machines.inventory.ComponentTankContainer in project Binnie by ForestryMC.

the class PackagePolymeriser method createMachine.

@Override
public void createMachine(Machine machine) {
    new ComponentGeneticGUI(machine, GeneticsGUI.POLYMERISER);
    ComponentInventorySlots inventory = new ComponentInventorySlots(machine);
    // Slot Gold
    InventorySlot slotGold = inventory.addSlot(Polymeriser.SLOT_GOLD, getSlotRL("catalyst"));
    slotGold.setValidator(new SlotValidator.Item(new ItemStack(Items.GOLD_NUGGET, 1), ModuleMachine.getSpriteNugget()));
    slotGold.forbidExtraction();
    // Slot Serum
    InventorySlot slotSerum = inventory.addSlot(Polymeriser.SLOT_SERUM, getSlotRL("process"));
    slotSerum.setValidator(new SlotValidatorUnfilledSerum());
    slotSerum.forbidInteraction();
    slotSerum.setReadOnly();
    for (InventorySlot slot : inventory.addSlotArray(Polymeriser.SLOT_SERUM_RESERVE, getSlotRL("input"))) {
        slot.setValidator(new SlotValidatorUnfilledSerum());
        slot.forbidExtraction();
    }
    for (InventorySlot slot : inventory.addSlotArray(Polymeriser.SLOT_SERUM_FINISHED, getSlotRL("output"))) {
        slot.setReadOnly();
    }
    ComponentInventoryTransfer transfer = new ComponentInventoryTransfer(machine);
    transfer.addRestock(Polymeriser.SLOT_SERUM_RESERVE, Polymeriser.SLOT_SERUM, 1);
    transfer.addStorage(Polymeriser.SLOT_SERUM, Polymeriser.SLOT_SERUM_FINISHED, (stack) -> !stack.isItemDamaged());
    ComponentTankContainer tank = new ComponentTankContainer(machine);
    tank.addTank(Polymeriser.TANK_BACTERIA, "input", 1000).setValidator(new BacteriaTankValidator());
    tank.addTank(Polymeriser.TANK_DNA, "input", 1000).setValidator(new DnaTankValidator());
    new ComponentChargedSlots(machine).addCharge(1);
    new ComponentPowerReceptor(machine, 8000);
    new PolymeriserLogic(machine);
    new PolymeriserFX(machine);
}
Also used : ComponentInventorySlots(binnie.core.machines.inventory.ComponentInventorySlots) InventorySlot(binnie.core.machines.inventory.InventorySlot) ComponentChargedSlots(binnie.core.machines.inventory.ComponentChargedSlots) ComponentGeneticGUI(binnie.genetics.machine.ComponentGeneticGUI) ComponentInventoryTransfer(binnie.core.machines.inventory.ComponentInventoryTransfer) ComponentTankContainer(binnie.core.machines.inventory.ComponentTankContainer) ItemStack(net.minecraft.item.ItemStack) SlotValidator(binnie.core.machines.inventory.SlotValidator) ComponentPowerReceptor(binnie.core.machines.power.ComponentPowerReceptor)

Example 5 with ComponentTankContainer

use of binnie.core.machines.inventory.ComponentTankContainer in project Binnie by ForestryMC.

the class PackageInoculator method createMachine.

@Override
public void createMachine(final Machine machine) {
    new ComponentGeneticGUI(machine, GeneticsGUI.INOCULATOR);
    final ComponentInventorySlots inventory = new ComponentInventorySlots(machine);
    InventorySlot slotSerumVial = inventory.addSlot(Inoculator.SLOT_SERUM_VIAL, getSlotRL("serum.active"));
    slotSerumVial.forbidInteraction();
    slotSerumVial.setReadOnly();
    final SlotValidator serumValid = new SerumSlotValidator();
    slotSerumVial.setValidator(serumValid);
    for (InventorySlot slot : inventory.addSlotArray(Inoculator.SLOT_SERUM_RESERVE, getSlotRL("serum.input"))) {
        slot.setValidator(serumValid);
        slot.forbidExtraction();
    }
    for (InventorySlot slot : inventory.addSlotArray(Inoculator.SLOT_SERUM_EXPENDED, getSlotRL("serum.output"))) {
        slot.setValidator(serumValid);
        slot.setReadOnly();
    }
    for (InventorySlot slot : inventory.addSlotArray(Inoculator.SLOT_RESERVE, getSlotRL("input"))) {
        slot.forbidExtraction();
        slot.setValidator(new ValidatorIndividualInoculate());
    }
    InventorySlot slotTarget = inventory.addSlot(Inoculator.SLOT_TARGET, getSlotRL("process"));
    slotTarget.setValidator(new ValidatorIndividualInoculate());
    slotTarget.setReadOnly();
    slotTarget.forbidInteraction();
    for (final InventorySlot slot : inventory.addSlotArray(Inoculator.SLOT_FINISHED, getSlotRL("output"))) {
        slot.setReadOnly();
        slot.forbidInsertion();
        slot.setValidator(new ValidatorIndividualInoculate());
    }
    final ComponentInventoryTransfer transfer = new ComponentInventoryTransfer(machine);
    transfer.addRestock(Inoculator.SLOT_RESERVE, 9, 1);
    transfer.addRestock(Inoculator.SLOT_SERUM_RESERVE, 0);
    transfer.addStorage(Inoculator.SLOT_SERUM_VIAL, Inoculator.SLOT_SERUM_EXPENDED, (stack) -> Engineering.getCharges(stack) == 0);
    transfer.addStorage(Inoculator.SLOT_TARGET, Inoculator.SLOT_FINISHED, (stack) -> {
        if (!stack.isEmpty()) {
            IMachine machine1 = transfer.getMachine();
            MachineUtil machineUtil = machine1.getMachineUtil();
            if (!machineUtil.getStack(Inoculator.SLOT_SERUM_VIAL).isEmpty() && machine1.getInterface(InoculatorLogic.class).isValidSerum() != null) {
                return true;
            }
        }
        return false;
    });
    new ComponentPowerReceptor(machine, 15000);
    new InoculatorLogic(machine);
    new InoculatorFX(machine);
    new ComponentTankContainer(machine).addTank(Inoculator.TANK_VEKTOR, "input", 1000).setValidator(new BacteriaVectorTankValidator());
}
Also used : MachineUtil(binnie.core.machines.MachineUtil) IMachine(binnie.core.machines.IMachine) ComponentInventorySlots(binnie.core.machines.inventory.ComponentInventorySlots) InventorySlot(binnie.core.machines.inventory.InventorySlot) ComponentGeneticGUI(binnie.genetics.machine.ComponentGeneticGUI) ComponentInventoryTransfer(binnie.core.machines.inventory.ComponentInventoryTransfer) ComponentTankContainer(binnie.core.machines.inventory.ComponentTankContainer) SlotValidator(binnie.core.machines.inventory.SlotValidator) ComponentPowerReceptor(binnie.core.machines.power.ComponentPowerReceptor)

Aggregations

ComponentInventorySlots (binnie.core.machines.inventory.ComponentInventorySlots)10 ComponentTankContainer (binnie.core.machines.inventory.ComponentTankContainer)10 ComponentPowerReceptor (binnie.core.machines.power.ComponentPowerReceptor)10 InventorySlot (binnie.core.machines.inventory.InventorySlot)8 ComponentInventoryTransfer (binnie.core.machines.inventory.ComponentInventoryTransfer)5 TankSlot (binnie.core.machines.inventory.TankSlot)5 ComponentGeneticGUI (binnie.genetics.machine.ComponentGeneticGUI)5 SlotValidator (binnie.core.machines.inventory.SlotValidator)4 ComponentChargedSlots (binnie.core.machines.inventory.ComponentChargedSlots)3 EthanolTankValidator (binnie.genetics.machine.EthanolTankValidator)2 IMachine (binnie.core.machines.IMachine)1 MachineUtil (binnie.core.machines.MachineUtil)1 TankValidator (binnie.core.machines.inventory.TankValidator)1 SlotValidatorBreweryGrain (binnie.extratrees.machines.brewery.window.SlotValidatorBreweryGrain)1 SlotValidatorBreweryIngredient (binnie.extratrees.machines.brewery.window.SlotValidatorBreweryIngredient)1 SlotValidatorBreweryYeast (binnie.extratrees.machines.brewery.window.SlotValidatorBreweryYeast)1 TankValidatorFermentInput (binnie.extratrees.machines.brewery.window.TankValidatorFermentInput)1 TankValidatorFermentOutput (binnie.extratrees.machines.brewery.window.TankValidatorFermentOutput)1 TankValidatorDistilleryInput (binnie.extratrees.machines.distillery.window.TankValidatorDistilleryInput)1 TankValidatorDistilleryOutput (binnie.extratrees.machines.distillery.window.TankValidatorDistilleryOutput)1