Package com.epicsagaonline.bukkit.ChallengeMaps.objects

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


  }

  public @Override void onPlayerRespawn(PlayerRespawnEvent event)
  {
    Player player = event.getPlayer();
    GameState gs = Current.GameStates.get(player.getName());
    if (gs != null)
    {
      if (gs.canRespawn())
      {
        String respawnWorld = event.getRespawnLocation().getWorld().getName();
        if (!gs.getWorld().getName().equalsIgnoreCase(respawnWorld))
        {
          event.setRespawnLocation(gs.getWorld().getSpawnLocation());
        }
        if (gs.getMap().getNumberOfLives() >= 0)
        {
          int livesLeft = gs.getMap().getNumberOfLives() - gs.getDeathCount();
          if (livesLeft > 0)
          {
            player.sendMessage("You Have " + livesLeft + " Lives Left.");
          }
          else
          {
            player.sendMessage(ChatColor.RED + "You Have No Lives Left.");
          }
        }
      }
      else
      {
        player.sendMessage("You have died too many times, sending you back home.");

        String worldName = player.getWorld().getName();

        event.setRespawnLocation(gs.getEntryPoint());
        gs.setInChallenge(false);

        if (gs.getMap().getResetInventory())
        {
          gs.toggleInventory();
        }

        Current.Plugin.getServer().unloadWorld(worldName, true);
        Current.GameWorlds.remove(worldName);
        gs.PendingRemoval = true;
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 (sender instanceof Player)
    {

      Player player = (Player) sender;
      GameState gs = Current.getGameStateByWorld(player.getWorld());

      if (gs != null)
      {

        player.sendMessage("Sending you back home.");

        String worldName = player.getWorld().getName();

        if (gs.getEntryPoint() != null)
        {
          player.teleport(gs.getEntryPoint());
        }
        else
        {
          player.teleport(Util.GetLocationFromString(Current.getMapEntranceByMap(gs.getMap()).getChestLocation()));
        }
        gs.setInChallenge(false);

        if (gs.getMap().getResetInventory())
        {
          gs.toggleInventory();
        }

        Current.Plugin.getServer().unloadWorld(worldName, true);
        Current.GameWorlds.remove(worldName);
        gs.PendingRemoval = true;
View Full Code Here

  public CMObjectives(String[] data, CommandSender sender)
  {
    if (sender instanceof Player)
    {
      Player player = (Player) sender;
      GameState gs = Current.GameStates.get(player.getName());
      if (gs != null)
      {
        int pageNumber = 1;
        int maxPages = 1;
        int firstIndex = 0;
        int objPerPage = 5;

        if (data.length > 1 && Util.IsNumeric(data[1]))
        {
          pageNumber = Integer.parseInt(data[1]);
        }

        if (pageNumber <= 0 && pageNumber > maxPages)
        {
          pageNumber = 1;
        }

        firstIndex = (pageNumber - 1) * objPerPage;
        maxPages = (int) Math.ceil(gs.getMap().getObjectives().size() / objPerPage);

        player.sendMessage("Objectives for " + gs.getMap().getMapName() + ". Page " + pageNumber + " of " + maxPages);
        for (int count = 0; count < objPerPage; count++)
        {
          String message = BuildMessage(gs, firstIndex + count);
          if (message != null && message.length() > 0)
          {
View Full Code Here

  {
    if (sender instanceof Player)
    {

      Player player = (Player) sender;
      GameState gs = Current.getGameStateByWorld(player.getWorld());

      if (gs != null)
      {
        player.sendMessage("Your current score is " + ChatColor.BLUE + gs.getScore());
      }
      else
      {
        player.sendMessage("You must be within a challenge to view your score.");
      }
View Full Code Here

      if (PermissionsManager.hasPermission(player, "challengemaps.enter"))
      {
        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)
            {
View Full Code Here

TOP

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

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.