mirror of
https://github.com/barkeser2002/CatServer.git
synced 2026-09-25 12:05:59 +03:00
41 lines
1.2 KiB
Diff
41 lines
1.2 KiB
Diff
--- ../src-base/minecraft/net/minecraft/network/play/server/SPacketChat.java
|
|
+++ ../src-work/minecraft/net/minecraft/network/play/server/SPacketChat.java
|
|
@@ -13,6 +13,7 @@
|
|
{
|
|
private ITextComponent chatComponent;
|
|
private ChatType type;
|
|
+ public net.md_5.bungee.api.chat.BaseComponent[] components; // Spigot
|
|
|
|
public SPacketChat()
|
|
{
|
|
@@ -29,6 +30,14 @@
|
|
this.type = type;
|
|
}
|
|
|
|
+ // CatServer start
|
|
+ public SPacketChat(ITextComponent message, byte type)
|
|
+ {
|
|
+ this.chatComponent = message;
|
|
+ this.type = ChatType.byId(type);
|
|
+ }
|
|
+ // CatServer end
|
|
+
|
|
public void readPacketData(PacketBuffer buf) throws IOException
|
|
{
|
|
this.chatComponent = buf.readTextComponent();
|
|
@@ -37,7 +46,13 @@
|
|
|
|
public void writePacketData(PacketBuffer buf) throws IOException
|
|
{
|
|
- buf.writeTextComponent(this.chatComponent);
|
|
+ // Spigot start
|
|
+ if (components != null) {
|
|
+ buf.writeString(net.md_5.bungee.chat.ComponentSerializer.toString(components));
|
|
+ } else {
|
|
+ buf.writeTextComponent(this.chatComponent);
|
|
+ }
|
|
+ // Spigot end
|
|
buf.writeByte(this.type.getId());
|
|
}
|
|
|