From 8cfe680abc79a67af4e3917810c78946740c1937 Mon Sep 17 00:00:00 2001 From: pop4959 Date: Mon, 25 Mar 2024 12:09:13 -0700 Subject: [PATCH] Fix empty translations being sent to Console (#5737) --- .../src/main/java/com/earth2me/essentials/CommandSource.java | 4 +++- Essentials/src/main/java/com/earth2me/essentials/Console.java | 3 +++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/Essentials/src/main/java/com/earth2me/essentials/CommandSource.java b/Essentials/src/main/java/com/earth2me/essentials/CommandSource.java index 59a88a21b..ed8d5bdb6 100644 --- a/Essentials/src/main/java/com/earth2me/essentials/CommandSource.java +++ b/Essentials/src/main/java/com/earth2me/essentials/CommandSource.java @@ -36,7 +36,9 @@ public class CommandSource { } final String translation = tlLiteral(tlKey, args); - sendComponent(AdventureUtil.miniMessage().deserialize(translation)); + if (!translation.isEmpty()) { + sendComponent(AdventureUtil.miniMessage().deserialize(translation)); + } } public String tl(final String tlKey, final Object... args) { diff --git a/Essentials/src/main/java/com/earth2me/essentials/Console.java b/Essentials/src/main/java/com/earth2me/essentials/Console.java index 9dacde649..6414f3cef 100644 --- a/Essentials/src/main/java/com/earth2me/essentials/Console.java +++ b/Essentials/src/main/java/com/earth2me/essentials/Console.java @@ -69,6 +69,9 @@ public final class Console implements IMessageRecipient { @Override public void sendTl(String tlKey, Object... args) { final String translation = tlLiteral(tlKey, args); + if (translation.isEmpty()) { + return; + } final Audience consoleAudience = ((Essentials) ess).getBukkitAudience().sender(getCommandSender()); final Component component = AdventureUtil.miniMessage()