24 lines
1.3 KiB
Batchfile
24 lines
1.3 KiB
Batchfile
@echo off
|
|
setlocal
|
|
cd /d "%~dp0"
|
|
rem Starts OpenOnyx (run\client\*.jar, built by tools\build.sh) on Java 21.
|
|
|
|
rem Use the bundled jre\ when Git LFS fetched it (lib\modules is ~140 MB, not a 134-byte pointer); otherwise Temurin 21.
|
|
set "JAVA_EXE=jre\bin\java.exe"
|
|
for %%F in ("jre\lib\modules") do if %%~zF LSS 1000000 set "JAVA_EXE=C:\Program Files\Eclipse Adoptium\jdk-21.0.13.9-hotspot\bin\java.exe"
|
|
if not exist "%JAVA_EXE%" (
|
|
echo Java 21 was not found. Install Temurin 21 or fetch jre\ with Git LFS.
|
|
pause
|
|
exit /b 1
|
|
)
|
|
|
|
rem The game reads assets from .\assets; link the vanilla launcher's 1.8 assets in (sounds, language files).
|
|
if not exist "assets" mkdir "assets"
|
|
for %%D in (indexes objects) do if not exist "assets\%%D" if exist "%APPDATA%\.minecraft\assets\%%D" mklink /J "assets\%%D" "%APPDATA%\.minecraft\assets\%%D" >nul
|
|
|
|
rem Generational ZGC keeps GC pauses under 0.05 ms (the default G1 paused up to ~40 ms, which showed as stutter).
|
|
set "JVM_FLAGS=-Xms2G -Xmx4G -XX:+UseZGC -XX:+ZGenerational -XX:+AlwaysPreTouch"
|
|
|
|
"%JAVA_EXE%" %JVM_FLAGS% -Dfile.encoding=UTF-8 -Donyx.user="admin" -Djava.library.path="rt\natives" -cp "client\onyx.jar;client\patches.jar;client\mc.jar;rt\libs\*" Start --username i_use_pastes --gameDir "." --width 925 --height 530
|
|
if errorlevel 1 pause
|