From 3347af79fac0c058d597e60e6e7f3c2108a11c52 Mon Sep 17 00:00:00 2001 From: Zach Date: Sat, 8 Jun 2024 23:31:36 -0500 Subject: [PATCH] Readd %player% placeholders --- .../simplestaffchat/utilities/chat/Placeholders.java | 3 +++ .../simplestaffchat/utilities/chat/Placeholders.java | 2 ++ 2 files changed, 5 insertions(+) diff --git a/SimpleStaffChat-Bungee/src/main/java/me/refracdevelopment/simplestaffchat/utilities/chat/Placeholders.java b/SimpleStaffChat-Bungee/src/main/java/me/refracdevelopment/simplestaffchat/utilities/chat/Placeholders.java index e441d09..4e2e453 100644 --- a/SimpleStaffChat-Bungee/src/main/java/me/refracdevelopment/simplestaffchat/utilities/chat/Placeholders.java +++ b/SimpleStaffChat-Bungee/src/main/java/me/refracdevelopment/simplestaffchat/utilities/chat/Placeholders.java @@ -12,6 +12,9 @@ public String setPlaceholders(CommandSender sender, String placeholder) { placeholder = placeholder.replace("%prefix%", SimpleStaffChat.getInstance().getLocaleFile().getString("prefix")); if (sender instanceof ProxiedPlayer player) { + placeholder = placeholder.replace("%player%", player.getName()); + placeholder = placeholder.replace("%displayname%", player.getDisplayName()); + if (LuckPermsUtil.getLuckPerms() != null) { placeholder = placeholder.replace("%luckperms_prefix%", LuckPermsUtil.getPrefix(player)); placeholder = placeholder.replace("%luckperms_suffix%", LuckPermsUtil.getSuffix(player)); diff --git a/SimpleStaffChat-Velocity/src/main/java/me/refracdevelopment/simplestaffchat/utilities/chat/Placeholders.java b/SimpleStaffChat-Velocity/src/main/java/me/refracdevelopment/simplestaffchat/utilities/chat/Placeholders.java index a061f53..087055f 100644 --- a/SimpleStaffChat-Velocity/src/main/java/me/refracdevelopment/simplestaffchat/utilities/chat/Placeholders.java +++ b/SimpleStaffChat-Velocity/src/main/java/me/refracdevelopment/simplestaffchat/utilities/chat/Placeholders.java @@ -12,6 +12,8 @@ public String setPlaceholders(CommandSource sender, String placeholder) { placeholder = placeholder.replace("%prefix%", SimpleStaffChat.getInstance().getLocaleFile().getString("prefix")); if (sender instanceof Player player) { + placeholder = placeholder.replace("%player%", player.getUsername()); + if (LuckPermsUtil.getLuckPerms() != null) { placeholder = placeholder.replace("%luckperms_prefix%", LuckPermsUtil.getPrefix(player)); placeholder = placeholder.replace("%luckperms_suffix%", LuckPermsUtil.getSuffix(player));