diff options
author | Travis Watkins <amaranth@ubuntu.com> | 2014-04-10 20:04:38 -0500 |
---|---|---|
committer | Travis Watkins <amaranth@ubuntu.com> | 2014-04-11 22:28:35 -0500 |
commit | 8f771c737850130534b0fade70494f7ce3cbc8fd (patch) | |
tree | e4180121cdaf4f15b325aa059469b44975fca8a4 /src/main/java/net/minecraft/server/PacketPlayOutNamedEntitySpawn.java | |
parent | 0df7555cecff17ffab68b8280dcf8471b10f020c (diff) | |
download | craftbukkit-8f771c737850130534b0fade70494f7ce3cbc8fd.tar craftbukkit-8f771c737850130534b0fade70494f7ce3cbc8fd.tar.gz craftbukkit-8f771c737850130534b0fade70494f7ce3cbc8fd.tar.lz craftbukkit-8f771c737850130534b0fade70494f7ce3cbc8fd.tar.xz craftbukkit-8f771c737850130534b0fade70494f7ce3cbc8fd.zip |
Update CraftBukkit to Minecraft 1.7.8
Diffstat (limited to 'src/main/java/net/minecraft/server/PacketPlayOutNamedEntitySpawn.java')
-rw-r--r-- | src/main/java/net/minecraft/server/PacketPlayOutNamedEntitySpawn.java | 32 |
1 files changed, 30 insertions, 2 deletions
diff --git a/src/main/java/net/minecraft/server/PacketPlayOutNamedEntitySpawn.java b/src/main/java/net/minecraft/server/PacketPlayOutNamedEntitySpawn.java index 8bab5281..7bae4054 100644 --- a/src/main/java/net/minecraft/server/PacketPlayOutNamedEntitySpawn.java +++ b/src/main/java/net/minecraft/server/PacketPlayOutNamedEntitySpawn.java @@ -1,8 +1,11 @@ package net.minecraft.server; +import java.util.Iterator; import java.util.List; +import java.util.UUID; import net.minecraft.util.com.mojang.authlib.GameProfile; +import net.minecraft.util.com.mojang.authlib.properties.Property; import java.io.IOException; // CraftBukkit @@ -37,7 +40,19 @@ public class PacketPlayOutNamedEntitySpawn extends Packet { public void a(PacketDataSerializer packetdataserializer) throws IOException { // CraftBukkit - added throws this.a = packetdataserializer.a(); - this.b = new GameProfile(packetdataserializer.c(36), packetdataserializer.c(16)); + UUID uuid = UUID.fromString(packetdataserializer.c(36)); + + this.b = new GameProfile(uuid, packetdataserializer.c(16)); + int i = packetdataserializer.a(); + + for (int j = 0; j < i; ++j) { + String s = packetdataserializer.c(32767); + String s1 = packetdataserializer.c(32767); + String s2 = packetdataserializer.c(32767); + + this.b.getProperties().put(s, new Property(s, s1, s2)); + } + this.c = packetdataserializer.readInt(); this.d = packetdataserializer.readInt(); this.e = packetdataserializer.readInt(); @@ -49,8 +64,21 @@ public class PacketPlayOutNamedEntitySpawn extends Packet { public void b(PacketDataSerializer packetdataserializer) throws IOException { // CraftBukkit - added throws packetdataserializer.b(this.a); - packetdataserializer.a(this.b.getId()); + UUID uuid = this.b.getId(); + + packetdataserializer.a(uuid == null ? "" : uuid.toString()); packetdataserializer.a(this.b.getName().length() > 16 ? this.b.getName().substring(0, 16) : this.b.getName()); // CraftBukkit - Limit name length to 16 characters + packetdataserializer.b(this.b.getProperties().size()); + Iterator iterator = this.b.getProperties().values().iterator(); + + while (iterator.hasNext()) { + Property property = (Property) iterator.next(); + + packetdataserializer.a(property.getName()); + packetdataserializer.a(property.getValue()); + packetdataserializer.a(property.getSignature()); + } + packetdataserializer.writeInt(this.c); packetdataserializer.writeInt(this.d); packetdataserializer.writeInt(this.e); |