public boolean loadServerWorldsList() {
   sendDebugMsg("Loading Server World List");
   for (World world : plugin.getServer().getWorlds())
     try {
       // String[] split = world.getName().split("/");
       // String worldName = split[split.length-1];
       // universe.newWorld(worldName);
       universe.newWorld(world.getName());
     } catch (AlreadyRegisteredException e) {
       e.printStackTrace();
     } catch (NotRegisteredException e) {
       e.printStackTrace();
     }
   return true;
 }
Exemple #2
0
  @Override
  public void run() {
    try {
      town.addResident(resident);
      towny.deleteCache(resident.getName());
      TownyUniverse.getDataSource().saveResident(resident);
      TownyUniverse.getDataSource().saveTown(town);

      TownyMessaging.sendTownMessage(
          town,
          ChatTools.color(
              String.format(TownySettings.getLangString("msg_join_town"), resident.getName())));
    } catch (AlreadyRegisteredException e) {
      try {
        TownyMessaging.sendResidentMessage(resident, e.getMessage());
      } catch (TownyException e1) {
      }
    }
  }