Fix fusion reactor power gen. Closes #1961

This commit is contained in:
drcrazy 2020-01-09 16:33:32 +03:00
parent 5e3341df21
commit 88c0aca954
2 changed files with 8 additions and 10 deletions

View file

@ -177,6 +177,9 @@ public class SolarPanelBlockEntity extends PowerAcceptorBlockEntity implements I
@Override @Override
public double getBaseMaxOutput() { public double getBaseMaxOutput() {
if (getPanel() == TRContent.SolarPanels.CREATIVE){
return EnergyTier.INSANE.getMaxOutput();
}
// Solar panel output will only be limited by the cables the users use // Solar panel output will only be limited by the cables the users use
return EnergyTier.EXTREME.getMaxOutput(); return EnergyTier.EXTREME.getMaxOutput();
} }

View file

@ -129,9 +129,7 @@ public class FusionControlComputerBlockEntity extends PowerAcceptorBlockEntity
return true; return true;
} }
if (ItemUtils.isItemEqual(inventory.getInvStack(slot), stack, true, tags)) { if (ItemUtils.isItemEqual(inventory.getInvStack(slot), stack, true, tags)) {
if (stack.getCount() + inventory.getInvStack(slot).getCount() <= stack.getMaxCount()) { return stack.getCount() + inventory.getInvStack(slot).getCount() <= stack.getMaxCount();
return true;
}
} }
return false; return false;
} }
@ -168,8 +166,8 @@ public class FusionControlComputerBlockEntity extends PowerAcceptorBlockEntity
/** /**
* Validates if reactor has all inputs and can output result * Validates if reactor has all inputs and can output result
* *
* @param recipe * @param recipe FusionReactorRecipe Recipe to validate
* @return * @return Boolean True if we have all inputs and can fit output
*/ */
private boolean validateRecipe(FusionReactorRecipe recipe) { private boolean validateRecipe(FusionReactorRecipe recipe) {
return hasAllInputs(recipe) && canFitStack(recipe.getOutputs().get(0), outputStackSlot, true); return hasAllInputs(recipe) && canFitStack(recipe.getOutputs().get(0), outputStackSlot, true);
@ -274,7 +272,7 @@ public class FusionControlComputerBlockEntity extends PowerAcceptorBlockEntity
} }
if (hasStartedCrafting && crafingTickTime < currentRecipe.getTime()) { if (hasStartedCrafting && crafingTickTime < currentRecipe.getTime()) {
// Power gen // Power gen
if (currentRecipe.getPower() < 0) { if (currentRecipe.getPower() > 0) {
// Waste power if it has no where to go // Waste power if it has no where to go
double power = Math.abs(currentRecipe.getPower()) * getPowerMultiplier(); double power = Math.abs(currentRecipe.getPower()) * getPowerMultiplier();
addEnergy(power); addEnergy(power);
@ -456,10 +454,7 @@ public class FusionControlComputerBlockEntity extends PowerAcceptorBlockEntity
if(!hasStartedCrafting){ if(!hasStartedCrafting){
return 1; //Waiting on power return 1; //Waiting on power
} }
if(hasStartedCrafting){ return 2; //Crafting
return 2; //Crafting
}
return -1;
} }
public void setState(int state){ public void setState(int state){