Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int radius = 2;//or whatever you want it to be
- int rangeSquared = (int)Math.pow(radius, radius);
- final Block block = new Location(p.getWorld(), p.getLocation().getX(), p.getLocation().getY(), p.getLocation().getZ()).getBlock();
- final int x = block.getX();
- final int y = block.getY();
- final int z = block.getZ();
- final int minX = x - radius;
- final int minY = y - radius;
- final int minZ = z - radius;
- final int maxX = x + radius;
- final int maxY = y + radius;
- for (int counterX = minX; counterX <= maxX; counterX++)
- {
- for (int counterZ = minZ; counterZ <= maxZ; counterZ++)
- {
- final Block blockName = p.getWorld().getBlockAt(counterX, y-1, counterZ);
- final Location locBlock = blockName.getLocation();
- final Location checker = p.getLocation();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement