本文整理汇总了Java中org.spongepowered.asm.mixin.Mixins类的典型用法代码示例。如果您正苦于以下问题:Java Mixins类的具体用法?Java Mixins怎么用?Java Mixins使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Mixins类属于org.spongepowered.asm.mixin包,在下文中一共展示了Mixins类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: OrionCore
import org.spongepowered.asm.mixin.Mixins; //导入依赖的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.Mixins; //导入依赖的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.Mixins; //导入依赖的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: registerMixinConfig
import org.spongepowered.asm.mixin.Mixins; //导入依赖的package包/类
@Override
public void registerMixinConfig(String mixinConfigName) {
Ensure.ensureCondition(MIXIN_NAME_PATTERN.matcher(mixinConfigName).matches(),
"Mixin configuration name '" + mixinConfigName + "' does not match pattern '" +
MIXIN_NAME_PATTERN + "'");
/* Check if mixin configuration with same name already exists, as people like to do dumb stuff... */
Ensure.ensureCondition(!orionCore.mixinConfigurations.contains(mixinConfigName),
"Mixin configuration with name '" + mixinConfigName + "' already exists!");
orionCore.mixinConfigurations.add(mixinConfigName);
Mixins.addConfiguration(mixinConfigName);
}
开发者ID:OrionMinecraft,项目名称:Orion,代码行数:14,代码来源:OrionAPIImpl.java
示例5: injectIntoClassLoader
import org.spongepowered.asm.mixin.Mixins; //导入依赖的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: BlockCraftCore
import org.spongepowered.asm.mixin.Mixins; //导入依赖的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
示例7: configureMixinEnvironment
import org.spongepowered.asm.mixin.Mixins; //导入依赖的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: call
import org.spongepowered.asm.mixin.Mixins; //导入依赖的package包/类
@Override
public Void call() throws Exception {
MixinBootstrap.init();
Mixins.addConfiguration("mixins.productionline.core.json");
return null;
}
开发者ID:GoodTimeStudio,项目名称:Production-Line,代码行数:7,代码来源:PLSetup.java
注:本文中的org.spongepowered.asm.mixin.Mixins类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论