aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/gtnhlanth/common/tileentity
diff options
context:
space:
mode:
authorElisis <gtandemmodding@gmail.com>2024-11-24 10:14:22 +1100
committerGitHub <noreply@github.com>2024-11-23 23:14:22 +0000
commit9ce867e5aa95d2f8a8a809e33b3a0fb874e3b36b (patch)
tree96333d48657f7c07e03b2ce8d7367a0a2ccc7523 /src/main/java/gtnhlanth/common/tileentity
parent2449dbf9168456d49f0cf29097ff780f6cd63deb (diff)
downloadGT5-Unofficial-9ce867e5aa95d2f8a8a809e33b3a0fb874e3b36b.tar.gz
GT5-Unofficial-9ce867e5aa95d2f8a8a809e33b3a0fb874e3b36b.tar.bz2
GT5-Unofficial-9ce867e5aa95d2f8a8a809e33b3a0fb874e3b36b.zip
Beamline fixes 4 (#3504)
Co-authored-by: BlueHero233 <jeleiacraft@gmail.com> Co-authored-by: Martin Robertz <dream-master@gmx.net> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Ethryan <3237986+Ethryan@users.noreply.github.com>
Diffstat (limited to 'src/main/java/gtnhlanth/common/tileentity')
-rw-r--r--src/main/java/gtnhlanth/common/tileentity/MTELINAC.java48
-rw-r--r--src/main/java/gtnhlanth/common/tileentity/MTESourceChamber.java7
-rw-r--r--src/main/java/gtnhlanth/common/tileentity/MTESynchrotron.java119
-rw-r--r--src/main/java/gtnhlanth/common/tileentity/MTETargetChamber.java80
-rw-r--r--src/main/java/gtnhlanth/common/tileentity/recipe/beamline/BeamlineRecipeLoader.java110
5 files changed, 234 insertions, 130 deletions
diff --git a/src/main/java/gtnhlanth/common/tileentity/MTELINAC.java b/src/main/java/gtnhlanth/common/tileentity/MTELINAC.java
index 7ae15db3aa..8fb3a54e92 100644
--- a/src/main/java/gtnhlanth/common/tileentity/MTELINAC.java
+++ b/src/main/java/gtnhlanth/common/tileentity/MTELINAC.java
@@ -195,7 +195,8 @@ public class MTELINAC extends MTEEnhancedMultiBlockBase<MTELINAC> implements ISu
}
- tt.addInfo("Requires (length + 1)kL/s of coolant")
+ tt.addInfo("Requires (length)kL/s of coolant")
+ .addSeparator()
.beginVariableStructureBlock(7, 7, 7, 7, 19, 83, false)
.addController("Front bottom")
.addCasingInfoRange(LanthItemList.SHIELDED_ACCELERATOR_CASING.getLocalizedName(), 325, 1285, false)
@@ -283,7 +284,8 @@ public class MTELINAC extends MTEEnhancedMultiBlockBase<MTELINAC> implements ISu
FluidStack primFluid = tFluidInputs.get(0);
// 1b (1000L)/m/operation
- final int fluidConsumed = 1000 * length;
+ final int fluidConsumed = 1000 * (length + 1); // length variable is technically physical length - 1, adding
+ // here so as to not affect existing math
this.mEfficiency = (10000 - (this.getIdealStatus() - this.getRepairStatus()) * 1000);
this.mEfficiencyIncrease = 10000;
@@ -307,8 +309,11 @@ public class MTELINAC extends MTEEnhancedMultiBlockBase<MTELINAC> implements ISu
}
mMaxProgresstime = 1 * TickTime.SECOND;
+
// Consume the input tier's corresponding practical voltage instead of the maximum suggested by the logic
- mEUt = (int) -GTValues.VP[(int) this.getInputVoltageTier()];
+ // 1A if one energy hatch, 4A if two
+ mEUt = (int) ((this.mEnergyHatches.size() == 1) ? -GTValues.VP[(int) this.getInputVoltageTier()]
+ : (int) (-this.getMaxInputAmps() * GTValues.VP[(int) this.getInputVoltageTier()]));
// Particle stays the same with this multiblock
outputParticle = particleId;
@@ -336,10 +341,8 @@ public class MTELINAC extends MTEEnhancedMultiBlockBase<MTELINAC> implements ISu
: inputFocus * (machineFocus / 100); // If input focus > machine focus, take the average of both, else
// weigh the former by the latter
- long voltage = this.getMaxInputVoltage();
- // voltageFactor = calculateVoltageFactor(voltage);
-
- // machineEnergy = Math.max(-((60) / this.length) * voltageFactor + 60_000, 2000); // Minimum of 2000keV
+ // 1A of full power if one energy hatch, 4A if two
+ long voltage = (this.mEnergyHatches.size() == 1) ? this.getMaxInputVoltage() : this.getMaxInputPower();
machineEnergy = (float) Math.max(length / 4 * Math.pow(voltage, 1.0 / 3.0), 50); // Minimum of 50keV
@@ -347,13 +350,6 @@ public class MTELINAC extends MTEEnhancedMultiBlockBase<MTELINAC> implements ISu
.getEnergy();
inputEnergy = Math.min(inputEnergy, 7500); // Does not scale past 7500 keV, prevents double LINAC issue
- /*
- * outputEnergy = Math.min(
- * (1 + inputEnergy / Particle.getParticleFromId(outputParticle)
- * .maxSourceEnergy()) * machineEnergy,
- * 120_000); // TODO more complex calculation than just
- * // addition
- */
outputEnergy = (float) Math.pow(
10,
@@ -408,7 +404,6 @@ public class MTELINAC extends MTEEnhancedMultiBlockBase<MTELINAC> implements ISu
@Override
public void stopMachine() {
- // GTLog.out.print("Machine stopped");
outputFocus = 0;
outputEnergy = 0;
outputParticle = 0;
@@ -445,6 +440,10 @@ public class MTELINAC extends MTEEnhancedMultiBlockBase<MTELINAC> implements ISu
BeamInformation information = this.getInputInformation();
+ if (information == null) {
+ information = new BeamInformation(0, 0, 0, 0);
+ }
+
return new String[] {
/* 1 */ StatCollector.translateToLocal("GT5U.multiblock.Progress") + ": "
+ EnumChatFormatting.GREEN
@@ -473,7 +472,9 @@ public class MTELINAC extends MTEEnhancedMultiBlockBase<MTELINAC> implements ISu
+ EnumChatFormatting.YELLOW
+ GTUtility.formatNumbers(getMaxInputVoltage())
+ EnumChatFormatting.RESET
- + " EU/t(*2A) "
+ + " EU/t(*"
+ + getMaxInputAmps()
+ + "A)"
+ StatCollector.translateToLocal("GT5U.machines.tier")
+ ": "
+ EnumChatFormatting.YELLOW
@@ -503,7 +504,7 @@ public class MTELINAC extends MTEEnhancedMultiBlockBase<MTELINAC> implements ISu
StatCollector.translateToLocal("beamline.coolusage") + ": " // Coolant usage:
+ EnumChatFormatting.AQUA
- + length
+ + (length + 1)
+ EnumChatFormatting.RESET
+ " kL/s", // e.g. "24 kL/s
@@ -558,7 +559,6 @@ public class MTELINAC extends MTEEnhancedMultiBlockBase<MTELINAC> implements ISu
// Will it matter? No :boubs_glasses:
if (in.q == null) return new BeamInformation(0, 0, 0, 0);
- // if (in.q == null) return new BeamInformation(10000, 10, 0, 90); // temporary for testing purposes
return in.q.getContent();
}
@@ -569,13 +569,6 @@ public class MTELINAC extends MTEEnhancedMultiBlockBase<MTELINAC> implements ISu
return (float) Math.pow(1.1, 0.2 * fluidTemp);
}
- /*
- * 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) {
return DescTextLocalization.addText("LINAC.hint", 11);
@@ -612,8 +605,6 @@ public class MTELINAC extends MTEEnhancedMultiBlockBase<MTELINAC> implements ISu
length += 2;
}
- // if (!checkPiece(STRUCTURE_PIECE_END, 3, 6, -length)) return false;
-
// Likely off by one or two, not visible to player however so doesn't particularly matter
length += 8;
@@ -635,9 +626,6 @@ public class MTELINAC extends MTEEnhancedMultiBlockBase<MTELINAC> implements ISu
}
for (int i = -8; i > -lLength - 1; i -= 2) {
-
- // GTLog.out.print("Building inner piece! i = " + i);
-
buildPiece(STRUCTURE_PIECE_LAYER, stackSize, hintsOnly, 3, 6, i);
}
diff --git a/src/main/java/gtnhlanth/common/tileentity/MTESourceChamber.java b/src/main/java/gtnhlanth/common/tileentity/MTESourceChamber.java
index 8fb94d505c..5c69bae5a8 100644
--- a/src/main/java/gtnhlanth/common/tileentity/MTESourceChamber.java
+++ b/src/main/java/gtnhlanth/common/tileentity/MTESourceChamber.java
@@ -154,15 +154,10 @@ public class MTESourceChamber extends MTEEnhancedMultiBlockBase<MTESourceChamber
return false;
}
- /*
- * protected OverclockDescriber createOverclockDescriber() { return new EUNoTotalOverclockDescriber((byte) 4, 1); }
- */
@Override
public boolean checkRecipe(ItemStack itemStack) {
- // GTLog.out.print("In checkRecipe");
-
// No input particle, so no input quantities
outputFocus = 0;
@@ -172,7 +167,7 @@ public class MTESourceChamber extends MTEEnhancedMultiBlockBase<MTESourceChamber
ItemStack[] tItems = this.getStoredInputs()
.toArray(new ItemStack[0]);
- // GTLog.out.print(Arrays.toString(tItems));
+
long tVoltageMaxTier = this.getMaxInputVoltage(); // Used to keep old math the same
long tVoltageActual = GTValues.VP[(int) this.getInputVoltageTier()];
diff --git a/src/main/java/gtnhlanth/common/tileentity/MTESynchrotron.java b/src/main/java/gtnhlanth/common/tileentity/MTESynchrotron.java
index dfecdcd71e..2d8f0c2f08 100644
--- a/src/main/java/gtnhlanth/common/tileentity/MTESynchrotron.java
+++ b/src/main/java/gtnhlanth/common/tileentity/MTESynchrotron.java
@@ -4,6 +4,7 @@ import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock;
import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlockAdder;
import static gregtech.api.enums.GTValues.VN;
import static gregtech.api.enums.HatchElement.Energy;
+import static gregtech.api.enums.HatchElement.ExoticEnergy;
import static gregtech.api.enums.HatchElement.InputHatch;
import static gregtech.api.enums.HatchElement.Maintenance;
import static gregtech.api.enums.HatchElement.OutputHatch;
@@ -40,9 +41,11 @@ import gregtech.api.enums.TickTime;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
-import gregtech.api.metatileentity.implementations.MTEEnhancedMultiBlockBase;
+import gregtech.api.metatileentity.implementations.MTEExtendedPowerMultiBlockBase;
+import gregtech.api.metatileentity.implementations.MTEHatch;
import gregtech.api.metatileentity.implementations.MTEHatchEnergy;
import gregtech.api.render.TextureFactory;
+import gregtech.api.util.ExoticEnergyInputHelper;
import gregtech.api.util.GTUtility;
import gregtech.api.util.MultiblockTooltipBuilder;
import gregtech.api.util.shutdown.ShutDownReason;
@@ -58,7 +61,7 @@ import gtnhlanth.common.tileentity.recipe.beamline.BeamlineRecipeLoader;
import gtnhlanth.util.DescTextLocalization;
import gtnhlanth.util.Util;
-public class MTESynchrotron extends MTEEnhancedMultiBlockBase<MTESynchrotron> implements ISurvivalConstructable {
+public class MTESynchrotron extends MTEExtendedPowerMultiBlockBase<MTESynchrotron> implements ISurvivalConstructable {
private static final IStructureDefinition<MTESynchrotron> STRUCTURE_DEFINITION;
@@ -79,6 +82,8 @@ public class MTESynchrotron extends MTEEnhancedMultiBlockBase<MTESynchrotron> im
private int energyHatchTier;
+ private boolean usingExotic = false;
+
private int antennaeTier;
private Byte glassTier;
@@ -440,7 +445,9 @@ public class MTESynchrotron extends MTEEnhancedMultiBlockBase<MTESynchrotron> im
).addElement('c', ofBlock(LanthItemList.SHIELDED_ACCELERATOR_CASING, 0))
.addElement('k', ofBlock(GregTechAPI.sBlockCasings1, 15)) // Superconducting coils
.addElement('d', ofBlock(LanthItemList.COOLANT_DELIVERY_CASING, 0))
- .addElement('e', buildHatchAdder(MTESynchrotron.class).atLeast(ImmutableMap.of(Energy, 4)).dot(6).casingIndex(CASING_INDEX).build())
+
+ // Adder overriden due to ExoticEnergy originally calling its own adder, giving false positives
+ .addElement('e', buildHatchAdder(MTESynchrotron.class).atLeast(ImmutableMap.of(Energy.or(ExoticEnergy), 4)).adder(MTESynchrotron::addEnergyInputToMachineList).dot(6).casingIndex(CASING_INDEX).build())
.addElement('n', ofBlock(LanthItemList.NIOBIUM_CAVITY_CASING, 0))
.addElement('a', ofBlockAdder(MTESynchrotron::addAntenna, LanthItemList.ANTENNA_CASING_T1, 0)) //Antenna Casings
.addElement('i', buildHatchAdder(MTESynchrotron.class).atLeast(ImmutableMap.of(InputHatch, 2)).dot(4).casingIndex(CASING_INDEX).build())
@@ -475,6 +482,8 @@ public class MTESynchrotron extends MTEEnhancedMultiBlockBase<MTESynchrotron> im
private int machineTemp;
+ private long energyHatchAmperage;
+
public MTESynchrotron(String aName) {
super(aName);
}
@@ -620,19 +629,64 @@ public class MTESynchrotron extends MTEEnhancedMultiBlockBase<MTESynchrotron> im
}
IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity();
if (aMetaTileEntity == null) return false;
- if (aMetaTileEntity instanceof MTEHatchEnergy hatch) {
- // First energy hatch added
- if (this.mEnergyHatches.isEmpty()) this.energyHatchTier = hatch.mTier;
+ boolean firstHatch = false;
+ if (this.mEnergyHatches.isEmpty() && this.mExoticEnergyHatches.isEmpty()) firstHatch = true;
+
+ if (aMetaTileEntity instanceof MTEHatch hatch) {
+
+ if (firstHatch) {
+
+ this.energyHatchTier = hatch.mTier;
+ this.energyHatchAmperage = hatch.maxWorkingAmperesIn();
+
+ }
// Disallow any hatches that don't match the tier of the first hatch added
if (hatch.mTier != this.energyHatchTier) return false;
- hatch.updateTexture(aBaseCasingIndex);
- hatch.updateCraftingIcon(this.getMachineCraftingIcon());
- return mEnergyHatches.add(hatch);
+ if (hatch.maxWorkingAmperesIn() != this.energyHatchAmperage) // Prevent mixing amperages within a tier
+ return false;
+
+ if (aMetaTileEntity instanceof MTEHatchEnergy hatchNormal) {
+
+ if (usingExotic) // usingExotic defaults to false, only set when known to be using exotics
+ return false; // If exotics are already being used, disallow non-exotics
+
+ hatchNormal.updateTexture(aBaseCasingIndex);
+ hatchNormal.updateCraftingIcon(this.getMachineCraftingIcon());
+ return mEnergyHatches.add(hatchNormal);
+
+ } else if (aMetaTileEntity instanceof MTEHatch hatchExotic
+ && ExoticEnergyInputHelper.isExoticEnergyInput(aMetaTileEntity)) {
+
+ if (firstHatch) usingExotic = true;
+
+ if (!usingExotic) return false; // If normal hatches are already being used, disallow exotics
+
+ hatchExotic.updateTexture(aBaseCasingIndex);
+ hatchExotic.updateCraftingIcon(this.getMachineCraftingIcon());
+ return mExoticEnergyHatches.add(hatchExotic);
+
+ } else {
+ return false; // Not an energy hatch
+ }
+ } else {
+ return false; // Not a hatch of any kind
}
- return false;
+
+ /*
+ * if (aMetaTileEntity instanceof MTEHatchEnergy hatch) {
+ * // First energy hatch added
+ * if (this.mEnergyHatches.isEmpty()) this.energyHatchTier = hatch.mTier;
+ * // Disallow any hatches that don't match the tier of the first hatch added
+ * if (hatch.mTier != this.energyHatchTier) return false;
+ * hatch.updateTexture(aBaseCasingIndex);
+ * hatch.updateCraftingIcon(this.getMachineCraftingIcon());
+ * return mEnergyHatches.add(hatch);
+ * }
+ * return false;
+ */
}
private boolean addAntenna(Block block, int meta) {
@@ -715,9 +769,11 @@ public class MTESynchrotron extends MTEEnhancedMultiBlockBase<MTESynchrotron> im
mMaxProgresstime = TickTime.SECOND;
- long voltage = this.getMaxInputVoltage();
- mEUt = (int) (-voltage / GTValues.V[(int) this.getInputVoltageTier()]
- * GTValues.VP[(int) this.getInputVoltageTier()]); // Multiply VP by amps
+ long voltage = 0;
+
+ voltage = this.getMaxInputEu();
+
+ lEUt = -GTValues.VP[GTUtility.getTier(this.getAverageInputVoltage())] * this.getMaxInputAmps();
outputParticle = 1; // Photon
@@ -766,7 +822,7 @@ public class MTESynchrotron extends MTEEnhancedMultiBlockBase<MTESynchrotron> im
outputRate = (int) (inputRate * getOutputRatetio(voltageFactor, this.antennaeTier));
if (outputRate == 0) {
- stopMachine(SimpleShutDownReason.ofCritical("gtnhlanth.low_input_rate"));
+ stopMachine(SimpleShutDownReason.ofCritical("gtnhlanth.low_input_eut"));
return false;
}
@@ -841,7 +897,6 @@ public class MTESynchrotron extends MTEEnhancedMultiBlockBase<MTESynchrotron> im
for (MTEHatchInputBeamline in : this.mInputBeamline) {
if (in.q == null) return new BeamInformation(0, 0, 0, 0);
- // if (in.q == null) return new BeamInformation(10000, 10, 0, 90); // TODO temporary for testing purposes
return in.q.getContent();
}
@@ -857,10 +912,6 @@ public class MTESynchrotron extends MTEEnhancedMultiBlockBase<MTESynchrotron> im
return (float) (Math.sqrt(mEU) / 1500);
}
- /*
- * private static float getTemperatureFactor(int temperature) { float factor = (float) Math.pow(1.11, 0.18 *
- * temperature); return factor; }
- */
private static double calculateOutputParticleEnergy(long voltage, double inputParticleEnergy, int antennaTier) {
/*
@@ -905,17 +956,19 @@ public class MTESynchrotron extends MTEEnhancedMultiBlockBase<MTESynchrotron> im
long storedEnergy = 0;
long maxEnergy = 0;
- for (MTEHatchEnergy tHatch : mEnergyHatches) {
- if (tHatch.isValid()) {
- storedEnergy += tHatch.getBaseMetaTileEntity()
- .getStoredEU();
- maxEnergy += tHatch.getBaseMetaTileEntity()
- .getEUCapacity();
- }
+ for (MTEHatch tHatch : getExoticAndNormalEnergyHatchList()) {
+ storedEnergy += tHatch.getBaseMetaTileEntity()
+ .getStoredEU();
+ maxEnergy += tHatch.getBaseMetaTileEntity()
+ .getEUCapacity();
}
BeamInformation information = this.getInputInformation();
+ if (information == null) {
+ information = new BeamInformation(0, 0, 0, 0);
+ }
+
return new String[] {
/* 1 */ StatCollector.translateToLocal("GT5U.multiblock.Progress") + ": "
+ EnumChatFormatting.GREEN
@@ -942,13 +995,15 @@ public class MTESynchrotron extends MTEEnhancedMultiBlockBase<MTESynchrotron> im
+ " EU/t",
/* 4 */ StatCollector.translateToLocal("GT5U.multiblock.mei") + ": "
+ EnumChatFormatting.YELLOW
- + GTUtility.formatNumbers(getMaxInputVoltage())
+ + GTUtility.formatNumbers(getAverageInputVoltage())
+ EnumChatFormatting.RESET
- + " EU/t(*2A) "
+ + " EU/t(*"
+ + getMaxInputAmps()
+ + "A)"
+ StatCollector.translateToLocal("GT5U.machines.tier")
+ ": "
+ EnumChatFormatting.YELLOW
- + VN[GTUtility.getTier(getMaxInputVoltage())]
+ + VN[GTUtility.getTier(getAverageInputVoltage())]
+ EnumChatFormatting.RESET,
/* 5 */ StatCollector.translateToLocal("GT5U.multiblock.problems") + ": "
+ EnumChatFormatting.RED
@@ -1035,7 +1090,11 @@ public class MTESynchrotron extends MTEEnhancedMultiBlockBase<MTESynchrotron> im
this.mAntennaCasings.clear();
this.mEnergyHatches.clear();
+ this.mExoticEnergyHatches.clear();
this.energyHatchTier = 0;
+ this.energyHatchAmperage = 0;
+ this.usingExotic = false;
+
this.antennaeTier = 0;
this.glassTier = 0;
@@ -1050,7 +1109,7 @@ public class MTESynchrotron extends MTEEnhancedMultiBlockBase<MTESynchrotron> im
return this.mInputBeamline.size() == 1 && this.mOutputBeamline.size() == 1
&& this.mMaintenanceHatches.size() == 1
- && this.mEnergyHatches.size() == 4
+ && (this.mEnergyHatches.size() == 4 || this.mExoticEnergyHatches.size() == 4)
&& this.glassTier >= MIN_GLASS_TIER;
}
diff --git a/src/main/java/gtnhlanth/common/tileentity/MTETargetChamber.java b/src/main/java/gtnhlanth/common/tileentity/MTETargetChamber.java
index ffc16fddf0..988bf1fd5c 100644
--- a/src/main/java/gtnhlanth/common/tileentity/MTETargetChamber.java
+++ b/src/main/java/gtnhlanth/common/tileentity/MTETargetChamber.java
@@ -272,15 +272,7 @@ public class MTETargetChamber extends MTEEnhancedMultiBlockBase<MTETargetChamber
})
.find();
- if (tRecipe == null || !tRecipe.isRecipeInputEqual(true, new FluidStack[] {}, tItemsWithFocusItemArray))
- return false;
-
- if (tRecipe.focusItem != null) {
- if (tRecipe.focusItem.getItem() != tFocusItem.getItem()) return false;
- }
-
- this.mEfficiency = (10000 - (this.getIdealStatus() - this.getRepairStatus()) * 1000);
- this.mEfficiencyIncrease = 10000;
+ if (tRecipe == null) return false;
BeamInformation inputInfo = this.getInputInformation();
@@ -297,23 +289,72 @@ public class MTETargetChamber extends MTEEnhancedMultiBlockBase<MTETargetChamber
if (inputParticle != tRecipe.particleId) return false;
- this.mMaxProgresstime = Math.max(Math.round((tRecipe.amount / inputRate * 5 * TickTime.SECOND)), 1); // 5
- // seconds
- // per
+ if (tRecipe.focusItem != null) {
+ if (tRecipe.focusItem.getItem() != tFocusItem.getItem()) return false;
+ }
+
+ int focusDurabilityDepletion = 1;
+
+ float progressTime = tRecipe.amount / inputRate * 5 * TickTime.SECOND;
+
+ int batchAmount = 1;
+
+ if (progressTime < 1) { // Subticking
+
+ batchAmount = (int) Math.round(1.0 / progressTime);
+
+ if (tRecipe.focusItem != null) {
+ int maskLimit = tFocusItem.getMaxDamage() - tFocusItem.getItemDamage() + 1;
+
+ if (batchAmount > maskLimit) batchAmount = maskLimit; // Limited by mask durability first, if it's
+ // present in recipe. Assume mask is present in
+ // machine from above condition
+ }
+
+ progressTime = 1;
+ }
+
+ this.mMaxProgresstime = (int) progressTime; // 5
+ // seconds
+ // per
// integer multiple
// over the rate. E.g., 100a, 10r
// would equal 50 seconds
+
if (this.mMaxProgresstime == Integer.MAX_VALUE - 1 && this.mEUt == Integer.MAX_VALUE - 1) return false;
+ double maxParallel = tRecipe
+ .maxParallelCalculatedByInputs(batchAmount, new FluidStack[] {}, tItemsWithFocusItemArray);
+
+ if (maxParallel < 1) // Insufficient items
+ return false;
+
+ if (batchAmount > maxParallel) batchAmount = (int) maxParallel;
+
+ tRecipe.consumeInput(batchAmount, new FluidStack[] {}, tItemsWithFocusItemArray);
+
+ focusDurabilityDepletion = batchAmount;
+
+ ItemStack[] itemOutputArray = GTUtility.copyItemArray(tRecipe.mOutputs);
+
+ for (ItemStack stack : itemOutputArray) {
+
+ stack.stackSize *= batchAmount;
+
+ }
+
+ this.mEfficiency = (10000 - (this.getIdealStatus() - this.getRepairStatus()) * 1000);
+ this.mEfficiencyIncrease = 10000;
+
mEUt = (int) -tVoltage;
if (this.mEUt > 0) this.mEUt = (-this.mEUt);
- this.mOutputItems = tRecipe.mOutputs;
+ this.mOutputItems = itemOutputArray;
if (tRecipe.focusItem != null) // Recipe actually uses the mask, can also assume machine mask item is nonnull
// due to above conditions
mInputFocus.get(0)
- .depleteFocusDurability(1);
+ .depleteFocusDurability(focusDurabilityDepletion);
this.updateSlots();
@@ -325,9 +366,6 @@ public class MTETargetChamber extends MTEEnhancedMultiBlockBase<MTETargetChamber
for (MTEHatchInputBeamline in : this.mInputBeamline) {
if (in.q == null) return new BeamInformation(0, 0, 0, 0);
- // if (in.q == null) return new BeamInformation(10, 10, Particle.PHOTON.ordinal(), 90); // temporary
- // for
- // testing purposes
return in.q.getContent();
}
@@ -337,6 +375,10 @@ public class MTETargetChamber extends MTEEnhancedMultiBlockBase<MTETargetChamber
private ItemStack getFocusItemStack() {
for (MTEBusInputFocus hatch : this.mInputFocus) {
+
+ if (hatch.getContentUsageSlots()
+ .isEmpty()) return null;
+
return hatch.getContentUsageSlots()
.get(0);
}
@@ -400,6 +442,10 @@ public class MTETargetChamber extends MTEEnhancedMultiBlockBase<MTETargetChamber
BeamInformation information = this.getInputInformation();
+ if (information == null) {
+ information = new BeamInformation(0, 0, 0, 0);
+ }
+
return new String[] {
/* 1 */ StatCollector.translateToLocal("GT5U.multiblock.Progress") + ": "
+ EnumChatFormatting.GREEN
diff --git a/src/main/java/gtnhlanth/common/tileentity/recipe/beamline/BeamlineRecipeLoader.java b/src/main/java/gtnhlanth/common/tileentity/recipe/beamline/BeamlineRecipeLoader.java
index d71b9a571e..f0b170bb4a 100644
--- a/src/main/java/gtnhlanth/common/tileentity/recipe/beamline/BeamlineRecipeLoader.java
+++ b/src/main/java/gtnhlanth/common/tileentity/recipe/beamline/BeamlineRecipeLoader.java
@@ -11,6 +11,7 @@ import net.minecraftforge.fluids.FluidRegistry;
import gregtech.api.enums.ItemList;
import gregtech.api.enums.Materials;
import gregtech.api.enums.OrePrefixes;
+import gregtech.api.enums.TierEU;
import gregtech.api.util.GTOreDictUnificator;
import gregtech.api.util.GTUtility;
import gtPlusPlus.core.material.MaterialsElements;
@@ -50,7 +51,7 @@ public class BeamlineRecipeLoader {
Materials.SuperCoolant.getFluid(1L)
.getFluid()
.getName(),
- Materials.Water.getFluid(1L)
+ WerkstoffMaterialPool.HotSuperCoolant.getFluidOrGas(1000)
.getFluid());
/*
@@ -111,59 +112,74 @@ public class BeamlineRecipeLoader {
if (mask.getProducedItem() == null) // Blank or error
continue;
- int index = 0;
- for (ItemList wafer : VIABLE_WAFERS) {
-
- index++;
-
- if (!Arrays.asList(mask.getForbiddenWafers())
- .contains(wafer)) {
-
- BeamlineRecipeAdder2.instance.addTargetChamberRecipe(
- wafer.get(1),
- GTUtility.copyAmountUnsafe((int) Math.pow(2, index + 2), mask.getProducedItem()),
- new ItemStack(LanthItemList.maskMap.get(mask), 0),
- 1,
- mask.getBaselineAmount() * (int) Math.pow(Math.sqrt(3), index - 1), // 3x recipe amount increase
- // per 2 increases in wafer
- // tier. This greatly
- // incentivises the use of
- // higher tier boule wafer
- // recipes
- mask.getMinEnergy(),
- mask.getMaxEnergy(),
- mask.getMinFocus(),
- 1,
- 1920);
+ if (mask.getTCTargetItem() == null) { // Wafer TC recipe
+
+ int index = 0;
+ for (ItemList wafer : VIABLE_WAFERS) {
+
+ index++;
+
+ if (!Arrays.asList(mask.getForbiddenWafers())
+ .contains(wafer)) {
+
+ BeamlineRecipeAdder2.instance.addTargetChamberRecipe(
+ wafer.get(1),
+ GTUtility.copyAmountUnsafe((int) Math.pow(2, index + 2), mask.getProducedItem()),
+ new ItemStack(LanthItemList.maskMap.get(mask), 0),
+ 1,
+ (int) Math.round(mask.getBaselineAmount() * Math.pow(Math.sqrt(2), index - 1)), // 2x recipe
+ // amount
+ // increase
+ // per 2 increases in wafer
+ // tier. This greatly
+ // incentivises the use of
+ // higher tier boule wafer
+ // recipes
+ mask.getMinEnergy(),
+ mask.getMaxEnergy(),
+ mask.getMinFocus(),
+ 1,
+ 1920);
+
+ }
}
+ continue;
+
}
- /*
- * if (!Arrays.asList(MaskList.CPU.getForbiddenWafers()).contains(wafer)) {
- * BeamlineRecipeAdder.instance.addTargetChamberRecipe( wafer.get(1), GT_Utility.copyAmountUnsafe((int)
- * Math.pow(2, index + 2), ItemList.Circuit_Wafer_CPU.get(1)), //Varies new
- * ItemStack(LanthItemList.maskMap.get(MaskList.CPU), 0), // Varies 0, 10 * (int) Math.pow(2, index - 1), //
- * Varies 1, //Varies 10000000, //Varies 50, //Varies 1, 1920 ); } /* PPIC
- */
-
- /*
- * if (!Arrays.asList(MaskList.PPIC.getForbiddenWafers()).contains(wafer)) {
- * GTLog.out.print("Adding recipe for PPIC with " + wafer.get(1).getUnlocalizedName() + " amount: " + 40 *
- * (int) Math.pow(2, index - 1)); BeamlineRecipeAdder.instance.addTargetChamberRecipe( wafer.get(1),
- * ItemList.Circuit_Wafer_PPIC.get((int) Math.pow(2, index + 2)), //Varies new
- * ItemStack(LanthItemList.maskMap.get(MaskList.PPIC), 0), // Varies 0, 40 * (int) Math.pow(2, index - 1),
- * // Varies 1, //Varies 10000000, //Varies 50, //Varies 1, 1920 ); }
- */
+ // Non-wafer recipes
+
+ BeamlineRecipeAdder2.instance.addTargetChamberRecipe(
+ GTUtility.copyAmountUnsafe(1, mask.getTCTargetItem()),
+ GTUtility.copyAmountUnsafe(4, mask.getProducedItem()),
+ new ItemStack(LanthItemList.maskMap.get(mask), 0),
+ 1,
+ mask.getBaselineAmount(),
+ mask.getMinEnergy(),
+ mask.getMaxEnergy(),
+ mask.getMinFocus(),
+ 1,
+ (int) TierEU.RECIPE_LuV);
}
- /*
- * BeamlineRecipeAdder2.instance.addTargetChamberRecipe( new ItemStack(Items.coal, 1), new
- * ItemStack(Items.diamond, 1), null, 1, 20, 100, 1000, 60, 1, 1920);
- * BeamlineRecipeAdder2.instance.addTargetChamberRecipe( new ItemStack(Items.coal, 1), new
- * ItemStack(Items.cooked_chicken, 1), null, 1, 20, 1, 10, 60, 1, 1920);
- */
+
+ /* LuAG */
+
+ // Raw Advanced Crystal Chip
+
+ BeamlineRecipeAdder2.instance.addTargetChamberRecipe(
+ WerkstoffMaterialPool.CeriumDopedLutetiumAluminiumGarnet.get(OrePrefixes.gemExquisite, 1),
+ GTUtility.copyAmountUnsafe(64, ItemList.Circuit_Chip_CrystalSoC.get(1)),
+ new ItemStack(LanthItemList.maskMap.get(MaskList.CSOC), 0),
+ 1,
+ 24,
+ 5,
+ 12,
+ 60,
+ 1,
+ (int) TierEU.RECIPE_LuV);
BeamlineRecipeAdder2.instance.addTargetChamberRecipe(
new ItemStack(Items.chicken, 1),