本文整理汇总了Java中net.minecraftforge.fml.relauncher.FMLLaunchHandler类的典型用法代码示例。如果您正苦于以下问题:Java FMLLaunchHandler类的具体用法?Java FMLLaunchHandler怎么用?Java FMLLaunchHandler使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
FMLLaunchHandler类属于net.minecraftforge.fml.relauncher包,在下文中一共展示了FMLLaunchHandler类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: sortTweakers
import net.minecraftforge.fml.relauncher.FMLLaunchHandler; //导入依赖的package包/类
private static void sortTweakers() {
TaskProfiler profiler = new TaskProfiler();
profiler.startOnce("Tweak Sorting.");
LogHelper.info("Sorting tweakers..");
for (TGameTweak tweak : allTweakers) {
LogHelper.debug("Attempting registration of tweaker \"%s\"...", tweak.getTweakName());
if (tweak instanceof TSideTweak) {
if (!FMLLaunchHandler.side().equals(((TSideTweak) tweak).getSide())) {
LogHelper.info("Tweaker \"%s\" will NOT be loaded as it is only for %s side!", tweak.getTweakName(), ((TSideTweak) tweak).getSide().toString());
continue;
}
}
if (tweak.isEnabled()) {
activeTweakers.add(tweak);
LogHelper.debug("Successfully registered Tweaker \"%s\"!", tweak.getTweakName());
}
}
TaskProfiler.ProfilerResult result = profiler.endOnce();
LogHelper.info("Tweaker sorting successfully found %s enabled tweakers in %sMs.", activeTweakers.size(), TimeUnit.NANOSECONDS.toMillis(result.time));
}
示例2: injectIntoClassLoader
import net.minecraftforge.fml.relauncher.FMLLaunchHandler; //导入依赖的package包/类
@Override
public void injectIntoClassLoader(LaunchClassLoader classLoader)
{
// The log4j2 queue is excluded so it is correctly visible from the obfuscated
// and deobfuscated parts of the code. Without, the UI won't show anything
classLoader.addClassLoaderExclusion("com.mojang.util.QueueLogAppender");
classLoader.addClassLoaderExclusion("jline.");
classLoader.addClassLoaderExclusion("org.fusesource.");
classLoader.addClassLoaderExclusion("net.minecraftforge.server.console.TerminalConsoleAppender");
FMLLaunchHandler.configureForServerLaunch(classLoader, this);
FMLLaunchHandler.appendCoreMods();
}
示例3: getSigningCertificate
import net.minecraftforge.fml.relauncher.FMLLaunchHandler; //导入依赖的package包/类
@Override
public Certificate getSigningCertificate()
{
if (FMLLaunchHandler.side() != Side.CLIENT)
return null;
try
{
Class<?> cbr = Class.forName("net.minecraft.client.ClientBrandRetriever", false, getClass().getClassLoader());
Certificate[] certificates = cbr.getProtectionDomain().getCodeSource().getCertificates();
return certificates != null ? certificates[0] : null;
}
catch (Exception e){} // Errors don't matter just return null.
return null;
}
示例4: injectData
import net.minecraftforge.fml.relauncher.FMLLaunchHandler; //导入依赖的package包/类
@Override
public void injectData(Map<String, Object> data)
{
liveEnv = (Boolean)data.get("runtimeDeobfuscationEnabled");
cl = (LaunchClassLoader) data.get("classLoader");
File mcDir = (File)data.get("mcLocation");
fmlLocation = (File)data.get("coremodLocation");
ClassPatchManager.INSTANCE.setup(FMLLaunchHandler.side());
FMLDeobfuscatingRemapper.INSTANCE.setup(mcDir, cl, (String) data.get("deobfuscationFileName"));
}
示例5: transform
import net.minecraftforge.fml.relauncher.FMLLaunchHandler; //导入依赖的package包/类
@Override
public byte[] transform(String name, String tname, byte[] bytes) {
if (bytes == null) return null;
try {
if (FMLLaunchHandler.side().isClient())
bytes = transformSubclasses(name, bytes);
bytes = transformer.transform(name, bytes);
} catch (Exception e) {
throw new RuntimeException(e);
}
return bytes;
}
示例6: transform
import net.minecraftforge.fml.relauncher.FMLLaunchHandler; //导入依赖的package包/类
@Override
public byte[] transform(String name, String transformedName, byte[] bytes)
{
if (FMLLaunchHandler.side().isClient() && transformedName.equals(TARGET_CLASS_NAME2))
{
return transFormMethod(bytes);
}
return bytes;
}
示例7: injectIntoClassLoader
import net.minecraftforge.fml.relauncher.FMLLaunchHandler; //导入依赖的package包/类
@Override
public void injectIntoClassLoader(LaunchClassLoader classLoader)
{
FMLLaunchHandler.configureForClientLaunch(classLoader, this);
FMLLaunchHandler.appendCoreMods();
}
示例8: handleClientMessage
import net.minecraftforge.fml.relauncher.FMLLaunchHandler; //导入依赖的package包/类
@Override
public IMessage handleClientMessage(TileDataSync message, MessageContext ctx) {
if(FMLLaunchHandler.side().isClient()) message.sendToClassHandler();
return null;
}
示例9: runtimeSide
import net.minecraftforge.fml.relauncher.FMLLaunchHandler; //导入依赖的package包/类
public static Side runtimeSide() { return FMLLaunchHandler.side(); }