From fdf1875e7fc591673cd7c7e79a8a48a192a9f0e2 Mon Sep 17 00:00:00 2001 From: Josh Roy <10731363+JRoy@users.noreply.github.com> Date: Tue, 24 Oct 2023 17:24:06 -0400 Subject: [PATCH 1/2] Fix incorrect permission node in /potion (#5552) Fixes #5549. --- .../java/com/earth2me/essentials/commands/Commandpotion.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Essentials/src/main/java/com/earth2me/essentials/commands/Commandpotion.java b/Essentials/src/main/java/com/earth2me/essentials/commands/Commandpotion.java index 447772df318..3af22728726 100644 --- a/Essentials/src/main/java/com/earth2me/essentials/commands/Commandpotion.java +++ b/Essentials/src/main/java/com/earth2me/essentials/commands/Commandpotion.java @@ -34,7 +34,7 @@ protected void run(final Server server, final User user, final String commandLab final Set potionslist = new TreeSet<>(); for (final Map.Entry entry : Potions.entrySet()) { final String potionName = entry.getValue().getName().toLowerCase(Locale.ENGLISH); - if (potionslist.contains(potionName) || user.isAuthorized("essentials.potion." + potionName)) { + if (potionslist.contains(potionName) || user.isAuthorized("essentials.potions." + potionName)) { potionslist.add(entry.getKey()); } } @@ -85,7 +85,7 @@ protected List getTabCompleteOptions(final Server server, final User use } for (final Map.Entry entry : Potions.entrySet()) { final String potionName = entry.getValue().getName().toLowerCase(Locale.ENGLISH); - if (user.isAuthorized("essentials.potion." + potionName)) { + if (user.isAuthorized("essentials.potions." + potionName)) { options.add("effect:" + entry.getKey()); } } From 3eceec87d318c45114e4a633a8cdaf180b840540 Mon Sep 17 00:00:00 2001 From: Marcel Kwiatkowski Date: Sun, 29 Oct 2023 00:29:11 +0200 Subject: [PATCH 2/2] Fix incorrect online count in custom quit message (#5541) Co-authored-by: MD <1917406+mdcfe@users.noreply.github.com> --- .../java/com/earth2me/essentials/EssentialsPlayerListener.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Essentials/src/main/java/com/earth2me/essentials/EssentialsPlayerListener.java b/Essentials/src/main/java/com/earth2me/essentials/EssentialsPlayerListener.java index b4ba60e2fef..e6f368a4776 100644 --- a/Essentials/src/main/java/com/earth2me/essentials/EssentialsPlayerListener.java +++ b/Essentials/src/main/java/com/earth2me/essentials/EssentialsPlayerListener.java @@ -270,7 +270,7 @@ public void onPlayerQuit(final PlayerQuitEvent event) { final String msg = ess.getSettings().getCustomQuitMessage() .replace("{PLAYER}", player.getDisplayName()) .replace("{USERNAME}", player.getName()) - .replace("{ONLINE}", NumberFormat.getInstance().format(ess.getOnlinePlayers().size())) + .replace("{ONLINE}", NumberFormat.getInstance().format(ess.getOnlinePlayers().size() - 1)) // Subtract 1 as the leaving player is still online during this time .replace("{UPTIME}", DateUtil.formatDateDiff(ManagementFactory.getRuntimeMXBean().getStartTime())) .replace("{PREFIX}", FormatUtil.replaceFormat(ess.getPermissionsHandler().getPrefix(player))) .replace("{SUFFIX}", FormatUtil.replaceFormat(ess.getPermissionsHandler().getSuffix(player)));