Package com.epicsagaonline.bukkit.EpicZones

Examples of com.epicsagaonline.bukkit.EpicZones.EpicZone


      if(data.length > 2 && data[2].length() > 0)
      {
        String tag = data[2].replaceAll("[^a-zA-Z0-9]", "");
        if(General.myZones.get(tag) == null)
        {
          EpicZone zone = new EpicZone();
          zone.setTag(tag);
          zone.setName(tag);
          Set(playerID, "editzone", zone);
          Set(playerID, "mode", EpicZoneMode.ZoneDraw);
          Set(playerID, "world", event.getPlayer().getWorld().getName());
          SendMessage(event, "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[2].length() > 0)
        {
          if(General.myZones.get(data[2]) != null)
          {
            String tag = data[2].replaceAll("[^a-zA-Z0-9]", "");
            Set(playerID, "editzone", new EpicZone(General.myZones.get(tag)));
            Set(playerID, "mode", EpicZoneMode.ZoneEdit);
            SendMessage(event, "Editing Zone: " + tag);
          }
          else
          {
View Full Code Here

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

  {
    if(ezp.getMode() == EpicZoneMode.None)
    {
      if(data.length > 2)
      {
        EpicZone zone = General.myZones.get(data[2].trim());
        if (zone != null)
        {
          String messageText;
         
          SendMessage(event, ChatColor.GOLD + "Zone: " + ChatColor.GREEN + zone.getName() + ChatColor.GOLD + " Tag: " + ChatColor.GREEN + "" + zone.getTag());
          if(zone.getCenter() != null)
          {
            SendMessage(event, ChatColor.GOLD + "Shape: " + ChatColor.GREEN + "Circle " + ChatColor.WHITE + "| " + ChatColor.GOLD + "Radius: " + ChatColor.GREEN + "" + zone.getRadius())
          }
          else
          {
            SendMessage(event, 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;
            }
            SendMessage(event, messageText);
          }
          SendMessage(event, ChatColor.GOLD + "Enter Text: " + ChatColor.GREEN + "" + zone.getEnterText());
          SendMessage(event, ChatColor.GOLD + "Exit Text: " + ChatColor.GREEN + "" + zone.getExitText());
          if(zone.hasParent())
          {
            SendMessage(event, ChatColor.GOLD + "Parent Zone: " + ChatColor.GREEN + zone.getParent().getName() + ChatColor.GOLD + " Tag: " + ChatColor.GREEN + zone.getParent().getTag());
          }
          SendMessage(event, 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())
          {
            SendMessage(event, messageText);
            SendMessage(event, ChatColor.AQUA + "REGEN: " + ChatColor.GREEN + "Delay [" + zone.getRegenDelay() + "] Amount[" + zone.getRegenAmount() + "] Interval[" + zone.getRegenInterval() + "]");
          }
          else
          {
            messageText = messageText + ChatColor.AQUA + "REGEN: " + ChatColor.RED + "OFF ";
            SendMessage(event, messageText);
          }
          messageText = ChatColor.AQUA + "MOBS:" + ChatColor.GREEN + "";
          for(String mobType: zone.getAllowedMobs())
          {
            messageText = messageText + " " + mobType.replace("org.bukkit.craftbukkit.entity.Craft", "");
          }
          SendMessage(event, messageText);         
        }
View Full Code Here

  }

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

    EpicZone 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)
    {
      player.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)
        {
          player.sendMessage(buildWhoPlayerName(ezp, players, i, allZones));
        }
      }
    }
    else
    {
      player.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)
        {
          player.sendMessage(buildWhoPlayerName(ezp, players, i, allZones));
View Full Code Here

      myZones.clear();
      myZoneTags.clear();
      try {
        while(scanner.hasNext())
        {
          EpicZone newZone;
          line = scanner.nextLine().trim();
          if(line.startsWith("#") || line.isEmpty()){continue;}
          newZone = new EpicZone(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)
    {
      EpicZone zone = myZones.get(zoneTag);
      if(zone.hasChildren())
      {
        //System.out.println("Attaching Child Zones To " + zone.getName() + "[" + zone.getTag() + "].");
        for(String child: zone.getChildrenTags())
        {
         
          EpicZone childZone = myZones.get(child);
         
          if(childZone != null)
          {
            //System.out.println("\t" + childZone.getName() + "[" + childZone.getTag() + "] added as a child of " + zone.getName() + "[" + zone.getTag() + "].");
            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)
    {
      EpicZone 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 EpicZone getZoneForPoint(int elevation, Point location, String worldName)
  {

    EpicZone result = null;
    String resultTag = "";
    for(String zoneTag: General.myZoneTags)
    {
      EpicZone 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.EpicZone

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.