Package com.epicsagaonline.bukkit.EpicZones

Examples of com.epicsagaonline.bukkit.EpicZones.Zone


      if(data.length > 1 && data[1].length() > 0)
      {
        String tag = data[1].replaceAll("[^a-zA-Z0-9]", "");
        if(General.myZones.get(tag) == null)
        {
          Zone zone = new Zone();
          zone.setTag(tag);
          zone.setName(tag);
          Set(playerID, "editzone", zone);
          Set(playerID, "mode", EpicZoneMode.ZoneDraw);
          Set(playerID, "world", player.getWorld().getName());
          sender.sendMessage("Zone Created. Start drawing your zone with the zone edit tool. Type /zone save when you are done drawing.");
        }
View Full Code Here


        if(data[1].length() > 0)
        {
          if(General.myZones.get(data[1]) != null)
          {
            String tag = data[1].replaceAll("[^a-zA-Z0-9]", "");
            Set(playerID, "editzone", new Zone(General.myZones.get(tag)));
            Set(playerID, "mode", EpicZoneMode.ZoneEdit);
            sender.sendMessage("Editing Zone: " + tag);
          }
          else
          {
View Full Code Here

    if(ezp.getMode() == EpicZoneMode.None)
    {
      for(String zoneTag: General.myZoneTags)
      {
        String messageText;
        Zone zone = General.myZones.get(zoneTag);
        messageText = ChatColor.GREEN + zone.getName() + ChatColor.GOLD + " [" + zone.getTag() + "]";
        if(zone.hasChildren())
        {
          messageText = messageText + ChatColor.WHITE + " | " + ChatColor.GREEN + "Children " + ChatColor.GOLD + "(" + zone.getChildren().size() + ")";
        }
        if(zone.hasParent())
        {
          messageText = messageText + ChatColor.WHITE + " | " + ChatColor.GREEN + "Parent " + ChatColor.GOLD + "[" + zone.getParent().getTag() + "]";
        }
        sender.sendMessage(messageText);
      }
    }
    else
View Full Code Here

  {
    if(ezp.getMode() == EpicZoneMode.None)
    {
      if(data.length > 1)
      {
        Zone zone = General.myZones.get(data[1].trim());
        if (zone != null)
        {
          String messageText;

          sender.sendMessage(ChatColor.GOLD + "Zone: " + ChatColor.GREEN + zone.getName() + ChatColor.GOLD + " Tag: " + ChatColor.GREEN + "" + zone.getTag());
          if(zone.getCenter() != null)
          {
            sender.sendMessage(ChatColor.GOLD + "Shape: " + ChatColor.GREEN + "Circle " + ChatColor.WHITE + "| " + ChatColor.GOLD + "Radius: " + ChatColor.GREEN + "" + zone.getRadius())
          }
          else
          {
            sender.sendMessage(ChatColor.GOLD + "Shape: " + ChatColor.GREEN + "Polygon " + ChatColor.WHITE + "| " + ChatColor.GOLD + "Points " + ChatColor.GREEN + "(" + zone.getPolygon().npoints + ")");
          }
          if(zone.hasChildren())
          {
            messageText = ChatColor.GOLD + "Child Zone Tags:" + ChatColor.GREEN + "";
            for(String childTag: zone.getChildrenTags())
            {
              messageText = messageText + " " + childTag;
            }
            sender.sendMessage(messageText);
          }
          sender.sendMessage(ChatColor.GOLD + "Enter Text: " + ChatColor.GREEN + "" + zone.getEnterText());
          sender.sendMessage(ChatColor.GOLD + "Exit Text: " + ChatColor.GREEN + "" + zone.getExitText());
          if(zone.hasParent())
          {
            sender.sendMessage(ChatColor.GOLD + "Parent Zone: " + ChatColor.GREEN + zone.getParent().getName() + ChatColor.GOLD + " Tag: " + ChatColor.GREEN + zone.getParent().getTag());
          }
          sender.sendMessage(ChatColor.GOLD + "Zone Flags: ");
          messageText = "";
          if(zone.hasPVP())
          {
            messageText = messageText + ChatColor.AQUA + "PVP: " + ChatColor.GREEN + "ON ";
          }
          else
          {
            messageText = messageText + ChatColor.AQUA + "PVP: " + ChatColor.RED + "OFF ";
          }
          if(zone.getAllowFire())
          {
            messageText = messageText + ChatColor.AQUA + "FIRE: " + ChatColor.GREEN + "ON  ";
          }
          else
          {
            messageText = messageText + ChatColor.AQUA + "FIRE: " + ChatColor.RED + "OFF ";
          }
          if(zone.getAllowExplode())
          {
            messageText = messageText + ChatColor.AQUA + "EXPLODE: " + ChatColor.GREEN + "ON  ";
          }
          else
          {
            messageText = messageText + ChatColor.AQUA + "EXPLODE: " + ChatColor.RED + "OFF ";
          }
          if(zone.hasRegen())
          {
            sender.sendMessage(messageText);
            sender.sendMessage(ChatColor.AQUA + "REGEN: " + ChatColor.GREEN + "Delay [" + zone.getRegenDelay() + "] Amount[" + zone.getRegenAmount() + "] Interval[" + zone.getRegenInterval() + "]");
          }
          else
          {
            messageText = messageText + ChatColor.AQUA + "REGEN: " + ChatColor.RED + "OFF ";
            sender.sendMessage(messageText);
          }
          messageText = ChatColor.AQUA + "MOBS:" + ChatColor.GREEN + "";
          for(String mobType: zone.getAllowedMobs())
          {
            messageText = messageText + " " + mobType.replace("org.bukkit.craftbukkit.entity.Craft", "");
          }
          sender.sendMessage(messageText);         
        }
View Full Code Here

  }

  private static void buildWho(EpicZonePlayer ezp, Player player, CommandSender sender, int pageNumber, boolean allZones)
  {

    Zone currentZone = General.getPlayer(player.getName()).getCurrentZone();
    if(currentZone == null){allZones = true;}
    ArrayList<EpicZonePlayer> players = getPlayers(currentZone, allZones);
    int playersPerPage = 8;
    int playerCount = players.size();

    if (allZones)
    {
      sender.sendMessage(playerCount + " Players Online [Page " + pageNumber + " of " + ((int)Math.ceil((double)playerCount / (double)playersPerPage)) + "]");
      for(int i = (pageNumber - 1) * playersPerPage; i < (pageNumber * playersPerPage); i++)
      {
        if (players.size() > i)
        {
          sender.sendMessage(buildWhoPlayerName(ezp, players, i, allZones));
        }
      }
    }
    else
    {
      sender.sendMessage(playerCount + " Players Online in " + currentZone.getName() + " [Page " + pageNumber + " of " + ((int)Math.ceil((double)playerCount / playersPerPage) + 1) + "]");
      for(int i = (pageNumber - 1) * playersPerPage; i < pageNumber * playersPerPage; i++)
      {
        if (players.size() > i)
        {
          sender.sendMessage(buildWhoPlayerName(ezp, players, i, allZones));
View Full Code Here

      myZones.clear();
      myZoneTags.clear();
      try {
        while(scanner.hasNext())
        {
          Zone newZone;
          line = scanner.nextLine().trim();
          if(line.startsWith("#") || line.isEmpty()){continue;}
          newZone = new Zone(line);;
          General.myZones.put(newZone.getTag(), newZone);
          General.myZoneTags.add(newZone.getTag());
        }

      }
      finally {
        scanner.close();
View Full Code Here

    ArrayList<String> badChildren = new ArrayList<String>();

    for(String zoneTag: myZoneTags)
    {
      Zone zone = myZones.get(zoneTag);
      if(zone.hasChildren())
      {
        for(String child: zone.getChildrenTags())
        {

          Zone childZone = myZones.get(child);

          if(childZone != null)
          {
            childZone.setParent(zone);
            zone.addChild(childZone);

            myZones.remove(child);
            myZones.put(child, childZone);
          }
View Full Code Here

    String result = "#Zone Tag|World|Zone Name|Flags|Enter Message|Exit Message|Floor|Ceiling|Child Zones|PointList\n";
    String line = "";

    for(String tag: myZoneTags)
    {
      Zone z = myZones.get(tag);
      line = z.getTag() + "|";
      line = line + z.getWorld() + "|";
      line = line + z.getName() + "|";
      line = line + BuildFlags(z) + "|";
      line = line + z.getEnterText() + "|";
      line = line + z.getExitText() + "|";
      line = line + z.getFloor() + "|";
      line = line + z.getCeiling() + "|";
      line = line + BuildChildren(z) + "|";
      line = line + BuildPointList(z) + "\n";
      result = result + line;
    }
    return result;
View Full Code Here

  }

  public static Zone getZoneForPoint(int elevation, Point location, String worldName)
  {

    Zone result = null;
    String resultTag = "";
    for(String zoneTag: General.myZoneTags)
    {
      Zone zone = General.myZones.get(zoneTag);
      resultTag = General.isPointInZone(zone, elevation, location, worldName);
      if(resultTag.length() > 0)
      {
        result = General.myZones.get(resultTag);
        break;
View Full Code Here

TOP

Related Classes of com.epicsagaonline.bukkit.EpicZones.Zone

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.