use of net.minecraft.block.PlantBlock in project BleachHack by BleachDrinker420.
the class WorldUtils method getTopBlockIgnoreLeaves.
public static int getTopBlockIgnoreLeaves(int x, int z) {
int top = mc.world.getTopY(Heightmap.Type.WORLD_SURFACE, x, z) - 1;
while (top > mc.world.getBottomY()) {
BlockState state = mc.world.getBlockState(new BlockPos(x, top, z));
if (!(state.isAir() || state.getBlock() instanceof LeavesBlock || state.getBlock() instanceof PlantBlock)) {
break;
}
top--;
}
return top;
}
Aggregations