private void addCocoa(int sourceX, int sourceY, int sourceZ, World world, Random random) {
if (height > 5 && random.nextInt(5) == 0) {
for (int y = 0; y < 2; y++) {
for (BlockFace cocoaFace : COCOA_FACES) {
if (random.nextInt(COCOA_FACES.length - y)
== 0) {
CocoaPlantSize size = COCOA_SIZE[random.nextInt(COCOA_SIZE.length)];
Block block = delegate
.getBlockState(world, sourceX, sourceY + height - 5 + y,
sourceZ)
.getBlock().getRelative(cocoaFace);
delegate.setTypeAndData(world, block.getX(), block.getY(),
block.getZ(),
Material.COCOA, new CocoaPlant(size, cocoaFace.getOppositeFace()));
}
}
}
}
}
}