š HyRestart - Automatic Server Restart Plugin
A comprehensive and configurable automatic restart plugin for Hytale servers with Discord integration and customizable warning messages.
š Why?
Server stability is crucial for multiplayer games. Regular restarts help maintain performance, clear memory leaks, and apply updates. HyRestart automates this process with:
- Scheduled restarts at configurable times
- Progressive player warnings before restarts
- Discord webhook notifications
- Fully customizable messages
Whether you're running a small community server or a large Hytale network, HyRestart ensures smooth, predictable server maintenance without surprising your players!
⨠Features
š Scheduled Restarts
- Configure multiple daily restart times (24-hour format)
- Configurable restart threshold and delays
ā ļø Player Warnings
- Customizable warning intervals (30min, 15min, 5min, 1min by default)
- Broadcast messages to all online players
- Configurable warning messages with placeholders
š Discord Integration
- Rich embed notifications via webhooks
- Customizable embed titles, descriptions, and colors
- Separate messages for warnings and final restart
- Time placeholder support
š§ Fully Configurable
- All messages configurable in
config.yml - System log messages customizable
- Warning intervals and messages
- Discord webhook settings
- Easy to translate to any language
š„ Installation
1ļøā£ Download the plugin
# Download HyRestart-1.0-SNAPSHOT.jar from releases
2ļøā£ Install on your server
# Place the JAR in your mods folder
cp HyRestart-1.0-SNAPSHOT.jar /path/to/hytale/mods/
3ļøā£ Start your server
The plugin will automatically create a default config.yml in mods/HyRestart/
4ļøā£ Configure your settings
Edit mods/HyRestart/config.yml to customize restart times, messages, and Discord integration
āļø Configuration
Basic Configuration
# Restart times (24h format: HH:mm)
restartTimes:
- "03:00"
- "09:00"
- "15:00"
- "21:00"
# Cooldown after a restart to prevent immediate re-restart loops (seconds)
restartCooldownSeconds: 60
# Final restart message
finalRestartMessage: "[Restart] Restarting server NOW!"
Warning Configuration
# Restart warnings
warnings:
- seconds: 1800 # 30 minutes
message: "[Restart] The server will restart in 30 minutes."
discordTime: "30 minutes"
- seconds: 900 # 15 minutes
message: "[Restart] The server will restart in 15 minutes."
discordTime: "15 minutes"
- seconds: 300 # 5 minutes
message: "[Restart] The server will restart in 5 minutes. Get ready!"
discordTime: "5 minutes"
- seconds: 60 # 1 minute
message: "[Restart] The server will restart in 1 minute. DISCONNECT NOW!"
discordTime: "1 minute"
Discord Integration
discord:
enabled: true
webhookUrl: "https://discord.com/api/webhooks/YOUR_WEBHOOK_URL"
embedTitle: "š Server Restart"
embedDescription: "The server will restart in **{time}**.\n\nPlease save your progress and disconnect."
embedColor: 16711680 # Red color in decimal
finalEmbedTitle: "ā ļø SERVER RESTARTING"
finalEmbedDescription: "The server is restarting NOW.\n\nThe server will be back in a few minutes."
šÆ Placeholder System
HyRestart supports placeholders in messages for dynamic content:
{time}- Restart time or time remaining{count}- Number of players{message}- Message content{error}- Error details{username}- Player username{code}- Response code{discordTime}- Human-readable time for Discord
Example:
broadcastingToPlayers: "[HyRestart] Broadcasting to {count} players: {message}"
š Building from Source
1ļøā£ Clone the repository
git clone https://github.com/alesixdev/HyRestart.git
cd HyRestart
2ļøā£ Add libraries
Add HytaleServer.jar on libraries
3ļøā£ Build with Gradle
./gradlew clean build
4ļøā£ Ready!
# The built plugin will be at:
build/libs/HyRestart-1.0-SNAPSHOT.jar
š§ Development
Project Structure:
HyRestart/
āāā src/main/
ā āāā java/dev/alesixdev/hyrestart/
ā ā āāā HyRestartPlugin.java # Main plugin entry
ā ā āāā config/
ā ā ā āāā ConfigManager.java # Config loading/saving
ā ā ā āāā ConfigData.java # Config data model
ā ā ā āāā WarningConfig.java # Warning data model
ā ā āāā scheduler/
ā ā ā āāā RestartScheduler.java # Restart logic
ā ā āāā utils/
ā ā āāā DiscordWebhook.java # Discord integration
ā āāā resources/
ā āāā config.yml # Default configuration
ā āāā manifest.json # Plugin manifest
āāā build.gradle # Build configuration
āāā README.md
š Support
- Issues: GitHub Issues
š License
Licensed under the MIT License. Use, modify, and redistribute freely.
