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());
- Bukkit.getConsoleSender().sendMessage(String.valueOf(limitedRegion.getBuffer()));
- for (X = 0; X < 16; X++)
- for (Z = 0; Z < 16; Z++) {
- if(!limitedRegion.isInRegion(X * chunkX, 0, Z * chunkZ))
- return;
- Chunk chunk = world.getChunkAt(X * chunkX, Z * chunkZ);
- for (Y = world.getMaxHeight() - 1; chunk.getBlock(X, Y, Z).getType() == Material.AIR; Y--);
- logger.info("Surface at x:" + X + " y:" + Y + " z:" + Z);
- for (; Y > 0; Y--)
- if (isOreType(chunk.getBlock(X, Y, Z).getType())) {
- logger.info("Cave block found at x:" + X + " y:" + Y + " z:" + Z + " and Type is " + chunk.getBlock(X, Y, Z).getType().toString());
- chunk.getBlock(X, Y, Z).setType(Material.STONE, false);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment