ForgePatch/patches/minecraft/net/minecraft/world/gen/feature/structure/StructureStart.java.patch

23 lines
1.2 KiB
Diff

--- a/net/minecraft/world/gen/feature/structure/StructureStart.java
+++ b/net/minecraft/world/gen/feature/structure/StructureStart.java
@@ -68,6 +68,9 @@
}
public NBTTagCompound func_143021_a(int p_143021_1_, int p_143021_2_) {
+ if (StructureIO.func_143033_a(this) == null) { // FORGE: This is just a more friendly error instead of the 'Null String' below
+ throw new RuntimeException("StructureStart \"" + this.getClass().getName() + "\" missing ID Mapping, Modder see MapGenStructureIO");
+ }
NBTTagCompound nbttagcompound = new NBTTagCompound();
if (this.func_75069_d()) {
nbttagcompound.func_74778_a("id", StructureIO.func_143033_a(this));
@@ -105,7 +108,8 @@
NBTTagList nbttaglist = p_143020_2_.func_150295_c("Children", 10);
for(int i = 0; i < nbttaglist.size(); ++i) {
- this.field_75075_a.add(StructureIO.func_143032_b(nbttaglist.func_150305_b(i), p_143020_1_));
+ StructurePiece tmp = StructureIO.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 componenet can't be loaded.
}
this.func_143017_b(p_143020_2_);