From 0fe65f51a797afad323e70c27e04f263a726bd37 Mon Sep 17 00:00:00 2001 From: Klesti Selimaj Date: Sat, 4 Apr 2026 22:34:39 +0200 Subject: [PATCH] Removed JVM args --- src-tauri/src/launcher/mod.rs | 8 +++-- src-tauri/src/lib.rs | 7 +--- src/components/SettingsSection.tsx | 53 +----------------------------- src/lib/types.ts | 1 - 4 files changed, 8 insertions(+), 61 deletions(-) diff --git a/src-tauri/src/launcher/mod.rs b/src-tauri/src/launcher/mod.rs index 4b424b4..4b27879 100644 --- a/src-tauri/src/launcher/mod.rs +++ b/src-tauri/src/launcher/mod.rs @@ -13,9 +13,9 @@ use lyceris::{ }, }; use once_cell::sync::Lazy; -use tauri::Emitter as _; +use tauri::{Emitter as _, State}; -use crate::GameVersion; +use crate::{GameVersion, SharedState}; pub static LAUNCHER_DIR: Lazy = Lazy::new(|| { ProjectDirs::from("org", "SaturnLauncher", "SaturnLauncher") @@ -25,6 +25,7 @@ pub static LAUNCHER_DIR: Lazy = Lazy::new(|| { #[tauri::command] pub async fn launch_game( app: tauri::AppHandle, + state: State<'_, SharedState>, version: GameVersion, account: MinecraftAccount, ) -> Result<(), String> { @@ -83,6 +84,9 @@ pub async fn launch_game( }, ) .loader(Fabric(version.loader_version).into()) + .memory(lyceris::minecraft::config::Memory::Megabyte( + state.lock().unwrap().settings.max_memory as u64, + )) .build(); println!("Starting installation"); diff --git a/src-tauri/src/lib.rs b/src-tauri/src/lib.rs index ff5c48e..fc60075 100644 --- a/src-tauri/src/lib.rs +++ b/src-tauri/src/lib.rs @@ -30,7 +30,6 @@ pub struct GameVersion { #[derive(Clone, Serialize, Deserialize)] pub struct LauncherSettings { - pub jvm_arguments: String, pub max_memory: u32, } @@ -44,11 +43,7 @@ pub struct AppState { impl Default for AppState { fn default() -> Self { Self { - settings: LauncherSettings { - jvm_arguments: "-XX:+UseG1GC -XX:+ParallelRefProcEnabled -XX:MaxGCPauseMillis=200" - .into(), - max_memory: 4096, - }, + settings: LauncherSettings { max_memory: 4096 }, version: String::from("1.21.6"), } } diff --git a/src/components/SettingsSection.tsx b/src/components/SettingsSection.tsx index ba690f3..a43eb65 100644 --- a/src/components/SettingsSection.tsx +++ b/src/components/SettingsSection.tsx @@ -1,12 +1,5 @@ import React, { useState, useEffect } from "react"; -import { - Cpu, - MemoryStick, - Save, - RefreshCcw, - Info, - AlertTriangle, -} from "lucide-react"; +import { MemoryStick, Save, RefreshCcw, Info } from "lucide-react"; import { getSettings, updateSettings } from "../lib/saturn"; import { motion } from "framer-motion"; import { LauncherSettings } from "@/lib/types"; @@ -41,8 +34,6 @@ const SettingsSection: React.FC = () => { const handleReset = async () => { // In a real app, this would reset to defaults in the service const defaultSettings: LauncherSettings = { - jvm_arguments: - "-XX:+UseG1GC -XX:+ParallelRefProcEnabled -XX:MaxGCPauseMillis=200", max_memory: 4096, }; setSettings(defaultSettings); @@ -142,48 +133,6 @@ const SettingsSection: React.FC = () => { - - {/* JVM Arguments */} - -
-
- -
-

Custom JVM Arguments

-
- -
-

- Advanced flags for the Java Virtual Machine. Saturn Client - includes optimized defaults, but you can override them here. -

- -