From c83f024c86f2b96c27f4892fdab2cdafed02e9de Mon Sep 17 00:00:00 2001 From: Aikar Date: Sat, 19 Mar 2016 15:16:54 -0400 Subject: [PATCH] Pass world to Village creation fixes NPE bug #95 diff --git a/src/main/java/net/minecraft/server/PersistentVillage.java b/src/main/java/net/minecraft/server/PersistentVillage.java index c09326636..3219ccca4 100644 --- a/src/main/java/net/minecraft/server/PersistentVillage.java +++ b/src/main/java/net/minecraft/server/PersistentVillage.java @@ -234,7 +234,7 @@ public class PersistentVillage extends PersistentBase { for (int i = 0; i < nbttaglist.size(); ++i) { NBTTagCompound nbttagcompound1 = nbttaglist.getCompound(i); - Village village = new Village(); + Village village = new Village(world); // Paper village.a(nbttagcompound1); this.villages.add(village); diff --git a/src/main/java/net/minecraft/server/Village.java b/src/main/java/net/minecraft/server/Village.java index e742cbe12..dfcabb83a 100644 --- a/src/main/java/net/minecraft/server/Village.java +++ b/src/main/java/net/minecraft/server/Village.java @@ -24,7 +24,7 @@ public class Village { private final List k; private int l; - public Village() { + private Village() { // Paper - Nothing should call this - world needs to be set. this.c = BlockPosition.ZERO; this.d = BlockPosition.ZERO; this.j = Maps.newHashMap(); -- 2.18.0