Search in sources :

Example 1 with ComponentInventoryTransfer

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

the class PackageAnalyser method createMachine.

@Override
public void createMachine(final Machine machine) {
    new ComponentGeneticGUI(machine, GeneticsGUI.ANALYSER);
    ComponentInventorySlots inventory = new ComponentInventorySlots(machine);
    for (InventorySlot slot : inventory.addSlotArray(Analyser.SLOT_RESERVE, getSlotRL("input"))) {
        slot.setValidator(new SlotValidatorUnanalysed());
        slot.forbidExtraction();
    }
    InventorySlot slotTarget = inventory.addSlot(Analyser.SLOT_TARGET, getSlotRL("analyse"));
    slotTarget.setReadOnly();
    slotTarget.forbidInteraction();
    InventorySlot slotDye = inventory.addSlot(Analyser.SLOT_DYE, getSlotRL("dye"));
    slotDye.forbidExtraction();
    slotDye.setValidator(new DyeSlotValidator());
    for (InventorySlot slot : inventory.addSlotArray(Analyser.SLOT_FINISHED, getSlotRL("output"))) {
        slot.forbidInsertion();
        slot.setReadOnly();
    }
    ComponentInventoryTransfer transfer = new ComponentInventoryTransfer(machine);
    transfer.addRestock(Analyser.SLOT_RESERVE, 6, 1);
    transfer.addStorage(6, Analyser.SLOT_FINISHED, ManagerGenetics::isAnalysed);
    new ComponentChargedSlots(machine).addCharge(13);
    new ComponentPowerReceptor(machine, 500);
    new AnalyserLogic(machine);
    new AnalyserFX(machine);
}
Also used : ComponentInventorySlots(binnie.core.machines.inventory.ComponentInventorySlots) InventorySlot(binnie.core.machines.inventory.InventorySlot) ManagerGenetics(binnie.core.genetics.ManagerGenetics) ComponentChargedSlots(binnie.core.machines.inventory.ComponentChargedSlots) ComponentGeneticGUI(binnie.genetics.machine.ComponentGeneticGUI) ComponentInventoryTransfer(binnie.core.machines.inventory.ComponentInventoryTransfer) ComponentPowerReceptor(binnie.core.machines.power.ComponentPowerReceptor)

Example 2 with ComponentInventoryTransfer

use of binnie.core.machines.inventory.ComponentInventoryTransfer 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 3 with ComponentInventoryTransfer

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

the class PackageSequencer method createMachine.

@Override
public void createMachine(final Machine machine) {
    new ComponentGeneticGUI(machine, GeneticsGUI.SEQUENCER);
    ComponentInventorySlots inventory = new ComponentInventorySlots(machine);
    InventorySlot slotDye = inventory.addSlot(Sequencer.SLOT_DYE, getSlotRL("dye"));
    slotDye.setValidator(new SlotValidator.Item(GeneticsItems.FluorescentDye.get(1), ModuleMachine.getSpriteDye()));
    slotDye.forbidExtraction();
    for (InventorySlot slot : inventory.addSlotArray(Sequencer.SLOT_RESERVE, getSlotRL("input"))) {
        slot.setValidator(new SlotValidatorUnsequenced());
        slot.forbidExtraction();
    }
    InventorySlot slotTarget = inventory.addSlot(Sequencer.SLOT_TARGET, getSlotRL("process"));
    slotTarget.setValidator(new SlotValidatorUnsequenced());
    slotTarget.setReadOnly();
    slotTarget.forbidInteraction();
    InventorySlot slotDone = inventory.addSlot(Sequencer.SLOT_DONE, getSlotRL("output"));
    slotDone.setReadOnly();
    ComponentInventoryTransfer transfer = new ComponentInventoryTransfer(machine);
    transfer.addRestock(Sequencer.SLOT_RESERVE, Sequencer.SLOT_TARGET, 1);
    new ComponentChargedSlots(machine).addCharge(0);
    new ComponentPowerReceptor(machine, 10000);
    new SequencerLogic(machine);
    new SequencerFX(machine);
}
Also used : ComponentInventorySlots(binnie.core.machines.inventory.ComponentInventorySlots) InventorySlot(binnie.core.machines.inventory.InventorySlot) SlotValidator(binnie.core.machines.inventory.SlotValidator) ComponentChargedSlots(binnie.core.machines.inventory.ComponentChargedSlots) ComponentGeneticGUI(binnie.genetics.machine.ComponentGeneticGUI) ComponentInventoryTransfer(binnie.core.machines.inventory.ComponentInventoryTransfer) ComponentPowerReceptor(binnie.core.machines.power.ComponentPowerReceptor)

