当前位置: 首页>>代码示例>>Java>>正文


Java MixinBootstrap类代码示例

本文整理汇总了Java中org.spongepowered.asm.launch.MixinBootstrap的典型用法代码示例。如果您正苦于以下问题:Java MixinBootstrap类的具体用法?Java MixinBootstrap怎么用?Java MixinBootstrap使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


MixinBootstrap类属于org.spongepowered.asm.launch包,在下文中一共展示了MixinBootstrap类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: OrionCore

import org.spongepowered.asm.launch.MixinBootstrap; //导入依赖的package包/类
/**
 * Private constructor to set up Mixin loader
 */
private OrionCore() {
    launcherService = BlackboardKey.get(BlackboardKey.LAUNCHER_SERVICE);

    logger.debug("Detecting CraftBukkit version...");
    if((this.cbVersion = detectCBVersion()) == CBVersion.UNKNOWN) {
        logger.warn("Failed to detect CraftBukkit version.");
    } else {
        logger.debug("Detected CraftBukkit version {} (id {})", cbVersion.getName(), cbVersion.getId());
    }

    logger.debug("Setting up SpongeMixin library...");
    MixinBootstrap.init();

    logger.debug("Setting Mixin Environment side to SERVER");
    MixinEnvironment.getDefaultEnvironment().setSide(MixinEnvironment.Side.SERVER);

    logger.debug("Setting up Mixin error handler");
    Mixins.registerErrorHandlerClass(OrionMixinErrorHandler.class.getName());

    logger.debug("Setting up Mixin token provider");
    MixinEnvironment.getDefaultEnvironment().registerTokenProviderClass(OrionTokenProvider.class.getName());

    logger.debug("Mixin library initialization finished!");
}
 
开发者ID:OrionMinecraft,项目名称:Orion,代码行数:28,代码来源:OrionCore.java

示例2: injectIntoClassLoader

import org.spongepowered.asm.launch.MixinBootstrap; //导入依赖的package包/类
@Override
public void injectIntoClassLoader(LaunchClassLoader launchClassLoader) {
    MixinBootstrap.init();

    Mixins.addConfiguration("mixins.past.json");

    MixinEnvironment.getDefaultEnvironment()
            .setSide(MixinEnvironment.Side.CLIENT);

    MixinEnvironment.getDefaultEnvironment()
            .setOption(Option.DEBUG_EXPORT, true);

    //launchClassLoader.registerTransformer("net.gogume1er.past.transformer.PastClassTransformer");
}
 
开发者ID:Gogume1er,项目名称:Past-Client,代码行数:15,代码来源:PastTweaker.java

示例3: injectIntoClassLoader

import org.spongepowered.asm.launch.MixinBootstrap; //导入依赖的package包/类
@Override
public final void injectIntoClassLoader(LaunchClassLoader classLoader) {
    ClientAPI.LOGGER.log(Level.INFO, "Injecting into ClassLoader");

    // Register custom transformer
    classLoader.registerTransformer(ClientTransformer.class.getName());

    // Check if a ClientInfo JSON is present
    if (this.getClass().getResourceAsStream("/client.json") == null) {
        throw new ClientInitException("Unable to locate Client Configuration (client.json)");
    }

    // Initialize the Mixin Bootstrap
    MixinBootstrap.init();
    ClientAPI.LOGGER.log(Level.INFO, "Initialized Mixin bootstrap");

    // Load the ClientAPI mixin config
    String capi = "mixins.capi.json";
    if (this.getClass().getResourceAsStream("/" + capi) == null) {
        throw new ClientInitException("Unable to locate ClientAPI mixin configuration");
    }
    Mixins.addConfiguration(capi);
    ClientAPI.LOGGER.log(Level.INFO, "Loaded ClientAPI mixin configuration");

    // Optional mixin configuration, added by client developers
    String mixin = "mixins.client.json";
    if (this.getClass().getResourceAsStream("/" + mixin) != null) {
        Mixins.addConfiguration(mixin);
        ClientAPI.LOGGER.log(Level.INFO, "Loaded Client mixin configuration");
    }

    // Ensure that the mixins are only run on client side
    MixinEnvironment.getDefaultEnvironment().setSide(MixinEnvironment.Side.CLIENT);
}
 
开发者ID:ImpactDevelopment,项目名称:ClientAPI,代码行数:35,代码来源:ClientTweaker.java

示例4: injectIntoClassLoader

import org.spongepowered.asm.launch.MixinBootstrap; //导入依赖的package包/类
@Override
public void injectIntoClassLoader(LaunchClassLoader launchClassLoader) {
    launchClassLoader.addClassLoaderExclusion("org.apache.logging.log4j.");
    MixinBootstrap.init();

    Mixins.addConfiguration("mixins.serenity.core.json");
    MixinEnvironment.getDefaultEnvironment().setObfuscationContext("notch");
    MixinEnvironment.getDefaultEnvironment().setSide(MixinEnvironment.Side.CLIENT);
}
 
开发者ID:SerenityEnterprises,项目名称:SerenityCE,代码行数:10,代码来源:SerenityTweaker.java

示例5: BlockCraftCore

import org.spongepowered.asm.launch.MixinBootstrap; //导入依赖的package包/类
public BlockCraftCore() {
    MixinBootstrap.init();

    try {
        Mixins.addConfiguration("mixins.blockcraft.json");
    } catch(Throwable t) {
        t.printStackTrace();
        ClassLoader cl = this.getClass().getClassLoader();
        URL[] urls = ((URLClassLoader)cl).getURLs();
        for(URL url: urls){
            System.out.println(url.getFile());
        }
    }
}
 
