mirror of
https://github.com/GTNewHorizons/TinkersConstruct.git
synced 2026-11-22 13:09:53 +00:00
Add check for getCrop() being null (#176)
This commit is contained in:
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);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user