Fixed potential NPEs in Structure code caused by componenets not being able to load. Closes #1686

This commit is contained in:
Lex Manos 2015-02-05 17:02:30 -08:00
parent b036b37a35
commit c80e75de9b

View file

@ -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_);
@@ -98,7 +102,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 componenet can't be loaded.
}
this.func_143017_b(p_143020_2_);