Ejemplo n.º 1
0
 @Override
 public GlowWorld getWorld(UUID uid) {
   for (GlowWorld world : worlds.getWorlds()) {
     if (uid.equals(world.getUID())) {
       return world;
     }
   }
   return null;
 }
Ejemplo n.º 2
0
  public void reloadFlyZones(boolean showMessage) {

    RocketInit.rocketZoneLocations.clear();
    List<String> zoneList = RocketInit.getPlugin().getConfig().getStringList("zones");

    if (zoneList.size() > 0) {

      for (String zone : zoneList) {

        String[] zoneSection = zone.split("\\|");

        final Location zoneLocationStart =
            new Location(
                Bukkit.getWorld(zoneSection[1]),
                Integer.parseInt(zoneSection[2]) - 25,
                Integer.parseInt(zoneSection[3]) - 5,
                Integer.parseInt(zoneSection[4]) - 25);

        final Location zoneLocationEnd =
            new Location(
                Bukkit.getWorld(zoneSection[1]),
                Integer.parseInt(zoneSection[2]) + 25,
                Integer.parseInt(zoneSection[3]) + 50,
                Integer.parseInt(zoneSection[4]) + 25);

        RocketInit.rocketZoneLocations.put(
            UUID.fromString(zoneSection[0]),
            new ConcurrentHashMap<Location, Location>() {
              {
                put(zoneLocationStart, zoneLocationEnd);
              }
            });
      }

      if (showMessage) RocketInit.registerMap.put("zone", zoneList.size());
    }
  }