Integrate the terrain in the tree gen helper

This commit is contained in:
Nedelosk committed 2016-03-26 13:28:13 +01:00
1 parent 1c1dd4918a
commit 8a40dd6d27
5 files changed
+65 -20

No files matched your search

@@ -207,16 +207,10 @@ public class ButterflyRoot extends SpeciesRoot implements IButterflyRoot {
do {
y--;
} while (!canReplace(world, new BlockPos(x, y, z)));
} while (!BlockUtil.canReplace(world, new BlockPos(x, y, z)));
return new BlockPos(x, y, z);
}
private boolean canReplace(World world, BlockPos pos) {
Block block = BlockUtil.getBlock(world, pos);
Material material = block.getMaterial();
return block.isReplaceable(world, pos) && !material.isLiquid() || block.isAir(world, pos) || material == Material.plants;
}
@Override
public boolean isMated(ItemStack stack) {