Package com.epicsagaonline.bukkit.ChallengeMaps.objects

Examples of com.epicsagaonline.bukkit.ChallengeMaps.objects.MapEntrance


              break;
          }
        }
        for (String loc : Current.MapEntrances.keySet())
        {
          MapEntrance me = Current.MapEntrances.get(loc);
          if (me.getMap().getMapName().equals(gs.getMap().getMapName()))
          {
            me.getHighScores().put(gs.getPlayer().getName(), gs.getScore());
          }
        }

        if (gs.PendingRemoval)
        {
View Full Code Here


    HashSet<String> savedEntrances = new HashSet<String>();

    int count = 1;
    for (String key : Current.MapEntrances.keySet())
    {
      MapEntrance me = Current.MapEntrances.get(key);
      if (me != null)
      {
        if (me.getMap() != null)
        {
          if (!savedEntrances.contains(me.getSignLocation()))
          {
            HashMap<String, Object> newEnt = new HashMap<String, Object>();
            newEnt.put("MapName", me.getMap().getMapName());
            newEnt.put("SignLocation", me.getSignLocation());
            newEnt.put("ChestLocation", me.getChestLocation());
            newEnt.put("HighScores", me.getHighScores());
            root.put("Entrance" + count, newEnt);
            savedEntrances.add(me.getSignLocation());
            count++;
          }
        }
      }
    }
View Full Code Here

          for (String key : root.keySet())
          {
            HashMap<String, Object> data = (HashMap<String, Object>) Util.getObjectValueFromHashSet(key, root);
            if (data != null)
            {
              MapEntrance me = new MapEntrance(data);
              if (me != null)
              {
                Current.MapEntrances.put(me.getSignLocation(), me);
                Current.MapEntrances.put(me.getChestLocation(), me);
              }
            }
          }
        }
      }
View Full Code Here

    return null;
  }

  public static MapEntrance getMapEntranceByMap(Map map)
  {
    MapEntrance result = null;

    for (String key : MapEntrances.keySet())
    {
      result = MapEntrances.get(key);
      if (result.getMap().getMapName().equals(map.getMapName()))
      {
        break;
      }
    }
View Full Code Here

          Block chest = event.getBlock().getWorld().getBlockAt(chestLoc);
          if (chest.getTypeId() == 54)
          {
            if (PermissionsManager.hasPermission(event.getPlayer(), "challengemaps.admin"))
            {
              MapEntrance me = new MapEntrance();
              me.setMap(map);
              me.setSignLocation(event.getBlock().getLocation());
              me.setChestLocation(chestLoc);
              Current.MapEntrances.put(me.getSignLocation(), me);
              Current.MapEntrances.put(me.getChestLocation(), me);
              event.setLine(0, "[Challenge]");
              event.setLine(1, map.getMapName());
              event.setLine(2, ""); // high score
              event.setLine(3, ""); // high score player
              event.getPlayer().sendMessage("Map Entrance Successfully Created.");
View Full Code Here

  public @Override void onBlockBreak(BlockBreakEvent event)
  {
    if (!event.isCancelled())
    {
      MapEntrance me = Current.MapEntrances.get(Util.GetStringFromLocation(event.getBlock().getLocation()));
      if (me != null)
      {
        // Do not allow the breaking of entrances or their chests.
        event.setCancelled(true);
        if (event.getPlayer() != null)
View Full Code Here

    if (!event.isCancelled())
    {
      Location loc = event.getLocation();
      if (loc != null)
      {
        MapEntrance me = Current.MapEntrances.get(Util.GetStringFromLocation(loc));
        if (me != null)
        {
          GameState gs = GameStateData.Load(me.getMap(), event.getPlayer(), false);
          event.getInventory().clear();
          for (Integer key : gs.getRewards().keySet())
          {
            event.getInventory().addItem(new ItemStack(key, gs.getRewards().get(key)));
          }
View Full Code Here

  {
    if (!event.isCancelled())
    {
      if (event.getAction() == Action.RIGHT_CLICK_BLOCK)
      {
        MapEntrance me = Current.MapEntrances.get(Util.GetStringFromLocation(event.getClickedBlock().getLocation()));
        if (me != null)
        {
          if (PermissionsManager.hasPermission(event.getPlayer(), "challengemaps.enter"))
          {
            if (event.getClickedBlock().getTypeId() == 54)
            {
              // Chest - Populate user specific treasure.
              // event.getPlayer().sendMessage("Treasure!");
            }
            else if (event.getClickedBlock().getTypeId() == 68)
            {
              Player player = event.getPlayer();
              Location loc = Util.GetLocationFromString(Util.GetStringFromLocation(player.getLocation()));
              GameState gs = GameStateData.Load(me.getMap(), player, false);
              if (gs != null)
              {

                if (gs.canRespawn())
                {
View Full Code Here

TOP

Related Classes of com.epicsagaonline.bukkit.ChallengeMaps.objects.MapEntrance

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.