Package com.palmergames.bukkit.towny

Examples of com.palmergames.bukkit.towny.AlreadyRegisteredException


    } catch (InvalidNameException e) {
      throw new NotRegisteredException(e.getMessage());
    }

    if (universe.getNationsMap().containsKey(filteredName.toLowerCase()))
      throw new AlreadyRegisteredException("The nation " + filteredName + " is already in use.");

    universe.getNationsMap().put(filteredName.toLowerCase(), new Nation(filteredName));

    universe.setChangedNotify(NEW_NATION);
  }
View Full Code Here


    } catch (InvalidNameException e) {
            throw new NotRegisteredException(e.getMessage());
    }
    */
    if (universe.getWorldMap().containsKey(filteredName.toLowerCase()))
      throw new AlreadyRegisteredException("The world " + filteredName + " is already in use.");

    universe.getWorldMap().put(filteredName.toLowerCase(), new TownyWorld(filteredName));

    universe.setChangedNotify(NEW_WORLD);
  }
View Full Code Here

    } catch (InvalidNameException e) {
      throw new NotRegisteredException(e.getMessage());
    }

    if (hasTown(filteredName))
      throw new AlreadyRegisteredException("The town " + filteredName + " is already in use.");

    // TODO: Delete/rename any invites.

    List<Resident> toSave = new ArrayList<Resident>(town.getResidents());
View Full Code Here

    } catch (InvalidNameException e) {
      throw new NotRegisteredException(e.getMessage());
    }

    if (hasNation(filteredName))
      throw new AlreadyRegisteredException("The nation " + filteredName + " is already in use.");

    // TODO: Delete/rename any invites.

    List<Town> toSave = new ArrayList<Town>(nation.getTowns());
View Full Code Here

   
    private void townClaim(Town town, WorldCoord worldCoord) throws TownyException {              
        try {
                TownBlock townBlock = worldCoord.getTownBlock();
                try {
                        throw new AlreadyRegisteredException(String.format(TownySettings.getLangString("msg_already_claimed"), townBlock.getTown().getName()));
                } catch (NotRegisteredException e) {
                        throw new AlreadyRegisteredException(TownySettings.getLangString("msg_already_claimed_2"));
                }
        } catch (NotRegisteredException e) {
                TownBlock townBlock = worldCoord.getWorld().newTownBlock(worldCoord);
                townBlock.setTown(town);
                if (!town.hasHomeBlock())
View Full Code Here

  }

  @Override
  public void addTownBlock(TownBlock townBlock) throws AlreadyRegisteredException {
    if (hasTownBlock(townBlock))
      throw new AlreadyRegisteredException();
    else {
      townBlocks.add(townBlock);
      if (townBlocks.size() == 1 && !hasHomeBlock())
        try {
          setHomeBlock(townBlock);
View Full Code Here

      return;
    }
    if (this.nation == nation)
      return;
    if (hasNation())
      throw new AlreadyRegisteredException();
    this.nation = nation;
  }
View Full Code Here

    resident.setTown(this);
  }

  public void addResidentCheck(Resident resident) throws AlreadyRegisteredException {
    if (hasResident(resident))
      throw new AlreadyRegisteredException(String.format(TownySettings.getLangString("msg_err_already_in_town"), resident.getName(), getFormattedName()));
    else if (resident.hasTown())
      try {
        if (!resident.getTown().equals(this))
          throw new AlreadyRegisteredException(String.format(TownySettings.getLangString("msg_err_already_in_town"), resident.getName(), getFormattedName()));
      } catch (NotRegisteredException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
      }
  }
View Full Code Here

      }
  }

  public void addAssistant(Resident resident) throws AlreadyRegisteredException, NotRegisteredException {
    if (hasAssistant(resident))
      throw new AlreadyRegisteredException();
   
    if (!hasResident(resident))
      throw new NotRegisteredException(resident.getName() + " doesn't belong to your town.");

    assistants.add(resident);
View Full Code Here

TOP

Related Classes of com.palmergames.bukkit.towny.AlreadyRegisteredException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.