Hotswapping: Difference between revisions

From ETM
Jump to navigation Jump to search
No edit summary
No edit summary
 
Line 1: Line 1:
'''Advanced, instant, auto detectable hot-swapping for minecraft / spigot / paper / plugins'''
'''Advanced, instant, auto detectable hot-swapping for minecraft / spigot / paper / plugins'''


== Setup ==
==Setup==


* Software needed:
*Software needed:
** https://github.com/JetBrains/JetBrainsRuntime/releases/
**https://github.com/JetBrains/JetBrainsRuntime/releases/
** http://hotswapagent.org/
**http://hotswapagent.org/
* Tools
*Tools
** SSH connection / tunnel setup
**SSH connection / tunnel setup
** Full IDE  
**Full IDE
** Reboot scripts
**Reboot scripts
** Deploy scripts
**Deploy scripts
*Automatic detection needs custom implementation dependent on plugin
**Based on Plugin-System from hotswapagent listening for @OnClassLoadEvent(classNameRegexp = ".*", events = REDEFINE)


== Conceptual ==
==Conceptual==


# Run & Deploy a plugin on a remote minecraft server
#Run & Deploy a plugin on a remote minecraft server
# Connect IDE to service
#Connect IDE to service
# Change code on the fly
#Change code on the fly
# See changes instantly after CTRL+S is pressed in the IDE for a given file
#See changes instantly after CTRL+S is pressed in the IDE for a given file


<br />
<br />


== Keep in mind ==
==Keep in mind==


* Hotswapagent does not always work
*Hotswapagent does not always work
* Anonymous classes cause cancer
*Anonymous classes cause cancer
* Running same versions essential
*Running same versions essential
* Make sure hotswap-agent-core.jar is in jbrsdk/lib/hotswap AND in mc-server libs
*Make sure hotswap-agent-core.jar is in jbrsdk/lib/hotswap AND in mc-server libs
* HOTSWAPAGENT='-XX:HotswapAgent=core'
*HOTSWAPAGENT='-XX:HotswapAgent=core'
* REDEFINITION='-XX:+AllowEnhancedClassRedefinition -XX:+AllowRedefinitionToAddDeleteMethods'
*REDEFINITION='-XX:+AllowEnhancedClassRedefinition -XX:+AllowRedefinitionToAddDeleteMethods'
* EXPERIMENTAL='--enable-preview -XX:+UnlockExperimentalVMOptions'
*EXPERIMENTAL='--enable-preview -XX:+UnlockExperimentalVMOptions'

Latest revision as of 18:06, 3 April 2023

Advanced, instant, auto detectable hot-swapping for minecraft / spigot / paper / plugins

Setup

Conceptual

  1. Run & Deploy a plugin on a remote minecraft server
  2. Connect IDE to service
  3. Change code on the fly
  4. 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'