mirror of
https://github.com/AtlasMediaGroup/TotalFreedomMod.git
synced 2025-07-07 06:23:05 +00:00
Luck Perms is actually based but also not based
This commit is contained in:
@ -9,9 +9,7 @@ import net.luckperms.api.model.group.Group;
|
||||
import net.luckperms.api.node.types.InheritanceNode;
|
||||
import net.luckperms.api.node.types.PrefixNode;
|
||||
import net.luckperms.api.node.types.WeightNode;
|
||||
import net.md_5.bungee.api.ChatColor;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.bukkit.util.FileUtil;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.Locale;
|
||||
@ -52,20 +50,23 @@ public class DisplayableGroup implements Displayable
|
||||
{
|
||||
Group matched = TotalFreedomMod.getPlugin().lpb.getAPI().getGroupManager().getGroup(group);
|
||||
|
||||
if (matched == null) {
|
||||
if (matched == null)
|
||||
{
|
||||
CompletableFuture<Group> cfg = TotalFreedomMod.getPlugin()
|
||||
.lpb
|
||||
.getAPI()
|
||||
.getGroupManager()
|
||||
.createAndLoadGroup(group);
|
||||
|
||||
cfg.thenAcceptAsync(g -> {
|
||||
cfg.thenAcceptAsync(g ->
|
||||
{
|
||||
WeightNode weightNode = WeightNode.builder(weight).build();
|
||||
PrefixNode prefixNode = PrefixNode.builder()
|
||||
.prefix(FUtil.miniMessage(GroupProvider.OPEN.append(tag.color(color)).append(GroupProvider.CLOSE)))
|
||||
.priority(1)
|
||||
.build();
|
||||
if (inheritance != null) {
|
||||
if (inheritance != null)
|
||||
{
|
||||
InheritanceNode inheritanceNode = InheritanceNode.builder(inheritance).build();
|
||||
g.getData(DataType.NORMAL).add(inheritanceNode);
|
||||
}
|
||||
@ -75,7 +76,8 @@ public class DisplayableGroup implements Displayable
|
||||
|
||||
matched = TotalFreedomMod.getPlugin().lpb.getAPI().getGroupManager().getGroup(group);
|
||||
|
||||
if (matched == null) throw new IllegalArgumentException("Group " + group + " does not exist and could not be created.");
|
||||
if (matched == null)
|
||||
throw new IllegalArgumentException("Group " + group + " does not exist and could not be created.");
|
||||
}
|
||||
|
||||
this.group = matched;
|
||||
@ -103,7 +105,8 @@ public class DisplayableGroup implements Displayable
|
||||
return weight;
|
||||
}
|
||||
|
||||
public Group getLuckPermsGroup() {
|
||||
public Group getLuckPermsGroup()
|
||||
{
|
||||
return this.group;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user