Search in sources :

Example 11 with ComponentPowerReceptor

use of binnie.core.machines.power.ComponentPowerReceptor in project Binnie by ForestryMC.

the class PackageIsolator method createMachine.

@Override
public void createMachine(final Machine machine) {
    // GUI
    new ComponentGeneticGUI(machine, GeneticsGUI.ISOLATOR);
    // Inventory
    final ComponentInventorySlots inventory = new ComponentInventorySlots(machine);
    InventorySlot slotEnzyme = inventory.addSlot(Isolator.SLOT_ENZYME, getSlotRL("enzyme"));
    slotEnzyme.setValidator(new SlotValidator.Item(GeneticsItems.Enzyme.get(1), ModuleMachine.getSpriteEnzyme()));
    slotEnzyme.forbidExtraction();
    InventorySlot slotSequencer = inventory.addSlot(Isolator.SLOT_SEQUENCER_VIAL, getSlotRL("sequencervial"));
    slotSequencer.setValidator(new SlotValidator.Item(GeneticsItems.EmptySequencer.get(1), ModuleMachine.getSpriteSequencer()));
    slotSequencer.forbidExtraction();
    for (InventorySlot slot : inventory.addSlotArray(Isolator.SLOT_RESERVE, getSlotRL("input"))) {
        slot.setValidator(new SlotValidator.Individual());
        slot.forbidExtraction();
    }
    InventorySlot slotTarget = inventory.addSlot(Isolator.SLOT_TARGET, getSlotRL("process"));
    slotTarget.setValidator(new SlotValidator.Individual());
    slotTarget.setReadOnly();
    slotTarget.forbidInteraction();
    InventorySlot slotResult = inventory.addSlot(Isolator.SLOT_RESULUT, getSlotRL("output"));
    slotResult.setReadOnly();
    slotResult.forbidInteraction();
    for (InventorySlot slot : inventory.addSlotArray(Isolator.SLOT_FINISHED, getSlotRL("output"))) {
        slot.setReadOnly();
        slot.forbidInsertion();
    }
    // Tanks
    final ComponentTankContainer tanks = new ComponentTankContainer(machine);
    tanks.addTank(Isolator.TANK_ETHANOL, "input", 1000).setValidator(new EthanolTankValidator());
    // Charged Slots
    final ComponentChargedSlots chargedSlots = new ComponentChargedSlots(machine);
    chargedSlots.addCharge(Isolator.SLOT_ENZYME);
    // Transfer
    final ComponentInventoryTransfer transfer = new ComponentInventoryTransfer(machine);
    transfer.addRestock(Isolator.SLOT_RESERVE, Isolator.SLOT_TARGET, 1);
    transfer.addStorage(Isolator.SLOT_RESULUT, Isolator.SLOT_FINISHED);
    // Logic
    new ComponentPowerReceptor(machine, 20000);
    new IsolatorLogic(machine);
    new IsolatorFX(machine);
}
Also used : EthanolTankValidator(binnie.genetics.machine.EthanolTankValidator) 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) SlotValidator(binnie.core.machines.inventory.SlotValidator) ComponentPowerReceptor(binnie.core.machines.power.ComponentPowerReceptor)

Example 12 with ComponentPowerReceptor

use of binnie.core.machines.power.ComponentPowerReceptor in project Binnie by ForestryMC.

the class PackageSplicer method createMachine.

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

Example 13 with ComponentPowerReceptor

use of binnie.core.machines.power.ComponentPowerReceptor in project Binnie by ForestryMC.

the class LumbermillMachine method createMachine.

