Adjust unloaded chunk check for block digging

This commit is contained in:
Spottedleaf
2025-03-09 10:54:40 -07:00
committed by Spottedleaf
parent 743346a5da
commit 1a7288aa05

View File

@@ -1145,7 +1145,7 @@
case ABORT_DESTROY_BLOCK:
case STOP_DESTROY_BLOCK:
+ // Paper start - Don't allow digging into unloaded chunks
+ if (this.player.level().getChunkIfLoadedImmediately(pos.getX() >> 4, pos.getZ() >> 4) == null) {
+ if (this.player.level().getChunkIfLoadedImmediately(pos.getX() >> 4, pos.getZ() >> 4) == null || !this.player.canInteractWithBlock(pos, 1.0)) {
+ this.player.connection.ackBlockChangesUpTo(packet.getSequence());
+ return;
+ }