Fix wood farming and block breaking stalls

This commit is contained in:
Tanner committed 2026-11-15 15:18:12 +00:00
1 parent 8ada31a918
commit 99bb5c98de
4 files changed
+70 -3

No files matched your search

+4 -1
View File
@@ -682,6 +682,7 @@ class LegacyGame:
# migrated actions use the 26.3 packet classes imported above.
class Game(LegacyGame):
ARM_SWING_INTERVAL = 0.1
BREAK_FINISH_GRACE = 0.2
DOOR_AUTO_OPEN_GRACE = 0.25
DOOR_TURN_DURATION = 0.3
@@ -1045,7 +1046,9 @@ class Game(LegacyGame):
self.g.breaking = location
self.breaking_state = block_id
now = time.monotonic()
self.break_deadline = now + duration
# A server tick and packet delay can otherwise make the client finish
# just before the server has accumulated the full mining progress.
self.break_deadline = now + duration + self.BREAK_FINISH_GRACE
self.animate()
self.next_swing_at = now + self.ARM_SWING_INTERVAL
return True