-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathstart.ps1
More file actions
29 lines (25 loc) · 985 Bytes
/
start.ps1
File metadata and controls
29 lines (25 loc) · 985 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
[Console]::OutputEncoding = [System.Text.Encoding]::UTF8
# Check if Java is installed
if (-not (Get-Command java -ErrorAction SilentlyContinue)) {
Write-Host "Java is not installed. Please install Java 21 or higher."
Write-Host "You can refer to the installation instructions at https://docs.powernukkitx.org/installation/windows"
exit 1
}
# Check if powernukkitx.jar exists
if (-not (Test-Path -Path "powernukkitx.jar")) {
Write-Host "PowerNukkitX.jar not found"
Write-Host "You can download the file from https://github.com/PowerNukkitX/PowerNukkitX/releases"
exit 1
}
$JAVA_CMD = "java"
$JAR_NAME = "powernukkitx.jar"
& $JAVA_CMD -Dfile.encoding=UTF-8 `
-Djansi.passthrough=true `
-Dterminal.ansi=true `
-XX:+UseZGC `
-XX:+ZGenerational `
-XX:+UseStringDeduplication `
--add-opens java.base/java.lang=ALL-UNNAMED `
--add-opens java.base/java.io=ALL-UNNAMED `
--add-opens java.base/java.net=ALL-UNNAMED `
-jar $JAR_NAME