Fixed tile entities persisting when switching between states that don't have TEs without changing the block. (#6674)

This commit is contained in:
Tom Boshoven 2020-05-12 17:21:28 -04:00 committed by GitHub
parent 5f082045b0
commit 988fc97af1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View file

@ -58,7 +58,7 @@
@Deprecated @Deprecated
public void func_196243_a(BlockState p_196243_1_, World p_196243_2_, BlockPos p_196243_3_, BlockState p_196243_4_, boolean p_196243_5_) { public void func_196243_a(BlockState p_196243_1_, World p_196243_2_, BlockPos p_196243_3_, BlockState p_196243_4_, boolean p_196243_5_) {
- if (this.func_149716_u() && p_196243_1_.func_177230_c() != p_196243_4_.func_177230_c()) { - if (this.func_149716_u() && p_196243_1_.func_177230_c() != p_196243_4_.func_177230_c()) {
+ if (p_196243_1_.hasTileEntity() && p_196243_1_.func_177230_c() != p_196243_4_.func_177230_c()) { + if (p_196243_1_.hasTileEntity() && (p_196243_1_.func_177230_c() != p_196243_4_.func_177230_c() || !p_196243_4_.hasTileEntity())) {
p_196243_2_.func_175713_t(p_196243_3_); p_196243_2_.func_175713_t(p_196243_3_);
} }
- -

View file

@ -31,7 +31,7 @@
if (!this.field_76637_e.field_72995_K) { if (!this.field_76637_e.field_72995_K) {
blockstate.func_196947_b(this.field_76637_e, p_177436_1_, p_177436_2_, p_177436_3_); blockstate.func_196947_b(this.field_76637_e, p_177436_1_, p_177436_2_, p_177436_3_);
- } else if (block1 != block && block1 instanceof ITileEntityProvider) { - } else if (block1 != block && block1 instanceof ITileEntityProvider) {
+ } else if (block1 != block && blockstate.hasTileEntity()) { + } else if ((block1 != block || !p_177436_2_.hasTileEntity()) && blockstate.hasTileEntity()) {
this.field_76637_e.func_175713_t(p_177436_1_); this.field_76637_e.func_175713_t(p_177436_1_);
} }