File tree Expand file tree Collapse file tree 2 files changed +12
-6
lines changed
common/src/main/kotlin/com/lambda/interaction/request/breaking Expand file tree Collapse file tree 2 files changed +12
-6
lines changed Original file line number Diff line number Diff line change @@ -94,7 +94,7 @@ object BreakManager : RequestHandler<BreakRequest>(
9494 TickEvent .Input .Pre ,
9595 TickEvent .Input .Post ,
9696 TickEvent .Player .Post ,
97- onOpen = { simulateAbandoned( ); processRequest(activeRequest ) },
97+ onOpen = { processRequest(activeRequest ); simulateAbandoned( ) },
9898 onClose = { checkForCancels() }
9999), PositionBlocking {
100100 private var primaryBreak: BreakInfo ?
Original file line number Diff line number Diff line change @@ -32,13 +32,19 @@ object ReBreakManager {
3232 var reBreak: BreakInfo ? = null
3333
3434 init {
35- listen<TickEvent .Post >(priority = Int .MIN_VALUE ) {
36- reBreak?.apply {
37- breakingTicks++
38- tickStats()
35+ listen<TickEvent .Pre >(priority = Int .MIN_VALUE ) {
36+ reBreak?.run {
37+ if (! progressedThisTick) {
38+ breakingTicks++
39+ progressedThisTick = true
40+ }
3941 }
4042 }
4143
44+ listen<TickEvent .Post >(priority = Int .MIN_VALUE ) {
45+ reBreak?.tickStats()
46+ }
47+
4248 listenUnsafe<ConnectionEvent .Connect .Pre >(priority = Int .MIN_VALUE ) {
4349 reBreak = null
4450 }
@@ -72,7 +78,7 @@ object ReBreakManager {
7278 val context = info.context
7379
7480 val breakProgress = context.cachedState.calcBlockBreakingDelta(player, world, context.blockPos)
75- return @runSafe if (info.breakingTicks * breakProgress >= info.breakConfig.breakThreshold) {
81+ return @runSafe if (( info.breakingTicks - info.breakConfig.fudgeFactor) * breakProgress >= info.breakConfig.breakThreshold) {
7682 if (context.cachedState.isEmpty) {
7783 return @runSafe ReBreakResult .Ignored
7884 }
You can’t perform that action at this time.
0 commit comments