Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @Override
- public void populate(WorldInfo worldInfo, Random random, int chunkX, int chunkZ, LimitedRegion limitedRegion) {
- int X, Y , Z;
- World world = Bukkit.getWorld(worldInfo.getName());
- for (X = 0; X < 16; X++)
- for (Z = 0; Z < 16; Z++) {
- if(!limitedRegion.isInRegion(chunkX * 16, 0, chunkZ * 16))
- return;
- for (Y = world.getMaxHeight() - 1; limitedRegion.getBlockData(X, Y, Z).getMaterial() == Material.AIR; Y--);
- logger.info("Surface at x:" + X + " y:" + Y + " z:" + Z);
- for (; Y > 0; Y--)
- if (isOreType(limitedRegion.getBlockData(X, Y, Z).getMaterial())) {
- logger.info("Cave block found at x:" + X + " y:" + Y + " z:" + Z + " and Type is " + limitedRegion.getBlockData(X, Y, Z).getMaterial());
- limitedRegion.setBlockData(X, Y, Z, Bukkit.createBlockData(Material.STONE));;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment