Package com.epicsagaonline.bukkit.ChallengeMaps.objects

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


      for (World world : this.getServer().getWorlds())
      {
        for (Player player : world.getPlayers())
        {
          String worldName = world.getName().replace("_" + player.getName(), "");
          Map map = Current.Maps.get(worldName.toLowerCase());
          if (map != null)
          {
            Current.GameWorlds.add(world.getName());
            GameStateData.Load(map, player, false);
          }
View Full Code Here


      FileInputStream stream;
      try
      {
        stream = new FileInputStream(file);
        root = (HashMap<String, Object>) yaml.load(stream);
        Map map = new Map(root);
        Current.Maps.put(map.getMapName().toLowerCase(), map);
      }
      catch (FileNotFoundException e)
      {
        Log.Write(e.getMessage());
      }
View Full Code Here

    {
      String line1 = event.getLines()[0];
      String line2 = event.getLines()[1];
      if (line1.equalsIgnoreCase("[challenge]"))
      {
        Map map = Current.Maps.get(line2.toLowerCase());
        if (map != null)
        {
          Location chestLoc = event.getBlock().getLocation();
          chestLoc.setY(chestLoc.getBlockY() - 1);
          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.");
              MapEntranceData.SaveMapEntrances();
View Full Code Here

  {
    String worldName = event.getPlayer().getWorld().getName();
    String mapName = worldName.replace("_" + event.getPlayer().getName(), "");
    if (!mapName.equals(worldName))
    {
      Map map = Current.Maps.get(mapName.toLowerCase());
      if (map != null)
      {
        GameState gs = Current.GameStates.get(event.getPlayer().getName());
        if (gs == null || !gs.getMap().getMapName().equalsIgnoreCase(mapName))
        {
          gs = GameStateData.Load(map, event.getPlayer(), false);
          if (gs != null)
          {

            if (gs.canRespawn())
            {
              World world = Current.LoadWorld(gs, event.getPlayer());
              if (gs.getMap().getResetInventory())
              {
                gs.toggleInventory();
              }

              event.getPlayer().teleport(world.getSpawnLocation());
              event.getPlayer().sendMessage(gs.getMap().getEntranceText());

              gs.setInChallenge(true);

            }
            else
            {
              gs.PendingRemoval = true;
            }

          }
          else
          {
            event.getPlayer().sendMessage("You have died too many times, you cannot enter this challenge anymore.");
          }
        }
      }
    }
    else
    {
      if (mapName.indexOf("_") > -1)
      {
        mapName = mapName.substring(0, mapName.indexOf("_"));
        Map map = Current.Maps.get(mapName.toLowerCase());
        if (map != null)
        {
          event.getPlayer().teleport(Util.GetLocationFromString(Current.getMapEntranceByMap(map).getSignLocation()));
        }
        else
View Full Code Here

    if (Current.GameStates.size() > 0)
    {
      for (String key : Current.GameStates.keySet())
      {
        GameState gs = Current.GameStates.get(key);
        Map map = gs.getMap();
        ProcessTime(gs, map);
        ProcessWeather(gs, map);
      }
    }
  }
View Full Code Here

      {
        if (data.length > 1)
        {
          String mapName = data[1].toLowerCase();
          GameState gs = Current.getGameStateByWorld(player.getWorld());
          Map map = Current.Maps.get(mapName);
          if (map != null)
          {
            if (gs == null)
            {
              if (!map.getHardcore())
              {
                Util.ResetWorld(mapName, player);
                player.sendMessage("Your instance of " + data[1] + " has been reset.");
              }
              else
View Full Code Here

TOP

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

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.