@Override
public void createMachine(final Machine machine) {
    new ExtraTreeMachine.ComponentExtraTreeGUI(machine, ExtraTreesGUID.LUMBERMILL);
    final ComponentInventorySlots inventory = new ComponentInventorySlots(machine);
    InventorySlot slotLog = inventory.addSlot(SLOT_LOG, getSlotRL("input"));
    slotLog.setValidator(new SlotValidatorLog(machine.getWorld()));
    slotLog.forbidExtraction();
    inventory.addSlot(SLOT_PLANKS, getSlotRL("output")).setReadOnly();
    inventory.addSlot(SLOT_BARK, getSlotRL("byproduct")).setReadOnly();
    inventory.addSlot(SLOT_SAWDUST, getSlotRL("byproduct")).setReadOnly();
    final ComponentTankContainer tanks = new ComponentTankContainer(machine);
    TankSlot tankWater = tanks.addTank(TANK_WATER, "input", TANK_WATER_CAPACITY);
    tankWater.setValidator(new TankValidator.Basic(ManagerLiquid.WATER));
    new ComponentPowerReceptor(machine);
    new LumbermillLogic(machine);
}
Also used : ComponentInventorySlots(binnie.core.machines.inventory.ComponentInventorySlots) ComponentTankContainer(binnie.core.machines.inventory.ComponentTankContainer) TankSlot(binnie.core.machines.inventory.TankSlot) InventorySlot(binnie.core.machines.inventory.InventorySlot) TankValidator(binnie.core.machines.inventory.TankValidator) SlotValidatorLog(binnie.extratrees.machines.lumbermill.window.SlotValidatorLog) ComponentPowerReceptor(binnie.core.machines.power.ComponentPowerReceptor)

Example 14 with ComponentPowerReceptor

use of binnie.core.machines.power.ComponentPowerReceptor in project Binnie by ForestryMC.

the class FruitPressMachine method createMachine.

@Override
public void createMachine(final Machine machine) {
    new ExtraTreeMachine.ComponentExtraTreeGUI(machine, ExtraTreesGUID.PRESS);
    final ComponentInventorySlots inventory = new ComponentInventorySlots(machine);
    final InventorySlot input = inventory.addSlot(SLOT_FRUIT, getSlotRL("input"));
    input.setValidator(new SlotValidatorSqueezable());
    input.forbidExtraction();
    final InventorySlot process = inventory.addSlot(SLOT_CURRENT, getSlotRL("process"));
    process.setValidator(new SlotValidatorSqueezable());
    process.forbidInteraction();
    final ComponentTankContainer tanks = new ComponentTankContainer(machine);
    tanks.addTank(TANK_OUTPUT, "output", TANK_OUTPUT_CAPACITY).setReadOnly();
    new ComponentPowerReceptor(machine);
    new ComponentInventoryTransfer(machine).addRestock(new int[] { SLOT_FRUIT }, SLOT_CURRENT, 1);
    new FruitPressLogic(machine);
}
Also used : ComponentInventorySlots(binnie.core.machines.inventory.ComponentInventorySlots) ComponentTankContainer(binnie.core.machines.inventory.ComponentTankContainer) SlotValidatorSqueezable(binnie.extratrees.machines.fruitpress.window.SlotValidatorSqueezable) InventorySlot(binnie.core.machines.inventory.InventorySlot) ComponentInventoryTransfer(binnie.core.machines.inventory.ComponentInventoryTransfer) ComponentPowerReceptor(binnie.core.machines.power.ComponentPowerReceptor)

Aggregations

ComponentInventorySlots (binnie.core.machines.inventory.ComponentInventorySlots)14 ComponentPowerReceptor (binnie.core.machines.power.ComponentPowerReceptor)14 InventorySlot (binnie.core.machines.inventory.InventorySlot)12 ComponentTankContainer (binnie.core.machines.inventory.ComponentTankContainer)10 ComponentInventoryTransfer (binnie.core.machines.inventory.ComponentInventoryTransfer)9 ComponentGeneticGUI (binnie.genetics.machine.ComponentGeneticGUI)9 SlotValidator (binnie.core.machines.inventory.SlotValidator)7 ComponentChargedSlots (binnie.core.machines.inventory.ComponentChargedSlots)5 TankSlot (binnie.core.machines.inventory.TankSlot)5 IMachine (binnie.core.machines.IMachine)2 MachineUtil (binnie.core.machines.MachineUtil)2 EthanolTankValidator (binnie.genetics.machine.EthanolTankValidator)2 ItemStack (net.minecraft.item.ItemStack)2 ManagerGenetics (binnie.core.genetics.ManagerGenetics)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