本文整理汇总了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!");
}
示例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");
}
示例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);
}
示例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);
}
示例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());
}
}
}
示例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");
}
示例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);
}
示例8: EightInSevenCoremod
import org.spongepowered.asm.launch.MixinBootstrap; //导入依赖的package包/类
public EightInSevenCoremod() {
MixinBootstrap.init();
MixinEnvironment env = MixinEnvironment.getDefaultEnvironment();
env.addConfiguration("mixins.eightinseven.json");
}
示例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;
}
示例10: ForgeCoremod
import org.spongepowered.asm.launch.MixinBootstrap; //导入依赖的package包/类
public ForgeCoremod() {
MixinBootstrap.init();
MixinEnvironment.getCurrentEnvironment()
.addConfiguration("mixins.common.json")
.addConfiguration("mixins.forge.json");
}
示例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...");
}