All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.kender.core.mc.CommandConstructor Maven / Gradle / Ivy

There is a newer version: 1.0.0
Show newest version
package net.kender.core.mc;

import java.nio.file.Path;
import java.util.UUID;

import net.kender.core.mc.Quikplays.Quikplay;
import net.kender.core.mc.Quikplays.profile;
import net.kender.kutils.OperativeSystem;

public class CommandConstructor {
	public String command;
	private static final OperativeSystem SYSTEM = OperativeSystem.thisOperativeSystem();

	public CommandConstructor(String user, int maxRam, int minRam, String assetsIndex, String libs, String mainClass,
			String LastVersionId, String gameDir, String javaBin, Path __DEST__, UUID UUID, String accesToken,
			Path AssetsDir, String XUID, String clientID, String userType, String versionType, Path natives) {
		command = javaBin + "\\bin\\java" + (SYSTEM == OperativeSystem.Windows ? ".exe" : "") + " -Djna.tmpdir=" + natives.toString() + " -Dio.netty.native.workdir="
				+ natives.toString() + " -Dorg.lwjgl.system.SharedLibraryExtractPath=" + natives.toString()
				+ " -Djava.library.path=" + natives.toString() + " -Xmx" + maxRam + "G -Xms" + minRam + "G "
				+ "-cp \".;" + __DEST__ + "\\versions\\" + LastVersionId + "\\" + LastVersionId + ".jar;" + libs + "\" "
				+ mainClass + " --gameDir " + gameDir + " --username " + user + " --assetIndex " + assetsIndex
				+ " --accessToken " + accesToken + " --version " + LastVersionId + " --uuid " + UUID.toString()
				+ " --assetsDir " + AssetsDir + " --xuid " + XUID + " --clientId " + clientID + " --userType "
				+ userType + " --versionType " + versionType + "";
	}

	public CommandConstructor(String user, int maxRam, int minRam, String assetsIndex, String libs, String mainClass,
			String LastVersionId, String gameDir, String javaBin, Path __DEST__, UUID UUID, String accesToken,
			Path AssetsDir, String XUID, String clientID, String userType, String versionType, Quikplay r,
			Path natives) {
		command = javaBin + "\\bin\\java" + (SYSTEM == OperativeSystem.Windows ? ".exe" : "") + "-Djna.tmpdir=" + natives.toString() + " -Dio.netty.native.workdir="
				+ natives.toString() + " -Dorg.lwjgl.system.SharedLibraryExtractPath=" + natives.toString()
				+ " -Djava.library.path=" + natives.toString() + "-Xmx" + maxRam + "G -Xms" + minRam + "G " + "-cp \".;" + __DEST__
				+ "\\versions\\" + LastVersionId + "\\" + LastVersionId + ".jar;" + libs + "\" " + mainClass
				+ " --gameDir " + gameDir + " --username " + user + " --assetIndex " + assetsIndex + " --accessToken "
				+ accesToken + " --version " + LastVersionId + " --uuid " + UUID.toString() + " --assetsDir "
				+ AssetsDir + " --xuid " + XUID + " --clientId " + clientID + " --userType " + userType
				+ " --versionType " + versionType;
		if (r.s != null) {
			command += " --quickPlayMultiplayer " + r.s.ip;
			if (r.sp != 0) {
				command += ":" + r.sp;
			}
		} else if (r.w != null) {
			command += " --quickPlaySingleplayer \"" + r.w.world.getFileName() + "\"";
		}
	}

	@Override
	public String toString() {
		return command;
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy