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

Commit

Permalink
FPlayer: add method get vault group
Browse files Browse the repository at this point in the history
  • Loading branch information
TheFaser committed Oct 7, 2023
1 parent 8c8bc85 commit 748d34f
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions src/main/java/net/flectone/misc/entity/FPlayer.java
Original file line number Diff line number Diff line change
Expand Up @@ -579,6 +579,14 @@ public boolean isSpies() {
@NotNull
public static String getVaultLocaleString(@NotNull CommandSender sender, @NotNull String localeString) {

String formattedLocaleString = locale.getString(localeString.replaceFirst("<group>", getVaultGroup(sender)));

return formattedLocaleString.isEmpty()
? locale.getString(localeString.replaceFirst("<group>", "default"))
: formattedLocaleString;
}

public static String getVaultGroup(@NotNull CommandSender sender) {
String hoverGroup = "default";

if (sender instanceof Player player) {
Expand All @@ -591,11 +599,6 @@ public static String getVaultLocaleString(@NotNull CommandSender sender, @NotNul

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

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

return formattedLocaleString.isEmpty()
? locale.getString(localeString.replaceFirst("<group>", "default"))
: formattedLocaleString;
return hoverGroup;
}
}

0 comments on commit 748d34f

Please sign in to comment.