mirror of
https://github.com/AtlasMediaGroup/TotalFreedomMod.git
synced 2025-07-07 06:23:05 +00:00
Added inheritance to the groups when created by TFM.
This commit is contained in:
@ -6,6 +6,7 @@ import net.kyori.adventure.text.Component;
|
||||
import net.kyori.adventure.text.format.TextColor;
|
||||
import net.luckperms.api.model.data.DataType;
|
||||
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;
|
||||
@ -40,6 +41,7 @@ public class DisplayableGroup implements Displayable
|
||||
private final boolean hasDefaultLoginMessage;
|
||||
|
||||
public DisplayableGroup(String group,
|
||||
String inheritance,
|
||||
Component plural,
|
||||
Component tag,
|
||||
int weight,
|
||||
@ -59,7 +61,14 @@ public class DisplayableGroup implements Displayable
|
||||
|
||||
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();
|
||||
PrefixNode prefixNode = PrefixNode.builder()
|
||||
.prefix(FUtil.miniMessage(GroupProvider.OPEN.append(tag.color(color)).append(GroupProvider.CLOSE)))
|
||||
.priority(1)
|
||||
.build();
|
||||
if (inheritance != null) {
|
||||
InheritanceNode inheritanceNode = InheritanceNode.builder(inheritance).build();
|
||||
g.getData(DataType.NORMAL).add(inheritanceNode);
|
||||
}
|
||||
g.getData(DataType.NORMAL).add(prefixNode);
|
||||
g.getData(DataType.NORMAL).add(weightNode);
|
||||
}).join(); // Block until the group is created and loaded.
|
||||
|
Reference in New Issue
Block a user