Examples of GameState


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

  public @Override void onBlockFade(BlockFadeEvent event)
  {
    if (!event.isCancelled())
    {
      GameState gs = Current.getGameStateByWorld(event.getBlock().getWorld());
      if (gs != null)
      {
        gs.removeMapContents(event.getBlock().getTypeId());
      }
    }
  }
View Full Code Here

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

  public @Override void onBlockForm(BlockFormEvent event)
  {
    if (!event.isCancelled())
    {
      GameState gs = Current.getGameStateByWorld(event.getBlock().getWorld());
      if (gs != null)
      {
        gs.removeMapContents(event.getBlock().getTypeId());
        gs.addMapContents(event.getNewState().getTypeId());
      }
    }
  }
View Full Code Here

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

  public @Override void onBlockFromTo(BlockFromToEvent event)
  {
    if (!event.isCancelled())
    {
      GameState gs = Current.getGameStateByWorld(event.getBlock().getWorld());
      if (gs != null)
      {
        if (event.getBlock().getTypeId() == event.getToBlock().getTypeId())
        {
          gs.addMapContents(event.getToBlock().getTypeId());
        }
        // Log.Write("From: " + event.getBlock().getTypeId());
        // Log.Write("To: " + event.getToBlock().getTypeId());
        // gs.addMapContents(event.getToBlock().getTypeId());
      }
View Full Code Here

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

  public @Override void onBlockSpread(BlockSpreadEvent event)
  {
    if (!event.isCancelled())
    {
      GameState gs = Current.getGameStateByWorld(event.getBlock().getWorld());
      if (gs != null)
      {
        gs.removeMapContents(event.getBlock().getTypeId());
        gs.addMapContents(event.getNewState().getTypeId());
      }
    }
  }
View Full Code Here

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

  public @Override void onLeavesDecay(LeavesDecayEvent event)
  {
    if (!event.isCancelled())
    {
      GameState gs = Current.getGameStateByWorld(event.getBlock().getWorld());
      if (gs != null)
      {
        gs.removeMapContents(event.getBlock().getTypeId());
      }
    }
  }
View Full Code Here

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

    if (entity != null)
    {
      if (entity instanceof Player)
      {
        Player player = (Player) event.getEntity();
        GameState gs = Current.GameStates.get(player.getName());
        if (gs != null)
        {
          gs.addDeath();
        }
      }
    }
  }
View Full Code Here

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

  public @Override void onInventoryCraft(InventoryCraftEvent event)
  {
    if (!event.isCancelled())
    {
      Player player = event.getPlayer();
      GameState gs = Current.GameStates.get(player.getName());
      if (gs != null)
      {
        ItemStack result = event.getResult();
        if (result != null)
        {
          gs.addItemCrafted(result.getTypeId());
        }
      }
    }
  }
View Full Code Here

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

      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

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

            }
            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())
                {
                  World world = Current.LoadWorld(gs, player);
                  if (gs.getMap().getResetInventory())
                  {
                    gs.toggleInventory();
                  }

                  player.teleport(world.getSpawnLocation());
                  player.sendMessage(gs.getMap().getEntranceText());

                  gs.setEntryPoint(loc);
                  gs.setInChallenge(true);

                }
                else
                {
                  gs.PendingRemoval = true;
View Full Code Here

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

    if (!event.isCancelled())
    {
      String worldName = event.getPlayer().getWorld().getName();
      if (Current.GameWorlds.contains(worldName))
      {
        GameState gs = Current.GameStates.get(event.getPlayer().getName());
        if (gs != null)
        {
          if (!gs.getMap().getAllowCommands())
          {
            HashSet<String> allowedCommands = new HashSet<String>();
            allowedCommands.add("leave");
            allowedCommands.add("cm");
            allowedCommands.add("kill");
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.