Package com.palmergames.bukkit.towny.object

Examples of com.palmergames.bukkit.towny.object.TownBlockOwner


   * @param location
   * @return true if the given player is owner in the given plot
   * @throws NotRegisteredException
   */
  public boolean isPlotOwner (Player player, Location location) throws NotRegisteredException {
    TownBlockOwner  owner  = TownyUniverse.getDataSource().getResident(player.getName());
    return TownyUniverse.getTownBlock(location).isOwner(owner);
  }
View Full Code Here


  public static List<String> getStatus(TownBlock townBlock) {
    List<String> out = new ArrayList<String>();

    try {
      TownBlockOwner owner;
      Town town = townBlock.getTown();
      TownyWorld world = townBlock.getWorld();

      if (townBlock.hasResident()) {
        owner = townBlock.getResident();
      } else {
        owner = townBlock.getTown();
      }

      out.add(ChatTools.formatTitle(TownyFormatter.getFormattedName(owner) + ((MinecraftTools.isOnline(owner.getName())) ? Colors.LightGreen + " (Online)" : "")));
      out.add(Colors.Green + " Perm: " + ((owner instanceof Resident) ? townBlock.getPermissions().getColourString() : townBlock.getPermissions().getColourString().replace("f", "r")));
      out.add(Colors.Green + "PvP: " + ((town.isPVP() || world.isForcePVP() || townBlock.getPermissions().pvp) ? Colors.Red + "ON" : Colors.LightGreen + "OFF") + Colors.Green + "  Explosions: " + ((world.isForceExpl() || townBlock.getPermissions().explosion) ? Colors.Red + "ON" : Colors.LightGreen + "OFF") + Colors.Green + "  Firespread: " + ((town.isFire() || world.isForceFire() || townBlock.getPermissions().fire) ? Colors.Red + "ON" : Colors.LightGreen + "OFF") + Colors.Green + "  Mob Spawns: " + ((town.hasMobs() || world.isForceTownMobs() || townBlock.getPermissions().mobs) ? Colors.Red + "ON" : Colors.LightGreen + "OFF"));

    } catch (NotRegisteredException e) {
      out.add("Error: " + e.getMessage());
View Full Code Here

                int n = 0;
                for (KeyValue<TownBlockOwner,Integer> kv : kvTable.getKeyValues()) {
                        n++;
                        if (maxListing != -1 && n > maxListing)
                                break;
                        TownBlockOwner town = (TownBlockOwner)kv.key;
                        output.add(String.format(
                                        Colors.Blue + "%30s "+Colors.Gold+"|"+Colors.LightGray+" %10d",
                                        TownyFormatter.getFormattedName(town),
                                        (Integer)kv.value));
                }
View Full Code Here

              //Set plot level permissions (if the plot owner) or Mayor/Assistant of the town.

              TownBlock townBlock = new WorldCoord(world, Coord.parseCoord(player)).getTownBlock();
              // Test we are allowed to work on this plot
              TownBlockOwner owner = plotTestOwner(resident, townBlock);
              town = townBlock.getTown();

              // Check we are allowed to set these perms
              toggleTest(player, townBlock, StringMgmt.join(StringMgmt.remFirstArg(split), ""));
View Full Code Here

TOP

Related Classes of com.palmergames.bukkit.towny.object.TownBlockOwner

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.