Example 4 with ComponentInventoryTransfer

use of binnie.core.machines.inventory.ComponentInventoryTransfer 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)

Example 5 with ComponentInventoryTransfer

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

the class PackageAcclimatiser method createMachine.

@Override
public void createMachine(final Machine machine) {
    new ComponentGeneticGUI(machine, GeneticsGUI.ACCLIMATISER);
    final ComponentInventorySlots inventory = new ComponentInventorySlots(machine);
    InventorySlot slotTarget = inventory.addSlot(Acclimatiser.SLOT_TARGET, getSlotRL("process"));
    slotTarget.setValidator(new SlotValidator.Individual());
    slotTarget.forbidInteraction();
    for (final InventorySlot slot : inventory.addSlotArray(Acclimatiser.SLOT_RESERVE, getSlotRL("input"))) {
        slot.forbidExtraction();
        slot.setValidator(new SlotValidator.Individual());
    }
    for (final InventorySlot slot : inventory.addSlotArray(Acclimatiser.SLOT_DRONE, getSlotRL("output"))) {
        slot.setReadOnly();
        slot.setValidator(new SlotValidator.Individual());
    }
    for (final InventorySlot slot : inventory.addSlotArray(Acclimatiser.SLOT_ACCLIMATISER, getSlotRL("acclimatiser"))) {
        slot.setValidator(new ValidatorAcclimatiserItem());
    }
    final ComponentInventoryTransfer transfer = new ComponentInventoryTransfer(machine);
    transfer.addRestock(Acclimatiser.SLOT_RESERVE, Acclimatiser.SLOT_TARGET, 1);
    transfer.addStorage(Acclimatiser.SLOT_TARGET, Acclimatiser.SLOT_DRONE, (stack) -> {
        NonNullList<ItemStack> stacks = machine.getMachineUtil().getNonEmptyStacks(Acclimatiser.SLOT_ACCLIMATISER);
        return !Acclimatiser.canAcclimatise(stack, stacks);
    });
    new ComponentPowerReceptor(machine, 5000);
    new AcclimatiserLogic(machine);
}
Also used : ComponentInventorySlots(binnie.core.machines.inventory.ComponentInventorySlots) InventorySlot(binnie.core.machines.inventory.InventorySlot) ItemStack(net.minecraft.item.ItemStack) SlotValidator(binnie.core.machines.inventory.SlotValidator) ComponentGeneticGUI(binnie.genetics.machine.ComponentGeneticGUI) ComponentInventoryTransfer(binnie.core.machines.inventory.ComponentInventoryTransfer) ComponentPowerReceptor(binnie.core.machines.power.ComponentPowerReceptor)

Aggregations

ComponentInventorySlots (binnie.core.machines.inventory.ComponentInventorySlots)9 ComponentInventoryTransfer (binnie.core.machines.inventory.ComponentInventoryTransfer)9 InventorySlot (binnie.core.machines.inventory.InventorySlot)9 ComponentPowerReceptor (binnie.core.machines.power.ComponentPowerReceptor)9 ComponentGeneticGUI (binnie.genetics.machine.ComponentGeneticGUI)8 SlotValidator (binnie.core.machines.inventory.SlotValidator)7 ComponentChargedSlots (binnie.core.machines.inventory.ComponentChargedSlots)5 ComponentTankContainer (binnie.core.machines.inventory.ComponentTankContainer)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 TankSlot (binnie.core.machines.inventory.TankSlot)1 SlotValidatorSqueezable (binnie.extratrees.machines.fruitpress.window.SlotValidatorSqueezable)1