From eda122bfba27558f89d1e2accf83e43027772366 Mon Sep 17 00:00:00 2001 From: Elisis Date: Mon, 9 Sep 2024 15:26:49 +1000 Subject: Beamline Fixes and Balancing (#3064) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Martin Robertz --- .../gtnhlanth/common/beamline/MTEBeamlinePipe.java | 57 ++++++++++------------ .../common/hatch/MTEHatchOutputBeamline.java | 49 +++++++++++++++++-- .../java/gtnhlanth/common/tileentity/MTELINAC.java | 5 +- .../common/tileentity/MTESourceChamber.java | 1 + .../common/tileentity/MTESynchrotron.java | 28 +++++++---- .../common/tileentity/MTETargetChamber.java | 1 - 6 files changed, 92 insertions(+), 49 deletions(-) (limited to 'src') diff --git a/src/main/java/gtnhlanth/common/beamline/MTEBeamlinePipe.java b/src/main/java/gtnhlanth/common/beamline/MTEBeamlinePipe.java index fbfb0eb9c6..5ff7447b28 100644 --- a/src/main/java/gtnhlanth/common/beamline/MTEBeamlinePipe.java +++ b/src/main/java/gtnhlanth/common/beamline/MTEBeamlinePipe.java @@ -111,38 +111,31 @@ public class MTEBeamlinePipe extends MetaPipeEntity implements IConnectsToBeamli @Override public IConnectsToBeamline getNext(IConnectsToBeamline source) { - for (ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) { - - if ((mConnections & 1 << dir.ordinal()) == 0) { - continue; - } - - TileEntity next = this.getBaseMetaTileEntity() - .getTileEntityAtSide(dir); - if (next instanceof IConnectsToBeamline && next != source) { - - if (((IConnectsToBeamline) next).isDataInputFacing(dir.getOpposite())) { - return (IConnectsToBeamline) next; - } - - } else if (next instanceof IGregTechTileEntity) { - - IMetaTileEntity meta = ((IGregTechTileEntity) next).getMetaTileEntity(); - if (meta instanceof IConnectsToBeamline && meta != source) { - - if (meta instanceof MTEBeamlinePipe && (((MTEBeamlinePipe) meta).connectionCount == 2)) { - - ((MTEBeamlinePipe) meta).markUsed(); - return (IConnectsToBeamline) meta; - } - - if (((IConnectsToBeamline) meta).isDataInputFacing(dir.getOpposite())) { - - return (IConnectsToBeamline) meta; - } - } - } - } + /* + * for (ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) { + * if ((mConnections & 1 << dir.ordinal()) == 0) { + * continue; + * } + * TileEntity next = this.getBaseMetaTileEntity() + * .getTileEntityAtSide(dir); + * if (next instanceof IConnectsToBeamline && next != source) { + * if (((IConnectsToBeamline) next).isDataInputFacing(dir.getOpposite())) { + * return (IConnectsToBeamline) next; + * } + * } else if (next instanceof IGregTechTileEntity) { + * IMetaTileEntity meta = ((IGregTechTileEntity) next).getMetaTileEntity(); + * if (meta instanceof IConnectsToBeamline && meta != source) { + * if (meta instanceof TileBeamline && (((TileBeamline) meta).connectionCount == 2)) { + * ((TileBeamline) meta).markUsed(); + * return (IConnectsToBeamline) meta; + * } + * if (((IConnectsToBeamline) meta).isDataInputFacing(dir.getOpposite())) { + * return (IConnectsToBeamline) meta; + * } + * } + * } + * } + */ return null; } diff --git a/src/main/java/gtnhlanth/common/hatch/MTEHatchOutputBeamline.java b/src/main/java/gtnhlanth/common/hatch/MTEHatchOutputBeamline.java index dfb210d725..00772fb5e8 100644 --- a/src/main/java/gtnhlanth/common/hatch/MTEHatchOutputBeamline.java +++ b/src/main/java/gtnhlanth/common/hatch/MTEHatchOutputBeamline.java @@ -83,14 +83,53 @@ public class MTEHatchOutputBeamline extends MTEHatchBeamlineConnector implements ISu .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("Use a lower temperature coolant to improve output focus") + .addInfo("Output energy does not scale for input energies higher than 7500 keV") // .addInfo("Extendable, with a minimum length of 18 blocks") .addInfo(DescTextLocalization.BLUEPRINT_INFO) .addInfo(DescTextLocalization.BEAMLINE_SCANNER_INFO) @@ -347,6 +348,8 @@ public class MTELINAC extends MTEEnhancedMultiBlockBase implements ISu inputEnergy = this.getInputInformation() .getEnergy(); + + inputEnergy = Math.min(inputEnergy, 7500); // Does not scale past 7500 keV, prevents double LINAC issue /* * outputEnergy = Math.min( * (1 + inputEnergy / Particle.getParticleFromId(outputParticle) diff --git a/src/main/java/gtnhlanth/common/tileentity/MTESourceChamber.java b/src/main/java/gtnhlanth/common/tileentity/MTESourceChamber.java index d978b1eaab..cec44a111a 100644 --- a/src/main/java/gtnhlanth/common/tileentity/MTESourceChamber.java +++ b/src/main/java/gtnhlanth/common/tileentity/MTESourceChamber.java @@ -126,6 +126,7 @@ public class MTESourceChamber extends MTEEnhancedMultiBlockBase im final MultiblockTooltipBuilder tt = new MultiblockTooltipBuilder(); tt.addMachineType("Particle Accelerator") .addInfo("Controller block for the Synchrotron") - .addInfo("Torus-shaped, accelerates electrons to produce high-energy electromagnetic radiation") + .addInfo("Torus-shaped, accelerates electrons to produce high-energy electromagnetic radiation,") + .addInfo("in the form of photons") + .addInfo("Antenna Casings can be one of two tiers, upgrade them to improve output rate and energy scaling") + .addInfo("Minimum input focus: " + MIN_INPUT_FOCUS) .addInfo(DescTextLocalization.BLUEPRINT_INFO) .addInfo(DescTextLocalization.BEAMLINE_SCANNER_INFO) + + .addInfo("Use a lower temperature coolant to improve output focus") .addInfo("Valid Coolants:"); // Valid coolant list @@ -854,10 +859,13 @@ public class MTESynchrotron extends MTEEnhancedMultiBlockBase im private static float getVoltageFactor(long mEU, int antennaTier) { // float factor = (float) Math.pow(1.00004, -mEU * Math.pow(antennaTier, 1.0/3.0) + 80000); - float factor = (float) -Math.pow(1.1, -mEU / 2000 * Math.pow(antennaTier, 2.0 / 3.0)) + 1; // Strictly improves - // with higher tier - // antenna - return (float) Math.max(1.0, factor); + // float factor = (float) -Math.pow(1.1, -mEU / 2000 * Math.pow(antennaTier, 2.0 / 3.0)) + 1; // Strictly + // improves + // with higher tier + // antenna + float factor = (float) (Math.sqrt(mEU) / 1500); + + return factor; } @@ -893,11 +901,11 @@ public class MTESynchrotron extends MTEEnhancedMultiBlockBase im // Punny, right? private static float getOutputRatetio(float voltageFactor, int antennaTier) { - return (float) (voltageFactor / (10 / Math.pow(2.5, antennaTier))); // Scale ratio with antenna tier, such a - // high - // exponential should be fine so long as - // there - // are only few antenna tiers + return (float) (voltageFactor / (10.0 / Math.pow(2.5, antennaTier))); // Scale ratio with antenna tier, such a + // high + // exponential should be fine so long as + // there + // are only few antenna tiers } @Override diff --git a/src/main/java/gtnhlanth/common/tileentity/MTETargetChamber.java b/src/main/java/gtnhlanth/common/tileentity/MTETargetChamber.java index 8545d5e23a..cd598f1bd0 100644 --- a/src/main/java/gtnhlanth/common/tileentity/MTETargetChamber.java +++ b/src/main/java/gtnhlanth/common/tileentity/MTETargetChamber.java @@ -101,7 +101,6 @@ public class MTETargetChamber extends MTEEnhancedMultiBlockBase