From e1c9ba99cdfb8fc9602395655dd892403c19bb5d Mon Sep 17 00:00:00 2001 From: Byteflux Date: Tue, 2 Jun 2015 01:40:46 -0700 Subject: [PATCH] Fix NPE when disabling certain structure generators --- Spigot-Server-Patches/Generator-Settings.patch | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Spigot-Server-Patches/Generator-Settings.patch b/Spigot-Server-Patches/Generator-Settings.patch index 5911ddce2..de72b940b 100644 --- a/Spigot-Server-Patches/Generator-Settings.patch +++ b/Spigot-Server-Patches/Generator-Settings.patch @@ -222,6 +222,18 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 } public Chunk getChunkAt(BlockPosition blockposition) { +diff --git a/src/main/java/net/minecraft/server/StructureGenerator.java b/src/main/java/net/minecraft/server/StructureGenerator.java +index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 +--- a/src/main/java/net/minecraft/server/StructureGenerator.java ++++ b/src/main/java/net/minecraft/server/StructureGenerator.java +@@ -0,0 +0,0 @@ public abstract class StructureGenerator extends WorldGenBase { + } + + public boolean b(BlockPosition blockposition) { ++ if (this.c == null) return false; // PaperSpigot + this.a(this.c); + return this.c(blockposition) != null; + } diff --git a/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java b/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java