本文整理汇总了Java中net.minecraft.launchwrapper.Launch.main方法的典型用法代码示例。如果您正苦于以下问题:Java Launch.main方法的具体用法?Java Launch.main怎么用?Java Launch.main使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.minecraft.launchwrapper.Launch
的用法示例。
在下文中一共展示了Launch.main方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: main
import net.minecraft.launchwrapper.Launch; //导入方法依赖的package包/类
public static void main(String... args) throws Exception {
List<String> launchWrapperArgs = new ArrayList<>();
launchWrapperArgs.add("--tweakClass");
launchWrapperArgs.add(MixinBootstrapTweaker.class.getName());
launchWrapperArgs.addAll(Arrays.asList(args));
Launch.main(launchWrapperArgs.toArray(new String[launchWrapperArgs.size()]));
}
示例2: load
import net.minecraft.launchwrapper.Launch; //导入方法依赖的package包/类
private static void load(String[] args) {
removeFromSysArgs();
String[] newArgs = new String[args.length + 6];
System.arraycopy(args, 0, newArgs, 6, args.length);
newArgs[0] = "--tweakClass";
newArgs[1] = PRE_TWEAKER;
newArgs[2] = "--tweakClass";
newArgs[3] = FML_TWEAKER;
newArgs[4] = "--tweakClass";
newArgs[5] = POST_TWEAKER;
Launch.main(newArgs);
}
示例3: main
import net.minecraft.launchwrapper.Launch; //导入方法依赖的package包/类
public static void main(String[] args) {
File file = new File(".gradle/minecraft/natives/");
if (!file.exists()) {
file = new File("../.gradle/minecraft/natives/");
}
System.setProperty("org.lwjgl.librarypath", file.getAbsolutePath());
OMLStrippableTransformer.SIDE = Side.CLIENT;
LaunchArguments arguments = new LaunchArguments(args);
if (arguments.containsArgument("password")) {
YggdrasilUserAuthentication auth = (YggdrasilUserAuthentication) (new YggdrasilAuthenticationService(Proxy.NO_PROXY, "1")).createUserAuthentication(Agent.MINECRAFT);
auth.setUsername(arguments.getArgument("username"));
auth.setPassword(arguments.getArgument("password"));
arguments.removeArgument("password");
try {
auth.logIn();
} catch (AuthenticationException e) {
e.printStackTrace();
return;
}
arguments.addArgument("accessToken", auth.getAuthenticatedToken());
arguments.addArgument("uuid", auth.getSelectedProfile().getId().toString().replace("-", ""));
arguments.addArgument("username", auth.getSelectedProfile().getName());
arguments.addArgument("userType", auth.getUserType().getName());
arguments.addArgument("userProperties", new GsonBuilder().registerTypeAdapter(PropertyMap.class, new PropertyMap.Serializer()).create().toJson(auth.getUserProperties()));
}
arguments.addArgument("version", "1.10.2");
arguments.addArgument("assetIndex", "1.10");
arguments.addArgument("tweakClass", "xyz.openmodloader.launcher.OMLTweaker");
if (arguments.containsArgument("accessToken")) {
arguments.addArgument("accessToken", "OpenModLoader");
}
Launch.main(arguments.getArguments());
}
示例4: main
import net.minecraft.launchwrapper.Launch; //导入方法依赖的package包/类
public static void main(String[] args) {
OMLStrippableTransformer.SIDE = Side.SERVER;
LaunchArguments arguments = new LaunchArguments(args);
arguments.addArgument("version", "1.10.2");
arguments.addArgument("assetIndex", "1.10");
arguments.addArgument("accessToken", "OpenModLoader");
arguments.addArgument("tweakClass", "xyz.openmodloader.launcher.OMLServerTweaker");
Launch.main(arguments.getArguments());
}
示例5: main
import net.minecraft.launchwrapper.Launch; //导入方法依赖的package包/类
public static void main(String[] args) {
List<String> argList = new ArrayList<>();
for (String arg : args) {
argList.add(arg);
}
argList.add("--tweakClass");
argList.add("net.fabricmc.base.launch.FabricServerTweaker");
Object[] objectList = argList.toArray();
String[] stringArray = Arrays.copyOf(objectList, objectList.length, String[].class);
Launch.main(stringArray);
}
示例6: main
import net.minecraft.launchwrapper.Launch; //导入方法依赖的package包/类
public static void main(final String[] args) throws Exception {
// Get the location of our jar
Path base = Paths.get(NeptuneServerMain.class.getProtectionDomain().getCodeSource().getLocation().toURI()).getParent();
// Establish whether the Minecraft server jar has already been obtained.
if (!checkMinecraft(base)) {
return;
}
// Invoke LaunchWrapper
Launch.main(join(args,
"--tweakClass", "org.neptunepowered.vanilla.launch.NeptuneServerTweaker"
));
}
示例7: main
import net.minecraft.launchwrapper.Launch; //导入方法依赖的package包/类
public static void main(String[] args) throws Exception {
if(!checkMinecraft()){
return;
}
Launch.main(join(args,
"--tweakClass", "jk_5.nailed.launch.ServerTweaker"
));
}