Advertisement
Guest User

Untitled

a guest
Apr 15th, 2014
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.78 KB | None | 0 0
  1. int radius = 2;//or whatever you want it to be  
  2.         int rangeSquared = (int)Math.pow(radius, radius);
  3.         final Block block = new Location(p.getWorld(), p.getLocation().getX(), p.getLocation().getY(), p.getLocation().getZ()).getBlock();
  4.         final int x = block.getX();
  5.         final int y = block.getY();
  6.         final int z = block.getZ();
  7.         final int minX = x - radius;
  8.         final int minY = y - radius;
  9.         final int minZ = z - radius;
  10.         final int maxX = x + radius;
  11.         final int maxY = y + radius;
  12. for (int counterX = minX; counterX <= maxX; counterX++)
  13.         {
  14.             for (int counterZ = minZ; counterZ <= maxZ; counterZ++)
  15.             {
  16.                 final Block blockName = p.getWorld().getBlockAt(counterX, y-1, counterZ);
  17.                 final Location locBlock = blockName.getLocation();
  18.                 final Location checker = p.getLocation();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement