Search in sources :

Example 6 with ComponentInventorySlots

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

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

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

the class PackageDesigner method createMachine.

@Override
public void createMachine(final Machine machine) {
    new ComponentBotanyGUI(machine, BotanyGUI.TILEWORKER);
    final ComponentInventorySlots inventory = new ComponentInventorySlots(machine);
    InventorySlot mortarSlot = inventory.addSlot(DesignerSlots.ADHESIVE_SLOT, new ResourceLocation(Constants.BOTANY_MOD_ID, "gui.slot.mortar"));
    mortarSlot.setValidator(new SlotValidatorDesignAdhesive(this.type));
    InventorySlot ceramicSlot1 = inventory.addSlot(DesignerSlots.DESIGN_SLOT_1, new ResourceLocation(Constants.BOTANY_MOD_ID, "gui.slot.ceramic"));
    ceramicSlot1.setValidator(new SlotValidatorDesignMaterial(this.type));
    InventorySlot ceramicSlot2 = inventory.addSlot(DesignerSlots.DESIGN_SLOT_2, new ResourceLocation(Constants.BOTANY_MOD_ID, "gui.slot.ceramic"));
    ceramicSlot2.setValidator(new SlotValidatorDesignMaterial(this.type));
    new ComponentDesignerRecipe(machine, this.type);
}
Also used : ComponentDesignerRecipe(binnie.design.gui.ComponentDesignerRecipe) ComponentInventorySlots(binnie.core.machines.inventory.ComponentInventorySlots) ComponentBotanyGUI(binnie.botany.machines.ComponentBotanyGUI) ResourceLocation(net.minecraft.util.ResourceLocation) InventorySlot(binnie.core.machines.inventory.InventorySlot) SlotValidatorDesignAdhesive(binnie.design.gui.SlotValidatorDesignAdhesive) SlotValidatorDesignMaterial(binnie.design.gui.SlotValidatorDesignMaterial)

Example 9 with ComponentInventorySlots

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

the class TileEntityMachine method getSlot.

@Nullable
@Override
public InventorySlot getSlot(int index) {
    Machine machine = getMachine();
    if (machine == null) {
        return null;
    }
    if (!machine.hasComponent(ComponentInventorySlots.class)) {
        return null;
    }
    ComponentInventorySlots inventorySlots = machine.getComponent(ComponentInventorySlots.class);
    return inventorySlots.getSlot(index);
}
Also used : ComponentInventorySlots(binnie.core.machines.inventory.ComponentInventorySlots) Nullable(javax.annotation.Nullable)

Example 10 with ComponentInventorySlots

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

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