Skip to content

Commit b05a988

Browse files
committed
isAir check in updateBreakProgress to account for unloaded chunks and cancelled checks when calling internalOnCancel
1 parent afee12a commit b05a988

File tree

1 file changed

+3
-2
lines changed
  • common/src/main/kotlin/com/lambda/interaction/request/breaking

1 file changed

+3
-2
lines changed

common/src/main/kotlin/com/lambda/interaction/request/breaking/BreakManager.kt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -561,6 +561,7 @@ object BreakManager : RequestHandler<BreakRequest>(
561561
*/
562562
private fun BreakInfo.cancelBreak() =
563563
runSafe {
564+
if (isRedundant || abandoned) return@runSafe
564565
setBreakingTextureStage(player, world, -1)
565566
if (isPrimary) {
566567
if (breaking) abortBreakPacket(world, interaction)
@@ -657,9 +658,9 @@ object BreakManager : RequestHandler<BreakRequest>(
657658
}
658659

659660
val blockState = blockState(ctx.blockPos)
660-
if (blockState.isEmpty) {
661+
if (blockState.isEmpty || blockState.isAir) {
661662
info.nullify()
662-
info.internalOnCancel()
663+
if (!info.isRedundant) info.internalOnCancel()
663664
return false
664665
}
665666

0 commit comments

Comments
 (0)