From 444fe64e32e0eb52e5d292ff84cedceecfc26deb Mon Sep 17 00:00:00 2001 From: Verclene Date: Thu, 5 May 2016 19:39:41 +0900 Subject: [PATCH] 7.1.7.39: Farmer: Fix planting beetroot bug; fix #34 --- .../blacklab/lmr/entity/mode/EntityMode_Farmer.java | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/main/java/net/blacklab/lmr/entity/mode/EntityMode_Farmer.java b/src/main/java/net/blacklab/lmr/entity/mode/EntityMode_Farmer.java index 9d1c68d..26920b9 100755 --- a/src/main/java/net/blacklab/lmr/entity/mode/EntityMode_Farmer.java +++ b/src/main/java/net/blacklab/lmr/entity/mode/EntityMode_Farmer.java @@ -280,10 +280,13 @@ protected boolean isFarmedLand(int x, int y, int z){ } protected boolean isCropGrown(int x, int y, int z){ - IBlockState state = owner.worldObj.getBlockState(new BlockPos(x,y,z)); - if(state.getBlock() instanceof BlockCrops){ - int age = (Integer) state.getValue(BlockCrops.AGE); - if(age==7) return true; + BlockPos position = new BlockPos(x, y, z); + IBlockState state = owner.worldObj.getBlockState(position); + Block block = state.getBlock(); + + if(block instanceof BlockCrops){ + // Max age -> Cannot glow(#34) + return !((BlockCrops)block).canGrow(owner.worldObj, position, state, owner.worldObj.isRemote); } return false; }