Package com.palmergames.bukkit.towny

Examples of com.palmergames.bukkit.towny.AlreadyRegisteredException


      }


        public void addAlly(Nation nation) throws AlreadyRegisteredException {
                if (hasAlly(nation))
                        throw new AlreadyRegisteredException();
                else {
                        try {
                                removeEnemy(nation);
                        } catch (NotRegisteredException e) {
                        }
View Full Code Here


                return getAllies().contains(nation);
        }

        public void addEnemy(Nation nation) throws AlreadyRegisteredException {
                if (hasEnemy(nation))
                        throw new AlreadyRegisteredException();
                else {
                        try {
                                removeAlly(nation);
                        } catch (NotRegisteredException e) {
                        }
View Full Code Here

                return towns.contains(town);
        }

        public void addTown(Town town) throws AlreadyRegisteredException {
                if (hasTown(town))
                        throw new AlreadyRegisteredException();
                else if (town.hasNation())
                        throw new AlreadyRegisteredException();
                else {
                        towns.add(town);
                        town.setNation(this);
                }
        }
View Full Code Here

                }
        }

        public void addAssistant(Resident resident) throws AlreadyRegisteredException {
                if (hasAssistant(resident))
                        throw new AlreadyRegisteredException();
                else
                        getAssistants().add(resident);
        }
View Full Code Here

                return townBlocks.contains(townBlock);
        }

        public void addTownBlock(TownBlock townBlock) throws AlreadyRegisteredException {
                if (hasTownBlock(townBlock))
                        throw new AlreadyRegisteredException();
                else
                        townBlocks.add(townBlock);
        }
View Full Code Here

            TownyUniverse.getDataSource().saveTownBlock(townBlock);

            return true;
          } else {
            //Should never reach here.
            throw new AlreadyRegisteredException(String.format(TownySettings.getLangString("msg_already_claimed"), owner.getName()));
          }
               
        } catch (NotRegisteredException e) {
          //Plot has no owner so it's the town selling it
          TownyMessaging.sendMsg(player, String.format("6) %s", worldCoord.toString()));
View Full Code Here

    return towns.contains(town);
  }

  public void addTown(Town town) throws AlreadyRegisteredException {
    if (hasTown(town))
      throw new AlreadyRegisteredException();
    else {
      towns.add(town);
      town.setWorld(this);
    }
  }
View Full Code Here

    newTownBlock(new Coord(x, z));
  }

  public TownBlock newTownBlock(Coord key) throws AlreadyRegisteredException {
    if (hasTownBlock(key))
      throw new AlreadyRegisteredException();
    townBlocks.put(new Coord(key.getX(), key.getZ()), new TownBlock(key.getX(), key.getZ(), this));
    return townBlocks.get(new Coord(key.getX(), key.getZ()));
  }
View Full Code Here

    } 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.");

    universe.getResidentMap().put(filteredName.toLowerCase(), new Resident(filteredName));

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

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

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

    universe.getTownsMap().put(filteredName.toLowerCase(), new Town(filteredName));

    universe.setChangedNotify(NEW_TOWN);
  }
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.