mirror of
https://github.com/GTNewHorizons/Binnie.git
synced 2026-11-23 21:49:49 +00:00
* Finalize, minor alloc reduction Also enable Jabel and generic injection * Update dependencies.gradle * Clean up Machine a bit * spotless more enhanced instanceof * Update ModuleMachine.java * More clen * WARN: Removed exception catching * Many, many tiny patches + birthday fix * Spotless * Spotless again * Fix getLow and clamp tolerance value * Revert event -> ignored on unused event parameters * Rename instanceof variables * Update Machine.java * Use StringBuilder * Cache getStack() * Oops, Jabel can't handle that * Spotless * Spotless again My IDE was fighting with it * Remove unused elements + scream test success
65 lines
2.7 KiB
Java
65 lines
2.7 KiB
Java
package binnie.genetics.machine.acclimatiser;
|
|
|
|
import net.minecraft.item.ItemStack;
|
|
|
|
import binnie.core.craftgui.minecraft.IMachineInformation;
|
|
import binnie.core.machines.Machine;
|
|
import binnie.core.machines.inventory.ComponentInventorySlots;
|
|
import binnie.core.machines.inventory.ComponentInventoryTransfer;
|
|
import binnie.core.machines.inventory.InventorySlot;
|
|
import binnie.core.machines.inventory.SlotValidator;
|
|
import binnie.core.machines.power.ComponentPowerReceptor;
|
|
import binnie.genetics.core.GeneticsGUI;
|
|
import binnie.genetics.core.GeneticsTexture;
|
|
import binnie.genetics.machine.ComponentGeneticGUI;
|
|
import binnie.genetics.machine.PackageGeneticBase;
|
|
|
|
public class AcclimatiserPackage extends PackageGeneticBase implements IMachineInformation {
|
|
|
|
public AcclimatiserPackage() {
|
|
super("acclimatiser", GeneticsTexture.Acclimatiser, 0x966a49, true);
|
|
}
|
|
|
|
@Override
|
|
public void createMachine(Machine machine) {
|
|
new ComponentGeneticGUI(machine, GeneticsGUI.Acclimatiser);
|
|
ComponentInventorySlots inventory = new ComponentInventorySlots(machine);
|
|
InventorySlot processSlot = inventory.addSlot(Acclimatiser.SLOT_TARGET, "process");
|
|
processSlot.setValidator(new SlotValidator.Individual());
|
|
processSlot.setReadOnly();
|
|
processSlot.forbidExtraction();
|
|
|
|
for (InventorySlot slot : inventory.addSlotArray(Acclimatiser.SLOT_RESERVE, "input")) {
|
|
slot.forbidExtraction();
|
|
slot.setValidator(new SlotValidator.Individual());
|
|
}
|
|
|
|
for (InventorySlot slot : inventory.addSlotArray(Acclimatiser.SLOT_DONE, "output")) {
|
|
slot.setReadOnly();
|
|
slot.setValidator(new SlotValidator.Individual());
|
|
}
|
|
|
|
for (InventorySlot slot : inventory.addSlotArray(Acclimatiser.SLOT_ACCLIMATISER, "acclimatiser")) {
|
|
slot.setValidator(new AcclimatiserItemSlotValidator());
|
|
}
|
|
|
|
ComponentInventoryTransfer transfer = new ComponentInventoryTransfer(machine);
|
|
transfer.addRestock(Acclimatiser.SLOT_RESERVE, Acclimatiser.SLOT_TARGET, 1);
|
|
transfer.addStorage(
|
|
Acclimatiser.SLOT_TARGET,
|
|
Acclimatiser.SLOT_DONE,
|
|
new ComponentInventoryTransfer.Condition() {
|
|
|
|
@Override
|
|
public boolean fufilled(ItemStack stack) {
|
|
return !Acclimatiser.canAcclimatise(
|
|
stack,
|
|
machine.getMachineUtil().getNonNullStacks(Acclimatiser.SLOT_ACCLIMATISER));
|
|
}
|
|
});
|
|
|
|
new ComponentPowerReceptor(machine, 5000);
|
|
new AcclimatiserComponentLogic(machine);
|
|
}
|
|
}
|