Skip to content
ID

Restart Flow

MF-AutoRestart uses a three-state restart flow:

IDLE -> COUNTDOWN -> COMMITTED

A restart can be cancelled only while it is in COUNTDOWN. Once it enters COMMITTED, the plugin continues to player handoff and the Paper restart request.

A countdown can start from:

  • an automatic daily or weekly schedule; or
  • /ar start [duration]; or
  • the public MFAutoRestartAPI#startRestart(...) method.

Before the countdown becomes active, AutoRestartStartEvent fires. It is cancellable.

At seconds listed in warning-intervals, every online player receives:

  • a chat message;
  • an action bar;
  • a title and subtitle.

Configured pre-restart-commands are executed at their exact countdown marks as console commands. %seconds% is replaced with the current remaining second value. A command failure is logged and does not abort the restart flow.

At 0 seconds:

  1. AutoRestartPreShutdownEvent fires.
  2. If the event is cancelled, the countdown returns to IDLE and the restart is recorded as ABORTED.
  3. Otherwise the restart becomes COMMITTED.
  4. Commands configured at countdown mark 0 run.
  5. Non-bypass players receive the redirect message and the BungeeCord-compatible Connect plugin message targeting settings.lobby-server.
  6. After settings.redirection-grace-period, any remaining non-bypass players are kicked with the fallback message.
  7. The restart is recorded as COMPLETED and the plugin calls Paper’s server restart API.

Players with mfautorestart.bypass are skipped by both the proxy redirect and the fallback kick.

/ar cancel and MFAutoRestartAPI#cancelRestart() only succeed during COUNTDOWN. A committed restart is not cancellable through this API.

After a successful cancellation, AutoRestartCancelEvent fires as a notification event. It is not cancellable.