aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--build.gradle.kts1
-rw-r--r--src/main/java/cc/polyfrost/oneconfig/internal/plugin/LoadingPlugin.java11
2 files changed, 9 insertions, 3 deletions
diff --git a/build.gradle.kts b/build.gradle.kts
index 9361919..6232699 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -236,7 +236,6 @@ tasks {
"ForceLoadAsMod" to true,
"TweakOrder" to "0",
"MixinConfigs" to "mixins.oneconfig.json",
- "FMLCorePlugin" to "cc.polyfrost.oneconfig.internal.plugin.LoadingPlugin",
"TweakClass" to "org.spongepowered.asm.launch.MixinTweaker",
"FMLCorePluginContainsFMLMod" to "lol"
)
diff --git a/src/main/java/cc/polyfrost/oneconfig/internal/plugin/LoadingPlugin.java b/src/main/java/cc/polyfrost/oneconfig/internal/plugin/LoadingPlugin.java
index 825dab8..7ab9d4c 100644
--- a/src/main/java/cc/polyfrost/oneconfig/internal/plugin/LoadingPlugin.java
+++ b/src/main/java/cc/polyfrost/oneconfig/internal/plugin/LoadingPlugin.java
@@ -4,18 +4,20 @@ import cc.polyfrost.oneconfig.internal.init.OneConfigInit;
import cc.polyfrost.oneconfig.internal.plugin.asm.ClassTransformer;
import net.minecraft.launchwrapper.Launch;
import net.minecraft.launchwrapper.LaunchClassLoader;
+import net.minecraftforge.fml.relauncher.IFMLLoadingPlugin;
import java.lang.reflect.Field;
import java.util.Map;
import java.util.Set;
-public class LoadingPlugin {
+public class LoadingPlugin implements IFMLLoadingPlugin {
/**
* Taken from LWJGLTwoPointFive under The Unlicense
* <a href="https://github.com/DJtheRedstoner/LWJGLTwoPointFive/blob/master/LICENSE/">https://github.com/DJtheRedstoner/LWJGLTwoPointFive/blob/master/LICENSE/</a>
*/
public LoadingPlugin() {
+ if (Launch.blackboard.containsKey("oneconfig.init.initialized")) return;
try {
Field f_exceptions = LaunchClassLoader.class.getDeclaredField("classLoaderExceptions");
f_exceptions.setAccessible(true);
@@ -28,23 +30,28 @@ public class LoadingPlugin {
}
}
+ @Override
public String[] getASMTransformerClass() {
+ if (Launch.blackboard.containsKey("oneconfig.init.registered_transformer")) return new String[]{};
Launch.blackboard.put("oneconfig.init.registered_transformer", true);
return new String[]{ClassTransformer.class.getName()};
}
+ @Override
public String getModContainerClass() {
return null;
}
+ @Override
public String getSetupClass() {
return null;
}
+ @Override
public void injectData(Map<String, Object> data) {
-
}
+ @Override
public String getAccessTransformerClass() {
return null;
}