|
25 | 25 | import com.sk89q.worldedit.util.adventure.text.Component; |
26 | 26 | import com.sk89q.worldedit.util.adventure.text.serializer.gson.GsonComponentSerializer; |
27 | 27 | import com.sk89q.worldedit.util.formatting.WorldEditText; |
28 | | -import net.minecraft.ChatFormatting; |
29 | 28 | import net.minecraft.commands.CommandSourceStack; |
30 | 29 |
|
31 | 30 | import java.util.Locale; |
@@ -65,47 +64,17 @@ public String getName() { |
65 | 64 | @Deprecated |
66 | 65 | public void printRaw(String msg) { |
67 | 66 | for (String part : msg.split("\n")) { |
68 | | - sendMessage(net.minecraft.network.chat.Component.literal(part)); |
| 67 | + print(Component.text(part)); |
69 | 68 | } |
70 | 69 | } |
71 | 70 |
|
72 | | - @Override |
73 | | - @Deprecated |
74 | | - public void printDebug(String msg) { |
75 | | - sendColorized(msg, ChatFormatting.GRAY); |
76 | | - } |
77 | | - |
78 | | - @Override |
79 | | - @Deprecated |
80 | | - public void print(String msg) { |
81 | | - sendColorized(msg, ChatFormatting.LIGHT_PURPLE); |
82 | | - } |
83 | | - |
84 | | - @Override |
85 | | - @Deprecated |
86 | | - public void printError(String msg) { |
87 | | - sendColorized(msg, ChatFormatting.RED); |
88 | | - } |
89 | | - |
90 | 71 | @Override |
91 | 72 | public void print(Component component) { |
92 | | - sendMessage(net.minecraft.network.chat.Component.Serializer.fromJson( |
93 | | - GsonComponentSerializer.gson().serialize(WorldEditText.format(component, getLocale())) |
| 73 | + this.sender.sendSystemMessage(net.minecraft.network.chat.Component.Serializer.fromJson( |
| 74 | + GsonComponentSerializer.gson().serialize(WorldEditText.format(component, getLocale())) |
94 | 75 | )); |
95 | 76 | } |
96 | 77 |
|
97 | | - private void sendColorized(String msg, ChatFormatting formatting) { |
98 | | - for (String part : msg.split("\n")) { |
99 | | - var component = net.minecraft.network.chat.Component.literal(part); |
100 | | - component.withStyle(formatting); |
101 | | - sendMessage(component); |
102 | | - } |
103 | | - } |
104 | | - |
105 | | - private void sendMessage(net.minecraft.network.chat.Component textComponent) { |
106 | | - this.sender.sendSystemMessage(textComponent); |
107 | | - } |
108 | | - |
109 | 78 | @Override |
110 | 79 | public String[] getGroups() { |
111 | 80 | return new String[0]; |
|
0 commit comments