From 044d4637649b55c866704de05e081cf7c9956fe2 Mon Sep 17 00:00:00 2001
From: Zach Brown <1254957+zachbr@users.noreply.github.com>
Date: Mon, 21 Mar 2016 10:28:45 -0500
Subject: [PATCH] Use singleton in Village class to work around null issue that
 evades

---
 .../Pass-world-to-Village-creation.patch                 | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/Spigot-Server-Patches/Pass-world-to-Village-creation.patch b/Spigot-Server-Patches/Pass-world-to-Village-creation.patch
index 8f732ea70b..b8ec114146 100644
--- a/Spigot-Server-Patches/Pass-world-to-Village-creation.patch
+++ b/Spigot-Server-Patches/Pass-world-to-Village-creation.patch
@@ -31,4 +31,13 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
          this.c = BlockPosition.ZERO;
          this.d = BlockPosition.ZERO;
          this.j = new TreeMap();
+@@ -0,0 +0,0 @@ public class Village {
+             NBTTagCompound nbttagcompound2 = nbttaglist1.get(j);
+ 
+             if (nbttagcompound2.hasKey("UUID")) {
+-                UserCache usercache = this.a.getMinecraftServer().getUserCache();
++                UserCache usercache = MinecraftServer.getServer().getUserCache(); // Paper - Bandaid for world being null
+                 GameProfile gameprofile = usercache.a(UUID.fromString(nbttagcompound2.getString("UUID")));
+ 
+                 if (gameprofile != null) {
 --
\ No newline at end of file