2019-04-23 04:47:07 +00:00
|
|
|
From b61f0153ccd138435700cfb4c711f477112574f6 Mon Sep 17 00:00:00 2001
|
2016-03-19 19:21:39 +00: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
|
2019-04-23 04:47:07 +00:00
|
|
|
index 98c6bbc183..7a9fb97530 100644
|
2016-03-19 19:21:39 +00:00
|
|
|
--- a/src/main/java/net/minecraft/server/PersistentVillage.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/PersistentVillage.java
|
2019-01-01 03:15:55 +00:00
|
|
|
@@ -237,7 +237,7 @@ public class PersistentVillage extends PersistentBase {
|
2016-03-19 19:21:39 +00:00
|
|
|
|
2019-01-01 03:15:55 +00:00
|
|
|
for (int i = 0; i < nbttaglist.size(); ++i) {
|
2018-07-15 01:53:17 +00:00
|
|
|
NBTTagCompound nbttagcompound1 = nbttaglist.getCompound(i);
|
2016-03-19 19:21:39 +00:00
|
|
|
- Village village = new Village();
|
|
|
|
+ Village village = new Village(world); // Paper
|
2019-01-01 03:15:55 +00:00
|
|
|
|
2016-03-19 19:21:39 +00:00
|
|
|
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
|
2019-04-23 04:47:07 +00:00
|
|
|
index 68ad7bc213..b794572915 100644
|
2016-03-19 19:21:39 +00:00
|
|
|
--- a/src/main/java/net/minecraft/server/Village.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/Village.java
|
2016-11-17 02:23:38 +00:00
|
|
|
@@ -24,7 +24,7 @@ public class Village {
|
2016-06-09 03:57:14 +00:00
|
|
|
private final List<Village.Aggressor> k;
|
2016-03-19 19:21:39 +00: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;
|
2016-11-17 02:23:38 +00:00
|
|
|
this.j = Maps.newHashMap();
|
2016-03-19 19:21:39 +00:00
|
|
|
--
|
2019-04-23 04:47:07 +00:00
|
|
|
2.21.0
|
2016-03-19 19:21:39 +00:00
|
|
|
|