Skip to content
This repository has been archived by the owner on Jan 20, 2024. It is now read-only.

Commit

Permalink
FPlayer: add LuckPerms API to get group
Browse files Browse the repository at this point in the history
  • Loading branch information
TheFaser committed Sep 17, 2023
1 parent ce123df commit 8d75221
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/main/java/net/flectone/misc/entity/FPlayer.java
Original file line number Diff line number Diff line change
Expand Up @@ -579,13 +579,15 @@ public static String getVaultLocaleString(@NotNull CommandSender sender, @NotNul

String hoverGroup = "default";

if(HookManager.enabledVault && sender instanceof Player player) {
Chat provider = FVault.getProvider();
if (sender instanceof Player player) {

String group = provider.getPrimaryGroup(player);
if(group != null) {
hoverGroup = group;
if (HookManager.enabledLuckPerms) {
hoverGroup = FLuckPerms.getPrimaryGroup(player);
} else if (HookManager.enabledVault) {
hoverGroup = FVault.getPrimaryGroup(player);
}

if (hoverGroup == null) hoverGroup = "default";
}

String formattedLocaleString = locale.getString(localeString.replaceFirst("<group>", hoverGroup));
Expand Down

0 comments on commit 8d75221

Please sign in to comment.