mirror of
https://github.com/GTNewHorizons/Binnie.git
synced 2026-11-27 15:33:12 +00:00
Some code improvement
This commit is contained in:
1 parent
3bd8c53273
commit
784fa0ad30
7 files changed
+41
-30
No files matched your search
@@ -65,14 +65,16 @@ public class AcclimatiserComponentLogic extends ComponentProcessIndefinate {
|
||||
|
||||
ItemStack acc = acclms.get(getUtil().getRandom().nextInt(acclms.size()));
|
||||
ItemStack acclimed = Acclimatiser.acclimatise(getUtil().getStack(Acclimatiser.SLOT_TARGET), acc);
|
||||
if (acclimed != null) {
|
||||
getUtil().setStack(Acclimatiser.SLOT_TARGET, acclimed);
|
||||
boolean removed = false;
|
||||
for (int i : Acclimatiser.SLOT_ACCLIMATISER) {
|
||||
if (!removed && getUtil().getStack(i) != null && getUtil().getStack(i).isItemEqual(acc)) {
|
||||
getUtil().decreaseStack(i, 1);
|
||||
removed = true;
|
||||
}
|
||||
if (acclimed == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
getUtil().setStack(Acclimatiser.SLOT_TARGET, acclimed);
|
||||
boolean removed = false;
|
||||
for (int i : Acclimatiser.SLOT_ACCLIMATISER) {
|
||||
if (!removed && getUtil().getStack(i) != null && getUtil().getStack(i).isItemEqual(acc)) {
|
||||
getUtil().decreaseStack(i, 1);
|
||||
removed = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,6 +9,8 @@ public class Genepool {
|
||||
public static final int RF_COST = 8000;
|
||||
public static final int TIME_PERIOD = 400;
|
||||
public static final float ENZYME_PER_PROCESS = 0.25f;
|
||||
public static final float ETHANOL_PER_PROCESS = 50.0f;
|
||||
public static final int ETHANOL_PER_TICK = 1;
|
||||
public static final int POWER_CAPACITY = 1600;
|
||||
public static final int TANK_DNA_CAPACITY = 2000;
|
||||
public static final int TANK_ETHANOL_CAPACITY = 1000;
|
||||
}
|
||||
@@ -80,7 +80,7 @@ public class GenepoolComponentLogic extends ComponentProcessSetCost implements I
|
||||
protected void onTickTask() {
|
||||
ethanolDrain += getDNAAmount(getUtil().getStack(Genepool.TANK_DNA)) * 1.2f * getProgressPerTick() / 100.0f;
|
||||
if (ethanolDrain >= 1.0f) {
|
||||
getUtil().drainTank(Genepool.TANK_ETHANOL, 1);
|
||||
getUtil().drainTank(Genepool.TANK_ETHANOL, Genepool.ETHANOL_PER_TICK);
|
||||
ethanolDrain--;
|
||||
}
|
||||
|
||||
|
||||
@@ -44,10 +44,10 @@ public class GenepoolPackage extends PackageGeneticBase implements IMachineInfor
|
||||
}
|
||||
|
||||
ComponentTankContainer tanks = new ComponentTankContainer(machine);
|
||||
TankSlot dnaSlot = tanks.addTank(Genepool.TANK_DNA, "output", 2000);
|
||||
TankSlot dnaSlot = tanks.addTank(Genepool.TANK_DNA, "output", Genepool.TANK_DNA_CAPACITY);
|
||||
dnaSlot.setReadOnly();
|
||||
|
||||
TankSlot ethanolSlot = tanks.addTank(Genepool.TANK_ETHANOL, "input", 1000);
|
||||
TankSlot ethanolSlot = tanks.addTank(Genepool.TANK_ETHANOL, "input", Genepool.TANK_ETHANOL_CAPACITY);
|
||||
ethanolSlot.forbidExtraction();
|
||||
ethanolSlot.setValidator(new EthanolTankValidator());
|
||||
|
||||
|
||||
Reference in new issue
Block a user