User Tools

Site Tools


tutorial:mixin_hotswaps

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
tutorial:mixin_hotswaps [2019/10/24 21:42] – created draylartutorial:mixin_hotswaps [2025/04/11 13:23] (current) – Fix punctuation cph101
Line 2: Line 2:
 Mixins can't be hot-swapped in a default Fabric environment. To enable this functionality, you'll have to specify the ''-javaagent'' flag inside your VM options.   Mixins can't be hot-swapped in a default Fabric environment. To enable this functionality, you'll have to specify the ''-javaagent'' flag inside your VM options.  
  
-The only thing you'll need for step 1 is the sponge mixin jar. Fabric pulls this by default, so you should be able to locate it within your Gradle cache folder. IDEA users can look at the bottom of their project view on the left side of the screen to find the library:+The only pre-requisite is having a copy of the sponge mixin jar. Fabric pulls this by default, so you should be able to locate it within your Gradle cache folder. IDEA users can look at the bottom of their project view on the left side of the screen to find the library:
  
 {{https://i.imgur.com/fUrhss5.png}} {{https://i.imgur.com/fUrhss5.png}}
  
-Copy the full path to the jar and open up your run configurations. Under ''Minecraft Client'', expand the VM options tab. You'll need to set the ''-javaagent'' flag to the path of the mixin jar:+Copy the full path to the jar and open up your run configurations. Under ''Minecraft Client'', expand the VM options tab. You'll need to set the ''-javaagent'' flag to the path of the mixin jar
 + 
 +Optionally, you can add the ''-XX:+AllowEnhancedClassRedefinition'' flag to enable parameters to be changed, and fields or methods to be added/removed:
  
 {{https://i.imgur.com/SuW9MlV.png}} {{https://i.imgur.com/SuW9MlV.png}}
  
-Run your game. You can now reload mixins using the same rules as normal+You can do these things if you also add the ''-XX:+AllowEnhancedClassRedefinition'' VM option. 
- - no adding or removing methods + 
- - no changing method parameters +To recompile your mixin in IntelliJ, use the ''Recompile'' option in the ''Build'' menu. The default keybind for this is ''Ctrl+Shift+F9''. 
- - no adding or removing fields+ 
 +=== Notes ====
  
-=== Notes === +DCEVM does not officially support mixin swapping: 
-In my experience, Mixin hot-swapping didn't fully work until I updated to JDK 1.8.0 231 (latest).+  * When run on Java 1.8:181DCEVM and Mixin reloads do not work. 
 +  * When run on DCEVM Java 11, you can reload, but the hot swap task freezes. 
 +  * When run on JetBrains Runtime's Java 17 fork (with DCEVM), Mixin hotswapping and DCEVM work properly.
  
  
tutorial/mixin_hotswaps.1571953378.txt.gz · Last modified: 2019/10/24 21:42 by draylar