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++) {
- int Xcord = (chunkX * 16) + X;
- int Zcord = (chunkZ * 16) + Z;
- if(!limitedRegion.isInRegion(Xcord, 0, Zcord))
- continue;
- for (Y = world.getMaxHeight() - 1; limitedRegion.getBlockData(Xcord, Y, Zcord).getMaterial() == Material.AIR; Y--);
- //logger.info("Surface at x:" + Xcord + " y:" + Y + " z:" + Zcord);
- for (; Y > -65; Y--){
- if (oreMaterial.contains(limitedRegion.getBlockData(Xcord, Y, Zcord).getMaterial())){
- logger.info("Cave block found at x:" + Xcord + " y:" + Y + " z:" + Zcord + " and Type is " + limitedRegion.getBlockData(Xcord, Y, Zcord).getMaterial());
- limitedRegion.setBlockData(Xcord, Y, Zcord, Bukkit.createBlockData(Material.SPONGE));
- }
- if (deepOreMaterial.contains(limitedRegion.getBlockData(Xcord, Y, Zcord).getMaterial())){
- logger.info("Cave block found at x:" + Xcord + " y:" + Y + " z:" + Zcord + " and Type is " + limitedRegion.getBlockData(Xcord, Y, Zcord).getMaterial());
- limitedRegion.setBlockData(Xcord, Y, Zcord, Bukkit.createBlockData(Material.SPONGE));
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment