Code
#$mchome = "$env:APPDATA\.minecraft"
$mchome = "C:\work\mc"
$mcversion = "1.6.2"
$javabin = "C:\Program Files\Java\jre7\bin\javaw.exe"
$maxheap = "2G"
$mainclass = "net.minecraft.client.main.Main"
$username = "DosAmp"
# TODO: JSON parsen und spezielle Bibliotheken nutzen
# ConvertFrom-Json ist erst in PowerShell 3.0 verfügbar :(
$classpath = @(Get-ChildItem -Path ($mchome + "\libraries") -Recurse -Include "*.jar" | ForEach-Object {$_.FullName})
$classpath += (Get-Item ($mchome + "\versions\" + $mcversion + "\" + $mcversion + ".jar")).FullName
$cpparam = ($classpath -Join ";")
# XXX: manuell extrahierte LWJGL-DLLs
$params = @("-Xmx$maxheap", "-Djava.library.path=$mchome\natives", "-cp", $cpparam, $mainclass, "--username", $username, "--version", $mcversion, "--gameDir", $mchome, "--assetsDir", "$mchome\assets")
& $javabin $params
Alles anzeigen