Skip to content

Fix global revive scheduler execution and reload handling#48

Merged
Nergly merged 1 commit intomasterfrom
codex/fix-player-revive-timing-issue
Apr 24, 2026
Merged

Fix global revive scheduler execution and reload handling#48
Nergly merged 1 commit intomasterfrom
codex/fix-player-revive-timing-issue

Conversation

@Nergly
Copy link
Copy Markdown
Owner

@Nergly Nergly commented Apr 24, 2026

Motivation

  • The global revive task previously ran its reset logic from an async callback which can access Bukkit state off the main thread and silently fail, preventing players from being unbanned/revived at the scheduled time.
  • Reloading the plugin via initialize() did not recreate the GlobalReviveUnDeathBan runnable, so schedule/config changes from /ah reload were not applied.
  • Centralize lifecycle handling so the global revive scheduler is started/stopped deterministically and honors config changes.

Description

  • Changed GlobalReviveUnDeathBan.run() to compute the next run, load ServerData asynchronously, and then dispatch runGlobalReset back onto the Bukkit main thread with Bukkit.getScheduler().runTask(...).
  • Added explicit error handling/logging for async server-data load failures and exceptions thrown while executing reset logic on the main thread.
  • Moved creation/start of GlobalReviveUnDeathBan into initialize() and removed the duplicate startup from onEnable(), and now initialize() stops any existing instance before recreating it so /ah reload updates the schedule.
  • Adjusted logging so completion is logged after the actual reset work runs on the main thread.

Testing

  • Built the project successfully: mvn -q -DskipTests package (build completed without errors).

Codex Task

@Nergly Nergly merged commit 34c1b02 into master Apr 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant