Skip to content

Commit

Permalink
Stafflist improvements.
Browse files Browse the repository at this point in the history
  • Loading branch information
frafol committed Jan 12, 2025
1 parent a32f14c commit 900039b
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 36 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,9 @@ public void execute(CommandSender sender, String[] args) {
if (BungeeConfig.SORTING_LIST_ENABLE.get(Boolean.class)) {
List<UUID> sortedList = new ArrayList<>();
for (String groups : BungeeConfig.SORTING_LIST.getStringList()) {
for (User user : api.getUserManager().getLoadedUsers()) {
for (UUID uuid : list) {
User user = api.getUserManager().getUser(uuid);
if (user == null) continue;
Group group = api.getGroupManager().getGroup(groups);
if (user.getInheritedGroups(QueryOptions.builder(QueryMode.CONTEXTUAL).build()).contains(group)) {
sortedList.add(user.getUniqueId());
Expand Down
11 changes: 2 additions & 9 deletions bungeecord/src/main/resources/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ settings:
stafflist_bypass_permission: "stafflist.bypass"

# You can enable or disable the bypass permission.
bypass_enabled: true
bypass_enabled: false

# Select if you want to sort the staff list by group weight.
# Set a weight in LP using: /lp group <group> setweight <weight>.
Expand Down Expand Up @@ -152,14 +152,7 @@ modules:
# You have to activate this option to fix it, please follow these steps:
# 1. Add this plugin in Spigot and BungeeCord servers.
# 2. Activate this option in both servers (this option will disable all staffchat modules in Spigot also).
# 3. Your problem is now fixed, note that Velocity is not affected by this issue if you install SignedVelocity in both Velocity and Spigot server.
# 3. Your problem is now fixed.
kick_workaround: false

# Are you getting double messages on Velocity when talking in staffchat/adminchat/donorchat?
# You have to activate this option to fix it, please follow these steps:
# 1. Add this plugin in Spigot and Velocity servers.
# 2. Activate this option in both servers (this option will disable all staffchat modules in Spigot also).
# 3. Your problem is now fixed, note that BungeeCord is not affected by this issue.
double_message_workaround: false

# Enjoy.
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,9 @@ public boolean execute(@NotNull CommandSender sender, @NotNull String commandLab
if (SpigotConfig.SORTING_LIST_ENABLE.get(Boolean.class)) {
List<UUID> sortedList = new ArrayList<>();
for (String groups : SpigotConfig.SORTING_LIST.getStringList()) {
for (User user : api.getUserManager().getLoadedUsers()) {
for (UUID uuid : list) {
User user = api.getUserManager().getUser(uuid);
if (user == null) continue;
Group group = api.getGroupManager().getGroup(groups);
if (user.getInheritedGroups(QueryOptions.builder(QueryMode.CONTEXTUAL).build()).contains(group)) {
sortedList.add(user.getUniqueId());
Expand Down
4 changes: 2 additions & 2 deletions spigot/src/main/resources/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ settings:
staff_quit_all_players: false # By activating it, the staff will receive a message every time any player leaves the server.

staff_switch_all_players: false # By activating it, the staff will receive a message every time any player switch a server.
staff_disable_afk_on_move: true # On Velocity and BungeeCord, this works when a player changes server.
staff_disable_afk_on_move: true

staff_join_silent: false # By activating it, the staff will not receive a message when another staff member with a permission enters the server.
staff_quit_silent: false # By activating it, the staff will not receive a message when another staff member with a permission leaves the server.
Expand Down Expand Up @@ -82,7 +82,7 @@ settings:
stafflist_bypass_permission: "stafflist.bypass"

# You can enable or disable the bypass permission.
bypass_enabled: true
bypass_enabled: false

# Select if you want to sort the staff list by group weight.
# Set a weight in LP using: /lp group <group> setweight <weight>.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,19 +61,9 @@ public void execute(@NotNull Invocation invocation) {
list = handleRedis();
} else {
for (Player players : PLUGIN.getServer().getAllPlayers()) {

if (!players.hasPermission(VelocityConfig.STAFFLIST_SHOW_PERMISSION.get(String.class))) {
continue;
}

if (VelocityConfig.STAFFLIST_BYPASS.get(Boolean.class) && players.hasPermission(VelocityConfig.STAFFLIST_BYPASS_PERMISSION.get(String.class))) {
continue;
}

if (PLUGIN.isPremiumVanish() && VanishUtil.isVanished(players)) {
continue;
}

if (!players.hasPermission(VelocityConfig.STAFFLIST_SHOW_PERMISSION.get(String.class))) continue;
if (VelocityConfig.STAFFLIST_BYPASS.get(Boolean.class) && players.hasPermission(VelocityConfig.STAFFLIST_BYPASS_PERMISSION.get(String.class))) continue;
if (PLUGIN.isPremiumVanish() && VanishUtil.isVanished(players)) continue;
list.add(players.getUniqueId());
}
}
Expand All @@ -90,7 +80,9 @@ public void execute(@NotNull Invocation invocation) {
if (VelocityConfig.SORTING_LIST_ENABLE.get(Boolean.class)) {
List<UUID> sortedList = new ArrayList<>();
for (String groups : VelocityConfig.SORTING_LIST.getStringList()) {
for (User user : api.getUserManager().getLoadedUsers()) {
for (UUID uuid : list) {
User user = api.getUserManager().getUser(uuid);
if (user == null) continue;
Group group = api.getGroupManager().getGroup(groups);
if (user.getInheritedGroups(QueryOptions.builder(QueryMode.CONTEXTUAL).build()).contains(group)) {
if (!sortedList.contains(user.getUniqueId()) && list.contains(user.getUniqueId())) {
Expand Down
11 changes: 2 additions & 9 deletions velocity/src/main/resources/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ settings:
stafflist_bypass_permission: "stafflist.bypass"

# You can enable or disable the bypass permission.
bypass_enabled: true
bypass_enabled: false

# Select if you want to sort the staff list by group weight.
# Set a weight in LP using: /lp group <group> setweight <weight>.
Expand Down Expand Up @@ -148,18 +148,11 @@ modules:

stafflist_module: true

# Are you getting kicked on BungeeCord when switching staffchat mode to globalchat mode?
# You have to activate this option to fix it, please follow these steps:
# 1. Add this plugin in Spigot and BungeeCord servers.
# 2. Activate this option in both servers (this option will disable all staffchat modules in Spigot also).
# 3. Your problem is now fixed, note that Velocity is not affected by this issue if you install SignedVelocity in both Velocity and Spigot server.
kick_workaround: false

# Are you getting double messages on Velocity when talking in staffchat/adminchat/donorchat?
# You have to activate this option to fix it, please follow these steps:
# 1. Add this plugin in Spigot and Velocity servers.
# 2. Activate this option in both servers (this option will disable all staffchat modules in Spigot also).
# 3. Your problem is now fixed, note that BungeeCord is not affected by this issue.
# 3. Your problem is now fixed.
double_message_workaround: false

# Enjoy.

0 comments on commit 900039b

Please sign in to comment.