Fixed using bonemeal on rocks consuming the bonemeal when it shouldn't

This commit is contained in:
Sollace 2021-09-03 00:47:23 +02:00
parent 77aeaabf78
commit e6223c8de1

View file

@ -93,6 +93,14 @@ public class RockCropBlock extends CropBlock {
return world.getClosestPlayer(pos.getX(), pos.getY(), pos.getZ(), 20, EquinePredicates.PLAYER_CAN_USE_EARTH) != null;
}
@Override
public boolean isFertilizable(BlockView world, BlockPos pos, BlockState state, boolean isClient) {
if (world instanceof World && !canGrow((World)world, ((World)world).random, pos, state)) {
return false;
}
return super.isFertilizable(world, pos, state, isClient);
}
@Override
protected ItemConvertible getSeedsItem() {
return UItems.PEBBLES;