Fix more legacy support

This commit is contained in:
md_5 2014-04-12 18:15:24 +10:00
parent 2a02b37ac2
commit a3b28bf525

View File

@ -1,4 +1,4 @@
From 2ef1e42e7e5489229c4c20ae2ae880fc992ca9b5 Mon Sep 17 00:00:00 2001
From a075d1294c4170b06370a4ffdbc9aa912ff16640 Mon Sep 17 00:00:00 2001
From: md_5 <git@md-5.net>
Date: Sat, 12 Apr 2014 15:11:15 +1000
Subject: [PATCH] Old / New Version Support.
@ -127,6 +127,56 @@ index 0000000..011a9aa
+ this.a(channelhandlercontext, (Packet) object, bytebuf);
+ }
+}
diff --git a/src/main/java/net/minecraft/server/PacketLoginOutSuccess.java b/src/main/java/net/minecraft/server/PacketLoginOutSuccess.java
new file mode 100644
index 0000000..a244f00
--- /dev/null
+++ b/src/main/java/net/minecraft/server/PacketLoginOutSuccess.java
@@ -0,0 +1,44 @@
+package net.minecraft.server;
+
+import java.io.IOException;
+import java.util.UUID;
+
+import net.minecraft.util.com.mojang.authlib.GameProfile;
+
+public class PacketLoginOutSuccess extends Packet {
+
+ private GameProfile a;
+
+ public PacketLoginOutSuccess() {}
+
+ public PacketLoginOutSuccess(GameProfile gameprofile) {
+ this.a = gameprofile;
+ }
+
+ public void a(PacketDataSerializer packetdataserializer) throws IOException {
+ String s = packetdataserializer.c(36);
+ String s1 = packetdataserializer.c(16);
+ UUID uuid = UUID.fromString(s);
+
+ this.a = new GameProfile(uuid, s1);
+ }
+
+ public void b(PacketDataSerializer packetdataserializer) throws IOException {
+ UUID uuid = this.a.getId();
+
+ packetdataserializer.a(uuid == null ? "" : ( ( packetdataserializer.version >= 5 ) ? uuid.toString() : uuid.toString().replaceAll( "-", "" ) ) );
+ packetdataserializer.a(this.a.getName());
+ }
+
+ public void a(PacketLoginOutListener packetloginoutlistener) {
+ packetloginoutlistener.a(this);
+ }
+
+ public boolean a() {
+ return true;
+ }
+
+ public void handle(PacketListener packetlistener) {
+ this.a((PacketLoginOutListener) packetlistener);
+ }
+}
diff --git a/src/main/java/net/minecraft/server/PacketPlayOutNamedEntitySpawn.java b/src/main/java/net/minecraft/server/PacketPlayOutNamedEntitySpawn.java
index 7bae405..5e24f7e 100644
--- a/src/main/java/net/minecraft/server/PacketPlayOutNamedEntitySpawn.java