예제 #1
0
  public Group getGroupForPlayer(String playerName) {
    for (Group group : groups) {
      if (group.isInGroup(playerName)) return group;
    }

    return null;
  }
예제 #2
0
  public boolean isInGroup(String playerName, String groupName) {
    // boolean returnValue = false;
    for (Group group : groups) {
      if (group.getName().equalsIgnoreCase(groupName)) {
        return group.isInGroup(playerName);
      }
    }

    // Kikkit.MinecraftLog.info("isInGroup(" + playerName +", " + groupName + "): " + returnValue);

    return false;
  }
예제 #3
0
  public boolean canUseCommand(String player, String command) {
    if (Kikkit.IsDebugging) Kikkit.MinecraftLog.info("Groups to search: " + groups.size());

    for (Group group : groups) {
      if (Kikkit.IsDebugging)
        Kikkit.MinecraftLog.info("    canUseCommand is looking at " + group.getName());

      boolean ingroup = group.isInGroup(player);
      boolean canuse = group.canUseCommand(command);

      if (Kikkit.IsDebugging) {
        Kikkit.MinecraftLog.info("        isInGroup: " + ingroup);
        Kikkit.MinecraftLog.info("        canUseCommand: " + canuse);
      }

      // if(group.isInGroup(player) && group.canUseCommand(command)) return true;
      if (ingroup && canuse) return true;
    }

    return false;
  }