Only add -XstartOnFirstThread on mac os

dev/0.11
modmuss50 2018-12-12 18:10:47 +00:00
parent d9d89d1674
commit f875e34a67
3 changed files with 12 additions and 3 deletions

View File

@ -28,6 +28,7 @@ import net.fabricmc.loom.LoomGradleExtension;
import net.fabricmc.loom.providers.MappingsProvider;
import net.fabricmc.loom.util.Constants;
import net.fabricmc.loom.util.MinecraftVersionInfo;
import net.fabricmc.loom.util.OperatingSystem;
import org.gradle.api.tasks.JavaExec;
import java.io.File;
@ -78,7 +79,9 @@ public class RunClientTask extends JavaExec {
LoomGradleExtension extension = this.getProject().getExtensions().getByType(LoomGradleExtension.class);
List<String> args = new ArrayList<>(super.getJvmArgs());
args.add("-Dfabric.development=true");
args.add("-XstartOnFirstThread");
if(OperatingSystem.getOS().equalsIgnoreCase("osx")){
args.add("-XstartOnFirstThread");
}
return args;
}

View File

@ -74,7 +74,6 @@ public class RunServerTask extends JavaExec {
LoomGradleExtension extension = this.getProject().getExtensions().getByType(LoomGradleExtension.class);
List<String> args = new ArrayList<>(super.getJvmArgs());
args.add("-Dfabric.development=true");
args.add("-XstartOnFirstThread");
return args;
}

View File

@ -92,7 +92,7 @@ public class RunConfig {
ideaClient.projectName = project.getName();
ideaClient.configName = "Minecraft Client";
ideaClient.runDir = "file://$PROJECT_DIR$/" + extension.runDir;
ideaClient.vmArgs = "-Dfabric.development=true -XstartOnFirstThread";
ideaClient.vmArgs = "-Dfabric.development=true" + getOSClientJVMArgs();
ideaClient.programArgs = "--tweakClass " + Constants.FABRIC_CLIENT_TWEAKER + " --assetIndex " + minecraftVersionInfo.assetIndex.getFabricId(extension.getMinecraftProvider().minecraftVersion) + " --assetsDir \"" + new File(extension.getUserCache(), "assets").getAbsolutePath() + "\"";
return ideaClient;
@ -125,4 +125,11 @@ public class RunConfig {
return dummyConfig;
}
public static String getOSClientJVMArgs(){
if(OperatingSystem.getOS().equalsIgnoreCase("osx")){
return " -XstartOnFirstThread";
}
return "";
}
}