Removed JVM args

This commit is contained in:
2026-04-04 22:34:39 +02:00
parent 67d8b9e365
commit 0fe65f51a7
4 changed files with 8 additions and 61 deletions
+6 -2
View File
@@ -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<ProjectDirs> = Lazy::new(|| {
ProjectDirs::from("org", "SaturnLauncher", "SaturnLauncher")
@@ -25,6 +25,7 @@ pub static LAUNCHER_DIR: Lazy<ProjectDirs> = 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");
+1 -6
View File
@@ -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"),
}
}
+1 -52
View File
@@ -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 = () => {
</div>
</div>
</motion.div>
{/* JVM Arguments */}
<motion.div
initial={{ opacity: 0, y: 10 }}
animate={{ opacity: 1, y: 0 }}
transition={{ delay: 0.1 }}
className="panel p-6 space-y-6"
>
<div className="flex items-center gap-3">
<div className="w-8 h-8 rounded-lg bg-saturn-accent/10 flex items-center justify-center text-saturn-accent">
<Cpu size={18} />
</div>
<h2 className="text-lg font-bold">Custom JVM Arguments</h2>
</div>
<div className="space-y-4">
<p className="text-xs text-saturn-text-secondary leading-relaxed">
Advanced flags for the Java Virtual Machine. Saturn Client
includes optimized defaults, but you can override them here.
</p>
<textarea
value={settings.jvm_arguments}
onChange={(e) =>
setSettings({ ...settings, jvm_arguments: e.target.value })
}
className="w-full h-32 bg-saturn-bg border border-saturn-border rounded-lg p-4 text-sm font-mono text-saturn-text-secondary focus:outline-none focus:border-saturn-accent/50 focus:ring-1 focus:ring-saturn-accent/50 transition-all resize-none"
placeholder="-XX:+UseG1GC..."
/>
<div className="p-3 bg-yellow-500/5 border border-yellow-500/10 rounded-lg flex gap-3">
<AlertTriangle
size={16}
className="text-yellow-500 shrink-0 mt-0.5"
/>
<p className="text-xs text-yellow-500/80 leading-relaxed">
Incorrect JVM arguments can prevent the game from starting. Only
modify if you know what you're doing.
</p>
</div>
</div>
</motion.div>
</div>
</div>
);
-1
View File
@@ -16,6 +16,5 @@ export interface GameVersion {
}
export interface LauncherSettings {
jvm_arguments: string;
max_memory: number;
}