PaperMC/CraftBukkit-Patches/0096-Convert-Horses-owner-to-UUID.patch
2016-03-03 03:46:48 -06:00

31 lines
1.2 KiB
Diff

From 429cd2e895873f3403e564cffda453b8ceb68a0e Mon Sep 17 00:00:00 2001
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 ba06096..5b9b879 100644
--- a/src/main/java/net/minecraft/server/EntityHorse.java
+++ b/src/main/java/net/minecraft/server/EntityHorse.java
@@ -983,6 +983,17 @@ public class EntityHorse extends EntityAnimal implements IInventoryListener, IJu
s = nbttagcompound.getString("OwnerUUID");
} else {
String s1 = nbttagcompound.getString("Owner");
+ // Spigot start
+ if ( s1 == null || s1.isEmpty() )
+ {
+ if (nbttagcompound.hasKey("OwnerName")) {
+ String owner = nbttagcompound.getString("OwnerName");
+ if (owner != null && !owner.isEmpty()) {
+ s1 = owner;
+ }
+ }
+ }
+ // Spigot end
s = NameReferencingFileConverter.a(this.h(), s1);
}
--
2.5.0