Fixed potential NPEs in Structure code caused by componenets not being able to load. Closes #1686
This commit is contained in:
parent
b036b37a35
commit
c80e75de9b
1 changed files with 10 additions and 0 deletions
|
@ -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_);
|
||||
|
|
Loading…
Reference in a new issue