From c1d8afce9b4c33c947207c8cb9e9eed1891745a6 Mon Sep 17 00:00:00 2001 From: Zach Brown Date: Wed, 10 Sep 2014 19:41:12 -0500 Subject: [PATCH] Don't allow 1.8 clients to join... they crash when encountering 1.8 blocks/items/etc --- .../0041-Implement-a-few-1.8-features.patch | 21 ++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/Spigot-Server-Patches/0041-Implement-a-few-1.8-features.patch b/Spigot-Server-Patches/0041-Implement-a-few-1.8-features.patch index ef0672f322..9e501a401a 100644 --- a/Spigot-Server-Patches/0041-Implement-a-few-1.8-features.patch +++ b/Spigot-Server-Patches/0041-Implement-a-few-1.8-features.patch @@ -1,4 +1,4 @@ -From 8f6c0f5ec64da2c1ac31fc0b2edfd0188185a06e Mon Sep 17 00:00:00 2001 +From ffe49c3d17d1d1fb36e483d72f25c20684bd25a9 Mon Sep 17 00:00:00 2001 From: Zach Brown Date: Sun, 7 Sep 2014 15:45:58 -0500 Subject: [PATCH] Implement a few 1.8 features @@ -397,6 +397,25 @@ index 381ae78..e72e4e1 100644 } protected Item getLoot() { +diff --git a/src/main/java/net/minecraft/server/HandshakeListener.java b/src/main/java/net/minecraft/server/HandshakeListener.java +index e0a1708..49568ea 100644 +--- a/src/main/java/net/minecraft/server/HandshakeListener.java ++++ b/src/main/java/net/minecraft/server/HandshakeListener.java +@@ -72,7 +72,13 @@ public class HandshakeListener implements PacketHandshakingInListener { + } + // CraftBukkit end + +- if (packethandshakinginsetprotocol.d() > 5 && packethandshakinginsetprotocol.d() != 47) { // Spigot ++ // PaperSpigot start - DC non-1.8 clients ++ if (packethandshakinginsetprotocol.d() != 47) { ++ chatcomponenttext = new ChatComponentText( "You must join using a 1.8 client!" ); ++ this.b.handle(new PacketLoginOutDisconnect(chatcomponenttext), new GenericFutureListener[0]); ++ this.b.close(chatcomponenttext); ++ } else if (packethandshakinginsetprotocol.d() > 5 && packethandshakinginsetprotocol.d() != 47) { // Spigot ++ // PaperSpigot end + chatcomponenttext = new ChatComponentText( org.spigotmc.SpigotConfig.outdatedServerMessage ); // Spigot + this.b.handle(new PacketLoginOutDisconnect(chatcomponenttext), new GenericFutureListener[0]); + this.b.close(chatcomponenttext); diff --git a/src/main/java/net/minecraft/server/Item.java b/src/main/java/net/minecraft/server/Item.java index 4382f1a..7493e42 100644 --- a/src/main/java/net/minecraft/server/Item.java