Package org.spout.vanilla.scoreboard

Examples of org.spout.vanilla.scoreboard.Objective


      // make sure the player has the right amount of points for the specified objectives
      boolean enoughPoints = minScores.isEmpty() && maxScores.isEmpty(); // default to whether there are any objectives set
      if (board != null) {
        // first make sure the player has the minimum requirements
        for (Map.Entry<String, Integer> e : minScores.entrySet()) {
          Objective obj = board.getObjective(e.getKey());
          if (obj == null) {
            continue;
          }

          int score = obj.getScore(p.getName()); // player's score for specified objective
          int minScore = e.getValue(); // specified minimum score
          enoughPoints = score >= minScore;
          if (!enoughPoints) {
            // not enough? break.
            break;
          }
        }

        // next make sure the player isn't over the maximums
        for (Map.Entry<String, Integer> e : maxScores.entrySet()) {
          Objective obj = board.getObjective(e.getKey());
          if (obj == null) {
            continue;
          }

          int score = obj.getScore(p.getName()); // player's score for specified objective
          int maxScore = e.getValue(); // specified maximum score
          enoughPoints = score <= maxScore;
          if (!enoughPoints) {
            // too many points? break.
            break;
View Full Code Here


    event.getMessages().add(new PlayerHeldItemChangeMessage(event.getSelectedSlot()));
  }

  @EventHandler
  public void onObjectiveAction(ObjectiveActionEvent event) {
    Objective obj = event.getObjective();
    event.getMessages().add(new ScoreboardObjectiveMessage(obj.getName(), obj.getDisplayName(), event.getAction()));
  }
View Full Code Here

TOP

Related Classes of org.spout.vanilla.scoreboard.Objective

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.