Fixed IModelData not being cleared when tile entity is removed (#6115)

This commit is contained in:
Wyn Price 2019-10-11 04:07:52 +01:00 committed by tterrag
parent 01d14004a9
commit 5978670897
2 changed files with 8 additions and 3 deletions

View File

@ -49,15 +49,16 @@
this.field_145850_b.func_175666_e(this.field_174879_c, this.field_195045_e.func_177230_c());
}
}
@@ -139,6 +146,7 @@
@@ -139,6 +146,8 @@
public void func_145843_s() {
this.field_145846_f = true;
+ this.invalidateCaps();
+ requestModelDataUpdate();
}
public void func_145829_t() {
@@ -181,6 +189,13 @@
@@ -181,6 +190,13 @@
return this.field_200663_e;
}

View File

@ -84,10 +84,14 @@ public class ModelDataManager
for (BlockPos pos : needUpdate)
{
TileEntity toUpdate = world.getTileEntity(pos);
if (toUpdate != null)
if (toUpdate != null && !toUpdate.isRemoved())
{
data.put(pos, toUpdate.getModelData());
}
else
{
data.remove(pos);
}
}
}
}