From 7fc5cd856e46182e727f383a911ffa46326611f1 Mon Sep 17 00:00:00 2001 From: Thinkofname Date: Wed, 30 Mar 2016 16:51:22 +0100 Subject: [PATCH] Support Minecraft 1.9.2 --- nms-patches/HandshakeListener.patch | 2 +- nms-patches/PacketStatusListener.patch | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/nms-patches/HandshakeListener.patch b/nms-patches/HandshakeListener.patch index 4798ca8aaf..081af021dc 100644 --- a/nms-patches/HandshakeListener.patch +++ b/nms-patches/HandshakeListener.patch @@ -64,7 +64,7 @@ + } + // CraftBukkit end + -+ if (packethandshakinginsetprotocol.b() > 108) { ++ if (packethandshakinginsetprotocol.b() > 109) { chatcomponenttext = new ChatComponentText("Outdated server! I\'m still on 1.9"); this.b.sendPacket(new PacketLoginOutDisconnect(chatcomponenttext)); this.b.close(chatcomponenttext); diff --git a/nms-patches/PacketStatusListener.patch b/nms-patches/PacketStatusListener.patch index 90ef226101..408a67d8bf 100644 --- a/nms-patches/PacketStatusListener.patch +++ b/nms-patches/PacketStatusListener.patch @@ -17,7 +17,7 @@ public class PacketStatusListener implements PacketStatusInListener { private static final IChatBaseComponent a = new ChatComponentText("Status request has been handled."); -@@ -19,8 +30,99 @@ +@@ -19,8 +30,101 @@ this.networkManager.close(PacketStatusListener.a); } else { this.d = true; @@ -109,6 +109,8 @@ + int version = minecraftServer.getServerPing().getServerData().getProtocolVersion(); + if (this.networkManager.channel.pipeline().get(PacketEncoder.class).version == 108) { + version = 108; ++ } else if (this.networkManager.channel.pipeline().get(PacketEncoder.class).version == 109) { ++ version = 109; + } + ping.setServerInfo(new ServerPing.ServerData(minecraftServer.getServerModName() + " " + minecraftServer.getVersion(), version)); +