forked from Upstream/Velocitab
Add only_list_players_in_same_group
option (true by default)
This commit is contained in:
parent
6007cdddb3
commit
dbf5509a9a
@ -49,6 +49,11 @@ public class Settings {
|
|||||||
@YamlComment("The formats to use for the fallback group.")
|
@YamlComment("The formats to use for the fallback group.")
|
||||||
private String fallbackGroup = "default";
|
private String fallbackGroup = "default";
|
||||||
|
|
||||||
|
@Getter
|
||||||
|
@YamlKey("only_list_players_in_same_group")
|
||||||
|
@YamlComment("Only show other players on a server that is part of the same server group as the player.")
|
||||||
|
private boolean onlyListPlayersInSameGroup = true;
|
||||||
|
|
||||||
@YamlKey("enable_papi_hook")
|
@YamlKey("enable_papi_hook")
|
||||||
private boolean enablePapiHook = true;
|
private boolean enablePapiHook = true;
|
||||||
|
|
||||||
|
@ -73,9 +73,12 @@ public class PlayerTabList {
|
|||||||
final Map<String, String> playerRoles = new HashMap<>();
|
final Map<String, String> playerRoles = new HashMap<>();
|
||||||
|
|
||||||
for (TabPlayer player : players) {
|
for (TabPlayer player : players) {
|
||||||
if (serversInGroup.isPresent() && !serversInGroup.get().contains(player.getServerName())) {
|
// Skip players on other servers if the setting is enabled
|
||||||
continue; // Skip players on other servers
|
if (plugin.getSettings().isOnlyListPlayersInSameGroup() && serversInGroup.isPresent()
|
||||||
|
&& !serversInGroup.get().contains(player.getServerName())) {
|
||||||
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
playerRoles.put(player.getPlayer().getUsername(), player.getTeamName(plugin));
|
playerRoles.put(player.getPlayer().getUsername(), player.getTeamName(plugin));
|
||||||
tabList.getEntries().stream()
|
tabList.getEntries().stream()
|
||||||
.filter(e -> e.getProfile().getId().equals(player.getPlayer().getUniqueId())).findFirst()
|
.filter(e -> e.getProfile().getId().equals(player.getPlayer().getUniqueId())).findFirst()
|
||||||
|
Loading…
Reference in New Issue
Block a user