|
$optionsFile = "options.txt"; |
|
$path = Convert-Path("."); |
|
# $path = Join-Path -Path $path -ChildPath "minecraft"; |
|
$path = Join-Path -Path $path -ChildPath $optionsFile; |
|
|
|
# Check if config file exists |
|
if (Test-Path($path)) |
|
{ |
|
Write-Host "File exists"; |
|
$data = Get-Content $path; |
|
|
|
### General |
|
# fov to 88 |
|
$data = $data -replace "fov:\d(\.\d*)", "fov:0.45"; |
|
|
|
### Audio |
|
# master to 0.2 |
|
$data = $data -replace "soundCategory_master:\d(\.\d+)?", "soundCategory_master:0.2"; |
|
$data = $data -replace "master:\d(\.\d+)?", "master:0.2"; |
|
|
|
### Video settings |
|
# Max Brightness |
|
$data = $data -replace "gamma:\d(\.\d)?", "gamma:1.0"; |
|
# gui level 3/large |
|
$data = $data -replace "guiScale:\d", "guiScale:3"; |
|
# vsync off |
|
$data = $data -replace "enableVsync:true", "enableVsync:false"; |
|
# mipmap 0 |
|
$data = $data -replace "mipmapLevels:\d", "mipmapLevels:0"; |
|
|
|
### Controls |
|
# Disable Auto jump |
|
$data = $data -replace "autoJump:true", "autoJump:false"; |
|
# change inventory to tab, list players to apostrophe/ae |
|
## new keycode system |
|
$data = $data -replace "key_key.inventory:key\..*", "key_key.inventory:key.keyboard.tab"; # TODO: check if anything else uses that key (modded binds) |
|
$data = $data -replace "key_key.playerlist:key\..*", "key_key.playerlist:key.keyboard.apostrophe"; |
|
## old keycodes |
|
$data = $data -replace "key_key.inventory:\d+", "key_key.inventory:15"; |
|
$data = $data -replace "key_key.playerlist:\d+", "key_key.playerlist:40"; |
|
|
|
### Misc |
|
# disable mp warning |
|
$data = $data -replace "skipMultiplayerWarning:false", "skipMultiplayerWarning:true"; |
|
# disable snooper |
|
$data = $data -replace "snooperEnabled:true", "snooperEnabled:false"; |
|
# disable tutorial |
|
$data = $data -replace "tutorialStep:.*", "tutorialStep:none"; |
|
|
|
|
|
# Write back |
|
$data | Out-File -encoding ASCII $path; |
|
} |
|
else |
|
{ |
|
# throw if you want the thing to die, problem: may stop the game from running if it hasn't created a config file yet |
|
Write-Error "$optionsFile at $path doesn't exist"; |
|
} |