Paper/Spigot-Server-Patches/0072-Pass-world-to-Village-creation.patch
Aikar d089acb3bd
Switch to using ForgeFlower for Paper Only mc-dev imports
ForgeFlower is better than Spigots FernFlower at decompiling the source.

However, in order to maintain the CraftBukkit patches, we must keep
using spigots for the primary.

However, for any file that we import on top of Spigots imported files
there is nothing stopping us from using better decompiled files.

So these changes will use ForgeFlower to maintain a better set of
decomped files, so anything we add on top of Paper can start off
in a better spot.
2018-08-31 23:47:57 -04:00

37 lines
1.5 KiB
Diff

From e1a7033e3c4af7eb6dae4c51bf3a2f02ea02654d Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
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 d58f6b2a86..d14a9e3a3e 100644
--- a/src/main/java/net/minecraft/server/PersistentVillage.java
+++ b/src/main/java/net/minecraft/server/PersistentVillage.java
@@ -202,7 +202,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 f87e8e05af..bda67faefe 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<Village.Aggressor> 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