package cc.polyfrost.oneconfig.plugin;
import cc.polyfrost.oneconfig.init.OneConfigInit;
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 implements IFMLLoadingPlugin {
/**
* Taken from LWJGLTwoPointFive under The Unlicense
* https://github.com/DJtheRedstoner/LWJGLTwoPointFive/blob/master/LICENSE/
*/
public LoadingPlugin() {
try {
Field f_exceptions = LaunchClassLoader.class.getDeclaredField("classLoaderExceptions");
f_exceptions.setAccessible(true);
Set exceptions = (Set) f_exceptions.get(Launch.classLoader);
exceptions.remove("org.lwjgl.");
OneConfigInit.initialize(new String[]{});
} catch (Exception e) {
throw new RuntimeException("e");
}
}
@Override
public String[] getASMTransformerClass() {
return new String[]{"cc.polyfrost.oneconfig.plugin.asm.ClassTransformer"};
}
@Override
public String getModContainerClass() {
return null;
}
@Override
public String getSetupClass() {
return null;
}
@Override
public void injectData(Map data) {
}
@Override
public String getAccessTransformerClass() {
return null;
}
}