From 21cf8b4ea8e9e708e6066018005140c2fff788f0 Mon Sep 17 00:00:00 2001 From: Jules Date: Sat, 27 Jul 2024 14:31:51 -0700 Subject: [PATCH] Fixed empty messages sending to chat --- .../mmoitems/api/util/message/FormattedMessage.java | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/MMOItems-API/src/main/java/net/Indyuce/mmoitems/api/util/message/FormattedMessage.java b/MMOItems-API/src/main/java/net/Indyuce/mmoitems/api/util/message/FormattedMessage.java index 7651a408..546c937f 100644 --- a/MMOItems-API/src/main/java/net/Indyuce/mmoitems/api/util/message/FormattedMessage.java +++ b/MMOItems-API/src/main/java/net/Indyuce/mmoitems/api/util/message/FormattedMessage.java @@ -41,11 +41,6 @@ public class FormattedMessage { @NotNull public FormattedMessage format(ChatColor prefix, String... toReplace) { - - // Compatibility with #send(Player) - if (message.isEmpty()) - return this; - message = prefix + message; for (int j = 0; j < toReplace.length; j += 2) message = message.replace(toReplace[j], toReplace[j + 1]); @@ -59,7 +54,7 @@ public class FormattedMessage { * @param player Player receiving the message */ public void send(Player player) { - if (message.isEmpty()) + if (ChatColor.stripColor(message).isEmpty()) return; if (actionBar) {