Restart Flow
Overview
Section titled “Overview”MF-AutoRestart uses a three-state restart flow:
IDLE -> COUNTDOWN -> COMMITTEDA 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.
Starting a Countdown
Section titled “Starting a Countdown”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.
Countdown Warnings
Section titled “Countdown Warnings”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.
Terminal Boundary
Section titled “Terminal Boundary”At 0 seconds:
AutoRestartPreShutdownEventfires.- If the event is cancelled, the countdown returns to
IDLEand the restart is recorded asABORTED. - Otherwise the restart becomes
COMMITTED. - Commands configured at countdown mark
0run. - Non-bypass players receive the redirect message and the BungeeCord-compatible
Connectplugin message targetingsettings.lobby-server. - After
settings.redirection-grace-period, any remaining non-bypass players are kicked with the fallback message. - The restart is recorded as
COMPLETEDand the plugin calls Paper’s server restart API.
Players with mfautorestart.bypass are skipped by both the proxy redirect and the fallback kick.
Cancellation
Section titled “Cancellation”/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.