aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAbdiel Kavash <19243993+AbdielKavash@users.noreply.github.com>2024-04-12 14:15:00 -0600
committerGitHub <noreply@github.com>2024-04-12 22:15:00 +0200
commit08157ac34612a0298e0d8acb68ebd0f2bcdbd32f (patch)
tree65b03df2761c498ccb4698de73c1975b9deaa78c /src
parentea4699c56715180374cab6a6f4537fdddec18d70 (diff)
downloadGT5-Unofficial-08157ac34612a0298e0d8acb68ebd0f2bcdbd32f.tar.gz
GT5-Unofficial-08157ac34612a0298e0d8acb68ebd0f2bcdbd32f.tar.bz2
GT5-Unofficial-08157ac34612a0298e0d8acb68ebd0f2bcdbd32f.zip
Fix multiblock structure check bugs related to borosilicate glass. (#3)
* uBS + uD * Borosilicate Glass check fix * Non-exotic Energy Hatch fix. * Replace for loops.
Diffstat (limited to 'src')
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/API/BorosilicateGlass.java4
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java8
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaChemicalReactor.java8
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaOilCracker.java8
4 files changed, 23 insertions, 5 deletions
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/API/BorosilicateGlass.java b/src/main/java/com/github/bartimaeusnek/bartworks/API/BorosilicateGlass.java
index 3076455c70..764340af42 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/API/BorosilicateGlass.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/API/BorosilicateGlass.java
@@ -103,8 +103,8 @@ public class BorosilicateGlass {
return representatives;
}
- private static byte checkWithinBound(byte val, byte lo, byte hi) {
- return val > hi || val < lo ? -1 : val;
+ private static Byte checkWithinBound(byte val, byte lo, byte hi) {
+ return val > hi || val < lo ? null : val;
}
/**
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java
index de5ef59f18..fc490d6109 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java
@@ -365,7 +365,8 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_TileEntity_MegaMultiBlock
return false;
if (this.glassTier < 8) {
- for (GT_MetaTileEntity_Hatch hatch : this.mExoticEnergyHatches) {
+ for (int i = 0; i < this.mExoticEnergyHatches.size(); ++i) {
+ GT_MetaTileEntity_Hatch hatch = this.mExoticEnergyHatches.get(i);
if (hatch.getConnectionType() == GT_MetaTileEntity_Hatch.ConnectionType.LASER) {
return false;
}
@@ -373,6 +374,11 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_TileEntity_MegaMultiBlock
return false;
}
}
+ for (int i = 0; i < this.mEnergyHatches.size(); ++i) {
+ if (this.glassTier < this.mEnergyHatches.get(i).mTier) {
+ return false;
+ }
+ }
}
this.mHeatingCapacity = (int) this.getCoilLevel().getHeat() + 100 * (BW_Util.getTier(this.getMaxInputEu()) - 2);
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaChemicalReactor.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaChemicalReactor.java
index 2638f5de7c..3764812689 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaChemicalReactor.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaChemicalReactor.java
@@ -162,7 +162,8 @@ public class GT_TileEntity_MegaChemicalReactor
if (!this.checkPiece(STRUCTURE_PIECE_MAIN, 2, 2, 0) || this.mMaintenanceHatches.size() != 1) return false;
if (this.glassTier < 8) {
- for (GT_MetaTileEntity_Hatch hatch : this.mExoticEnergyHatches) {
+ for (int i = 0; i < this.mExoticEnergyHatches.size(); ++i) {
+ GT_MetaTileEntity_Hatch hatch = this.mExoticEnergyHatches.get(i);
if (hatch.getConnectionType() == GT_MetaTileEntity_Hatch.ConnectionType.LASER) {
return false;
}
@@ -170,6 +171,11 @@ public class GT_TileEntity_MegaChemicalReactor
return false;
}
}
+ for (int i = 0; i < this.mEnergyHatches.size(); ++i) {
+ if (this.glassTier < this.mEnergyHatches.get(i).mTier) {
+ return false;
+ }
+ }
}
return true;
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaOilCracker.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaOilCracker.java
index 650e386202..8b498694bd 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaOilCracker.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaOilCracker.java
@@ -238,7 +238,8 @@ public class GT_TileEntity_MegaOilCracker extends GT_TileEntity_MegaMultiBlockBa
if (!this.checkPiece(STRUCTURE_PIECE_MAIN, 6, 6, 0) || this.mMaintenanceHatches.size() != 1) return false;
if (this.glassTier < 8) {
- for (GT_MetaTileEntity_Hatch hatch : this.mExoticEnergyHatches) {
+ for (int i = 0; i < this.mExoticEnergyHatches.size(); ++i) {
+ GT_MetaTileEntity_Hatch hatch = this.mExoticEnergyHatches.get(i);
if (hatch.getConnectionType() == GT_MetaTileEntity_Hatch.ConnectionType.LASER) {
return false;
}
@@ -246,6 +247,11 @@ public class GT_TileEntity_MegaOilCracker extends GT_TileEntity_MegaMultiBlockBa
return false;
}
}
+ for (int i = 0; i < this.mEnergyHatches.size(); ++i) {
+ if (this.glassTier < this.mEnergyHatches.get(i).mTier) {
+ return false;
+ }
+ }
}
return true;