Update for latest CraftBukkit changes.

This commit is contained in:
md_5
2015-07-30 17:22:16 +10:00
parent fd378c06e5
commit f468d641ab
3 changed files with 58 additions and 13 deletions

View File

@@ -23,9 +23,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
this.b.a((PacketListener) (new LoginListener(this.a, this.b)));
+ // Spigot Start
+ if (org.spigotmc.SpigotConfig.bungee) {
+ String[] split = packethandshakinginsetprotocol.b.split("\00");
+ String[] split = packethandshakinginsetprotocol.hostname.split("\00");
+ if ( split.length == 3 || split.length == 4 ) {
+ packethandshakinginsetprotocol.b = split[0];
+ packethandshakinginsetprotocol.hostname = split[0];
+ b.l = new java.net.InetSocketAddress(split[1], ((java.net.InetSocketAddress) b.getSocketAddress()).getPort());
+ b.spoofedUUID = com.mojang.util.UUIDTypeAdapter.fromString( split[2] );
+ } else
@@ -41,7 +41,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ }
+ }
+ // Spigot End
((LoginListener) this.b.getPacketListener()).hostname = packethandshakinginsetprotocol.b + ":" + packethandshakinginsetprotocol.c; // CraftBukkit - set hostname
((LoginListener) this.b.getPacketListener()).hostname = packethandshakinginsetprotocol.hostname + ":" + packethandshakinginsetprotocol.port; // CraftBukkit - set hostname
}
break;
diff --git a/src/main/java/net/minecraft/server/LoginListener.java b/src/main/java/net/minecraft/server/LoginListener.java
@@ -138,9 +138,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
public void a(PacketDataSerializer packetdataserializer) throws IOException {
this.a = packetdataserializer.e();
- this.b = packetdataserializer.c(255);
+ this.b = packetdataserializer.c(Short.MAX_VALUE); // Spigot
this.c = packetdataserializer.readUnsignedShort();
- this.hostname = packetdataserializer.c(255);
+ this.hostname = packetdataserializer.c(Short.MAX_VALUE); // Spigot
this.port = packetdataserializer.readUnsignedShort();
this.d = EnumProtocol.a(packetdataserializer.e());
}
diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java