Package org.mctourney.autoreferee.AutoRefMatch

Examples of org.mctourney.autoreferee.AutoRefMatch.Role


    if (match == null || match.getCurrentState() == MatchStatus.NONE) return true;

    // if we are in practice mode, whatever...
    if (match.isPracticeMode()) return true;

    Role role = match.getRole(player);

    // if the player is a referee or is flying, nothing is off-limits
    if (role == Role.REFEREE || (match.getCurrentState().inProgress()
      && player.isFlying() && role == Role.PLAYER)) return true;
View Full Code Here


  }

  public static void modifyChatRecipients(AutoRefMatch match, Player speaker, Set<Player> recipients)
  {
    AutoRefTeam speakerTeam = match.getPlayerTeam(speaker);
    Role speakerRole = match.getRole(speaker);
    boolean practiceMode = match.isPracticeMode();

    Iterator<Player> iter = recipients.iterator();
    if (!match.getCurrentState().isBeforeMatch()) while (iter.hasNext())
    {
View Full Code Here

    if (sender instanceof Player)
    {
      Player player = (Player) sender;
      AutoRefMatch match = AutoReferee.getInstance().getMatch(player.getWorld());
      Role role = match == null ? AutoRefMatch.Role.NONE : match.getRole(player);

      if (!role.atLeast(permissions.role()))
        throw new CommandPermissionException(command, match == null
          ? "Command available only within an AutoReferee match"
          : ("Command not available to " + role.toString().toLowerCase()));

      for (String node : permissions.nodes()) if (!player.hasPermission(node))
        throw new CommandPermissionException(command, "Insufficient permissions");
    }
  }
View Full Code Here

TOP

Related Classes of org.mctourney.autoreferee.AutoRefMatch.Role

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.