Fusion reactor uses inputs before the craft starts to prevent power exploit, closes #1539
This commit is contained in:
parent
c201b3dbcf
commit
7db0097d23
1 changed files with 5 additions and 5 deletions
|
@ -222,7 +222,7 @@ public class TileFusionControlComputer extends TilePowerAcceptor
|
|||
}
|
||||
|
||||
if (this.currentRecipe != null) {
|
||||
if (this.inventory.hasChanged && !validateReactorRecipe(this.currentRecipe)) {
|
||||
if (!hasStartedCrafting && this.inventory.hasChanged && !validateReactorRecipe(this.currentRecipe)) {
|
||||
resetCrafter();
|
||||
return;
|
||||
}
|
||||
|
@ -232,6 +232,10 @@ public class TileFusionControlComputer extends TilePowerAcceptor
|
|||
if (this.canUseEnergy(this.currentRecipe.getStartEU())) {
|
||||
this.useEnergy(this.currentRecipe.getStartEU());
|
||||
this.hasStartedCrafting = true;
|
||||
this.decrStackSize(this.topStackSlot, this.currentRecipe.getTopInput().getCount());
|
||||
if (!this.currentRecipe.getBottomInput().isEmpty()) {
|
||||
this.decrStackSize(this.bottomStackSlot, this.currentRecipe.getBottomInput().getCount());
|
||||
}
|
||||
}
|
||||
}
|
||||
if (hasStartedCrafting && this.crafingTickTime < this.finalTickTime) {
|
||||
|
@ -253,10 +257,6 @@ public class TileFusionControlComputer extends TilePowerAcceptor
|
|||
} else {
|
||||
this.decrStackSize(this.outputStackSlot, -this.currentRecipe.getOutput().getCount());
|
||||
}
|
||||
this.decrStackSize(this.topStackSlot, this.currentRecipe.getTopInput().getCount());
|
||||
if (!this.currentRecipe.getBottomInput().isEmpty()) {
|
||||
this.decrStackSize(this.bottomStackSlot, this.currentRecipe.getBottomInput().getCount());
|
||||
}
|
||||
if (this.validateReactorRecipe(this.currentRecipe)) {
|
||||
this.crafingTickTime = 0;
|
||||
} else {
|
||||
|
|
Loading…
Add table
Reference in a new issue