aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/io/polyfrost/oneconfig/lwjgl/plugin/LoadingPlugin.java
diff options
context:
space:
mode:
authorWyvest <45589059+Wyvest@users.noreply.github.com>2022-04-15 18:20:30 +0900
committerWyvest <45589059+Wyvest@users.noreply.github.com>2022-04-15 18:20:30 +0900
commit30df3e578cef533cacedf737449bbd35d4ea5d11 (patch)
tree8463196ec6ffe0162cbb636189f4e373b8a81d72 /src/main/java/io/polyfrost/oneconfig/lwjgl/plugin/LoadingPlugin.java
parentddca3a3232eff15a7130efda03e7e5c408554412 (diff)
downloadOneConfig-30df3e578cef533cacedf737449bbd35d4ea5d11.tar.gz
OneConfig-30df3e578cef533cacedf737449bbd35d4ea5d11.tar.bz2
OneConfig-30df3e578cef533cacedf737449bbd35d4ea5d11.zip
fix shadow and add nanovg support
Diffstat (limited to 'src/main/java/io/polyfrost/oneconfig/lwjgl/plugin/LoadingPlugin.java')
-rw-r--r--src/main/java/io/polyfrost/oneconfig/lwjgl/plugin/LoadingPlugin.java52
1 files changed, 52 insertions, 0 deletions
diff --git a/src/main/java/io/polyfrost/oneconfig/lwjgl/plugin/LoadingPlugin.java b/src/main/java/io/polyfrost/oneconfig/lwjgl/plugin/LoadingPlugin.java
new file mode 100644
index 0000000..1f48135
--- /dev/null
+++ b/src/main/java/io/polyfrost/oneconfig/lwjgl/plugin/LoadingPlugin.java
@@ -0,0 +1,52 @@
+package io.polyfrost.oneconfig.lwjgl.plugin;
+
+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;
+
+/**
+ * Taken from LWJGLTwoPointFive under The Unlicense
+ * https://github.com/DJtheRedstoner/LWJGLTwoPointFive/blob/master/LICENSE/
+ */
+public class LoadingPlugin implements IFMLLoadingPlugin {
+
+ public LoadingPlugin() {
+ try {
+ Field f_exceptions = LaunchClassLoader.class.getDeclaredField("classLoaderExceptions");
+ f_exceptions.setAccessible(true);
+ Set<String> exceptions = (Set<String>) f_exceptions.get(Launch.classLoader);
+ exceptions.remove("org.lwjgl.");
+ } catch (Exception e) {
+ throw new RuntimeException("e");
+ }
+ }
+
+ @Override
+ public String[] getASMTransformerClass() {
+ return new String[]{"io.polyfrost.oneconfig.lwjgl.plugin.ClassTransformer"};
+ }
+
+ @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;
+ }
+} \ No newline at end of file