mrkirby153

Untitled

Nov 26th, 2013
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.80 KB | None | 0 0
  1. public static boolean overlap(Location center) {
  2.         int size = MainConfiguration.villageSize();
  3.         for (Map.Entry<String, ArrayList<Location>> entry : villages.entrySet()) {
  4.             String villageName = entry.getKey();
  5.             int[] coords = VillageConfig.getVillageCoords(villageName)
  6.             Location pt1 = new Location(VillageConfig.getVillageWorld(villageName), coords[0], coords[1], coords[2]);
  7.             Location village_2_center = VillageConfig.getVillageCenterpt1(pt1);
  8.             if(Math.abs(center.getBlockX() - village_2_center.getBlockX()) < size) return true;
  9.             if(Math.abs(center.getBlockY() - center.getBlockY()) < size) return true;
  10.             if(Math.abs(center.getBlockZ() - center.getBlockZ()) < size) return true;
  11.         }
  12.         return false;
  13.     }
Advertisement
Add Comment
Please, Sign In to add comment