Nuclear Option
Server administrators often find it awkward to constantly restart the server due to increasing lag issues. However, there are other challenges: players frequently ask for restarts, forcing the administrator to spend time even during rest or real-life activities.
This modification allows voting among participants to stop an overloaded server - while the administrator remains in an inconvenient position as players deal with server reboots after abuses like combining flying Pokemon with elytra, at least they can rest peacefully.
Functionality
Players enter the /nuke command to activate a vote for the nuclear option. When more than 50% of connected players support the restart, an irreversible 1-minute timer activates that stops the server with warnings to all participants. Importantly: currently it's impossible to safely restart the server through the mod - only stop it. For automatic restart, you'll need to configure a loop in the server launch script or similar solution.
Version 2.6
Fixed a bug that could cause the server to lose "democracy" if players voted for nukes and disconnected. Also resolved an issue with the welcome message not displaying. If you don't want a welcome message, it's recommended to update and leave the field blank in the configuration file.
Compatibility
The mod works server-side only. Client-side support may be added in the future for sound effects.
"Nuclear Option". The code is relatively simple, which can be useful for learning Scala in the Forge context.