@Override public String doCatch(PermissionGroup key) { return key.getName(); } });
public PermissionGroup getHighestPermissionGroup(PermissionPool permissionPool) { PermissionGroup permissionGroup = null; for (GroupEntityData groupEntityData : getGroups()) { if (permissionGroup == null) permissionGroup = permissionPool.getGroups().get(groupEntityData.getGroup()); else { if (permissionGroup.getJoinPower() < permissionPool.getGroups().get(groupEntityData.getGroup()).getJoinPower()) { permissionGroup = permissionPool.getGroups().get(groupEntityData.getGroup()); } } } return permissionGroup; }
public PermissionEntity getNewPermissionEntity(PlayerConnection playerWhereAmI) { return new PermissionEntity(playerWhereAmI.getUniqueId(), new HashMap<>(), null, null, Arrays.asList(new GroupEntityData(getDefaultGroup().getName(), 0L))); }
/** * Gets the name of the highest permission group for the given player. * * @param offlinePlayer the player to get the name of their highest * permission group for. * @return the name of the highest permission group of the given player * @see #getGroupName(UUID) * @see PermissionGroup * @see PermissionEntity */ public static String getGroupName(OfflinePlayer offlinePlayer) { return offlinePlayer.getPermissionEntity().getHighestPermissionGroup(CloudAPI.getInstance().getPermissionPool()).getName(); }
/** * Gets the display for the given player by their highest permission group. * * @param offlinePlayer the player to get the display for * @return the display for the given player * @see PermissionGroup * @see #getDisplay(UUID) */ public static String getDisplay(OfflinePlayer offlinePlayer) { return offlinePlayer.getPermissionEntity().getHighestPermissionGroup(CloudAPI.getInstance().getPermissionPool()).getDisplay(); }
/** * Gets the suffix of the given player by their highest permission group. * * @param offlinePlayer the player to get the suffix for * @return the suffix for the given player * @see PermissionGroup * @see #getSuffix(UUID) */ public static String getSuffix(OfflinePlayer offlinePlayer) { return offlinePlayer.getPermissionEntity().getHighestPermissionGroup(CloudAPI.getInstance().getPermissionPool()).getSuffix(); }
/** * Gets the join power of the given player by their highest permission group. * * @param player the player * @return the join power of the highest permission group of the player * @see PermissionGroup */ public static int getJoinPower(OfflinePlayer player) { return player.getPermissionEntity().getHighestPermissionGroup(CloudAPI.getInstance().getPermissionPool()).getJoinPower(); }
/** * Gets the prefix of the given player by their highest permission group. * * @param offlinePlayer the player to get the prefix for * @return the prefix for the given player * @see PermissionGroup * @see #getPrefix(UUID) */ public static String getPrefix(OfflinePlayer offlinePlayer) { return offlinePlayer.getPermissionEntity().getHighestPermissionGroup(CloudAPI.getInstance().getPermissionPool()).getPrefix(); }
/** * Gets the TagID of the highest permission group of the given player. * * @param offlinePlayer the player * @return The permission group's TagID of the highest permission group * of the given player * @see PermissionGroup */ public static int getPlayerGroupTagID(OfflinePlayer offlinePlayer) { return offlinePlayer.getPermissionEntity().getHighestPermissionGroup(CloudAPI.getInstance().getPermissionPool()).getTagId(); }
@Override public boolean isAccepted(GroupEntityData groupEntityData) { return groupEntityData.getGroup().equalsIgnoreCase(s2); } });
public PermissionGroup getDefaultGroup() { for (PermissionGroup group : groups.values()) { if (group.isDefaultGroup()) { return group; } } return null; }
/** * Checks if the player is in the specified permission group. * * @param groupName the name of the group * @param offlinePlayer the player to check for group membership * @return whether or not the player is in the requested group * @see PermissionEntity */ public static boolean isInGroup(String groupName, OfflinePlayer offlinePlayer) { return offlinePlayer.getPermissionEntity().isInGroup(groupName); }
public PermissionEntity getNewPermissionEntity(OfflinePlayer playerWhereAmI) { return new PermissionEntity(playerWhereAmI.getUniqueId(), new HashMap<>(), null, null, Arrays.asList(new GroupEntityData(getDefaultGroup().getName(), 0L))); }
@Override public String getPrimaryGroup(String s, String s1) { return getPlayer(s1).getPermissionEntity().getHighestPermissionGroup( CloudAPI.getInstance().getPermissionPool() ).getName(); }
/** * Gets the display of the player, identified by the given UUID * by their highest permission group. * * @param uuid the UUID of the player * @return the display for the given player * @see PermissionGroup * @see #getDisplay(OfflinePlayer) */ public static String getDisplay(UUID uuid) { return CloudAPI.getInstance().getOfflinePlayer(uuid).getPermissionEntity().getHighestPermissionGroup(CloudAPI. getInstance().getPermissionPool()).getDisplay(); }
/** * Gets the suffix of the given player identified by their UUID * by their highest permission group. * * @param uuid the UUID of the player * @return the suffix for the given player * @see PermissionGroup * @see #getSuffix(OfflinePlayer) */ public static String getSuffix(UUID uuid) { return CloudAPI.getInstance().getOfflinePlayer(uuid).getPermissionEntity().getHighestPermissionGroup(CloudAPI. getInstance().getPermissionPool()).getSuffix(); }