Skip to content

Commit 02eb8bf

Browse files
authored
Merge pull request #118 from EllanServer/codex/fix-click-dedup-cross-tick
fix(interact): widen click dedup window to stop cross-tick double-firing
2 parents 8456926 + 082f1ad commit 02eb8bf

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

src/main/java/top/ellan/mahjong/table/core/MahjongTableManager.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@
4646

4747
public final class MahjongTableManager implements Listener {
4848
private static final String ADMIN_PERMISSION = "mahjongpaper.admin";
49-
private static final long DUPLICATE_DISPLAY_ACTION_WINDOW_NANOS = 40_000_000L;
50-
private static final long DUPLICATE_HAND_TILE_CLICK_WINDOW_NANOS = 40_000_000L;
49+
private static final long DUPLICATE_DISPLAY_ACTION_WINDOW_NANOS = 150_000_000L;
50+
private static final long DUPLICATE_HAND_TILE_CLICK_WINDOW_NANOS = 150_000_000L;
5151
private static final long RECENT_DISPLAY_ACTION_TTL_SECONDS = 60L;
5252
private static final long RECENT_HAND_TILE_CLICK_TTL_SECONDS = 60L;
5353
private static final double PERSISTED_TABLE_CLEANUP_RADIUS_XZ = 4.5D;

src/main/java/top/ellan/mahjong/table/core/TableEventCoordinator.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,13 @@
4141
import org.bukkit.util.RayTraceResult;
4242

4343
final class TableEventCoordinator implements Listener {
44-
private static final long DUPLICATE_DISPLAY_ACTION_WINDOW_NANOS = 40_000_000L;
44+
private static final long DUPLICATE_DISPLAY_ACTION_WINDOW_NANOS = 150_000_000L;
4545
private static final long OVERHEAD_EXIT_GUARD_SECONDS = 2L;
4646
private static final double FLAT_INTERACTION_MAX_DISTANCE = 6.0D;
4747
private static final double FLAT_INTERACTION_BLOCK_EPSILON = 0.05D;
4848
/**
4949
* Bounded TTL on the per-player recent-action cache. The dedup window is
50-
* 40ms (DUPLICATE_DISPLAY_ACTION_WINDOW_NANOS), so anything older than a
50+
* 150ms (DUPLICATE_DISPLAY_ACTION_WINDOW_NANOS), so anything older than a
5151
* few seconds is by definition not a duplicate of a fresh click — but the
5252
* previous bare ConcurrentHashMap only evicted on PlayerQuitEvent, which
5353
* on Folia can occasionally be missed when the player's entity region

0 commit comments

Comments
 (0)