Skip to content

Commit 941b822

Browse files
committed
inlined usages of internalOnCancel
1 parent b05a988 commit 941b822

File tree

2 files changed

+3
-7
lines changed

2 files changed

+3
-7
lines changed

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

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,10 +75,6 @@ data class BreakInfo(
7575
}
7676
}
7777

78-
fun internalOnCancel() {
79-
request.onCancel?.invoke(context.blockPos)
80-
}
81-
8278
fun updateInfo(context: BreakContext, request: BreakRequest? = null) {
8379
updatedThisTick = true
8480
this.context = context

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -571,7 +571,7 @@ object BreakManager : RequestHandler<BreakRequest>(
571571
else abandoned = true
572572
}
573573

574-
internalOnCancel()
574+
request.onCancel?.invoke(context.blockPos)
575575
}
576576

577577
/**
@@ -647,7 +647,7 @@ object BreakManager : RequestHandler<BreakRequest>(
647647
}
648648
if (!startBreaking(info)) {
649649
info.nullify()
650-
info.internalOnCancel()
650+
info.request.onCancel?.invoke(info.context.blockPos)
651651
return false
652652
}
653653
val swing = config.swing
@@ -660,7 +660,7 @@ object BreakManager : RequestHandler<BreakRequest>(
660660
val blockState = blockState(ctx.blockPos)
661661
if (blockState.isEmpty || blockState.isAir) {
662662
info.nullify()
663-
if (!info.isRedundant) info.internalOnCancel()
663+
if (!info.isRedundant) info.request.onCancel?.invoke(info.context.blockPos)
664664
return false
665665
}
666666

0 commit comments

Comments
 (0)