final Random rand = GenericMath.getRandom();
if (rand.nextInt(chance) == 0) {
if (isFullyGrown(block)) {
for (int i = 0; i < BlockFaces.NESW.size(); i++) {
Block spread = block.translate(BlockFaces.NESW.get(i));
BlockMaterial material = spread.getMaterial();
if (material == VanillaMaterials.AIR) {
BlockMaterial belowSpread = spread.translate(BlockFace.BOTTOM).getMaterial();
if (belowSpread.isMaterial(VanillaMaterials.FARMLAND, VanillaMaterials.DIRT, VanillaMaterials.GRASS)) {
spread.setMaterial(this.getLastStageMaterial());
break;
}
} else if (material == getLastStageMaterial()) {
break;