Skip to content

Commit

Permalink
7.1.7.39: Farmer: Fix planting beetroot bug; fix #34
Browse files Browse the repository at this point in the history
  • Loading branch information
Verclene committed May 5, 2016
1 parent ead5da6 commit 444fe64
Showing 1 changed file with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 444fe64

Please sign in to comment.