Strip dashes when sending UUIDs to older clients.

This commit is contained in:
md_5 2014-04-12 18:04:17 +10:00
parent 8971d2afa7
commit 2a02b37ac2

View File

@ -1,4 +1,4 @@
From 465e79587b965603307f8a3497f552dd463137cc Mon Sep 17 00:00:00 2001 From 2ef1e42e7e5489229c4c20ae2ae880fc992ca9b5 Mon Sep 17 00:00:00 2001
From: md_5 <git@md-5.net> From: md_5 <git@md-5.net>
Date: Sat, 12 Apr 2014 15:11:15 +1000 Date: Sat, 12 Apr 2014 15:11:15 +1000
Subject: [PATCH] Old / New Version Support. Subject: [PATCH] Old / New Version Support.
@ -128,12 +128,15 @@ index 0000000..011a9aa
+ } + }
+} +}
diff --git a/src/main/java/net/minecraft/server/PacketPlayOutNamedEntitySpawn.java b/src/main/java/net/minecraft/server/PacketPlayOutNamedEntitySpawn.java diff --git a/src/main/java/net/minecraft/server/PacketPlayOutNamedEntitySpawn.java b/src/main/java/net/minecraft/server/PacketPlayOutNamedEntitySpawn.java
index 7bae405..edab87b 100644 index 7bae405..5e24f7e 100644
--- a/src/main/java/net/minecraft/server/PacketPlayOutNamedEntitySpawn.java --- a/src/main/java/net/minecraft/server/PacketPlayOutNamedEntitySpawn.java
+++ b/src/main/java/net/minecraft/server/PacketPlayOutNamedEntitySpawn.java +++ b/src/main/java/net/minecraft/server/PacketPlayOutNamedEntitySpawn.java
@@ -68,6 +68,7 @@ public class PacketPlayOutNamedEntitySpawn extends Packet { @@ -66,8 +66,9 @@ public class PacketPlayOutNamedEntitySpawn extends Packet {
packetdataserializer.b(this.a);
UUID uuid = this.b.getId();
packetdataserializer.a(uuid == null ? "" : uuid.toString()); - packetdataserializer.a(uuid == null ? "" : uuid.toString());
+ packetdataserializer.a( uuid == null ? "" : ( ( packetdataserializer.version >= 5 ) ? uuid.toString() : uuid.toString().replaceAll( "-", "" ) ) ); // Spigot
packetdataserializer.a(this.b.getName().length() > 16 ? this.b.getName().substring(0, 16) : this.b.getName()); // CraftBukkit - Limit name length to 16 characters packetdataserializer.a(this.b.getName().length() > 16 ? this.b.getName().substring(0, 16) : this.b.getName()); // CraftBukkit - Limit name length to 16 characters
+ if (packetdataserializer.version >= 5 ) { // Spigot + if (packetdataserializer.version >= 5 ) { // Spigot
packetdataserializer.b(this.b.getProperties().size()); packetdataserializer.b(this.b.getProperties().size());