Paper/CraftBukkit-Patches/0141-Convert-Horses-owner-to-UUID.patch

29 lines
1.2 KiB
Diff
Raw Normal View History

2014-04-17 21:47:40 +02:00
From b10521c8fbd8be80380d7a0f625b20d4ad80e70e Mon Sep 17 00:00:00 2001
2014-04-16 08:14:26 +02:00
From: Aikar <aikar@aikar.co>
Date: Wed, 16 Apr 2014 01:40:30 -0400
Subject: [PATCH] Convert Horses owner to UUID
diff --git a/src/main/java/net/minecraft/server/EntityHorse.java b/src/main/java/net/minecraft/server/EntityHorse.java
index 5978ea3..1b1ed9b 100644
--- a/src/main/java/net/minecraft/server/EntityHorse.java
+++ b/src/main/java/net/minecraft/server/EntityHorse.java
@@ -1000,6 +1000,14 @@ public class EntityHorse extends EntityAnimal implements IInventoryListener {
if (nbttagcompound.hasKeyOfType("OwnerUUID", 8)) {
this.setOwnerUUID(nbttagcompound.getString("OwnerUUID"));
}
+ // Spigot start
+ else if (nbttagcompound.hasKey("OwnerName")) {
+ String owner = nbttagcompound.getString("OwnerName");
+ if (owner != null && !owner.isEmpty()) {
+ this.setOwnerUUID(NameReferencingFileConverter.a(owner));
+ }
+ }
+ // Spigot end
// CraftBukkit start
if (nbttagcompound.hasKey("Bukkit.MaxDomestication")) {
this.maxDomestication = nbttagcompound.getInt("Bukkit.MaxDomestication");
--
2014-04-17 21:47:40 +02:00
1.8.5.2.msysgit.0
2014-04-16 08:14:26 +02:00