Skip to content

Commit

Permalink
Updated the patches
Browse files Browse the repository at this point in the history
  • Loading branch information
TelepathicGrunt committed Nov 9, 2024
1 parent 14f53f0 commit 58f3c35
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -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();
Expand Down Expand Up @@ -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_);
}
Expand Down
10 changes: 9 additions & 1 deletion patches/net/minecraft/world/level/chunk/LevelChunk.java.patch
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 58f3c35

Please sign in to comment.