Deprecate ChatColor (#9069)

All API that uses it is deprecated
This commit is contained in:
Jake Potrebic
2023-04-02 11:53:29 -07:00
parent 7d091ee970
commit 74b88dc367
7 changed files with 87 additions and 12 deletions

View File

@@ -34,6 +34,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
// Paper start
+ @Override
+ @Deprecated
+ public void sendActionBar(BaseComponent[] message) {
+ if (getHandle().connection == null) return;
+ net.minecraft.network.protocol.game.ClientboundSetActionBarTextPacket packet = new net.minecraft.network.protocol.game.ClientboundSetActionBarTextPacket((net.minecraft.network.chat.Component) null);
@@ -42,12 +43,14 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ }
+
+ @Override
+ @Deprecated
+ public void sendActionBar(String message) {
+ if (getHandle().connection == null || message == null || message.isEmpty()) return;
+ getHandle().connection.send(new net.minecraft.network.protocol.game.ClientboundSetActionBarTextPacket(CraftChatMessage.fromStringOrNull(message)));
+ }
+
+ @Override
+ @Deprecated
+ public void sendActionBar(char alternateChar, String message) {
+ if (message == null || message.isEmpty()) return;
+ sendActionBar(org.bukkit.ChatColor.translateAlternateColorCodes(alternateChar, message));