Paper/Spigot-Server-Patches/0083-Pass-world-to-Village-creation.patch

37 lines
1.4 KiB
Diff
Raw Normal View History

From 07d8e704ef4a680c1b1b82c7cabbc674dccc5904 Mon Sep 17 00:00:00 2001
2016-03-20 03:21:39 +08:00
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
2016-06-09 11:57:14 +08:00
index 75dc674..2a9444e 100644
2016-03-20 03:21:39 +08:00
--- a/src/main/java/net/minecraft/server/PersistentVillage.java
+++ b/src/main/java/net/minecraft/server/PersistentVillage.java
@@ -236,7 +236,7 @@ public class PersistentVillage extends PersistentBase {
for (int i = 0; i < nbttaglist.size(); ++i) {
NBTTagCompound nbttagcompound1 = nbttaglist.get(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
2016-06-09 11:57:14 +08:00
index 1fa7cb2..fc3a6ab 100644
2016-03-20 03:21:39 +08:00
--- a/src/main/java/net/minecraft/server/Village.java
+++ b/src/main/java/net/minecraft/server/Village.java
@@ -22,7 +22,7 @@ public class Village {
2016-06-09 11:57:14 +08:00
private final List<Village.Aggressor> k;
2016-03-20 03:21:39 +08:00
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 = new TreeMap();
--
2.10.0.windows.1
2016-03-20 03:21:39 +08:00