Search in sources :

Example 1 with MixinEnvironment

use of org.spongepowered.asm.mixin.MixinEnvironment in project Hyperium by HyperiumClient.

the class HyperiumTweaker method injectIntoClassLoader.

@Override
public void injectIntoClassLoader(LaunchClassLoader classLoader) {
    Hyperium.LOGGER.info("[Addons] Loading Addons...");
    Hyperium.LOGGER.info("Initialising Bootstraps...");
    MixinBootstrap.init();
    AddonBootstrap.INSTANCE.init();
    Hyperium.LOGGER.info("Applying transformers...");
    MixinEnvironment environment = MixinEnvironment.getDefaultEnvironment();
    Mixins.addConfiguration("mixins.hyperium.json");
    if (isRunningOptifine) {
        // Switch's to notch mappings
        environment.setObfuscationContext("notch");
    }
    if (environment.getObfuscationContext() == null) {
        // Switch's to notch mappings
        environment.setObfuscationContext("notch");
    }
    try {
        classLoader.addURL(new File(System.getProperty("java.home"), "lib/ext/nashorn.jar").toURI().toURL());
    } catch (MalformedURLException e) {
        e.printStackTrace();
    }
    environment.setSide(MixinEnvironment.Side.CLIENT);
}
Also used : MixinEnvironment(org.spongepowered.asm.mixin.MixinEnvironment) MalformedURLException(java.net.MalformedURLException) File(java.io.File)

Aggregations

File (java.io.File)1 MalformedURLException (java.net.MalformedURLException)1 MixinEnvironment (org.spongepowered.asm.mixin.MixinEnvironment)1