Skip to content

Commit

Permalink
apply mixin plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
Keriils committed Aug 6, 2024
1 parent 1acf6c0 commit 56af101
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 2 deletions.
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ apiPackage =
accessTransformersFile =

# Provides setup for Mixins if enabled. If you don't know what mixins are: Keep it disabled!
usesMixins = false
usesMixins = true

# Set to a non-empty string to configure mixins in a separate source set under src/VALUE, instead of src/main.
# This can speed up compile times thanks to not running the mixin annotation processor on all input sources.
Expand All @@ -88,7 +88,7 @@ usesMixinDebug = false
mixinPlugin =

# Specify the package that contains all of your Mixins. You may only place Mixins in this package or the build will fail!
mixinsPackage =
mixinsPackage = Mixins

# Specify the core mod entry class if you use a core mod. This class must implement IFMLLoadingPlugin!
# This parameter is for legacy compatibility only
Expand Down
46 changes: 46 additions & 0 deletions src/main/java/com/xir/NHUtilities/Mixins/MixinPlugin.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
package com.xir.NHUtilities.Mixins;

import java.util.List;
import java.util.Set;

import org.spongepowered.asm.lib.tree.ClassNode;
import org.spongepowered.asm.mixin.extensibility.IMixinConfigPlugin;
import org.spongepowered.asm.mixin.extensibility.IMixinInfo;

public class MixinPlugin implements IMixinConfigPlugin {

@Override
public void onLoad(String mixinPackage) {

}

@Override
public String getRefMapperConfig() {
return "";
}

@Override
public boolean shouldApplyMixin(String targetClassName, String mixinClassName) {
return false;
}

@Override
public void acceptTargets(Set<String> myTargets, Set<String> otherTargets) {

}

@Override
public List<String> getMixins() {
return List.of();
}

@Override
public void preApply(String s, ClassNode classNode, String s1, IMixinInfo iMixinInfo) {

}

@Override
public void postApply(String s, ClassNode classNode, String s1, IMixinInfo iMixinInfo) {

}
}
9 changes: 9 additions & 0 deletions src/main/resources/mixins.NHUtilities.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"required": true,
"minVersion": "0.8.5-GTNH",
"package": "com.xir.NHUtilities.Mixins",
"plugin": "com.xir.NHUtilities.Mixins.MixinPlugin",
"refmap": "mixins.NHUtilities.refmap.json",
"target": "@env(DEFAULT)",
"compatibilityLevel": "JAVA_8"
}

0 comments on commit 56af101

Please sign in to comment.