Add check for getCrop() being null (#176)

This commit is contained in:
ceg authored and GitHub committed 2025-05-17 23:54:10 +02:00
1 parent 848656dbad
commit d450f1dc27
1 file changed
+2 -1
@@ -16,7 +16,8 @@ public class Ic2CropHarvestHandler implements CropHarvestHandler {
@Override
public boolean tryHarvest(ItemStack stack, EntityPlayer player, World world, int x, int y, int z) {
return world.getTileEntity(x, y, z) instanceof ICropTile crop && crop.getCrop().canBeHarvested(crop)
return world.getTileEntity(x, y, z) instanceof ICropTile crop && crop.getCrop() != null
&& crop.getCrop().canBeHarvested(crop)
&& crop.harvest(true);
}
}