Remove ChatColor usages (#7543)
This commit is contained in:
@@ -1366,6 +1366,43 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
|
||||
public static void broadcastCommandMessage(@NotNull CommandSender source, @NotNull String message) {
|
||||
broadcastCommandMessage(source, message, true);
|
||||
}
|
||||
|
||||
public static void broadcastCommandMessage(@NotNull CommandSender source, @NotNull String message, boolean sendToSource) {
|
||||
- String result = source.getName() + ": " + message;
|
||||
+ // Paper start
|
||||
+ broadcastCommandMessage(source, net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer.legacySection().deserialize(message), sendToSource);
|
||||
+ }
|
||||
+
|
||||
+ public static void broadcastCommandMessage(@NotNull CommandSender source, @NotNull net.kyori.adventure.text.Component message) {
|
||||
+ broadcastCommandMessage(source, message, true);
|
||||
+ }
|
||||
+
|
||||
+ public static void broadcastCommandMessage(@NotNull CommandSender source, @NotNull net.kyori.adventure.text.Component message, boolean sendToSource) {
|
||||
+ net.kyori.adventure.text.TextComponent.Builder result = net.kyori.adventure.text.Component.text()
|
||||
+ .color(net.kyori.adventure.text.format.NamedTextColor.WHITE)
|
||||
+ .decoration(net.kyori.adventure.text.format.TextDecoration.ITALIC, false)
|
||||
+ .append(source.name())
|
||||
+ .append(net.kyori.adventure.text.Component.text(": "))
|
||||
+ .append(message);
|
||||
+ // Paper end
|
||||
|
||||
if (source instanceof BlockCommandSender) {
|
||||
BlockCommandSender blockCommandSender = (BlockCommandSender) source;
|
||||
@@ -0,0 +0,0 @@ public abstract class Command {
|
||||
}
|
||||
|
||||
Set<Permissible> users = Bukkit.getPluginManager().getPermissionSubscriptions(Server.BROADCAST_CHANNEL_ADMINISTRATIVE);
|
||||
- String colored = ChatColor.GRAY + "" + ChatColor.ITALIC + "[" + result + ChatColor.GRAY + ChatColor.ITALIC + "]";
|
||||
+ // Paper start
|
||||
+ net.kyori.adventure.text.TextComponent.Builder colored = net.kyori.adventure.text.Component.text()
|
||||
+ .color(net.kyori.adventure.text.format.NamedTextColor.GRAY)
|
||||
+ .decorate(net.kyori.adventure.text.format.TextDecoration.ITALIC)
|
||||
+ .append(net.kyori.adventure.text.Component.text("["), result, net.kyori.adventure.text.Component.text("]"));
|
||||
+ // Paper end
|
||||
|
||||
if (sendToSource && !(source instanceof ConsoleCommandSender)) {
|
||||
source.sendMessage(message);
|
||||
diff --git a/src/main/java/org/bukkit/command/CommandSender.java b/src/main/java/org/bukkit/command/CommandSender.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/org/bukkit/command/CommandSender.java
|
||||
|
||||
Reference in New Issue
Block a user