BungeeCord Chat API

By: md_5 <git@md-5.net>
This commit is contained in:
CraftBukkit/Spigot
2014-12-13 03:06:05 +01:00
parent 5ec1e1bc24
commit 49288f7f95
7 changed files with 287 additions and 0 deletions

View File

@@ -5,3 +5,16 @@
package net.minecraft.network.protocol.game;
import net.minecraft.network.RegistryFriendlyByteBuf;
@@ -12,6 +13,12 @@
public static final StreamCodec<RegistryFriendlyByteBuf, ClientboundSystemChatPacket> STREAM_CODEC = StreamCodec.composite(ComponentSerialization.TRUSTED_STREAM_CODEC, ClientboundSystemChatPacket::content, ByteBufCodecs.BOOL, ClientboundSystemChatPacket::overlay, ClientboundSystemChatPacket::new);
+ // Spigot start
+ public ClientboundSystemChatPacket(net.md_5.bungee.api.chat.BaseComponent[] content, boolean overlay) {
+ this(org.bukkit.craftbukkit.util.CraftChatMessage.fromJSON(net.md_5.bungee.chat.ComponentSerializer.toString(content)), overlay);
+ }
+ // Spigot end
+
@Override
public PacketType<ClientboundSystemChatPacket> type() {
return GamePacketTypes.CLIENTBOUND_SYSTEM_CHAT;