aboutsummaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
authorDeDiamondPro <67508414+DeDiamondPro@users.noreply.github.com>2022-06-11 17:35:22 +0200
committerDeDiamondPro <67508414+DeDiamondPro@users.noreply.github.com>2022-06-11 17:35:22 +0200
commit56b13f7fbba5550a6c77966726ab414da85f0a9b (patch)
tree081a68367355d8cb97adfc126b7166aa8f184191 /src/main
parentcf240685916b3d19b66ba1493aba2d9f9a07d151 (diff)
downloadOneConfig-56b13f7fbba5550a6c77966726ab414da85f0a9b.tar.gz
OneConfig-56b13f7fbba5550a6c77966726ab414da85f0a9b.tar.bz2
OneConfig-56b13f7fbba5550a6c77966726ab414da85f0a9b.zip
loading plugin
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/cc/polyfrost/oneconfig/internal/plugin/LoadingPlugin.java11
1 files changed, 9 insertions, 2 deletions
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;
}