public Group getGroupForPlayer(String playerName) { for (Group group : groups) { if (group.isInGroup(playerName)) return group; } return null; }
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; }
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; }