Parse colors from broadcast world command (#5913)

Make the broadcast world command mimic the behavior of the broadcast
command which correctly parses colors from the broadcast message.

Broadcast World Command Output Before: https://i.imgur.com/aFR6Zzb.png

Broadcast World Command Output After: https://i.imgur.com/qrvb8XD.png
This commit is contained in:
Slimified 2024-08-25 14:25:14 -07:00 committed by GitHub
parent f1a5caf98e
commit b54c8c1774
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -3,6 +3,7 @@ package com.earth2me.essentials.commands;
import com.earth2me.essentials.CommandSource;
import com.earth2me.essentials.User;
import com.earth2me.essentials.utils.AdventureUtil;
import com.earth2me.essentials.utils.FormatUtil;
import com.google.common.collect.Lists;
import net.ess3.api.TranslatableException;
import org.bukkit.Server;
@ -53,7 +54,7 @@ public class Commandbroadcastworld extends EssentialsCommand {
if (message.isEmpty()) {
throw new NotEnoughArgumentsException();
}
ess.broadcastTl(null, u -> !u.getBase().getWorld().equals(world), true, "broadcast", message, AdventureUtil.parsed(AdventureUtil.legacyToMini(name)));
ess.broadcastTl(null, u -> !u.getBase().getWorld().equals(world), true, "broadcast", FormatUtil.replaceFormat(message).replace("\\n", "\n"), AdventureUtil.parsed(AdventureUtil.legacyToMini(name)));
}
@Override