diff options
author | Yang Xizhi <60341015+GlodBlock@users.noreply.github.com> | 2022-05-04 18:58:49 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-04 12:58:49 +0200 |
commit | 7ee6c734bc494ffbe16b28c90d2909131280927a (patch) | |
tree | 11b0f267f35eae1a0246655cb3f41119638f0b9e /src | |
parent | 0f2d57a049a3e59b6198617d3e692f0f21c992ca (diff) | |
download | GT5-Unofficial-7ee6c734bc494ffbe16b28c90d2909131280927a.tar.gz GT5-Unofficial-7ee6c734bc494ffbe16b28c90d2909131280927a.tar.bz2 GT5-Unofficial-7ee6c734bc494ffbe16b28c90d2909131280927a.zip |
fix negative turbine (#185)
same thing https://github.com/GTNewHorizons/GT5-Unofficial/pull/1049
Diffstat (limited to 'src')
-rw-r--r-- | src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Turbine.java | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Turbine.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Turbine.java index a4040c1c5e..69f7f98606 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Turbine.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Turbine.java @@ -167,9 +167,6 @@ public class GT_MetaTileEntity_Hatch_Turbine extends GT_MetaTileEntity_Hatch { if (hasTurbine() && MathUtils.randInt(0, 1) == 0) { ItemStack aTurbine = getTurbine(); ((GT_MetaGenerated_Tool) aTurbine.getItem()).doDamage(aTurbine, (long)getDamageToComponent(aTurbine) * (long) Math.min(aEUt / damageFactorLow, Math.pow(aEUt, damageFactorHigh))); - if (aTurbine.stackSize == 0) { - aTurbine = null; - } } } @@ -213,6 +210,8 @@ public class GT_MetaTileEntity_Hatch_Turbine extends GT_MetaTileEntity_Hatch { else { //No Controller } + if (this.mInventory[0] != null && this.mInventory[0].stackSize <= 0) + this.mInventory[0] = null; } public boolean isControllerActive() { |