aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authormiozune <miozune@gmail.com>2022-09-27 00:15:29 +0900
committerGitHub <noreply@github.com>2022-09-26 16:15:29 +0100
commitcd282e42454d0eb233e0dcabc0de10c1fa1815ea (patch)
tree018a059592dc65e3c3184bd5672ef55071651a9f /src
parent474303e2d8bf4433bd137dc864524a67fe85fbad (diff)
downloadGT5-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.java4
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());