Search in sources :

Example 11 with ComponentInventorySlots

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

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

Example 13 with ComponentInventorySlots

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

the class PackageGenepool method createMachine.

@Override
public void createMachine(final Machine machine) {
    new ComponentGeneticGUI(machine, GeneticsGUI.GENEPOOL);
    ComponentInventorySlots inventory = new ComponentInventorySlots(machine);
    InventorySlot slotEnzyme = inventory.addSlot(Genepool.SLOT_ENZYME, getSlotRL("enzyme"));
    slotEnzyme.setValidator(new SlotValidator.Item(GeneticsItems.Enzyme.get(1), ModuleMachine.getSpriteEnzyme()));
    slotEnzyme.forbidExtraction();
    InventorySlot slotProcess = inventory.addSlot(Genepool.SLOT_BEE, getSlotRL("process"));
    slotProcess.setValidator(new SlotValidator.Individual());
    slotProcess.setReadOnly();
    slotProcess.forbidExtraction();
    for (InventorySlot slot : inventory.addSlotArray(Genepool.SLOT_RESERVE, getSlotRL("input"))) {
        slot.setValidator(new SlotValidator.Individual());
        slot.forbidExtraction();
    }
    ComponentTankContainer tanks = new ComponentTankContainer(machine);
    TankSlot tankDNA = tanks.addTank(Genepool.TANK_DNA, "output", 2000);
    tankDNA.setReadOnly();
    TankSlot tankEthanol = tanks.addTank(Genepool.TANK_ETHANOL, "input", 1000);
    tankEthanol.forbidExtraction();
    tankEthanol.setValidator(new EthanolTankValidator());
    ComponentInventoryTransfer transfer = new ComponentInventoryTransfer(machine);
    transfer.addRestock(Genepool.SLOT_RESERVE, Genepool.SLOT_BEE, 1);
    new ComponentPowerReceptor(machine, 1600);
    new GenepoolLogic(machine);
    ComponentChargedSlots chargedSlots = new ComponentChargedSlots(machine);
    chargedSlots.addCharge(Genepool.SLOT_ENZYME);
    new GenepoolFX(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) TankSlot(binnie.core.machines.inventory.TankSlot) SlotValidator(binnie.core.machines.inventory.SlotValidator) ComponentPowerReceptor(binnie.core.machines.power.ComponentPowerReceptor)

Example 14 with ComponentInventorySlots

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

the class PackageIncubator method createMachine.

@Override
public void createMachine(final Machine machine) {
    new ComponentGeneticGUI(machine, GeneticsGUI.INCUBATOR);
    ComponentInventorySlots inventory = new ComponentInventorySlots(machine);
    for (InventorySlot slot : inventory.addSlotArray(Incubator.SLOT_QUEUE, getSlotRL("input"))) {
        slot.forbidExtraction();
    }
    InventorySlot slotIncubator = inventory.addSlot(Incubator.SLOT_INCUBATOR, getSlotRL("incubator"));
    slotIncubator.forbidInteraction();
    for (InventorySlot slot : inventory.addSlotArray(Incubator.SLOT_OUTPUT, getSlotRL("output"))) {
        slot.setReadOnly();
    }
    new ComponentPowerReceptor(machine, 2000);
    ComponentTankContainer tanks = new ComponentTankContainer(machine);
    tanks.addTank(Incubator.TANK_INPUT, "input", 2000).forbidExtraction();
    tanks.addTank(Incubator.TANK_OUTPUT, "output", 2000).setReadOnly();
    new IncubatorLogic(machine);
}
Also used : ComponentInventorySlots(binnie.core.machines.inventory.ComponentInventorySlots) ComponentTankContainer(binnie.core.machines.inventory.ComponentTankContainer) InventorySlot(binnie.core.machines.inventory.InventorySlot) ComponentGeneticGUI(binnie.genetics.machine.ComponentGeneticGUI) ComponentPowerReceptor(binnie.core.machines.power.ComponentPowerReceptor)

Example 15 with ComponentInventorySlots

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

Aggregations

ComponentInventorySlots (binnie.core.machines.inventory.ComponentInventorySlots)18 ComponentPowerReceptor (binnie.core.machines.power.ComponentPowerReceptor)14 InventorySlot (binnie.core.machines.inventory.InventorySlot)13 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 ResourceLocation (net.minecraft.util.ResourceLocation)3 IMachine (binnie.core.machines.IMachine)2 MachineUtil (binnie.core.machines.MachineUtil)2 ComponentDesignerRecipe (binnie.design.gui.ComponentDesignerRecipe)2 SlotValidatorDesignAdhesive (binnie.design.gui.SlotValidatorDesignAdhesive)2 SlotValidatorDesignMaterial (binnie.design.gui.SlotValidatorDesignMaterial)2 EthanolTankValidator (binnie.genetics.machine.EthanolTankValidator)2 ItemStack (net.minecraft.item.ItemStack)2 ComponentBotanyGUI (binnie.botany.machines.ComponentBotanyGUI)1 ManagerGenetics (binnie.core.genetics.ManagerGenetics)1 TankValidator (binnie.core.machines.inventory.TankValidator)1