File tree Expand file tree Collapse file tree 3 files changed +32
-3
lines changed
java/com/myname/mymodid/mixins Expand file tree Collapse file tree 3 files changed +32
-3
lines changed Original file line number Diff line number Diff line change @@ -74,21 +74,21 @@ apiPackage =
7474accessTransformersFile =
7575
7676# Provides setup for Mixins if enabled. If you don't know what mixins are: Keep it disabled!
77- usesMixins = false
77+ usesMixins = true
7878
7979# Set to a non-empty string to configure mixins in a separate source set under src/VALUE, instead of src/main.
8080# This can speed up compile times thanks to not running the mixin annotation processor on all input sources.
8181# Mixin classes will have access to "main" classes, but not the other way around.
8282separateMixinSourceSet =
8383
8484# Adds some debug arguments like verbose output and class export.
85- usesMixinDebug = false
85+ usesMixinDebug = true
8686
8787# Specify the location of your implementation of IMixinConfigPlugin. Leave it empty otherwise.
8888mixinPlugin =
8989
9090# Specify the package that contains all of your Mixins. You may only place Mixins in this package or the build will fail!
91- mixinsPackage =
91+ mixinsPackage = mixins
9292
9393# Specify the core mod entry class if you use a core mod. This class must implement IFMLLoadingPlugin!
9494# This parameter is for legacy compatibility only
Original file line number Diff line number Diff line change 1+ package com .myname .mymodid .mixins ;
2+
3+ import net .minecraft .client .Minecraft ;
4+
5+ import org .spongepowered .asm .mixin .Mixin ;
6+ import org .spongepowered .asm .mixin .injection .At ;
7+ import org .spongepowered .asm .mixin .injection .Inject ;
8+ import org .spongepowered .asm .mixin .injection .callback .CallbackInfo ;
9+
10+ @ Mixin (Minecraft .class ) // the class targeted by this mixin
11+ public class MixinMinecraft_Example { // This is an example you should delete this class
12+
13+ @ Inject (method = "startGame" , at = @ At ("TAIL" ))
14+ private void example$sayHello (CallbackInfo ci ) {
15+ // this line of code will be injected at the end of the method "startGame" in the Minecraft class
16+ System .out .println ("Example mod says Hello from within Minecraft.startGame()!" );
17+ }
18+ }
Original file line number Diff line number Diff line change 1+ {
2+ "required" : true ,
3+ "minVersion" : " 0.8.5-GTNH" ,
4+ "package" : " com.myname.mymodid.mixins" ,
5+ "refmap" : " mixins.mymodid.refmap.json" ,
6+ "target" : " @env(DEFAULT)" ,
7+ "compatibilityLevel" : " JAVA_8" ,
8+ "mixins" : [],
9+ "client" : [" MixinMinecraft_Example" ],
10+ "server" : []
11+ }
You can’t perform that action at this time.
0 commit comments