本文整理汇总了Java中org.spongepowered.asm.mixin.MixinEnvironment类的典型用法代码示例。如果您正苦于以下问题:Java MixinEnvironment类的具体用法?Java MixinEnvironment怎么用?Java MixinEnvironment使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
MixinEnvironment类属于org.spongepowered.asm.mixin包,在下文中一共展示了MixinEnvironment类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: OrionCore
import org.spongepowered.asm.mixin.MixinEnvironment; //导入依赖的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.mixin.MixinEnvironment; //导入依赖的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.mixin.MixinEnvironment; //导入依赖的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: getToken
import org.spongepowered.asm.mixin.MixinEnvironment; //导入依赖的package包/类
@Override
public Integer getToken(String token, MixinEnvironment env) {
if(token.equals("CB_VERSION"))
return OrionCore.INSTANCE.getCBVersion().getId();
return null;
}
开发者ID:OrionMinecraft,项目名称:Orion,代码行数:8,代码来源:OrionTokenProvider.java
示例5: injectIntoClassLoader
import org.spongepowered.asm.mixin.MixinEnvironment; //导入依赖的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
示例6: ThaumicSpongeCoreMod
import org.spongepowered.asm.mixin.MixinEnvironment; //导入依赖的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: injectData
import org.spongepowered.asm.mixin.MixinEnvironment; //导入依赖的package包/类
@Override
public void injectData(Map<String, Object> data) {
System.out.println("Loading " + NAME + " mixins...");
// Add default mixins
// The path is CASE SENSITIVE, so be careful
MixinEnvironment.getDefaultEnvironment().addConfiguration(
"mixins." + NAME.toLowerCase() + ".json");
}
开发者ID:Cybermaxke,项目名称:Weathers,代码行数:10,代码来源:WeathersCore.java
示例8: configureMixinEnvironment
import org.spongepowered.asm.mixin.MixinEnvironment; //导入依赖的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
示例9: onLoad
import org.spongepowered.asm.mixin.MixinEnvironment; //导入依赖的package包/类
@Override
public void onLoad(String mixinPackage) {
MixinEnvironment.setCompatibilityLevel(MixinEnvironment.CompatibilityLevel.JAVA_8);
}
开发者ID:Cybermaxke,项目名称:LiteSpongeClient,代码行数:5,代码来源:SpongeClientMixinPlugin.java
示例10: EightInSevenCoremod
import org.spongepowered.asm.mixin.MixinEnvironment; //导入依赖的package包/类
public EightInSevenCoremod() {
MixinBootstrap.init();
MixinEnvironment env = MixinEnvironment.getDefaultEnvironment();
env.addConfiguration("mixins.eightinseven.json");
}
开发者ID:CannibalVox,项目名称:EightInSeven,代码行数:6,代码来源:EightInSevenCoremod.java
示例11: ForgeCoremod
import org.spongepowered.asm.mixin.MixinEnvironment; //导入依赖的package包/类
public ForgeCoremod() {
MixinBootstrap.init();
MixinEnvironment.getCurrentEnvironment()
.addConfiguration("mixins.common.json")
.addConfiguration("mixins.forge.json");
}
开发者ID:NeptunePowered,项目名称:NeptuneForge,代码行数:7,代码来源:ForgeCoremod.java
示例12: injectIntoClassLoader
import org.spongepowered.asm.mixin.MixinEnvironment; //导入依赖的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.mixin.MixinEnvironment类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论