mirror of
https://github.com/dmulloy2/ProtocolLib.git
synced 2025-02-10 01:21:47 +01:00
✨backwards compat✨
This commit is contained in:
parent
aa555f792e
commit
26274fed52
@ -95,10 +95,14 @@ public class ChatExtensions {
|
||||
for (WrappedChatComponent component : components) {
|
||||
PacketContainer packet = new PacketContainer(PacketType.Play.Server.CHAT);
|
||||
packet.getChatComponents().write(0, component);
|
||||
packet.getChatTypes().write(0, EnumWrappers.ChatType.SYSTEM);
|
||||
if (MinecraftVersion.NETHER_UPDATE_2.atOrAbove()) {
|
||||
packet.getUUIDs().write(0, SERVER_UUID);
|
||||
}
|
||||
|
||||
// 1.12+
|
||||
packet.getChatTypes().writeSafely(0, EnumWrappers.ChatType.SYSTEM);
|
||||
// 1.8-1.12
|
||||
packet.getBytes().writeSafely(0, (byte) 1);
|
||||
// 1.16+
|
||||
packet.getUUIDs().writeSafely(0, SERVER_UUID);
|
||||
|
||||
packets.add(packet);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user