开发者ID:me4502,项目名称:BlockCraft,代码行数:15,代码来源:BlockCraftCore.java

示例6: ThaumicSpongeCoreMod

import org.spongepowered.asm.launch.MixinBootstrap; //导入依赖的package包/类
public ThaumicSpongeCoreMod() {
    // Let's get this party started
    MixinBootstrap.init();
    MixinEnvironment.setCompatibilityLevel(JAVA_8);

    // Register common mixin configurations
    MixinEnvironment.getDefaultEnvironment()
            .addConfiguration("mixins.thaumicsponge.api.json")
            .addConfiguration("mixins.thaumicsponge.core.json")
            .addConfiguration("mixins.thaumicsponge.sponge.json");

}
 
开发者ID:gabizou,项目名称:ThaumicSponge,代码行数:13,代码来源:ThaumicSpongeCoreMod.java

示例7: configureMixinEnvironment

import org.spongepowered.asm.launch.MixinBootstrap; //导入依赖的package包/类
private static void configureMixinEnvironment() {
    log.debug("Initialising Mixin environment...");
    MixinBootstrap.init();
    Mixins.addConfigurations(
            "mixins.vanilla.bungee.json",
            "mixins.vanilla.core.json",
            "mixins.vanilla.perf.json");
    MixinEnvironment.getDefaultEnvironment().setSide(SERVER);
}
 
开发者ID:NeptunePowered,项目名称:NeptuneMod,代码行数:10,代码来源:NeptuneServerTweaker.java

示例8: EightInSevenCoremod

import org.spongepowered.asm.launch.MixinBootstrap; //导入依赖的package包/类
public EightInSevenCoremod() {
    MixinBootstrap.init();
    MixinEnvironment env = MixinEnvironment.getDefaultEnvironment();
    env.addConfiguration("mixins.eightinseven.json");
}
 
开发者ID:CannibalVox,项目名称:EightInSeven,代码行数:6,代码来源:EightInSevenCoremod.java

示例9: call

import org.spongepowered.asm.launch.MixinBootstrap; //导入依赖的package包/类
@Override
public Void call() throws Exception {
    MixinBootstrap.init();
    Mixins.addConfiguration("mixins.productionline.core.json");
    return null;
}
 
开发者ID:GoodTimeStudio,项目名称:Production-Line,代码行数:7,代码来源:PLSetup.java

示例10: ForgeCoremod

import org.spongepowered.asm.launch.MixinBootstrap; //导入依赖的package包/类
public ForgeCoremod() {
    MixinBootstrap.init();
    MixinEnvironment.getCurrentEnvironment()
            .addConfiguration("mixins.common.json")
            .addConfiguration("mixins.forge.json");
}
 
开发者ID:NeptunePowered,项目名称:NeptuneForge,代码行数:7,代码来源:ForgeCoremod.java

示例11: injectIntoClassLoader

import org.spongepowered.asm.launch.MixinBootstrap; //导入依赖的package包/类
@Override
public void injectIntoClassLoader(LaunchClassLoader loader) {
    logger.info("Initializing nailed");

    loader.addClassLoaderExclusion("scala.");
    loader.addClassLoaderExclusion("LZMA.");
    loader.addClassLoaderExclusion("com.google.");
    loader.addClassLoaderExclusion("com.nothome.delta.");
    loader.addClassLoaderExclusion("org.apache.");
    loader.addClassLoaderExclusion("com.mojang.");
    loader.addClassLoaderExclusion("org.fusesource.");
    loader.addClassLoaderExclusion("io.netty.");
    loader.addClassLoaderExclusion("gnu.trove.");
    loader.addClassLoaderExclusion("joptsimple.");
    loader.addClassLoaderExclusion("jk_5.nailed.server.mixin.");
    loader.addClassLoaderExclusion("jk_5.nailed.launch.");
    loader.addClassLoaderExclusion("jk_5.nailed.server.tweaker.");
    loader.addClassLoaderExclusion("org.spongepowered.tools.");

    BinPatchManager.instance().setup();

    loader.registerTransformer("jk_5.nailed.server.tweaker.transformer.PatchingTransformer");
    loader.registerTransformer("jk_5.nailed.server.tweaker.transformer.EventSubscriptionTransformer");

    logger.info("Applying runtime deobfuscation...");
    if(isObfuscated()){
        Launch.blackboard.put("nailed.deobf-srg", Paths.get("bin", "deobf.srg.gz"));
        loader.registerTransformer("jk_5.nailed.launch.transformers.DeobfuscationTransformer");
        logger.info("Runtime deobfuscation is applied.");
    } else {
        logger.info("Runtime deobfuscation was not applied. Nailed is being loaded in a deobfuscated environment.");
    }

    logger.info("Applying access transformer...");
    Launch.blackboard.put("nailed.at", "nailed_at.cfg");
    loader.registerTransformer("jk_5.nailed.launch.transformers.AccessTransformer");

    logger.info("Initializing Mixin environment...");
    MixinBootstrap.init();
    MixinEnvironment env = MixinEnvironment.getCurrentEnvironment();
    env.addConfiguration("mixins.nailed.core.json");
    env.setSide(MixinEnvironment.Side.SERVER);
    loader.registerTransformer(MixinBootstrap.TRANSFORMER_CLASS);

    logger.info("Initialization finished. Starting Minecraft server...");
}
 
开发者ID:nailed,项目名称:nailed,代码行数:47,代码来源:ServerTweaker.java


注:本文中的org.spongepowered.asm.launch.MixinBootstrap类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。