diff options
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); |