Fixed empty messages sending to chat

This commit is contained in:
Jules 2024-07-27 14:31:51 -07:00
parent 6a6f2c0377
commit 21cf8b4ea8

View File

@ -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) {