From 88c0aca954db59d3cbf73baee939d851ac648308 Mon Sep 17 00:00:00 2001 From: drcrazy Date: Thu, 9 Jan 2020 16:33:32 +0300 Subject: [PATCH] Fix fusion reactor power gen. Closes #1961 --- .../generator/SolarPanelBlockEntity.java | 3 +++ .../FusionControlComputerBlockEntity.java | 15 +++++---------- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/src/main/java/techreborn/blockentity/generator/SolarPanelBlockEntity.java b/src/main/java/techreborn/blockentity/generator/SolarPanelBlockEntity.java index e8d7c5b90..3ebdc3418 100644 --- a/src/main/java/techreborn/blockentity/generator/SolarPanelBlockEntity.java +++ b/src/main/java/techreborn/blockentity/generator/SolarPanelBlockEntity.java @@ -177,6 +177,9 @@ public class SolarPanelBlockEntity extends PowerAcceptorBlockEntity implements I @Override 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 return EnergyTier.EXTREME.getMaxOutput(); } diff --git a/src/main/java/techreborn/blockentity/machine/multiblock/FusionControlComputerBlockEntity.java b/src/main/java/techreborn/blockentity/machine/multiblock/FusionControlComputerBlockEntity.java index 166319c23..aa88bd6af 100644 --- a/src/main/java/techreborn/blockentity/machine/multiblock/FusionControlComputerBlockEntity.java +++ b/src/main/java/techreborn/blockentity/machine/multiblock/FusionControlComputerBlockEntity.java @@ -129,9 +129,7 @@ public class FusionControlComputerBlockEntity extends PowerAcceptorBlockEntity return true; } if (ItemUtils.isItemEqual(inventory.getInvStack(slot), stack, true, tags)) { - if (stack.getCount() + inventory.getInvStack(slot).getCount() <= stack.getMaxCount()) { - return true; - } + return stack.getCount() + inventory.getInvStack(slot).getCount() <= stack.getMaxCount(); } return false; } @@ -168,8 +166,8 @@ public class FusionControlComputerBlockEntity extends PowerAcceptorBlockEntity /** * Validates if reactor has all inputs and can output result * - * @param recipe - * @return + * @param recipe FusionReactorRecipe Recipe to validate + * @return Boolean True if we have all inputs and can fit output */ private boolean validateRecipe(FusionReactorRecipe recipe) { return hasAllInputs(recipe) && canFitStack(recipe.getOutputs().get(0), outputStackSlot, true); @@ -274,7 +272,7 @@ public class FusionControlComputerBlockEntity extends PowerAcceptorBlockEntity } if (hasStartedCrafting && crafingTickTime < currentRecipe.getTime()) { // Power gen - if (currentRecipe.getPower() < 0) { + if (currentRecipe.getPower() > 0) { // Waste power if it has no where to go double power = Math.abs(currentRecipe.getPower()) * getPowerMultiplier(); addEnergy(power); @@ -456,10 +454,7 @@ public class FusionControlComputerBlockEntity extends PowerAcceptorBlockEntity if(!hasStartedCrafting){ return 1; //Waiting on power } - if(hasStartedCrafting){ - return 2; //Crafting - } - return -1; + return 2; //Crafting } public void setState(int state){