This commit is contained in:
1 parent
483d3163ea
commit
d0300fd72c
1 file changed
+4
-5
@@ -10,7 +10,6 @@ import net.dv8tion.jda.api.hooks.ListenerAdapter;
|
||||
import net.dv8tion.jda.api.requests.GatewayIntent;
|
||||
import net.luckperms.api.LuckPerms;
|
||||
import net.luckperms.api.LuckPermsProvider;
|
||||
import net.luckperms.api.model.group.Group;
|
||||
import net.luckperms.api.model.user.User;
|
||||
import net.luckperms.api.query.QueryOptions;
|
||||
import org.bukkit.ChatColor;
|
||||
@@ -23,7 +22,6 @@ import java.awt.Color;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.util.Comparator;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
@@ -184,9 +182,10 @@ public final class AsminDiscordBridge extends JavaPlugin {
|
||||
if (luckPerms == null) return Integer.MIN_VALUE;
|
||||
User user = luckPerms.getUserManager().getUser(player.getUniqueId());
|
||||
if (user == null) return Integer.MIN_VALUE;
|
||||
Set<Group> groups = user.getInheritedGroups(QueryOptions.defaultContextualOptions());
|
||||
return groups.stream().map(Group::getWeight).filter(weight -> weight != null)
|
||||
.max(Integer::compareTo).orElse(Integer.MIN_VALUE);
|
||||
return user.getInheritedGroups(QueryOptions.defaultContextualOptions()).stream()
|
||||
.mapToInt(group -> group.getWeight().orElse(Integer.MIN_VALUE))
|
||||
.max()
|
||||
.orElse(Integer.MIN_VALUE);
|
||||
}
|
||||
|
||||
private String getPlayerPrefix(Player player) {
|
||||
|
||||
Reference in new issue
Block a user