Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static boolean overlap(Location center) {
- int size = MainConfiguration.villageSize();
- System.out.println("[o] Adding blocks to arraylist");
- ArrayList<Location> overlapped = new ArrayList<Location>();
- for (Map.Entry<String, ArrayList<Location>> entry : villages.entrySet()) {
- ArrayList<Location> l = entry.getValue();
- for (Location l1 : l) {
- overlapped.add(l1);
- }
- }
- System.out.println("[o] Checking overlap");
- World world = center.getWorld();
- int cx = center.getBlockX();
- int cy = center.getBlockY();
- int cz = center.getBlockZ();
- for (int x = -size; x <= size; x++) {
- for (int z = -size; z <= size; z++) {
- for (int y = 0; y <= 256; y++) {
- Location l = new Location(world, cx + x, cy + y, cz + z);
- if (overlapped.contains(l)) {
- System.out.println("[o] Done overlap!");
- return true;
- }
- }
- }
- }
- System.out.println("[o] Done no overlap");
- return false;
- }
Advertisement
Add Comment
Please, Sign In to add comment