aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/net/glease
diff options
context:
space:
mode:
authorGlease <4586901+Glease@users.noreply.github.com>2022-12-19 20:05:43 +0800
committerGlease <4586901+Glease@users.noreply.github.com>2022-12-20 22:24:48 +0800
commit209ff94f083b367fe01cfae8f2b12ecb93091ef4 (patch)
tree298ea107e96613b9c7d3bb3a7595375301b3c6d0 /src/main/java/net/glease
parentd422ae2f5032aaca01d45d44e5c1644996c9a09d (diff)
downloadGT5-Unofficial-209ff94f083b367fe01cfae8f2b12ecb93091ef4.tar.gz
GT5-Unofficial-209ff94f083b367fe01cfae8f2b12ecb93091ef4.tar.bz2
GT5-Unofficial-209ff94f083b367fe01cfae8f2b12ecb93091ef4.zip
fix more lEUt nonsense
Diffstat (limited to 'src/main/java/net/glease')
-rw-r--r--src/main/java/net/glease/ggfab/mte/MTE_AdvAssLine.java20
-rw-r--r--src/main/java/net/glease/ggfab/util/OverclockHelper.java3
2 files changed, 12 insertions, 11 deletions
diff --git a/src/main/java/net/glease/ggfab/mte/MTE_AdvAssLine.java b/src/main/java/net/glease/ggfab/mte/MTE_AdvAssLine.java
index 576e2e0fdb..851f9ba59c 100644
--- a/src/main/java/net/glease/ggfab/mte/MTE_AdvAssLine.java
+++ b/src/main/java/net/glease/ggfab/mte/MTE_AdvAssLine.java
@@ -297,6 +297,7 @@ public class MTE_AdvAssLine extends GT_MetaTileEntity_ExtendedPowerMultiBlockBas
for (Slice slice : slices) {
slice.reset();
}
+ getBaseMetaTileEntity().issueClientUpdate();
}
@Override
@@ -364,10 +365,14 @@ public class MTE_AdvAssLine extends GT_MetaTileEntity_ExtendedPowerMultiBlockBas
@Override
public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) {
if (checkMachine()) {
+ long oV = inputVoltage, oEut = inputEUt;
inputVoltage = Integer.MAX_VALUE;
inputEUt = 0;
mEnergyHatches.forEach(this::recordEnergySupplier);
mExoticEnergyHatches.forEach(this::recordEnergySupplier);
+ if (mMaxProgresstime > 0 && (oV != inputVoltage || oEut != inputEUt)) {
+ criticalStopMachine();
+ }
return true;
} else {
inputVoltage = V[0];
@@ -448,7 +453,7 @@ public class MTE_AdvAssLine extends GT_MetaTileEntity_ExtendedPowerMultiBlockBas
if (slice.progress > 0)
tEUt += baseEUt;
}
- mEUt = tEUt;
+ lEUt = tEUt;
if (slices[0].canStart() && getBaseMetaTileEntity().isAllowedToWork()) {
if (hasAllFluids(currentRecipe)) {
@@ -595,7 +600,7 @@ public class MTE_AdvAssLine extends GT_MetaTileEntity_ExtendedPowerMultiBlockBas
mMaxProgresstime = laserOverclock.getDuration();
}
// In case recipe is too OP for that machine
- if (mMaxProgresstime == Integer.MAX_VALUE - 1 && mEUt == Integer.MAX_VALUE - 1) {
+ if (mMaxProgresstime == Integer.MAX_VALUE - 1 && lEUt == Integer.MAX_VALUE - 1) {
if (GT_Values.D1) {
GT_FML_LOGGER.info("Recipe too OP");
}
@@ -627,10 +632,10 @@ public class MTE_AdvAssLine extends GT_MetaTileEntity_ExtendedPowerMultiBlockBas
mOutputItems = new ItemStack[]{recipe.mOutput};
- if (this.mEUt > 0) {
- this.mEUt = -this.mEUt;
+ if (this.lEUt > 0) {
+ this.lEUt = -this.lEUt;
}
- baseEUt = mEUt;
+ baseEUt = lEUt;
this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000);
this.mEfficiencyIncrease = 10000;
updateSlots();
@@ -705,11 +710,6 @@ public class MTE_AdvAssLine extends GT_MetaTileEntity_ExtendedPowerMultiBlockBas
tag.setInteger("mDuration", mMaxProgresstime / currentRecipe.mInputs.length);
}
- @Override
- public String[] getInfoData() {
- return super.getInfoData();
- }
-
private void drainAllFluids(GT_Recipe.GT_Recipe_AssemblyLine recipe) {
for (int i = 0; i < recipe.mFluidInputs.length; i++) {
depleteInput(recipe.mFluidInputs[i]);
diff --git a/src/main/java/net/glease/ggfab/util/OverclockHelper.java b/src/main/java/net/glease/ggfab/util/OverclockHelper.java
index 7d0699a298..b188089ed9 100644
--- a/src/main/java/net/glease/ggfab/util/OverclockHelper.java
+++ b/src/main/java/net/glease/ggfab/util/OverclockHelper.java
@@ -20,7 +20,8 @@ public class OverclockHelper {
if (recipeEUt > inputEUt) return null;
float currentPenalty = 4 + penaltyIncreaseFactor;
// 2/(n+k) overclock until energy hatch is crying
- while (recipeEUt * currentPenalty < inputEUt && duration > 1) {
+ // must ensure it doesn't go to negative after overclock
+ while (recipeEUt * currentPenalty > 0 && recipeEUt * currentPenalty < inputEUt && duration > 1) {
duration >>= 1;
recipeEUt *= currentPenalty;
currentPenalty += penaltyIncreaseFactor;