diff --git a/patches/net/minecraft/world/level/block/state/BlockBehaviour.java.patch b/patches/net/minecraft/world/level/block/state/BlockBehaviour.java.patch index 9fdd0acefe..6f1997eee2 100644 --- a/patches/net/minecraft/world/level/block/state/BlockBehaviour.java.patch +++ b/patches/net/minecraft/world/level/block/state/BlockBehaviour.java.patch @@ -1,5 +1,14 @@ --- a/net/minecraft/world/level/block/state/BlockBehaviour.java +++ b/net/minecraft/world/level/block/state/BlockBehaviour.java +@@ -171,7 +_,7 @@ + } + + protected void onRemove(BlockState p_60515_, Level p_60516_, BlockPos p_60517_, BlockState p_60518_, boolean p_60519_) { +- if (p_60515_.hasBlockEntity() && !p_60515_.is(p_60518_.getBlock())) { ++ if (p_60515_.hasBlockEntity() && (!p_60515_.is(p_60518_.getBlock()) || !p_60518_.hasBlockEntity())) { + p_60516_.removeBlockEntity(p_60517_); + } + } @@ -182,7 +_,7 @@ if (!p_311951_.isAir() && p_312925_.getBlockInteraction() != Explosion.BlockInteraction.TRIGGER_BLOCK) { Block block = p_311951_.getBlock(); @@ -97,6 +106,15 @@ return this.getBlock().useItemOn(p_316374_, this.asState(), p_316651_, p_316877_.getBlockPos(), p_316623_, p_316469_, p_316877_); } +@@ -843,7 +_,7 @@ + } + + public boolean hasBlockEntity() { +- return this.getBlock() instanceof EntityBlock; ++ return this.getBlock().hasBlockEntity(this.asState()); + } + + @Nullable @@ -871,6 +_,7 @@ return this.getBlock().getSeed(this.asState(), p_60727_); } diff --git a/patches/net/minecraft/world/level/chunk/LevelChunk.java.patch b/patches/net/minecraft/world/level/chunk/LevelChunk.java.patch index dfa6a02fdf..1088d2a017 100644 --- a/patches/net/minecraft/world/level/chunk/LevelChunk.java.patch +++ b/patches/net/minecraft/world/level/chunk/LevelChunk.java.patch @@ -26,7 +26,15 @@ ProfilerFiller profilerfiller = Profiler.get(); profilerfiller.push("updateSkyLightSources"); this.skyLightSources.update(this, j, i, l); -@@ -298,7 +_,7 @@ +@@ -291,14 +_,14 @@ + boolean flag2 = blockstate.hasBlockEntity(); + if (!this.level.isClientSide) { + blockstate.onRemove(this.level, p_62865_, p_62866_, p_62867_); +- } else if (!blockstate.is(block) && flag2) { ++ } else if ((!blockstate.is(block) || !p_62866_.hasBlockEntity()) && flag2) { + this.removeBlockEntity(p_62865_); + } + if (!levelchunksection.getBlockState(j, k, l).is(block)) { return null; } else {