Skip to content

Fix core scheduling, command, and thread correctness issues - #291

Merged
BenCodez merged 8 commits into
masterfrom
fix/core-correctness
Aug 23, 2026
Merged

BenCodez merged 8 commits into
masterfrom
fix/core-correctness

Conversation

@BenCodez

Copy link
Copy Markdown
Owner

Summary

Fix several deterministic AdvancedCore correctness issues outside the reward subsystem.

Thread safety

  • remove System.exit(0) from FileThread.ReadThread interruption handling
  • remove System.exit(0) from the deprecated Thread.ReadThread helper
  • treat interruption as normal shutdown: restore the interrupt flag and exit the loop
  • use each worker thread's own interruption state instead of the outer thread reference

Inventory scheduling

  • fix BInventory.addUpdatingButton(...) to use its interval argument as the fixed-delay period instead of incorrectly reusing the initial delay
  • retain existing timer cancellation behavior

MiscUtils correctness

  • make addSeconds(Date, int) add to the supplied date instead of the current time
  • increment stagger delay for each list command so staggered commands actually run on successive ticks
  • normalize leading / consistently before Bukkit console command dispatch, including list/staggered and single-command paths

Tests

  • add MiscUtilsTest for supplied-date arithmetic, stagger delay progression, and slash stripping
  • add BInventoryTest for initial delay/update interval and future cancellation
  • add ThreadInterruptionTest verifying both legacy worker threads terminate normally when interrupted

This PR is intentionally focused on deterministic correctness fixes and does not change reward behavior or configuration.

@BenCodez
BenCodez marked this pull request as ready for review August 23, 2026 20:04
@BenCodez
BenCodez merged commit 4f06ce0 into master Aug 23, 2026
4 checks passed
@BenCodez
BenCodez deleted the fix/core-correctness branch August 23, 2026 20:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant