From 7859a7053e1710ac09c0a60a57d149fa07afcf68 Mon Sep 17 00:00:00 2001 From: Daniel Mendes <70096037+Steelux8@users.noreply.github.com> Date: Sun, 13 Aug 2023 14:30:43 +0100 Subject: More LFTR Chain Fixes (#716) * Fix LFTR powergen without fuel - Override "process" from ProcessingLogic to execute the new "resetMultiProcessing" method before returning NO_Recipe; - Add new "resetMultiProcessing" method to reset EU/t value, progress, recipe and shut down the LFTR when inputs aren't enough. * Fix Sparge Tower OC and 10x speed bonus - Changed voltage calculation to actually allow overclocking with 2 energy hatches, which the Sparge Tower already accepted; - Removed the 10x speed bonus the multi had for seemingly no reason, and reduced recipe time by 10x, from 250s to 25s, on all of its recipes to compensate. * Fix Sparge Tower energy handling - Set lEUt to negative to properly consume energy, since the old logic used a positive lEUt value, which corresponds to EU generation, not consumption. * Tweaked Fuel Refinery required hatches - Removed the Output Bus requirement, as there are no item outputs in this recipe map; - Changed the fluid hatch count to minimum 2 input and 1 output, which is enough for Refinery recipes. Left the maximum at the previous 4 input and 2 output, to keep existing structures working and for setups that produce two fuels per Refinery. * Downscaled longest Refinery recipes - Changed the two very long Refinery recipes, so that fluid amounts are 10x lower in input and output, alongside a 10x smaller duration, to make them more manageable, and less punishing if the multi voids for some reason. * Apply spotless * Requested fixes * spotlessApply (#720) Co-authored-by: GitHub GTNH Actions <> --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- .../java/gregtech/api/util/GasSpargingRecipe.java | 2 +- .../GregtechMetaTileEntity_SpargeTower.java | 20 +++++++++++++++++--- .../multi/production/GregtechMTE_NuclearReactor.java | 16 ++++++++++++++++ .../production/GregtechMetaTileEntity_Refinery.java | 9 +++++---- .../recipe/RecipeLoader_NuclearFuelProcessing.java | 16 ++++++++-------- 5 files changed, 47 insertions(+), 16 deletions(-) (limited to 'src') diff --git a/src/main/java/gregtech/api/util/GasSpargingRecipe.java b/src/main/java/gregtech/api/util/GasSpargingRecipe.java index 304dd24384..55eb828e3e 100644 --- a/src/main/java/gregtech/api/util/GasSpargingRecipe.java +++ b/src/main/java/gregtech/api/util/GasSpargingRecipe.java @@ -28,7 +28,7 @@ public class GasSpargingRecipe implements Comparable { aOutputs = ArrayUtils.insertElementAtIndex(aOutputs, 1, aSpargedFuel); mFluidOutputs = aOutputs; mMaxOutputQuantity = aMaxOutputQuantity; - mDuration = 500 * 10; // Actual recipe time is 10x less than this number, not sure why + mDuration = 500; mEUt = MaterialUtils.getVoltageForTier(5); } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_SpargeTower.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_SpargeTower.java index 662f0e0470..438cb650a8 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_SpargeTower.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_SpargeTower.java @@ -18,6 +18,7 @@ import java.util.List; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.fluids.FluidStack; @@ -142,7 +143,6 @@ public class GregtechMetaTileEntity_SpargeTower extends GregtechMeta_MultiBlockB final GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); tt.addMachineType("Gas Sparge Tower").addInfo("Controller block for the Sparging Tower") .addInfo("Runs gases through depleted molten salts to extract precious fluids") - .addInfo("Has a speed bonus of 10x - recipe times are 1/10 of what is shown on NEI") .addInfo("Works the same way as the Distillation Tower, but with a fixed height of 8") .addInfo("Fluids are only put out at the correct height") .addInfo("The correct height equals the slot number in the NEI recipe").addSeparator() @@ -204,7 +204,7 @@ public class GregtechMetaTileEntity_SpargeTower extends GregtechMeta_MultiBlockB @Override public @NotNull CheckRecipeResult checkProcessing() { ArrayList tFluidList = getStoredFluids(); - long tVoltage = getMaxInputVoltage(); + long tVoltage = GT_Utility.roundUpVoltage(this.getMaxInputVoltage()); byte tTier = (byte) Math.max(0, GT_Utility.getTier(tVoltage)); FluidStack[] tFluids = tFluidList.toArray(new FluidStack[0]); if (tFluids.length > 0) { @@ -219,12 +219,17 @@ public class GregtechMetaTileEntity_SpargeTower extends GregtechMeta_MultiBlockB this.mEfficiencyIncrease = 10000; calculateOverclockedNessMulti((long) tRecipe.mEUt, tRecipe.mDuration, 1, tVoltage); - mMaxProgresstime = Math.max(1, mMaxProgresstime / 10); + mMaxProgresstime = Math.max(1, mMaxProgresstime); ArrayList aFluidOutputs = getByproductsOfSparge( tRecipe.mFluidInputs[0], tRecipe.mFluidInputs[1]); this.mOutputFluids = aFluidOutputs.toArray(new FluidStack[0]); updateSlots(); + + if (lEUt > 0) { + lEUt = (-lEUt); + } + return CheckRecipeResultRegistry.SUCCESSFUL; } } @@ -486,4 +491,13 @@ public class GregtechMetaTileEntity_SpargeTower extends GregtechMeta_MultiBlockB } return aLayerIndex > 0; } + + @Override + public void loadNBTData(NBTTagCompound aNBT) { + super.loadNBTData(aNBT); + // Ensure that lEUt is negative from loaded NBT data, since this multi consumes EU + if (lEUt > 0) { + lEUt = (-lEUt); + } + } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMTE_NuclearReactor.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMTE_NuclearReactor.java index 9f91316621..fbfbf7bc2d 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMTE_NuclearReactor.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMTE_NuclearReactor.java @@ -359,6 +359,16 @@ public class GregtechMTE_NuclearReactor extends GregtechMeta_MultiBlockBase= 7) { - if (this.mInputHatches.size() == 4 && this.mOutputHatches.size() == 2 - && this.mOutputBusses.size() == 1 + if (this.mInputHatches.size() >= 2 && this.mInputHatches.size() <= 4 + && this.mOutputHatches.size() >= 1 + && this.mOutputHatches.size() <= 2 && this.mMufflerHatches.size() == 1 && this.mMaintenanceHatches.size() == 1 && this.mEnergyHatches.size() == 1) { diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/recipe/RecipeLoader_NuclearFuelProcessing.java b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/recipe/RecipeLoader_NuclearFuelProcessing.java index e088b50880..b39ceb8e3a 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/recipe/RecipeLoader_NuclearFuelProcessing.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/recipe/RecipeLoader_NuclearFuelProcessing.java @@ -232,8 +232,8 @@ public class RecipeLoader_NuclearFuelProcessing { */ CORE.RA.addFissionFuel( - FLUORIDES.ZIRCONIUM_TETRAFLUORIDE.getFluidStack(1000), - NUCLIDE.LiFBeF2UF4.getFluidStack(9000), + FLUORIDES.ZIRCONIUM_TETRAFLUORIDE.getFluidStack(100), + NUCLIDE.LiFBeF2UF4.getFluidStack(900), null, null, null, @@ -241,9 +241,9 @@ public class RecipeLoader_NuclearFuelProcessing { null, null, null, - NUCLIDE.LiFBeF2ZrF4UF4.getFluidStack(10000), + NUCLIDE.LiFBeF2ZrF4UF4.getFluidStack(1000), null, - 20 * 60 * 120, // Duration + 20 * 60 * 12, // Duration MaterialUtils.getVoltageForTier(5)); // LiFBeF2ThF4UF4 @@ -258,8 +258,8 @@ public class RecipeLoader_NuclearFuelProcessing { */ CORE.RA.addFissionFuel( - FLUORIDES.THORIUM_TETRAFLUORIDE.getFluidStack(1000), - NUCLIDE.LiFBeF2UF4.getFluidStack(9000), + FLUORIDES.THORIUM_TETRAFLUORIDE.getFluidStack(100), + NUCLIDE.LiFBeF2UF4.getFluidStack(900), null, null, null, @@ -267,9 +267,9 @@ public class RecipeLoader_NuclearFuelProcessing { null, null, null, - NUCLIDE.LiFBeF2ThF4UF4.getFluidStack(10000), + NUCLIDE.LiFBeF2ThF4UF4.getFluidStack(1000), null, - 20 * 60 * 150, // Duration + 20 * 60 * 15, // Duration MaterialUtils.getVoltageForTier(5)); } } -- cgit