diff options
author | Wyvest <45589059+Wyvest@users.noreply.github.com> | 2022-05-21 17:50:43 +0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-21 12:50:43 +0200 |
commit | ba87b8b1fa4e2397a3e0ed5a18f7ea6137d42f77 (patch) | |
tree | a052e7ac963be0f64980fc3faa664ebf20a52b34 /src/main/java/cc/polyfrost/oneconfig/plugin/OneConfigMixinPlugin.java | |
parent | 1abe65dc3875df5a490d8c900399e61a378ae901 (diff) | |
download | OneConfig-ba87b8b1fa4e2397a3e0ed5a18f7ea6137d42f77.tar.gz OneConfig-ba87b8b1fa4e2397a3e0ed5a18f7ea6137d42f77.tar.bz2 OneConfig-ba87b8b1fa4e2397a3e0ed5a18f7ea6137d42f77.zip |
vigilance compat (#15)
* vigilance compat
reorganize ASM
* remove non-RenderManager nanovg usage wherever possible
fix build
generalize utils
* setupGradle task
* migrate to kotlin gradle
use essential gradle toolkit
shade new gson
* Small changes
* Update .gitignore
* fix natives
* Fix all problems
* null
Co-authored-by: DeDiamondPro <67508414+DeDiamondPro@users.noreply.github.com>
Diffstat (limited to 'src/main/java/cc/polyfrost/oneconfig/plugin/OneConfigMixinPlugin.java')
-rw-r--r-- | src/main/java/cc/polyfrost/oneconfig/plugin/OneConfigMixinPlugin.java | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/src/main/java/cc/polyfrost/oneconfig/plugin/OneConfigMixinPlugin.java b/src/main/java/cc/polyfrost/oneconfig/plugin/OneConfigMixinPlugin.java new file mode 100644 index 0000000..9ceacde --- /dev/null +++ b/src/main/java/cc/polyfrost/oneconfig/plugin/OneConfigMixinPlugin.java @@ -0,0 +1,51 @@ +package cc.polyfrost.oneconfig.plugin; + +import org.spongepowered.asm.lib.tree.ClassNode; +import org.spongepowered.asm.mixin.extensibility.IMixinConfigPlugin; +import org.spongepowered.asm.mixin.extensibility.IMixinInfo; + +import java.util.List; +import java.util.Set; + +public class OneConfigMixinPlugin implements IMixinConfigPlugin { + public static boolean isVigilance = false; + @Override + public void onLoad(String mixinPackage) { + try { + Class.forName("gg.essential.vigilance.Vigilant"); + isVigilance = true; + } catch (Exception e) { + isVigilance = false; + } + } + + @Override + public String getRefMapperConfig() { + return null; + } + + @Override + public boolean shouldApplyMixin(String targetClassName, String mixinClassName) { + return !targetClassName.contains("vigilance") || isVigilance; + } + + @Override + public void acceptTargets(Set<String> myTargets, Set<String> otherTargets) { + + } + + @Override + public List<String> getMixins() { + return null; + } + + @Override + public void preApply(String targetClassName, ClassNode targetClass, String mixinClassName, IMixinInfo mixinInfo) { + + } + + @Override + public void postApply(String targetClassName, ClassNode targetClass, String mixinClassName, IMixinInfo mixinInfo) { + + } +} |