aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSpacebuilder2020 <spacebuilder2020@users.noreply.github.com>2024-09-08 18:28:14 -0600
committerGitHub <noreply@github.com>2024-09-09 00:28:14 +0000
commite37dd40d641add25c5041a4907954dc2b925aa1a (patch)
tree560c8922259d506bcf7e3d3bb8f451802790a4fa
parentc43cdd94e65c6e19d8380d1b2c87ce19d5d49011 (diff)
downloadGT5-Unofficial-e37dd40d641add25c5041a4907954dc2b925aa1a.tar.gz
GT5-Unofficial-e37dd40d641add25c5041a4907954dc2b925aa1a.tar.bz2
GT5-Unofficial-e37dd40d641add25c5041a4907954dc2b925aa1a.zip
Remove Dynamic Adjustment logic and instead apply the adjustment right away if a fuel is eligible for super eff increase (#3062)
Co-authored-by: Martin Robertz <dream-master@gmx.net> Co-authored-by: boubou19 <miisterunknown@gmail.com>
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/multi/MTELargeBoiler.java25
1 files changed, 10 insertions, 15 deletions
diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/MTELargeBoiler.java b/src/main/java/gregtech/common/tileentities/machines/multi/MTELargeBoiler.java
index 64998d619b..da7af756de 100644
--- a/src/main/java/gregtech/common/tileentities/machines/multi/MTELargeBoiler.java
+++ b/src/main/java/gregtech/common/tileentities/machines/multi/MTELargeBoiler.java
@@ -365,21 +365,9 @@ public abstract class MTELargeBoiler extends MTEEnhancedMultiBlockBase<MTELargeB
@Override
public boolean onRunningTick(ItemStack aStack) {
if (this.mEUt > 0) {
- int maxEff = getMaxEfficiency(mInventory[1]) - ((getIdealStatus() - getRepairStatus()) * 1000);
- if (this.mSuperEfficencyIncrease > 0 && mEfficiency <= maxEff) {
+ int maxEff = getCorrectedMaxEfficiency(mInventory[1]);
+ if (this.mSuperEfficencyIncrease > 0 && mEfficiency < maxEff) {
mEfficiency = Math.max(0, Math.min(mEfficiency + mSuperEfficencyIncrease, maxEff));
- if (mEfficiency == maxEff) {
- // Adjust the burntime dynamically to account for circuit program
- // This is to account for the dramatic issue where the machine outputs the throttled
- // amount but the burntime is not throttled.
- // This is very apparent when burning blocks with super high burntimes
- int oldProgressTime = mProgresstime;
- int oldMaxProgressTime = mMaxProgresstime;
- int maxProgressTime = adjustBurnTimeForConfig(oldMaxProgressTime);
- double progressRatio = (double) oldProgressTime / oldMaxProgressTime;
- int progressTime = (int) Math.ceil(maxProgressTime * progressRatio);
- mMaxProgresstime = maxProgressTime - (progressTime - oldProgressTime);
- }
}
int tGeneratedEU = (int) (this.mEUt * 2L * this.mEfficiency / 10000L);
if (tGeneratedEU > 0) {
@@ -488,8 +476,15 @@ public abstract class MTELargeBoiler extends MTEEnhancedMultiBlockBase<MTELargeB
return Math.max(adjustedSteamOutput, 25);
}
+ private int getCorrectedMaxEfficiency(ItemStack itemStack) {
+ return getMaxEfficiency(itemStack) - ((getIdealStatus() - getRepairStatus()) * 1000);
+ }
+
private int adjustBurnTimeForConfig(int rawBurnTime) {
- if (mEfficiency < getMaxEfficiency(mInventory[1]) - ((getIdealStatus() - getRepairStatus()) * 1000)) {
+ // Checks if the fuel is eligible for a super efficiency increase and if so, we want to immediately apply the
+ // adjustment!
+ // We also want to check that the fuel
+ if (rawBurnTime * getEfficiencyIncrease() <= 5000 && mEfficiency < getCorrectedMaxEfficiency(mInventory[1])) {
return rawBurnTime;
}
int adjustedEUt = Math.max(25, getEUt() - (isSuperheated() ? 75 : 25) * integratedCircuitConfig);