aboutsummaryrefslogtreecommitdiff
path: root/src/main/java
diff options
context:
space:
mode:
authorboubou19 <miisterunknown@gmail.com>2023-12-17 20:52:19 +0100
committerGitHub <noreply@github.com>2023-12-17 11:52:19 -0800
commit0eeb22bc3bf00bf845234e99de185bde9889889c (patch)
treedd130dabe72448b2367928edc19e9c90a71a3771 /src/main/java
parentbbaf2ced7ee55843884d8bd8cb2ad511e3a53361 (diff)
downloadGT5-Unofficial-0eeb22bc3bf00bf845234e99de185bde9889889c.tar.gz
GT5-Unofficial-0eeb22bc3bf00bf845234e99de185bde9889889c.tar.bz2
GT5-Unofficial-0eeb22bc3bf00bf845234e99de185bde9889889c.zip
fix IOOBE when there is no fuel fluids (#808)
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/GT_MTE_LargeTurbine_Plasma.java5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/GT_MTE_LargeTurbine_Plasma.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/GT_MTE_LargeTurbine_Plasma.java
index 5a0629fe5d..985c4e3e40 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/GT_MTE_LargeTurbine_Plasma.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/GT_MTE_LargeTurbine_Plasma.java
@@ -177,7 +177,10 @@ public class GT_MTE_LargeTurbine_Plasma extends GregtechMetaTileEntity_LargerTur
// Reduce produced power depending on the ratio between fuel value and turbine EU/t with the following
// formula:
// EU/t = EU/t * MIN(1, ( ( (FuelValue / 200) ^ 2 ) / EUPerTurbine))
- int fuelValue = getFuelValue(new FluidStack(tFluids.get(0), 0));
+ int fuelValue = 0;
+ if (tFluids.size() > 0) {
+ fuelValue = getFuelValue(new FluidStack(tFluids.get(0), 0));
+ }
float magicValue = (fuelValue * 0.005f) * (fuelValue * 0.005f);
float efficiencyLoss = Math.min(1.0f, magicValue / euPerTurbine);
newPower *= efficiencyLoss;