Add Sequencer JEI recipes

This commit is contained in:
mezz committed 2016-10-29 01:20:39 -07:00
1 parent 7c37c3f126
commit c40cdb281f
19 files changed
+214 -137

No files matched your search

@@ -2,7 +2,7 @@ package binnie.genetics.machine.polymeriser;
import binnie.core.machines.inventory.SlotValidator;
import binnie.genetics.Genetics;
import binnie.genetics.api.IItemChargable;
import binnie.genetics.api.IItemChargeable;
import binnie.genetics.machine.ModuleMachine;
import net.minecraft.item.ItemStack;
@@ -13,7 +13,7 @@ public class SlotValidatorUnfilledSerum extends SlotValidator {
@Override
public boolean isValid(final ItemStack itemStack) {
return itemStack.getItem() instanceof IItemChargable;
return itemStack.getItem() instanceof IItemChargeable;
}
@Override
@@ -43,8 +43,8 @@ public class PackageSequencer extends GeneticMachine.PackageGeneticBase implemen
slotTarget.setValidator(new SlotValidatorUnsequenced());
slotTarget.setReadOnly();
slotTarget.forbidInteraction();
InventorySlot slotDrone = inventory.addSlot(Sequencer.SLOT_DRONE, "output");
slotDrone.setReadOnly();
InventorySlot slotDone = inventory.addSlot(Sequencer.SLOT_DONE, "output");
slotDone.setReadOnly();
ComponentInventoryTransfer transfer = new ComponentInventoryTransfer(machine);
transfer.addRestock(Sequencer.SLOT_RESERVE, Sequencer.SLOT_TARGET, 1);
new ComponentChargedSlots(machine).addCharge(0);
@@ -6,7 +6,7 @@ public class Sequencer {
public static final int SLOT_DYE = 0;
public static final int[] SLOT_RESERVE = new int[]{1, 2, 3, 4};
public static final int SLOT_TARGET = 5;
public static final int SLOT_DRONE = 6;
public static final int SLOT_DONE = 6;
public static BinnieIcon fxSeqA;
public static BinnieIcon fxSeqG;
public static BinnieIcon fxSeqT;
@@ -15,8 +15,7 @@ public class SequencerLogic extends ComponentProcess implements IProcess {
super(machine);
}
public float getSequenceStrength() {
final ItemStack stack = this.getUtil().getStack(Sequencer.SLOT_TARGET);
public static float getSequenceStrength(ItemStack stack) {
if (stack == null) {
return 1.0f;
}
@@ -26,7 +25,8 @@ public class SequencerLogic extends ComponentProcess implements IProcess {
@Override
public int getProcessLength() {
return (int) (19200.0f * this.getSequenceStrength());
final ItemStack stack = this.getUtil().getStack(Sequencer.SLOT_TARGET);
return (int) (19200.0f * getSequenceStrength(stack));
}
@Override
@@ -50,8 +50,9 @@ public class SequencerLogic extends ComponentProcess implements IProcess {
if (this.getUtil().getSlotCharge(Sequencer.SLOT_DYE) == 0.0f) {
return new ErrorState.NoItem(Genetics.proxy.localise("machine.machine.sequencer.errors.insufficient.dye"), Sequencer.SLOT_DYE);
}
if (this.getUtil().getStack(Sequencer.SLOT_DRONE) != null && this.getUtil().getStack(Sequencer.SLOT_DRONE).stackSize >= 64) {
return new ErrorState.NoSpace(Genetics.proxy.localise("machine.machine.sequencer.errors.no.space"), new int[]{Sequencer.SLOT_DRONE});
ItemStack stackDone = this.getUtil().getStack(Sequencer.SLOT_DONE);
if (stackDone != null && stackDone.stackSize >= 64) {
return new ErrorState.NoSpace(Genetics.proxy.localise("machine.machine.sequencer.errors.no.space"), new int[]{Sequencer.SLOT_DONE});
}
return super.canProgress();
}
@@ -74,10 +75,10 @@ public class SequencerLogic extends ComponentProcess implements IProcess {
final SequencerItem seqItem = new SequencerItem(this.getUtil().getStack(Sequencer.SLOT_TARGET));
GeneTracker.getTracker(this.getMachine().getWorld(), this.getMachine().getOwner()).registerGene(seqItem.getGene());
this.getUtil().decreaseStack(Sequencer.SLOT_TARGET, 1);
if (this.getUtil().getStack(Sequencer.SLOT_DRONE) == null) {
this.getUtil().setStack(Sequencer.SLOT_DRONE, GeneticsItems.EmptySequencer.get(1));
if (this.getUtil().getStack(Sequencer.SLOT_DONE) == null) {
this.getUtil().setStack(Sequencer.SLOT_DONE, GeneticsItems.EmptySequencer.get(1));
} else {
this.getUtil().decreaseStack(Sequencer.SLOT_DRONE, -1);
this.getUtil().decreaseStack(Sequencer.SLOT_DONE, -1);
}
}