aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/gregtech
diff options
context:
space:
mode:
authorrepo-alt <wvk17@yandex.ru>2022-07-25 14:25:11 +0300
committerGitHub <noreply@github.com>2022-07-25 18:25:11 +0700
commitd6a7bb9b495ad0894a945620873bbe6cf3c77361 (patch)
tree0449865934f009a5715e980ac3ffb89b631b1718 /src/main/java/gregtech
parentb409dc2722f0fbd3490f2896fc08f41f66699857 (diff)
downloadGT5-Unofficial-d6a7bb9b495ad0894a945620873bbe6cf3c77361.tar.gz
GT5-Unofficial-d6a7bb9b495ad0894a945620873bbe6cf3c77361.tar.bz2
GT5-Unofficial-d6a7bb9b495ad0894a945620873bbe6cf3c77361.zip
Fix configuration circuit usage for bigger boilers (#1139)
* Fix configuration circuit usage for bigger boilers * isIntegratedCircuit refactored
Diffstat (limited to 'src/main/java/gregtech')
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler.java23
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_Titanium.java13
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_TungstenSteel.java13
3 files changed, 20 insertions, 29 deletions
diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler.java
index f651c42283..977d88a4a9 100644
--- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler.java
+++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler.java
@@ -33,6 +33,7 @@ import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofChain;
import static com.gtnewhorizon.structurelib.structure.StructureUtility.onElementPass;
import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose;
import static gregtech.api.enums.GT_Values.STEAM_PER_WATER;
+import static gregtech.api.enums.ItemList.Circuit_Integrated;
import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_LARGE_BOILER;
import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_LARGE_BOILER_ACTIVE;
import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_LARGE_BOILER_ACTIVE_GLOW;
@@ -181,10 +182,26 @@ public abstract class GT_MetaTileEntity_LargeBoiler extends GT_MetaTileEntity_En
return true;
}
+ boolean isFuelValid() {
+ if (!isSuperheated())
+ return true;
+ for (ItemStack input : getStoredInputs()) {
+ if (!GT_Recipe.GT_Recipe_Map_LargeBoilerFakeFuels.isAllowedSolidFuel(input) && !Circuit_Integrated.isStackEqual(input, true, true)) {
+ //if any item is not in ALLOWED_SOLID_FUELS, operation cannot be allowed because it might still be consumed
+ this.mMaxProgresstime = 0;
+ this.mEUt = 0;
+ return false;
+ }
+ }
+ return true;
+ }
+
@Override
public boolean checkRecipe(ItemStack aStack) {
+ if (!isFuelValid())
+ return false;
//Do we have an integrated circuit with a valid configuration?
- if (mInventory[1] != null && mInventory[1].getUnlocalizedName().startsWith("gt.integrated_circuit")) {
+ if (Circuit_Integrated.isStackEqual(mInventory[1], true, true)) {
int circuit_config = mInventory[1].getItemDamage();
if (circuit_config >= 1 && circuit_config <= 25) {
// If so, overwrite the current config
@@ -382,7 +399,7 @@ public abstract class GT_MetaTileEntity_LargeBoiler extends GT_MetaTileEntity_En
}
private int adjustEUtForConfig(int rawEUt) {
- int adjustedSteamOutput = rawEUt - 25 * integratedCircuitConfig;
+ int adjustedSteamOutput = rawEUt - (isSuperheated() ? 75 : 25) * integratedCircuitConfig;
return Math.max(adjustedSteamOutput, 25);
}
@@ -390,7 +407,7 @@ public abstract class GT_MetaTileEntity_LargeBoiler extends GT_MetaTileEntity_En
if (mEfficiency < getMaxEfficiency(mInventory[1]) - ((getIdealStatus() - getRepairStatus()) * 1000)) {
return rawBurnTime;
}
- int adjustedEUt = Math.max(25, getEUt() - 25 * integratedCircuitConfig);
+ int adjustedEUt = Math.max(25, getEUt() - (isSuperheated() ? 75 : 25) * integratedCircuitConfig);
int adjustedBurnTime = rawBurnTime * getEUt() / adjustedEUt;
this.excessProjectedEU += getEUt() * rawBurnTime - adjustedEUt * adjustedBurnTime;
adjustedBurnTime += this.excessProjectedEU / adjustedEUt;
diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_Titanium.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_Titanium.java
index b81dab847b..8ae4b6034a 100644
--- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_Titanium.java
+++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_Titanium.java
@@ -91,17 +91,4 @@ public class GT_MetaTileEntity_LargeBoiler_Titanium extends GT_MetaTileEntity_La
@Override
boolean isSuperheated() { return true; }
-
- @Override
- public boolean checkRecipe(ItemStack aStack) {
- for(ItemStack input : getStoredInputs()) {
- if(!GT_Recipe_Map_LargeBoilerFakeFuels.isAllowedSolidFuel(input)) {
- //if any item is not in ALLOWED_SOLID_FUELS, operation cannot be allowed because it might still be consumed
- this.mMaxProgresstime = 0;
- this.mEUt = 0;
- return false;
- }
- }
- return super.checkRecipe(aStack);
- }
}
diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_TungstenSteel.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_TungstenSteel.java
index 75a080c49f..e1e6e18091 100644
--- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_TungstenSteel.java
+++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_TungstenSteel.java
@@ -89,17 +89,4 @@ public class GT_MetaTileEntity_LargeBoiler_TungstenSteel extends GT_MetaTileEnti
@Override
boolean isSuperheated() { return true; }
-
- @Override
- public boolean checkRecipe(ItemStack aStack) {
- for(ItemStack input : getStoredInputs()) {
- if(!GT_Recipe_Map_LargeBoilerFakeFuels.isAllowedSolidFuel(input)) {
- //if any item is not in ALLOWED_SOLID_FUELS, operation cannot be allowed because it might still be consumed
- this.mMaxProgresstime = 0;
- this.mEUt = 0;
- return false;
- }
- }
- return super.checkRecipe(aStack);
- }
}