diff options
Diffstat (limited to 'src/main/java/cc/polyfrost/oneconfig/plugin')
-rw-r--r-- | src/main/java/cc/polyfrost/oneconfig/plugin/OneConfigMixinPlugin.java | 2 | ||||
-rw-r--r-- | src/main/java/cc/polyfrost/oneconfig/plugin/asm/tweakers/VigilantTransformer.java | 28 |
2 files changed, 14 insertions, 16 deletions
diff --git a/src/main/java/cc/polyfrost/oneconfig/plugin/OneConfigMixinPlugin.java b/src/main/java/cc/polyfrost/oneconfig/plugin/OneConfigMixinPlugin.java index f5cac15..951e942 100644 --- a/src/main/java/cc/polyfrost/oneconfig/plugin/OneConfigMixinPlugin.java +++ b/src/main/java/cc/polyfrost/oneconfig/plugin/OneConfigMixinPlugin.java @@ -1,6 +1,5 @@ package cc.polyfrost.oneconfig.plugin; -import cc.polyfrost.oneconfig.libs.mixinextras.MixinExtrasBootstrap; import org.spongepowered.asm.lib.tree.ClassNode; import org.spongepowered.asm.mixin.extensibility.IMixinConfigPlugin; import org.spongepowered.asm.mixin.extensibility.IMixinInfo; @@ -13,7 +12,6 @@ public class OneConfigMixinPlugin implements IMixinConfigPlugin { @Override public void onLoad(String mixinPackage) { - MixinExtrasBootstrap.init(); try { Class.forName("gg.essential.vigilance.Vigilant"); isVigilance = true; diff --git a/src/main/java/cc/polyfrost/oneconfig/plugin/asm/tweakers/VigilantTransformer.java b/src/main/java/cc/polyfrost/oneconfig/plugin/asm/tweakers/VigilantTransformer.java index fecdeed..29cf2fd 100644 --- a/src/main/java/cc/polyfrost/oneconfig/plugin/asm/tweakers/VigilantTransformer.java +++ b/src/main/java/cc/polyfrost/oneconfig/plugin/asm/tweakers/VigilantTransformer.java @@ -16,6 +16,20 @@ import org.objectweb.asm.tree.*; import java.io.File; public class VigilantTransformer implements ITransformer { + @SuppressWarnings("unused") + public static VigilanceConfig returnNewConfig(Vigilant vigilant, File file) { + if (vigilant != null && Minecraft.getMinecraft().isCallingFromMinecraftThread()) { + String name = !vigilant.getGuiTitle().equals("Settings") ? vigilant.getGuiTitle() : Loader.instance().activeModContainer() == null ? "Unknown" : Loader.instance().activeModContainer().getName(); + if (name.equals("OneConfig")) name = "Essential"; + String finalName = name; + // duplicate fix + if (ConfigCore.oneConfigMods.stream().anyMatch(mod -> mod.name.equals(finalName))) return null; + return new VigilanceConfig(new Mod(name, ModType.THIRD_PARTY), file.getAbsolutePath(), vigilant); + } else { + return null; + } + } + @Override public String[] getClassName() { return new String[]{"gg.essential.vigilance.Vigilant"}; @@ -88,18 +102,4 @@ public class VigilantTransformer implements ITransformer { } } } - - @SuppressWarnings("unused") - public static VigilanceConfig returnNewConfig(Vigilant vigilant, File file) { - if (vigilant != null && Minecraft.getMinecraft().isCallingFromMinecraftThread()) { - String name = !vigilant.getGuiTitle().equals("Settings") ? vigilant.getGuiTitle() : Loader.instance().activeModContainer() == null ? "Unknown" : Loader.instance().activeModContainer().getName(); - if (name.equals("OneConfig")) name = "Essential"; - String finalName = name; - // duplicate fix - if (ConfigCore.oneConfigMods.stream().anyMatch(mod -> mod.name.equals(finalName))) return null; - return new VigilanceConfig(new Mod(name, ModType.THIRD_PARTY), file.getAbsolutePath(), vigilant); - } else { - return null; - } - } } |