diff options
| author | Elisis <gtandemmodding@gmail.com> | 2024-08-24 05:18:09 +1000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-08-23 19:18:09 +0000 |
| commit | 71e7f3dc16a7be69a3f89c17a170d401383bf021 (patch) | |
| tree | 2b4f74c3edfdefc2152fb0dd245916e6eb3222f5 /src/main/java/com/elisis/gtnhlanth/common/tileentity | |
| parent | 0dc1b9feefc03c16efe66e14c5b8707214693658 (diff) | |
| download | GT5-Unofficial-71e7f3dc16a7be69a3f89c17a170d401383bf021.tar.gz GT5-Unofficial-71e7f3dc16a7be69a3f89c17a170d401383bf021.tar.bz2 GT5-Unofficial-71e7f3dc16a7be69a3f89c17a170d401383bf021.zip | |
General beamline fixes, balancing (#2899)
* Remove cell chemistry, increase tiering of recipes from mask-making process
* Fix LN2 and LOX in LINAC and Synchrotron
* Fix Synchrotron structure definition antenna having a different meta to the actual block
* Fix Accelerator Glass Hardness
* Fix mobs spawning inside Synchrotron, make LiB6 rods less painful to make
* Halve TC base recipe duration, loosen focus requirements for lower-tier wafers, add more detail to LINAC TT
* Improve LINAC output energy eu/t scaling
* Remove log
* Spotless
* Remove merge artifact
* Spotless apply for branch beamline-fixes-2 for #2899 (#2900)
spotlessApply
Co-authored-by: GitHub GTNH Actions <>
---------
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Martin Robertz <dream-master@gmx.net>
Co-authored-by: Connor-Colenso <52056774+Connor-Colenso@users.noreply.github.com>
Diffstat (limited to 'src/main/java/com/elisis/gtnhlanth/common/tileentity')
4 files changed, 67 insertions, 35 deletions
diff --git a/src/main/java/com/elisis/gtnhlanth/common/tileentity/LINAC.java b/src/main/java/com/elisis/gtnhlanth/common/tileentity/LINAC.java index e456813bc6..98b20becb7 100644 --- a/src/main/java/com/elisis/gtnhlanth/common/tileentity/LINAC.java +++ b/src/main/java/com/elisis/gtnhlanth/common/tileentity/LINAC.java @@ -178,15 +178,20 @@ public class LINAC extends GT_MetaTileEntity_EnhancedMultiBlockBase<LINAC> imple final GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); tt.addMachineType("Particle Accelerator") .addInfo("Controller block for the LINAC") + .addInfo("Accelerates charged particles to higher energies") + .addInfo("Increasing length increases output energy, but decreases focus") + .addInfo("Use a lower temperature coolant to improve focus") // .addInfo("Extendable, with a minimum length of 18 blocks") .addInfo(DescTextLocalization.BLUEPRINT_INFO) .addInfo(DescTextLocalization.BEAMLINE_SCANNER_INFO) .addInfo("Valid Coolants:"); // Valid coolant list - for (Fluid fluid : BeamlineRecipeLoader.coolantMap.keySet()) { + for (String fluidName : BeamlineRecipeLoader.coolantMap.keySet()) { - tt.addInfo("- " + fluid.getLocalizedName(new FluidStack(fluid, 1))); + tt.addInfo( + "- " + FluidRegistry.getFluid(fluidName) + .getLocalizedName(null)); } @@ -334,17 +339,27 @@ public class LINAC extends GT_MetaTileEntity_EnhancedMultiBlockBase<LINAC> imple // weigh the former by the latter long voltage = this.getMaxInputVoltage(); - voltageFactor = calculateVoltageFactor(voltage); + // voltageFactor = calculateVoltageFactor(voltage); - machineEnergy = Math.max(-((60) / this.length) * voltageFactor + 60_000, 2000); // Minimum of 2000keV + // machineEnergy = Math.max(-((60) / this.length) * voltageFactor + 60_000, 2000); // Minimum of 2000keV + + machineEnergy = (float) Math.max(length / 4 * Math.pow(voltage, 1.0 / 3.0), 50); // Minimum of 50keV inputEnergy = this.getInputInformation() .getEnergy(); - outputEnergy = Math.min( - (1 + inputEnergy / Particle.getParticleFromId(outputParticle) - .maxSourceEnergy()) * machineEnergy, - 120_000); // TODO more complex calculation than just - // addition + /* + * outputEnergy = Math.min( + * (1 + inputEnergy / Particle.getParticleFromId(outputParticle) + * .maxSourceEnergy()) * machineEnergy, + * 120_000); // TODO more complex calculation than just + * // addition + */ + + outputEnergy = (float) Math.pow( + 10, + 1 + inputEnergy / Particle.getParticleFromId(outputParticle) + .maxSourceEnergy()) + * machineEnergy; inputRate = this.getInputInformation() .getRate(); @@ -359,13 +374,17 @@ public class LINAC extends GT_MetaTileEntity_EnhancedMultiBlockBase<LINAC> imple primFluid.amount -= fluidConsumed; - FluidStack fluidOutput = new FluidStack( - BeamlineRecipeLoader.coolantMap.get(primFluid.getFluid()), - fluidConsumed); + Fluid fluidOutput = BeamlineRecipeLoader.coolantMap.get( + primFluid.getFluid() + .getName()); if (Objects.isNull(fluidOutput)) return false; - this.addFluidOutputs(new FluidStack[] { fluidOutput }); + FluidStack fluidOutputStack = new FluidStack(fluidOutput, fluidConsumed); + + if (Objects.isNull(fluidOutputStack)) return false; + + this.addFluidOutputs(new FluidStack[] { fluidOutputStack }); outputAfterRecipe(); @@ -552,11 +571,12 @@ public class LINAC extends GT_MetaTileEntity_EnhancedMultiBlockBase<LINAC> imple return factor; } - private static float calculateVoltageFactor(long voltage) { - - float factor = (float) Math.pow(1.00009, -(0.1 * voltage - 114000)); - return factor; - } + /* + * private static float calculateVoltageFactor(long voltage) { + * float factor = (float) Math.pow(1.00009, -(0.1 * voltage - 114000)); + * return factor; + * } + */ @Override public String[] getStructureDescription(ItemStack arg0) { diff --git a/src/main/java/com/elisis/gtnhlanth/common/tileentity/Synchrotron.java b/src/main/java/com/elisis/gtnhlanth/common/tileentity/Synchrotron.java index 6733bc5338..ee63bc8d20 100644 --- a/src/main/java/com/elisis/gtnhlanth/common/tileentity/Synchrotron.java +++ b/src/main/java/com/elisis/gtnhlanth/common/tileentity/Synchrotron.java @@ -442,8 +442,8 @@ public class Synchrotron extends GT_MetaTileEntity_EnhancedMultiBlockBase<Synchr .addElement('k', ofBlock(GregTech_API.sBlockCasings1, 15)) // Superconducting coils .addElement('d', ofBlock(LanthItemList.COOLANT_DELIVERY_CASING, 0)) .addElement('e', buildHatchAdder(Synchrotron.class).atLeast(ImmutableMap.of(Energy, 4)).dot(6).casingIndex(CASING_INDEX).build()) - .addElement('n', ofBlock(GregTech_API.sBlockMetal5, 5)) //Niobium Blocks - .addElement('a', ofBlockAdder(Synchrotron::addAntenna, LanthItemList.ANTENNA_CASING_T1, 3)) //Antenna Casings + .addElement('n', ofBlock(LanthItemList.NIOBIUM_CAVITY_CASING, 0)) + .addElement('a', ofBlockAdder(Synchrotron::addAntenna, LanthItemList.ANTENNA_CASING_T1, 0)) //Antenna Casings .addElement('i', buildHatchAdder(Synchrotron.class).atLeast(ImmutableMap.of(InputHatch, 2)).dot(4).casingIndex(CASING_INDEX).build()) .addElement('o', buildHatchAdder(Synchrotron.class).atLeast(ImmutableMap.of(OutputHatch, 2)).dot(5).casingIndex(CASING_INDEX).build()) .addElement('v', buildHatchAdder(Synchrotron.class).hatchClass(TileHatchInputBeamline.class).casingIndex(CASING_INDEX) @@ -500,9 +500,11 @@ public class Synchrotron extends GT_MetaTileEntity_EnhancedMultiBlockBase<Synchr .addInfo("Valid Coolants:"); // Valid coolant list - for (Fluid fluid : BeamlineRecipeLoader.coolantMap.keySet()) { + for (String fluidName : BeamlineRecipeLoader.coolantMap.keySet()) { - tt.addInfo("- " + fluid.getLocalizedName(new FluidStack(fluid, 1))); + tt.addInfo( + "- " + FluidRegistry.getFluid(fluidName) + .getLocalizedName(null)); } @@ -512,7 +514,7 @@ public class Synchrotron extends GT_MetaTileEntity_EnhancedMultiBlockBase<Synchr .addController("Front middle") .addCasingInfoExactly(LanthItemList.SHIELDED_ACCELERATOR_CASING.getLocalizedName(), 676, false) .addCasingInfoExactly("Superconducting Coil Block", 90, false) - .addCasingInfoExactly("Niobium Block", 64, false) + .addCasingInfoExactly("Niobium Cavity Casing", 64, false) .addCasingInfoExactly(LanthItemList.COOLANT_DELIVERY_CASING.getLocalizedName(), 28, false) .addCasingInfoExactly("Borosilicate Glass Block (LuV+)", 16, false) .addCasingInfoExactly("Antenna Casing (must match)", 4, true) @@ -781,12 +783,17 @@ public class Synchrotron extends GT_MetaTileEntity_EnhancedMultiBlockBase<Synchr primaryFluid.amount -= CONSUMED_FLUID; - FluidStack fluidOutput = new FluidStack( - BeamlineRecipeLoader.coolantMap.get(primaryFluid.getFluid()), - CONSUMED_FLUID); + Fluid fluidOutput = BeamlineRecipeLoader.coolantMap.get( + primaryFluid.getFluid() + .getName()); + if (Objects.isNull(fluidOutput)) return false; - this.addFluidOutputs(new FluidStack[] { fluidOutput }); + FluidStack fluidOutputStack = new FluidStack(fluidOutput, CONSUMED_FLUID); + + if (Objects.isNull(fluidOutputStack)) return false; + + this.addFluidOutputs(new FluidStack[] { fluidOutputStack }); outputAfterRecipe(); diff --git a/src/main/java/com/elisis/gtnhlanth/common/tileentity/TargetChamber.java b/src/main/java/com/elisis/gtnhlanth/common/tileentity/TargetChamber.java index 1fde839173..ad696f8fd3 100644 --- a/src/main/java/com/elisis/gtnhlanth/common/tileentity/TargetChamber.java +++ b/src/main/java/com/elisis/gtnhlanth/common/tileentity/TargetChamber.java @@ -304,10 +304,12 @@ public class TargetChamber extends GT_MetaTileEntity_EnhancedMultiBlockBase<Targ if (inputParticle != tRecipe.particleId) return false; - this.mMaxProgresstime = Math.round((tRecipe.amount / inputRate * 10 * TickTime.SECOND)); // 10 seconds per - // integer multiple + this.mMaxProgresstime = Math.max(Math.round((tRecipe.amount / inputRate * 5 * TickTime.SECOND)), 1); // 5 + // seconds + // per + // integer multiple // over the rate. E.g., 100a, 10r - // would equal 100 seconds + // would equal 50 seconds if (this.mMaxProgresstime == Integer.MAX_VALUE - 1 && this.mEUt == Integer.MAX_VALUE - 1) return false; mEUt = (int) -tVoltage; diff --git a/src/main/java/com/elisis/gtnhlanth/common/tileentity/recipe/beamline/BeamlineRecipeLoader.java b/src/main/java/com/elisis/gtnhlanth/common/tileentity/recipe/beamline/BeamlineRecipeLoader.java index 5b2ca7b650..2c5eef4ea0 100644 --- a/src/main/java/com/elisis/gtnhlanth/common/tileentity/recipe/beamline/BeamlineRecipeLoader.java +++ b/src/main/java/com/elisis/gtnhlanth/common/tileentity/recipe/beamline/BeamlineRecipeLoader.java @@ -22,7 +22,7 @@ import gtPlusPlus.core.material.ELEMENT; public class BeamlineRecipeLoader { - public static final HashMap<Fluid, Fluid> coolantMap = new HashMap<>(); + public static final HashMap<String, Fluid> coolantMap = new HashMap<>(); private static final ItemList[] VIABLE_WAFERS = new ItemList[] { ItemList.Circuit_Silicon_Wafer, ItemList.Circuit_Silicon_Wafer2, ItemList.Circuit_Silicon_Wafer3, ItemList.Circuit_Silicon_Wafer4, @@ -36,18 +36,21 @@ public class BeamlineRecipeLoader { coolantMap.put( Materials.LiquidNitrogen.getGas(1L) - .getFluid(), + .getFluid() + .getName(), Materials.Nitrogen.getGas(1L) .getFluid()); coolantMap.put( Materials.LiquidOxygen.getGas(1L) - .getFluid(), + .getFluid() + .getName(), Materials.Oxygen.getGas(1L) .getFluid()); - coolantMap.put(FluidRegistry.getFluid("ic2coolant"), FluidRegistry.getFluid("ic2hotcoolant")); + coolantMap.put("ic2coolant", FluidRegistry.getFluid("ic2hotcoolant")); coolantMap.put( Materials.SuperCoolant.getFluid(1L) - .getFluid(), + .getFluid() + .getName(), Materials.Water.getFluid(1L) .getFluid()); |
