From 9704f25aa89415c2bb4ca4dd932a0ef8849ddf9e Mon Sep 17 00:00:00 2001 From: Lex Manos Date: Thu, 5 Feb 2015 17:03:43 -0800 Subject: [PATCH] Fixed potential NPEs in Structure code caused by componenets not being able to load. --- .../world/gen/structure/StructureStart.java.patch | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/patches/minecraft/net/minecraft/world/gen/structure/StructureStart.java.patch b/patches/minecraft/net/minecraft/world/gen/structure/StructureStart.java.patch index b21aa36e8..9615cd339 100644 --- a/patches/minecraft/net/minecraft/world/gen/structure/StructureStart.java.patch +++ b/patches/minecraft/net/minecraft/world/gen/structure/StructureStart.java.patch @@ -11,3 +11,13 @@ NBTTagCompound nbttagcompound = new NBTTagCompound(); nbttagcompound.func_74778_a("id", MapGenStructureIO.func_143033_a(this)); nbttagcompound.func_74768_a("ChunkX", p_143021_1_); +@@ -97,7 +101,8 @@ + + for (int i = 0; i < nbttaglist.func_74745_c(); ++i) + { +- this.field_75075_a.add(MapGenStructureIO.func_143032_b(nbttaglist.func_150305_b(i), p_143020_1_)); ++ StructureComponent tmp = MapGenStructureIO.func_143032_b(nbttaglist.func_150305_b(i), p_143020_1_); ++ if (tmp != null) this.field_75075_a.add(tmp); //Forge: Prevent NPEs further down the line when a component can't be loaded. + } + + this.func_143017_b(p_143020_2_);