Package com.palmergames.bukkit.towny

Examples of com.palmergames.bukkit.towny.NotRegisteredException


 
  @Override
  public Town getTown(String name) throws NotRegisteredException {
    Town town = universe.getTownsMap().get(name.toLowerCase());
    if (town == null)
      throw new NotRegisteredException(String.format("The town '%s' is not registered.", name));
    return town;
  }
View Full Code Here


  @Override
  public Nation getNation(String name) throws NotRegisteredException {
    Nation nation = universe.getNationsMap().get(name.toLowerCase());
    if (nation == null)
      throw new NotRegisteredException(String.format("The nation '%s' is not registered.", name));
    return nation;
  }
View Full Code Here

  @Override
  public TownyWorld getWorld(String name) throws NotRegisteredException {
    TownyWorld world = universe.getWorldMap().get(name.toLowerCase());

    if (world == null)
      throw new NotRegisteredException("World not registered!");

    return world;
  }
View Full Code Here

  public void newResident(String name) throws AlreadyRegisteredException, NotRegisteredException {
    String filteredName;
    try {
      filteredName = universe.checkAndFilterName(name);
    } catch (InvalidNameException e) {
      throw new NotRegisteredException(e.getMessage());
    }

    if (universe.getResidentMap().containsKey(filteredName.toLowerCase()))
      throw new AlreadyRegisteredException("A resident with the name " + filteredName + " is already in use.");
View Full Code Here

  public void newTown(String name) throws AlreadyRegisteredException, NotRegisteredException {
    String filteredName;
    try {
      filteredName = universe.checkAndFilterName(name);
    } catch (InvalidNameException e) {
      throw new NotRegisteredException(e.getMessage());
    }

    if (universe.getTownsMap().containsKey(filteredName.toLowerCase()))
      throw new AlreadyRegisteredException("The town " + filteredName + " is already in use.");
View Full Code Here

  public void newNation(String name) throws AlreadyRegisteredException, NotRegisteredException {
    String filteredName;
    try {
      filteredName = universe.checkAndFilterName(name);
    } catch (InvalidNameException e) {
      throw new NotRegisteredException(e.getMessage());
    }

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

    String filteredName;
    try {
      filteredName = universe.checkAndFilterName(newName);
    } catch (InvalidNameException e) {
      throw new NotRegisteredException(e.getMessage());
    }

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

    String filteredName;
    try {
      filteredName = universe.checkAndFilterName(newName);
    } catch (InvalidNameException e) {
      throw new NotRegisteredException(e.getMessage());
    }

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

  public Nation getNation() throws NotRegisteredException {
    if (hasNation())
      return nation;
    else
      throw new NotRegisteredException("Town doesn't belong to any nation.");
  }
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.NotRegisteredException

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.