Search in sources :

Example 1 with TankSlot

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

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

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

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

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

the class ControlLiquidTank method getHelpTooltip.

@Override
@SideOnly(Side.CLIENT)
public void getHelpTooltip(final Tooltip tooltip, ITooltipFlag tooltipFlag) {
    if (this.getTankSlot() != null) {
        final TankSlot slot = this.getTankSlot();
        tooltip.add(slot.getName());
        NumberFormat numberFormat = I18N.getNumberFormat();
        tooltip.add(I18N.localise(ModId.CORE, "gui.tank.capacity", numberFormat.format(this.getTankCapacity())));
        if (tooltipFlag.isAdvanced()) {
            Collection<EnumFacing> inputSides = slot.getInputSides();
            if (inputSides.size() > 0) {
                tooltip.add(TextFormatting.GRAY + I18N.localise(ModId.CORE, "gui.side.insert", MachineSide.asString(inputSides)));
            }
            Collection<EnumFacing> outputSides = slot.getOutputSides();
            if (outputSides.size() > 0) {
                tooltip.add(TextFormatting.GRAY + I18N.localise(ModId.CORE, "gui.side.extract", MachineSide.asString(outputSides)));
            }
            if (slot.isReadOnly()) {
                tooltip.add(TextFormatting.GRAY + I18N.localise(ModId.CORE, "gui.tank.output"));
            }
        }
    }
}
Also used : TankSlot(binnie.core.machines.inventory.TankSlot) EnumFacing(net.minecraft.util.EnumFacing) NumberFormat(java.text.NumberFormat) SideOnly(net.minecraftforge.fml.relauncher.SideOnly)

Aggregations

TankSlot (binnie.core.machines.inventory.TankSlot)6 ComponentInventorySlots (binnie.core.machines.inventory.ComponentInventorySlots)5 ComponentTankContainer (binnie.core.machines.inventory.ComponentTankContainer)5 ComponentPowerReceptor (binnie.core.machines.power.ComponentPowerReceptor)5 InventorySlot (binnie.core.machines.inventory.InventorySlot)3 ComponentChargedSlots (binnie.core.machines.inventory.ComponentChargedSlots)1 ComponentInventoryTransfer (binnie.core.machines.inventory.ComponentInventoryTransfer)1 SlotValidator (binnie.core.machines.inventory.SlotValidator)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 SlotValidatorLog (binnie.extratrees.machines.lumbermill.window.SlotValidatorLog)1 ComponentGeneticGUI (binnie.genetics.machine.ComponentGeneticGUI)1 EthanolTankValidator (binnie.genetics.machine.EthanolTankValidator)1 NumberFormat (java.text.NumberFormat)1