Hotswapping
Advanced, instant, auto detectable hot-swapping for minecraft / spigot / paper / plugins
Setup
- Software needed:
- Tools
- SSH connection / tunnel setup
- Full IDE
- Reboot scripts
- Deploy scripts
- Automatic detection needs custom implementation dependent on plugin
- Based on Plugin-System from hotswapagent listening for @OnClassLoadEvent(classNameRegexp = ".*", events = REDEFINE)
Conceptual
- Run & Deploy a plugin on a remote minecraft server
- Connect IDE to service
- Change code on the fly
- See changes instantly after CTRL+S is pressed in the IDE for a given file
Keep in mind
- Hotswapagent does not always work
- Anonymous classes cause cancer
- Running same versions essential
- Make sure hotswap-agent-core.jar is in jbrsdk/lib/hotswap AND in mc-server libs
- HOTSWAPAGENT='-XX:HotswapAgent=core'
- REDEFINITION='-XX:+AllowEnhancedClassRedefinition -XX:+AllowRedefinitionToAddDeleteMethods'
- EXPERIMENTAL='--enable-preview -XX:+UnlockExperimentalVMOptions'