mirror of
https://github.com/mii443/minecraft-scala-plugin-template.git
synced 2025-08-22 16:05:37 +00:00
Add hot reload functionality to development script
- Add 'reload' command for quick plugin updates - Plugin files are copied to running server without restart - Manual /reload command required in server console - Safer alternative to full restart for development 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@ -59,6 +59,15 @@ case "${1:-start}" in
|
||||
echo "💡 To detach: Press Ctrl+P then Ctrl+Q"
|
||||
docker attach minecraft-dev-server
|
||||
;;
|
||||
"reload")
|
||||
echo "🔄 Hot reloading plugin..."
|
||||
build_plugin
|
||||
echo "📦 Copying plugin to server..."
|
||||
docker cp target/scala-2.13/minecraft-scala-plugin_2.13-1.0.0.jar minecraft-dev-server:/minecraft/plugins/minecraft-scala-plugin.jar
|
||||
echo "🔌 Reloading plugins in server..."
|
||||
docker exec minecraft-dev-server bash -c 'echo "reload" > /tmp/reload_cmd' || echo "⚠️ Use '/reload' command in server console for hot reload"
|
||||
echo "✅ Plugin copied! Use '/reload' in server console to apply changes"
|
||||
;;
|
||||
"rebuild")
|
||||
echo "🔨 Rebuilding everything..."
|
||||
build_plugin
|
||||
@ -68,7 +77,7 @@ case "${1:-start}" in
|
||||
echo "✅ Complete rebuild finished!"
|
||||
;;
|
||||
*)
|
||||
echo "Usage: $0 {start|stop|restart|logs|console|attach|rebuild}"
|
||||
echo "Usage: $0 {start|stop|restart|logs|console|attach|reload|rebuild}"
|
||||
echo ""
|
||||
echo "Commands:"
|
||||
echo " start - Build plugin and start server"
|
||||
@ -77,6 +86,7 @@ case "${1:-start}" in
|
||||
echo " logs - View server logs"
|
||||
echo " console - Connect to server console (bash)"
|
||||
echo " attach - Attach to Minecraft server console"
|
||||
echo " reload - Hot reload plugin (requires manual /reload)"
|
||||
echo " rebuild - Complete rebuild (server + plugin)"
|
||||
exit 1
|
||||
;;
|
||||
|
Reference in New Issue
Block a user