From 342630e7b48bf2308b2eb562db47ee70845d00f0 Mon Sep 17 00:00:00 2001 From: md_5 Date: Sat, 15 Mar 2014 08:46:24 +1100 Subject: [PATCH] Alter BungeeCord support to require BungeeCord when it is enabled. --- .../0061-BungeeCord-Support.patch | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/CraftBukkit-Patches/0061-BungeeCord-Support.patch b/CraftBukkit-Patches/0061-BungeeCord-Support.patch index e5e4a80..c61ac35 100644 --- a/CraftBukkit-Patches/0061-BungeeCord-Support.patch +++ b/CraftBukkit-Patches/0061-BungeeCord-Support.patch @@ -1,4 +1,4 @@ -From 1cc0f87c4395182a37da05723d68f1730c21a0b6 Mon Sep 17 00:00:00 2001 +From 8efc549832c3ed150b6427738460301fce938ab5 Mon Sep 17 00:00:00 2001 From: md_5 Date: Sun, 1 Dec 2013 18:18:41 +1100 Subject: [PATCH] BungeeCord Support @@ -6,23 +6,26 @@ Subject: [PATCH] BungeeCord Support Provides support for IP forwarding via BungeeCord. diff --git a/src/main/java/net/minecraft/server/HandshakeListener.java b/src/main/java/net/minecraft/server/HandshakeListener.java -index ff7b3d3..a517306 100644 +index ff7b3d3..0215891 100644 --- a/src/main/java/net/minecraft/server/HandshakeListener.java +++ b/src/main/java/net/minecraft/server/HandshakeListener.java -@@ -73,6 +73,19 @@ public class HandshakeListener implements PacketHandshakingInListener { +@@ -73,6 +73,22 @@ public class HandshakeListener implements PacketHandshakingInListener { this.b.a((IChatBaseComponent) chatcomponenttext); } else { this.b.a((PacketListener) (new LoginListener(this.a, this.b))); + // Spigot Start + if (org.spigotmc.SpigotConfig.bungee) { + String[] split = packethandshakinginsetprotocol.b.split("\00"); -+ if (split.length == 2 || split.length == 3) { ++ if ( split.length == 3 ) { + packethandshakinginsetprotocol.b = split[0]; + b.l = new java.net.InetSocketAddress(split[1], ((java.net.InetSocketAddress) b.getSocketAddress()).getPort()); -+ } -+ if ( split.length == 3 ) -+ { + b.spoofedUUID = split[2]; ++ } else ++ { ++ chatcomponenttext = new ChatComponentText("If you wish to use IP forwarding, please enable it in your BungeeCord config as well!"); ++ this.b.handle(new PacketLoginOutDisconnect(chatcomponenttext), new GenericFutureListener[0]); ++ this.b.a(chatcomponenttext); ++ return; + } + } + // Spigot End