本文整理匯總了Java中net.minecraft.launchwrapper.LaunchClassLoader.addTransformerExclusion方法的典型用法代碼示例。如果您正苦於以下問題:Java LaunchClassLoader.addTransformerExclusion方法的具體用法?Java LaunchClassLoader.addTransformerExclusion怎麽用?Java LaunchClassLoader.addTransformerExclusion使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類net.minecraft.launchwrapper.LaunchClassLoader
的用法示例。
在下文中一共展示了LaunchClassLoader.addTransformerExclusion方法的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: call
import net.minecraft.launchwrapper.LaunchClassLoader; //導入方法依賴的package包/類
@Override
public Void call() throws Exception {
AlchemyThrowables.checkThrowables();
logger.info("Setup: " + AlchemySetup.class.getName());
LaunchClassLoader loader = AlchemyEngine.getLaunchClassLoader();
// Support for optifine in a development environment
if (!AlchemyEngine.isRuntimeDeobfuscationEnabled())
if (AlchemyEngine.runtimeSide().isClient())
TransformerInjectOptifine.tryInject(loader);
// Injection is used to modify the at(AccessTransformer) logic of forge
// See build.gradle#L73 & ast.gradle
injectAccessTransformer(AlchemyEngine.getAlchemyCoreLocation(), loader);
// Should not be transformer javafx
loader.addTransformerExclusion("javafx.");
// An extension to net.minecraftforge.fml.common.asm.transformers.SideTransformer when transformer Alchemy's class
TransformerSide.inject(loader);
// Init DLC main class
AlchemyDLCLoader.stream().forEach(IDLCInfo::clinitDLCMainClass);
// Debug info
List<IClassTransformer> transformers = $(loader, "transformers");
AlchemyTransformerManager.logger.info(Joiner.on('\n').appendTo(new StringBuilder("Transformers: \n"), transformers).toString());
return Tool.VOID;
}
示例2: configureLaunchClassLoader
import net.minecraft.launchwrapper.LaunchClassLoader; //導入方法依賴的package包/類
private static void configureLaunchClassLoader(final LaunchClassLoader loader) {
// Logging
loader.addClassLoaderExclusion("org.slf4j.");
loader.addClassLoaderExclusion("org.jline.");
loader.addClassLoaderExclusion("com.sun.");
loader.addClassLoaderExclusion("com.mojang.util.QueueLogAppender");
// Neptune Launch
loader.addClassLoaderExclusion("com.google.common.");
loader.addClassLoaderExclusion("org.neptunepowered.vanilla.launch.");
// Don't allow transforming libraries
loader.addTransformerExclusion("com.google.");
loader.addTransformerExclusion("org.apache.");
loader.addTransformerExclusion("joptsimple.");
loader.addTransformerExclusion("io.netty.");
loader.addTransformerExclusion("it.unimi.dsi.fastutil.");
loader.addTransformerExclusion("com.github.benmanes.caffeine.");
loader.addTransformerExclusion("net.visualillusionsent.utils.");
// Add a transformer exclusion for translator so we can get the JAR path from it
loader.addTransformerExclusion("net.canarymod.Translator");
}
示例3: injectIntoClassLoader
import net.minecraft.launchwrapper.LaunchClassLoader; //導入方法依賴的package包/類
@Override
public void injectIntoClassLoader(LaunchClassLoader classLoader)
{
classLoader.addClassLoaderExclusion("org.apache.");
classLoader.addClassLoaderExclusion("com.google.common.");
classLoader.addTransformerExclusion("cpw.mods.fml.repackage.");
classLoader.addTransformerExclusion("cpw.mods.fml.relauncher.");
classLoader.addTransformerExclusion("cpw.mods.fml.common.asm.transformers.");
classLoader.addClassLoaderExclusion("LZMA.");
FMLLaunchHandler.configureForClientLaunch(classLoader, this);
FMLLaunchHandler.appendCoreMods();
}
示例4: injectIntoClassLoader
import net.minecraft.launchwrapper.LaunchClassLoader; //導入方法依賴的package包/類
@Override
public void injectIntoClassLoader(LaunchClassLoader classLoader)
{
// The mojang packages are excluded so the log4j2 queue is correctly visible from
// the obfuscated and deobfuscated parts of the code. Without, the UI won't show anything
classLoader.addClassLoaderExclusion("com.mojang.");
classLoader.addTransformerExclusion("cpw.mods.fml.repackage.");
classLoader.addTransformerExclusion("cpw.mods.fml.relauncher.");
classLoader.addTransformerExclusion("cpw.mods.fml.common.asm.transformers.");
classLoader.addClassLoaderExclusion("LZMA.");
FMLLaunchHandler.configureForServerLaunch(classLoader, this);
FMLLaunchHandler.appendCoreMods();
}
示例5: injectIntoClassLoader
import net.minecraft.launchwrapper.LaunchClassLoader; //導入方法依賴的package包/類
@Override
public void injectIntoClassLoader(LaunchClassLoader classLoader)
{
classLoader.addTransformerExclusion("cpw.mods.fml.repackage.");
classLoader.addTransformerExclusion("cpw.mods.fml.relauncher.");
classLoader.addTransformerExclusion("cpw.mods.fml.common.asm.transformers.");
classLoader.addClassLoaderExclusion("LZMA.");
FMLLaunchHandler.configureForClientLaunch(classLoader, this);
FMLLaunchHandler.appendCoreMods();
}
示例6: injectIntoClassLoader
import net.minecraft.launchwrapper.LaunchClassLoader; //導入方法依賴的package包/類
@Override
public void injectIntoClassLoader(LaunchClassLoader classLoader)
{
classLoader.addTransformerExclusion("cpw.mods.fml.repackage.");
classLoader.addTransformerExclusion("cpw.mods.fml.relauncher.");
classLoader.addTransformerExclusion("cpw.mods.fml.common.asm.transformers.");
classLoader.addClassLoaderExclusion("LZMA.");
FMLLaunchHandler.configureForServerLaunch(classLoader, this);
FMLLaunchHandler.appendCoreMods();
}
示例7: injectIntoClassLoader
import net.minecraft.launchwrapper.LaunchClassLoader; //導入方法依賴的package包/類
@Override
public void injectIntoClassLoader(LaunchClassLoader loader) {
loader.addTransformerExclusion("guichaguri.boha.tweak");
loader.registerTransformer("guichaguri.boha.tweak.transformer.BlockTransformer");
}
示例8: loadCoreMod
import net.minecraft.launchwrapper.LaunchClassLoader; //導入方法依賴的package包/類
private static FMLPluginWrapper loadCoreMod(LaunchClassLoader classLoader, String coreModClass, File location)
{
String coreModName = coreModClass.substring(coreModClass.lastIndexOf('.') + 1);
try
{
FMLRelaunchLog.fine("Instantiating coremod class %s", coreModName);
classLoader.addTransformerExclusion(coreModClass);
Class<?> coreModClazz = Class.forName(coreModClass, true, classLoader);
Name coreModNameAnn = coreModClazz.getAnnotation(IFMLLoadingPlugin.Name.class);
if (coreModNameAnn != null && !Strings.isNullOrEmpty(coreModNameAnn.value()))
{
coreModName = coreModNameAnn.value();
FMLRelaunchLog.finer("coremod named %s is loading", coreModName);
}
MCVersion requiredMCVersion = coreModClazz.getAnnotation(IFMLLoadingPlugin.MCVersion.class);
if (!Arrays.asList(rootPlugins).contains(coreModClass) && (requiredMCVersion == null || Strings.isNullOrEmpty(requiredMCVersion.value())))
{
FMLRelaunchLog.log(Level.WARN, "The coremod %s does not have a MCVersion annotation, it may cause issues with this version of Minecraft",
coreModClass);
}
else if (requiredMCVersion != null && !FMLInjectionData.mccversion.equals(requiredMCVersion.value()))
{
FMLRelaunchLog.log(Level.ERROR, "The coremod %s is requesting minecraft version %s and minecraft is %s. It will be ignored.", coreModClass,
requiredMCVersion.value(), FMLInjectionData.mccversion);
return null;
}
else if (requiredMCVersion != null)
{
FMLRelaunchLog.log(Level.DEBUG, "The coremod %s requested minecraft version %s and minecraft is %s. It will be loaded.", coreModClass,
requiredMCVersion.value(), FMLInjectionData.mccversion);
}
TransformerExclusions trExclusions = coreModClazz.getAnnotation(IFMLLoadingPlugin.TransformerExclusions.class);
if (trExclusions != null)
{
for (String st : trExclusions.value())
{
classLoader.addTransformerExclusion(st);
}
}
DependsOn deplist = coreModClazz.getAnnotation(IFMLLoadingPlugin.DependsOn.class);
String[] dependencies = new String[0];
if (deplist != null)
{
dependencies = deplist.value();
}
SortingIndex index = coreModClazz.getAnnotation(IFMLLoadingPlugin.SortingIndex.class);
int sortIndex = index != null ? index.value() : 0;
IFMLLoadingPlugin plugin = (IFMLLoadingPlugin) coreModClazz.newInstance();
String accessTransformerClass = plugin.getAccessTransformerClass();
if (accessTransformerClass != null)
{
FMLRelaunchLog.log(Level.DEBUG, "Added access transformer class %s to enqueued access transformers", accessTransformerClass);
accessTransformers.add(accessTransformerClass);
}
FMLPluginWrapper wrap = new FMLPluginWrapper(coreModName, plugin, location, sortIndex, dependencies);
loadPlugins.add(wrap);
FMLRelaunchLog.fine("Enqueued coremod %s", coreModName);
return wrap;
}
catch (ClassNotFoundException cnfe)
{
if (!Lists.newArrayList(rootPlugins).contains(coreModClass))
FMLRelaunchLog.log(Level.ERROR, cnfe, "Coremod %s: Unable to class load the plugin %s", coreModName, coreModClass);
else
FMLRelaunchLog.fine("Skipping root plugin %s", coreModClass);
}
catch (ClassCastException cce)
{
FMLRelaunchLog.log(Level.ERROR, cce, "Coremod %s: The plugin %s is not an implementor of IFMLLoadingPlugin", coreModName, coreModClass);
}
catch (InstantiationException ie)
{
FMLRelaunchLog.log(Level.ERROR, ie, "Coremod %s: The plugin class %s was not instantiable", coreModName, coreModClass);
}
catch (IllegalAccessException iae)
{
FMLRelaunchLog.log(Level.ERROR, iae, "Coremod %s: The plugin class %s was not accessible", coreModName, coreModClass);
}
return null;
}
示例9: loadCoreMod
import net.minecraft.launchwrapper.LaunchClassLoader; //導入方法依賴的package包/類
private static FMLPluginWrapper loadCoreMod(LaunchClassLoader classLoader, String coreModClass, File location)
{
String coreModName = coreModClass.substring(coreModClass.lastIndexOf('.') + 1);
try
{
FMLRelaunchLog.fine("Instantiating coremod class %s", coreModName);
classLoader.addTransformerExclusion(coreModClass);
Class<?> coreModClazz = Class.forName(coreModClass, true, classLoader);
Name coreModNameAnn = coreModClazz.getAnnotation(IFMLLoadingPlugin.Name.class);
if (coreModNameAnn != null && !Strings.isNullOrEmpty(coreModNameAnn.value()))
{
coreModName = coreModNameAnn.value();
FMLRelaunchLog.finest("coremod named %s is loading", coreModName);
}
MCVersion requiredMCVersion = coreModClazz.getAnnotation(IFMLLoadingPlugin.MCVersion.class);
if (!Arrays.asList(rootPlugins).contains(coreModClass) && (requiredMCVersion == null || Strings.isNullOrEmpty(requiredMCVersion.value())))
{
FMLRelaunchLog.log(Level.WARNING, "The coremod %s does not have a MCVersion annotation, it may cause issues with this version of Minecraft",
coreModClass);
}
else if (requiredMCVersion != null && !FMLInjectionData.mccversion.equals(requiredMCVersion.value()))
{
FMLRelaunchLog.log(Level.SEVERE, "The coremod %s is requesting minecraft version %s and minecraft is %s. It will be ignored.", coreModClass,
requiredMCVersion.value(), FMLInjectionData.mccversion);
return null;
}
else if (requiredMCVersion != null)
{
FMLRelaunchLog.log(Level.FINE, "The coremod %s requested minecraft version %s and minecraft is %s. It will be loaded.", coreModClass,
requiredMCVersion.value(), FMLInjectionData.mccversion);
}
TransformerExclusions trExclusions = coreModClazz.getAnnotation(IFMLLoadingPlugin.TransformerExclusions.class);
if (trExclusions != null)
{
for (String st : trExclusions.value())
{
classLoader.addTransformerExclusion(st);
}
}
DependsOn deplist = coreModClazz.getAnnotation(IFMLLoadingPlugin.DependsOn.class);
String[] dependencies = new String[0];
if (deplist != null)
{
dependencies = deplist.value();
}
SortingIndex index = coreModClazz.getAnnotation(IFMLLoadingPlugin.SortingIndex.class);
int sortIndex = index != null ? index.value() : 0;
IFMLLoadingPlugin plugin = (IFMLLoadingPlugin) coreModClazz.newInstance();
FMLPluginWrapper wrap = new FMLPluginWrapper(coreModName, plugin, location, sortIndex, dependencies);
loadPlugins.add(wrap);
FMLRelaunchLog.fine("Enqueued coremod %s", coreModName);
return wrap;
}
catch (ClassNotFoundException cnfe)
{
if (!Lists.newArrayList(rootPlugins).contains(coreModClass))
FMLRelaunchLog.log(Level.SEVERE, cnfe, "Coremod %s: Unable to class load the plugin %s", coreModName, coreModClass);
else
FMLRelaunchLog.fine("Skipping root plugin %s", coreModClass);
}
catch (ClassCastException cce)
{
FMLRelaunchLog.log(Level.SEVERE, cce, "Coremod %s: The plugin %s is not an implementor of IFMLLoadingPlugin", coreModName, coreModClass);
}
catch (InstantiationException ie)
{
FMLRelaunchLog.log(Level.SEVERE, ie, "Coremod %s: The plugin class %s was not instantiable", coreModName, coreModClass);
}
catch (IllegalAccessException iae)
{
FMLRelaunchLog.log(Level.SEVERE, iae, "Coremod %s: The plugin class %s was not accessible", coreModName, coreModClass);
}
return null;
}