diff options
author | miozune <miozune@gmail.com> | 2022-09-27 00:15:29 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-09-26 16:15:29 +0100 |
commit | cd282e42454d0eb233e0dcabc0de10c1fa1815ea (patch) | |
tree | 018a059592dc65e3c3184bd5672ef55071651a9f /src | |
parent | 474303e2d8bf4433bd137dc864524a67fe85fbad (diff) | |
download | GT5-Unofficial-cd282e42454d0eb233e0dcabc0de10c1fa1815ea.tar.gz GT5-Unofficial-cd282e42454d0eb233e0dcabc0de10c1fa1815ea.tar.bz2 GT5-Unofficial-cd282e42454d0eb233e0dcabc0de10c1fa1815ea.zip |
Fix NPE with Crop Harvester (#378)
* Fix NPE with Crop Harvester
* address review
Diffstat (limited to 'src')
-rw-r--r-- | src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_CropHarvestor.java | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_CropHarvestor.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_CropHarvestor.java index 2847a15539..bea3645a03 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_CropHarvestor.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_CropHarvestor.java @@ -270,9 +270,9 @@ public class GT_MetaTileEntity_CropHarvestor extends GT_MetaTileEntity_BasicTank ItemStack[] aHarvest = tCrop.harvest_automated(true); if (aHarvest != null && aHarvest.length > 0) { for (ItemStack aStack : aHarvest) { - if (aStack.stackSize > 0) { + if (aStack != null && aStack.stackSize > 0) { if (this.mTier * 5 > MathUtils.randInt(1, 100)) { - aStack.stackSize += Math.floor(tCrop.getGain() / 10); + aStack.stackSize += tCrop.getGain() / 10; Logger.INFO("Bonus output given for " + aCrop.displayName()); } Logger.INFO("Harvested " + aCrop.displayName()); |