From 85569887b4a06df7e39536a550733cf09cad62ac Mon Sep 17 00:00:00 2001 From: StellaArtois Date: Fri, 25 Oct 2013 19:16:20 +0100 Subject: [PATCH] First pass support for 1.6.4 --- .gitignore | 1 + README.md | 21 +- applychanges.bat | 3 +- applychanges.py | 2 +- build.bat | 4 +- build.py | 4 +- create_install.sh | 2 +- getchanges.bat | 3 +- getchanges.py | 9 +- install.py | 9 +- installer/1.6.4-forge-nohydra.json | 225 ++ installer/1.6.4-forge.json | 243 ++ installer/1.6.4-nohydra.json | 215 ++ installer/1.6.4.json | 233 ++ installer/Installer.java | 25 +- installer/META-INF/MANIFEST.MF | 3 + installer/installer.jar | Bin 53266 -> 55073 bytes .../src/ChatMessageComponent.java.patch | 11 + patches/net/minecraft/src/Config.java.patch | 62 +- .../minecraft/src/EntityRenderer.java.patch | 1269 +++++----- .../net/minecraft/src/EnumOptions.java.patch | 202 +- .../net/minecraft/src/GameSettings.java.patch | 104 +- .../minecraft/src/GuiAchievements.java.patch | 26 +- .../net/minecraft/src/GuiIngame.java.patch | 68 +- .../net/minecraft/src/GuiNewChat.java.patch | 80 +- .../net/minecraft/src/GuiOptions.java.patch | 116 +- .../src/GuiPerformanceSettingsOF.java.patch | 22 +- .../src/GuiQualitySettingsOF.java.patch | 22 +- .../net/minecraft/src/GuiScreen.java.patch | 227 +- patches/net/minecraft/src/GuiSlot.java.patch | 124 +- .../net/minecraft/src/Minecraft.java.patch | 2239 ++++++++--------- .../net/minecraft/src/ModelBiped.java.patch | 94 +- .../minecraft/src/MovementInput.java.patch | 22 +- .../src/MovementInputFromOptions.java.patch | 35 +- .../net/minecraft/src/RandomMobs.java.patch | 63 + .../net/minecraft/src/Reflector.java.patch | 134 +- .../net/minecraft/src/RenderGlobal.java.patch | 148 +- .../net/minecraft/src/RenderPlayer.java.patch | 144 +- .../minecraft/src/ScaledResolution.java.patch | 22 +- .../src/ScreenChatOptions.java.patch | 122 +- .../net/minecraft/src/SoundManager.java.patch | 22 +- .../minecraft/src/StringTranslate.java.patch | 22 +- .../src/ThreadDownloadImage.java.patch | 36 + .../ThreadDownloadImageDataINNER1.java.patch | 35 + .../src/VersionCheckThread.java.patch | 26 + src/com/mtbs3d/minecrift/VRRenderer.java | 8 +- .../mtbs3d/minecrift/settings/VRSettings.java | 2 +- src/com/mtbs3d/minecrift/utils/SessionID.java | 83 + sync-public.sh | 2 +- test.sh | 2 +- 50 files changed, 3859 insertions(+), 2737 deletions(-) create mode 100644 installer/1.6.4-forge-nohydra.json create mode 100644 installer/1.6.4-forge.json create mode 100644 installer/1.6.4-nohydra.json create mode 100644 installer/1.6.4.json create mode 100644 installer/META-INF/MANIFEST.MF create mode 100644 patches/net/minecraft/src/ChatMessageComponent.java.patch create mode 100644 patches/net/minecraft/src/RandomMobs.java.patch create mode 100644 patches/net/minecraft/src/ThreadDownloadImage.java.patch create mode 100644 patches/net/minecraft/src/ThreadDownloadImageDataINNER1.java.patch create mode 100644 patches/net/minecraft/src/VersionCheckThread.java.patch create mode 100644 src/com/mtbs3d/minecrift/utils/SessionID.java diff --git a/.gitignore b/.gitignore index 7f5506f8..2ae9dba9 100644 --- a/.gitignore +++ b/.gitignore @@ -11,3 +11,4 @@ releases/ *.class *install*.jar *install*.exe +patches/Start.java.patch diff --git a/README.md b/README.md index 89b7804e..31b63efa 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ Minecrift Mod for Minecraft =========================== -Current Version: 1.1 beta +Current Version: Minecrift 1.6.4 StellaArtois, mabrowning 2013 @@ -13,8 +13,8 @@ With thanks to: - The team behind the MCP coders' pack, and the Minecraft community - why Mojang bother obfuscating the source when you guys have done such a fantastic job of de-obfuscating it is beyond me! -- Powback for his initial work on the Java JNI wrapper to the SDK. Seeing this - inspired me to get off my arse and get modding. See +- Powback for his initial work on the Java JNI wrapper to the Oculus SDK. Seeing + this inspired me to get off my arse and get modding. See [this Reddit thread](http://www.reddit.com/r/oculus/comments/1c1vh0/java_wrapper_for_devs/) - shakesoda and Ben (and others?) at MTBS for creating the GLSL version of the Oculus distortion shader. @@ -52,14 +52,14 @@ Click the button below to go to our Jenkins page where you can download the latest build hot-off-the-presses. [![Powered By CloudBees](http://www.cloudbees.com/sites/default/files/Button-Powered-by-CB.png) -](https://minecraftvr.ci.cloudbees.com/job/minecrift-1.6.2/) +](https://minecraftvr.ci.cloudbees.com/job/minecrift-1.6.4/lastSuccessfulBuild/artifact/) --- Installation ------------ -Download and run the latest minecrift-1.6.2-b###-installer.exe/jar. +Download and run the latest minecrift-1.6.4-b###-installer.exe/jar. *WINDOWS USERS: IMPORTANT* (but only required once). Install the Microsoft VS2010 C++ redists (both x86 and x64) from [here](http://www.microsoft.com/en-us/download/details.aspx?id=5555) @@ -152,7 +152,6 @@ Here are some other hotkeys that allow quick access to changing VR settings. Known Issues ------------ -FSAA (Super Sampling) doesn't work on OSX and is disabled. There are quite a small bugs that can be seen on the [GitHub issue tracker](https://github.com/mabrowning/minecrift/issues) @@ -191,14 +190,14 @@ Linux, but was written with cross-platform support in mind, so should be usable Run install.sh (or install.bat) to download mcp, minecraft, Optifine, and other libraries; deobfuscate the base system, and apply the patches and new files. -Use the MCP environment in /mcp804 to modify, test, and recompile. If you use -the built-in eclipse workspace, you'll need to add the JRift and SixenseJava -jars, located in the jars/libraries/ directory. JRift is in de/fruitfly/ovr and -SixenseJava is in com/sixense. +Use the MCP environment in /mcpxxx to modify, test, and recompile. If you use +the built-in eclipse workspace, you'll need to add the JRift, SixenseJava and +JMumble jars, located in the jars/libraries/ directory. JRift is in de/fruitfly/ovr +and SixenseJava is in com/sixense. Run build.sh (or build.bat) to create a release installer. -Run getchanges.sh (or getchanges.bat) to diff the modified /mcp804/src files into +Run getchanges.sh (or getchanges.bat) to diff the modified /mcpxxx/src files into version controlled /patches and copy the new classes into the /src/ directory. diff --git a/applychanges.bat b/applychanges.bat index 97b47c07..a7efa73a 100644 --- a/applychanges.bat +++ b/applychanges.bat @@ -1,5 +1,6 @@ @echo off -.\mcp\runtime\bin\python\python_mcp applychanges.py +REM.\mcp\runtime\bin\python\python_mcp applychanges.py +python applychanges.py pause diff --git a/applychanges.py b/applychanges.py index d864389c..58a37fed 100644 --- a/applychanges.py +++ b/applychanges.py @@ -80,4 +80,4 @@ def applychanges(mcp_dir): elif os.path.isfile(os.path.join('..', 'runtime', 'commands.py')): applychanges(os.path.abspath('..')) else: - applychanges(os.path.abspath('mcp804')) + applychanges(os.path.abspath('mcp811')) diff --git a/build.bat b/build.bat index 85d5125d..68cccdbb 100644 --- a/build.bat +++ b/build.bat @@ -1,3 +1,5 @@ @echo off -.\mcp\runtime\bin\python\python_mcp build.py +REM.\mcp\runtime\bin\python\python_mcp build.py +python build.py + pause diff --git a/build.py b/build.py index ebb5c233..ed9ff094 100644 --- a/build.py +++ b/build.py @@ -3,7 +3,7 @@ from optparse import OptionParser import subprocess, shlex -mc_ver ="1.6.2" +mc_ver ="1.6.4" try: WindowsError @@ -138,4 +138,4 @@ def main(mcp_dir): elif os.path.isfile(os.path.join('..', 'runtime', 'commands.py')): main(os.path.abspath('..')) else: - main(os.path.abspath('mcp804')) + main(os.path.abspath('mcp811')) diff --git a/create_install.sh b/create_install.sh index 87816c17..2d981cbc 100755 --- a/create_install.sh +++ b/create_install.sh @@ -1,3 +1,3 @@ #!/usr/bin/env python from build import create_install -create_install("mcp804") +create_install("mcp811") diff --git a/getchanges.bat b/getchanges.bat index 9a727ce2..934b4825 100644 --- a/getchanges.bat +++ b/getchanges.bat @@ -1,3 +1,4 @@ @echo off -.\mcp\runtime\bin\python\python_mcp getchanges.py +REM.\mcp\runtime\bin\python\python_mcp getchanges.py +python getchanges.py pause diff --git a/getchanges.py b/getchanges.py index ff5f7a35..dfe02d16 100644 --- a/getchanges.py +++ b/getchanges.py @@ -37,8 +37,11 @@ def main(mcp_dir): except OSError as e: pass - os.mkdir( new_src_dir ) - os.mkdir( patch_base_dir ) + if not os.path.exists( new_src_dir ): + os.mkdir( new_src_dir ) + + if not os.path.exists( patch_base_dir ): + os.mkdir( patch_base_dir ) mod_src_dir = os.path.join( mcp_dir , "src", "minecraft" ) org_src_dir = os.path.join( mcp_dir , "src", ".minecraft_orig" ) @@ -82,4 +85,4 @@ def main(mcp_dir): elif os.path.isfile(os.path.join('..', 'runtime', 'commands.py')): main(os.path.abspath('..')) else: - main(os.path.abspath('mcp804')) + main(os.path.abspath('mcp811')) diff --git a/install.py b/install.py index c1df5121..b2ff29ca 100644 --- a/install.py +++ b/install.py @@ -10,9 +10,10 @@ base_dir = os.path.dirname(os.path.abspath(__file__)) -mc_version = "1.6.2" -of_version = mc_version+"_HD_U_B3" -mcp_version = "mcp804" +mc_version = "1.6.4" +of_version = mc_version+"_HD_U_C6" +of_file_extension = ".jar" +mcp_version = "mcp811" try: WindowsError @@ -103,7 +104,7 @@ def download_deps( mcp_dir ): optifine_dir = os.path.join(jars,"libraries","net","optifine","OptiFine",of_version ) mkdir_p( optifine_dir ) - download_file( "http://optifine.net/download.php?f=OptiFine_"+of_version+".zip", os.path.join( optifine_dir, "OptiFine-"+of_version+".jar" )) + download_file( "http://optifine.net/download.php?f=OptiFine_"+of_version+of_file_extension, os.path.join( optifine_dir, "OptiFine-"+of_version+".jar" )) json_obj = [] with open(json_file,"rb") as f: diff --git a/installer/1.6.4-forge-nohydra.json b/installer/1.6.4-forge-nohydra.json new file mode 100644 index 00000000..bdc55132 --- /dev/null +++ b/installer/1.6.4-forge-nohydra.json @@ -0,0 +1,225 @@ +{ + "id": "1.6.4-minecrift-$VERSION", + "time": "2013-07-17T13:59:42-05:00", + "releaseTime": "2013-07-17T08:09:02-05:00", + "type": "release", + "processArguments": "username_session_version", + "minecraftArguments": "--username ${auth_player_name} --session ${auth_session} --version ${version_name} --gameDir ${game_directory} --assetsDir ${game_assets} --tweakClass cpw.mods.fml.common.launcher.FMLTweaker", + "libraries": [ + { + "name": "com.paulscode:codecjorbis:20101023" + }, + { + "name": "com.paulscode:codecwav:20101023" + }, + { + "name": "com.paulscode:libraryjavasound:20101123" + }, + { + "name": "com.paulscode:librarylwjglopenal:20100824" + }, + { + "name": "com.paulscode:soundsystem:20120107" + }, + { + "name": "argo:argo:2.25_fixed" + }, + { + "name": "org.bouncycastle:bcprov-jdk15on:1.47" + }, + { + "name": "com.google.guava:guava:14.0" + }, + { + "name": "org.apache.commons:commons-lang3:3.1" + }, + { + "name": "commons-io:commons-io:2.4" + }, + { + "name": "net.java.jinput:jinput:2.0.5" + }, + { + "name": "net.java.jutils:jutils:1.0.0" + }, + { + "name": "com.google.code.gson:gson:2.2.2" + }, + { + "name": "optifine:OptiFine:1.6.4_HD_U_C6" + }, + { + "name": "de.fruitfly.ovr:JRift:0.2.5.1", + "url": "http://repo.minecraft-vr.com/" + }, + { + "name": "net.minecraftforge:minecraftforge:$FORGE_VERSION", + "url": "http://files.minecraftforge.net/maven/" + }, + { + "name": "net.minecraft:launchwrapper:1.7", + "serverreq": true + }, + { + "name": "org.ow2.asm:asm-all:4.1", + "serverreq": true + }, + { + "name": "net.sf.jopt-simple:jopt-simple:4.5", + "serverreq": true + }, + { + "name": "lzma:lzma:0.0.1", + "serverreq": true + }, + { + "name": "net.aib42.mumblelink:JMumble:1.0", + "url": "http://repo.minecraft-vr.com/" + }, + { + "name": "org.lwjgl.lwjgl:lwjgl:2.9.0", + "rules": [ + { + "action": "allow" + }, + { + "action": "disallow", + "os": { + "name": "osx", + "version": "^10\\.5\\.\\d$" + } + } + ] + }, + { + "name": "org.lwjgl.lwjgl:lwjgl_util:2.9.0", + "rules": [ + { + "action": "allow" + }, + { + "action": "disallow", + "os": { + "name": "osx", + "version": "^10\\.5\\.\\d$" + } + } + ] + }, + { + "name": "org.lwjgl.lwjgl:lwjgl-platform:2.9.0", + "rules": [ + { + "action": "allow" + }, + { + "action": "disallow", + "os": { + "name": "osx", + "version": "^10\\.5\\.\\d$" + } + } + ], + "natives": { + "linux": "natives-linux", + "windows": "natives-windows", + "osx": "natives-osx" + }, + "extract": { + "exclude": [ + "META-INF/" + ] + } + }, + { + "name": "org.lwjgl.lwjgl:lwjgl:2.9.1-nightly-20130708-debug3", + "rules": [ + { + "action": "allow", + "os": { + "name": "osx", + "version": "^10\\.5\\.\\d$" + } + } + ] + }, + { + "name": "org.lwjgl.lwjgl:lwjgl_util:2.9.1-nightly-20130708-debug3", + "rules": [ + { + "action": "allow", + "os": { + "name": "osx", + "version": "^10\\.5\\.\\d$" + } + } + ] + }, + { + "name": "org.lwjgl.lwjgl:lwjgl-platform:2.9.1-nightly-20130708-debug3", + "rules": [ + { + "action": "allow", + "os": { + "name": "osx", + "version": "^10\\.5\\.\\d$" + } + } + ], + "natives": { + "linux": "natives-linux", + "windows": "natives-windows", + "osx": "natives-osx" + }, + "extract": { + "exclude": [ + "META-INF/" + ] + } + }, + { + "name": "net.java.jinput:jinput-platform:2.0.5", + "natives": { + "linux": "natives-linux", + "windows": "natives-windows", + "osx": "natives-osx" + }, + "extract": { + "exclude": [ + "META-INF/" + ] + } + }, + { + "name": "de.fruitfly.ovr:JRiftLibrary:0.2.5.1", + "url": "http://repo.minecraft-vr.com/", + "natives": { + "linux": "natives-linux", + "windows": "natives-windows", + "osx": "natives-osx" + }, + "extract": { + "exclude": [ + "META-INF/" + ] + } + }, + { + "name": "net.aib42.mumblelink:JMumbleLibrary:1.1", + "url": "http://repo.minecraft-vr.com/", + "natives": { + "linux": "natives-linux", + "windows": "natives-windows", + "osx": "natives-osx" + }, + "extract": { + "exclude": [ + "META-INF/" + ] + } + } + ], + "mainClass": "net.minecraft.launchwrapper.Launch", + "minimumLauncherVersion": 4, + "synced": false +} diff --git a/installer/1.6.4-forge.json b/installer/1.6.4-forge.json new file mode 100644 index 00000000..d4961238 --- /dev/null +++ b/installer/1.6.4-forge.json @@ -0,0 +1,243 @@ +{ + "id": "1.6.4-minecrift-$VERSION", + "time": "2013-07-17T13:59:42-05:00", + "releaseTime": "2013-07-17T08:09:02-05:00", + "type": "release", + "processArguments": "username_session_version", + "minecraftArguments": "--username ${auth_player_name} --session ${auth_session} --version ${version_name} --gameDir ${game_directory} --assetsDir ${game_assets} --tweakClass cpw.mods.fml.common.launcher.FMLTweaker", + "libraries": [ + { + "name": "com.paulscode:codecjorbis:20101023" + }, + { + "name": "com.paulscode:codecwav:20101023" + }, + { + "name": "com.paulscode:libraryjavasound:20101123" + }, + { + "name": "com.paulscode:librarylwjglopenal:20100824" + }, + { + "name": "com.paulscode:soundsystem:20120107" + }, + { + "name": "argo:argo:2.25_fixed" + }, + { + "name": "org.bouncycastle:bcprov-jdk15on:1.47" + }, + { + "name": "com.google.guava:guava:14.0" + }, + { + "name": "org.apache.commons:commons-lang3:3.1" + }, + { + "name": "commons-io:commons-io:2.4" + }, + { + "name": "net.java.jinput:jinput:2.0.5" + }, + { + "name": "net.java.jutils:jutils:1.0.0" + }, + { + "name": "com.google.code.gson:gson:2.2.2" + }, + { + "name": "optifine:OptiFine:1.6.4_HD_U_C6" + }, + { + "name": "de.fruitfly.ovr:JRift:0.2.5.1", + "url": "http://repo.minecraft-vr.com/" + }, + { + "name": "com.sixense:SixenseJava:062612.1", + "url": "http://repo.minecraft-vr.com/" + }, + { + "name": "net.minecraftforge:minecraftforge:$FORGE_VERSION", + "url": "http://files.minecraftforge.net/maven/" + }, + { + "name": "net.minecraft:launchwrapper:1.7", + "serverreq": true + }, + { + "name": "org.ow2.asm:asm-all:4.1", + "serverreq": true + }, + { + "name": "net.sf.jopt-simple:jopt-simple:4.5", + "serverreq": true + }, + { + "name": "lzma:lzma:0.0.1", + "serverreq": true + }, + { + "name": "net.aib42.mumblelink:JMumble:1.0", + "url": "http://repo.minecraft-vr.com/" + }, + { + "name": "org.lwjgl.lwjgl:lwjgl:2.9.0", + "rules": [ + { + "action": "allow" + }, + { + "action": "disallow", + "os": { + "name": "osx", + "version": "^10\\.5\\.\\d$" + } + } + ] + }, + { + "name": "org.lwjgl.lwjgl:lwjgl_util:2.9.0", + "rules": [ + { + "action": "allow" + }, + { + "action": "disallow", + "os": { + "name": "osx", + "version": "^10\\.5\\.\\d$" + } + } + ] + }, + { + "name": "org.lwjgl.lwjgl:lwjgl-platform:2.9.0", + "rules": [ + { + "action": "allow" + }, + { + "action": "disallow", + "os": { + "name": "osx", + "version": "^10\\.5\\.\\d$" + } + } + ], + "natives": { + "linux": "natives-linux", + "windows": "natives-windows", + "osx": "natives-osx" + }, + "extract": { + "exclude": [ + "META-INF/" + ] + } + }, + { + "name": "org.lwjgl.lwjgl:lwjgl:2.9.1-nightly-20130708-debug3", + "rules": [ + { + "action": "allow", + "os": { + "name": "osx", + "version": "^10\\.5\\.\\d$" + } + } + ] + }, + { + "name": "org.lwjgl.lwjgl:lwjgl_util:2.9.1-nightly-20130708-debug3", + "rules": [ + { + "action": "allow", + "os": { + "name": "osx", + "version": "^10\\.5\\.\\d$" + } + } + ] + }, + { + "name": "org.lwjgl.lwjgl:lwjgl-platform:2.9.1-nightly-20130708-debug3", + "rules": [ + { + "action": "allow", + "os": { + "name": "osx", + "version": "^10\\.5\\.\\d$" + } + } + ], + "natives": { + "linux": "natives-linux", + "windows": "natives-windows", + "osx": "natives-osx" + }, + "extract": { + "exclude": [ + "META-INF/" + ] + } + }, + { + "name": "net.java.jinput:jinput-platform:2.0.5", + "natives": { + "linux": "natives-linux", + "windows": "natives-windows", + "osx": "natives-osx" + }, + "extract": { + "exclude": [ + "META-INF/" + ] + } + }, + { + "name": "de.fruitfly.ovr:JRiftLibrary:0.2.5.1", + "url": "http://repo.minecraft-vr.com/", + "natives": { + "linux": "natives-linux", + "windows": "natives-windows", + "osx": "natives-osx" + }, + "extract": { + "exclude": [ + "META-INF/" + ] + } + }, + { + "name": "net.aib42.mumblelink:JMumbleLibrary:1.1", + "url": "http://repo.minecraft-vr.com/", + "natives": { + "linux": "natives-linux", + "windows": "natives-windows", + "osx": "natives-osx" + }, + "extract": { + "exclude": [ + "META-INF/" + ] + } + }, + { + "name": "com.sixense:SixenseJavaLibrary:062612.0", + "url": "http://repo.minecraft-vr.com/", + "natives": { + "linux": "natives-linux", + "windows": "natives-windows", + "osx": "natives-osx" + }, + "extract": { + "exclude": [ + "META-INF/" + ] + } + } + ], + "mainClass": "net.minecraft.launchwrapper.Launch", + "minimumLauncherVersion": 4, + "synced": false +} diff --git a/installer/1.6.4-nohydra.json b/installer/1.6.4-nohydra.json new file mode 100644 index 00000000..f7605857 --- /dev/null +++ b/installer/1.6.4-nohydra.json @@ -0,0 +1,215 @@ +{ + "id": "1.6.4-minecrift-$VERSION", + "time": "2013-07-17T13:59:42-05:00", + "releaseTime": "2013-07-17T08:09:02-05:00", + "type": "release", + "minecraftArguments": "--username ${auth_player_name} --session ${auth_session} --version ${version_name} --gameDir ${game_directory} --assetsDir ${game_assets} --tweakClass optifine.OptiFineTweaker", + "libraries": [ + { + "name": "net.sf.jopt-simple:jopt-simple:4.5" + }, + { + "name": "com.paulscode:codecjorbis:20101023" + }, + { + "name": "com.paulscode:codecwav:20101023" + }, + { + "name": "com.paulscode:libraryjavasound:20101123" + }, + { + "name": "com.paulscode:librarylwjglopenal:20100824" + }, + { + "name": "com.paulscode:soundsystem:20120107" + }, + { + "name": "argo:argo:2.25_fixed" + }, + { + "name": "org.bouncycastle:bcprov-jdk15on:1.47" + }, + { + "name": "com.google.guava:guava:14.0" + }, + { + "name": "org.apache.commons:commons-lang3:3.1" + }, + { + "name": "commons-io:commons-io:2.4" + }, + { + "name": "net.java.jinput:jinput:2.0.5" + }, + { + "name": "net.java.jutils:jutils:1.0.0" + }, + { + "name": "com.google.code.gson:gson:2.2.2" + }, + { + "name": "optifine:OptiFine:1.6.4_HD_U_C6" + }, + { + "name": "de.fruitfly.ovr:JRift:0.2.5.1", + "url": "http://repo.minecraft-vr.com/" + }, + { + "name": "net.minecraft:launchwrapper:1.7", + "serverreq": true + }, + { + "name": "org.ow2.asm:asm-all:4.1", + "serverreq": true + }, + { + "name": "net.aib42.mumblelink:JMumble:1.0", + "url": "http://repo.minecraft-vr.com/" + }, + { + "name": "org.lwjgl.lwjgl:lwjgl:2.9.0", + "rules": [ + { + "action": "allow" + }, + { + "action": "disallow", + "os": { + "name": "osx", + "version": "^10\\.5\\.\\d$" + } + } + ] + }, + { + "name": "org.lwjgl.lwjgl:lwjgl_util:2.9.0", + "rules": [ + { + "action": "allow" + }, + { + "action": "disallow", + "os": { + "name": "osx", + "version": "^10\\.5\\.\\d$" + } + } + ] + }, + { + "name": "org.lwjgl.lwjgl:lwjgl-platform:2.9.0", + "rules": [ + { + "action": "allow" + }, + { + "action": "disallow", + "os": { + "name": "osx", + "version": "^10\\.5\\.\\d$" + } + } + ], + "natives": { + "linux": "natives-linux", + "windows": "natives-windows", + "osx": "natives-osx" + }, + "extract": { + "exclude": [ + "META-INF/" + ] + } + }, + { + "name": "org.lwjgl.lwjgl:lwjgl:2.9.1-nightly-20130708-debug3", + "rules": [ + { + "action": "allow", + "os": { + "name": "osx", + "version": "^10\\.5\\.\\d$" + } + } + ] + }, + { + "name": "org.lwjgl.lwjgl:lwjgl_util:2.9.1-nightly-20130708-debug3", + "rules": [ + { + "action": "allow", + "os": { + "name": "osx", + "version": "^10\\.5\\.\\d$" + } + } + ] + }, + { + "name": "org.lwjgl.lwjgl:lwjgl-platform:2.9.1-nightly-20130708-debug3", + "rules": [ + { + "action": "allow", + "os": { + "name": "osx", + "version": "^10\\.5\\.\\d$" + } + } + ], + "natives": { + "linux": "natives-linux", + "windows": "natives-windows", + "osx": "natives-osx" + }, + "extract": { + "exclude": [ + "META-INF/" + ] + } + }, + { + "name": "net.java.jinput:jinput-platform:2.0.5", + "natives": { + "linux": "natives-linux", + "windows": "natives-windows", + "osx": "natives-osx" + }, + "extract": { + "exclude": [ + "META-INF/" + ] + } + }, + { + "name": "de.fruitfly.ovr:JRiftLibrary:0.2.5.1", + "url": "http://repo.minecraft-vr.com/", + "natives": { + "linux": "natives-linux", + "windows": "natives-windows", + "osx": "natives-osx" + }, + "extract": { + "exclude": [ + "META-INF/" + ] + } + }, + { + "name": "net.aib42.mumblelink:JMumbleLibrary:1.1", + "url": "http://repo.minecraft-vr.com/", + "natives": { + "linux": "natives-linux", + "windows": "natives-windows", + "osx": "natives-osx" + }, + "extract": { + "exclude": [ + "META-INF/" + ] + } + } + ], + "mainClass": "net.minecraft.launchwrapper.Launch", + "minimumLauncherVersion": 4, + "synced": false +} \ No newline at end of file diff --git a/installer/1.6.4.json b/installer/1.6.4.json new file mode 100644 index 00000000..8518bfdc --- /dev/null +++ b/installer/1.6.4.json @@ -0,0 +1,233 @@ +{ + "id": "1.6.4-minecrift-$VERSION", + "time": "2013-07-17T13:59:42-05:00", + "releaseTime": "2013-07-17T08:09:02-05:00", + "type": "release", + "minecraftArguments": "--username ${auth_player_name} --session ${auth_session} --version ${version_name} --gameDir ${game_directory} --assetsDir ${game_assets} --tweakClass optifine.OptiFineTweaker", + "libraries": [ + { + "name": "net.sf.jopt-simple:jopt-simple:4.5" + }, + { + "name": "com.paulscode:codecjorbis:20101023" + }, + { + "name": "com.paulscode:codecwav:20101023" + }, + { + "name": "com.paulscode:libraryjavasound:20101123" + }, + { + "name": "com.paulscode:librarylwjglopenal:20100824" + }, + { + "name": "com.paulscode:soundsystem:20120107" + }, + { + "name": "argo:argo:2.25_fixed" + }, + { + "name": "org.bouncycastle:bcprov-jdk15on:1.47" + }, + { + "name": "com.google.guava:guava:14.0" + }, + { + "name": "org.apache.commons:commons-lang3:3.1" + }, + { + "name": "commons-io:commons-io:2.4" + }, + { + "name": "net.java.jinput:jinput:2.0.5" + }, + { + "name": "net.java.jutils:jutils:1.0.0" + }, + { + "name": "com.google.code.gson:gson:2.2.2" + }, + { + "name": "optifine:OptiFine:1.6.4_HD_U_C6" + }, + { + "name": "de.fruitfly.ovr:JRift:0.2.5.1", + "url": "http://repo.minecraft-vr.com/" + }, + { + "name": "com.sixense:SixenseJava:062612.1", + "url": "http://repo.minecraft-vr.com/" + }, + { + "name": "net.minecraft:launchwrapper:1.7", + "serverreq": true + }, + { + "name": "org.ow2.asm:asm-all:4.1", + "serverreq": true + }, + { + "name": "net.aib42.mumblelink:JMumble:1.0", + "url": "http://repo.minecraft-vr.com/" + }, + { + "name": "org.lwjgl.lwjgl:lwjgl:2.9.0", + "rules": [ + { + "action": "allow" + }, + { + "action": "disallow", + "os": { + "name": "osx", + "version": "^10\\.5\\.\\d$" + } + } + ] + }, + { + "name": "org.lwjgl.lwjgl:lwjgl_util:2.9.0", + "rules": [ + { + "action": "allow" + }, + { + "action": "disallow", + "os": { + "name": "osx", + "version": "^10\\.5\\.\\d$" + } + } + ] + }, + { + "name": "org.lwjgl.lwjgl:lwjgl-platform:2.9.0", + "rules": [ + { + "action": "allow" + }, + { + "action": "disallow", + "os": { + "name": "osx", + "version": "^10\\.5\\.\\d$" + } + } + ], + "natives": { + "linux": "natives-linux", + "windows": "natives-windows", + "osx": "natives-osx" + }, + "extract": { + "exclude": [ + "META-INF/" + ] + } + }, + { + "name": "org.lwjgl.lwjgl:lwjgl:2.9.1-nightly-20130708-debug3", + "rules": [ + { + "action": "allow", + "os": { + "name": "osx", + "version": "^10\\.5\\.\\d$" + } + } + ] + }, + { + "name": "org.lwjgl.lwjgl:lwjgl_util:2.9.1-nightly-20130708-debug3", + "rules": [ + { + "action": "allow", + "os": { + "name": "osx", + "version": "^10\\.5\\.\\d$" + } + } + ] + }, + { + "name": "org.lwjgl.lwjgl:lwjgl-platform:2.9.1-nightly-20130708-debug3", + "rules": [ + { + "action": "allow", + "os": { + "name": "osx", + "version": "^10\\.5\\.\\d$" + } + } + ], + "natives": { + "linux": "natives-linux", + "windows": "natives-windows", + "osx": "natives-osx" + }, + "extract": { + "exclude": [ + "META-INF/" + ] + } + }, + { + "name": "net.java.jinput:jinput-platform:2.0.5", + "natives": { + "linux": "natives-linux", + "windows": "natives-windows", + "osx": "natives-osx" + }, + "extract": { + "exclude": [ + "META-INF/" + ] + } + }, + { + "name": "de.fruitfly.ovr:JRiftLibrary:0.2.5.1", + "url": "http://repo.minecraft-vr.com/", + "natives": { + "linux": "natives-linux", + "windows": "natives-windows", + "osx": "natives-osx" + }, + "extract": { + "exclude": [ + "META-INF/" + ] + } + }, + { + "name": "net.aib42.mumblelink:JMumbleLibrary:1.1", + "url": "http://repo.minecraft-vr.com/", + "natives": { + "linux": "natives-linux", + "windows": "natives-windows", + "osx": "natives-osx" + }, + "extract": { + "exclude": [ + "META-INF/" + ] + } + }, + { + "name": "com.sixense:SixenseJavaLibrary:062612.0", + "url": "http://repo.minecraft-vr.com/", + "natives": { + "linux": "natives-linux", + "windows": "natives-windows", + "osx": "natives-osx" + }, + "extract": { + "exclude": [ + "META-INF/" + ] + } + } + ], + "mainClass": "net.minecraft.launchwrapper.Launch", + "minimumLauncherVersion": 4, + "synced": false +} \ No newline at end of file diff --git a/installer/Installer.java b/installer/Installer.java index 039c1fd8..006fb57b 100644 --- a/installer/Installer.java +++ b/installer/Installer.java @@ -24,7 +24,7 @@ /** * Derived from https://github.com/MinecraftForge/Installer/ - * Copyright 2013 MinecraftForge developers and Mark Browning + * Copyright 2013 MinecraftForge developers, Mark Browning, StellaArtois * * Licensed under GNU LGPL v2.1 or later. * @@ -33,10 +33,12 @@ */ public class Installer extends JPanel implements PropertyChangeListener { private static final long serialVersionUID = -562178983462626162L; - private static final String MC_VERSION = "1.6.2"; - private static final String OF_VERSION = "1.6.2_HD_U_B3"; - private InstallTask task; + private static final String MC_VERSION = "1.6.4"; + private static final String OF_VERSION = "1.6.4_HD_U_C6"; + private static final String OF_VERSION_EXT = "jar"; + private static final String OF_LIB_PATH = "libraries/optifine/OptiFine/"; + private InstallTask task; static private File targetDir; private JTextField selectedDirText; @@ -56,19 +58,20 @@ class InstallTask extends SwingWorker{ private boolean DownloadOptiFine() { try { - File fod = new File(targetDir,"libraries/net/optifine/OptiFine/"+OF_VERSION); + File fod = new File(targetDir,OF_LIB_PATH+OF_VERSION); fod.mkdirs(); File fo = new File(fod,"OptiFine-"+OF_VERSION+".jar"); if( fo.exists() && fo.length() > 375500 ) return true; - URL url = new URL("http://optifine.net/download.php?f=OptiFine_"+OF_VERSION+".zip"); + String surl = "http://optifine.net/download.php?f=OptiFine_"+OF_VERSION+"."+OF_VERSION_EXT; + URL url = new URL(surl); ReadableByteChannel rbc = Channels.newChannel(url.openStream()); FileOutputStream fos = new FileOutputStream(fo); boolean success = fos.getChannel().transferFrom(rbc, 0, Long.MAX_VALUE) > 0 ; fos.close(); return success; } catch (Exception e) { - finalMessage += "Error: "+e.getLocalizedMessage(); + finalMessage += " Error: "+e.getLocalizedMessage(); } return false; } @@ -102,7 +105,7 @@ private boolean SetupMinecraftAsLibrary() { lib_jar.close(); return true; } catch (Exception e) { - finalMessage += "Error: "+e.getLocalizedMessage(); + finalMessage += " Error: "+e.getLocalizedMessage(); } return false; } @@ -179,7 +182,7 @@ public int read(byte[] buff) throws IOException { null_jar.close(); return ver_json_file.exists() && ver_file.exists(); } catch (Exception e) { - finalMessage += "Error: "+e.getLocalizedMessage(); + finalMessage += " Error: "+e.getLocalizedMessage(); } } @@ -201,7 +204,7 @@ public Void doInBackground() { return null; } setProgress(50); - finalMessage = "Failed: Couldn't setup Minecraft "+MC_VERSION+" as library. Have you run "+MC_VERSION+"at least once yet?"; + finalMessage = "Failed: Couldn't setup Minecraft "+MC_VERSION+" as library. Have you run "+MC_VERSION+" at least once yet?"; if(!SetupMinecraftAsLibrary()) { return null; @@ -331,7 +334,7 @@ public Installer(File targetDir) version = "UNKNOWN"; try { - InputStream ver =Installer.class.getResourceAsStream("version"); + InputStream ver = Installer.class.getResourceAsStream("version"); if( ver != null ) { String[] tok = new BufferedReader(new InputStreamReader(ver)).readLine().split(":"); diff --git a/installer/META-INF/MANIFEST.MF b/installer/META-INF/MANIFEST.MF new file mode 100644 index 00000000..39b7f6f0 --- /dev/null +++ b/installer/META-INF/MANIFEST.MF @@ -0,0 +1,3 @@ +Manifest-Version: 1.0 +Main-Class: Installer + diff --git a/installer/installer.jar b/installer/installer.jar index b1d6b25fc7e2bda39c594daa6716c7b58cdaaee4..724063e551fcb92532477c6fee27a05367f2d30b 100644 GIT binary patch delta 14056 zcma)j18^YS)@>%XZQGvM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)Math.PI * 0.2F) * 0.3F; - } -+ -+ protected void updateCamera( float par1, boolean var14 ) -+ { -+ this.mc.mcProfiler.startSection("mouse"); -+ -+ if (this.mc.inGameHasFocus && var14) -+ { -+ this.mc.mouseHelper.mouseXYChange(); -+ float var4 = this.mc.gameSettings.mouseSensitivity * 0.6F + 0.2F; -+ float var5 = var4 * var4 * var4 * 8.0F; -+ float var6 = (float)this.mc.mouseHelper.deltaX * var5; -+ float var7 = (float)this.mc.mouseHelper.deltaY * var5; -+ byte var8 = 1; -+ -+ if (this.mc.gameSettings.invertMouse) -+ { -+ var8 = -1; -+ } -+ -+ if (this.mc.gameSettings.smoothCamera) -+ { -+ this.smoothCamYaw += var6; -+ this.smoothCamPitch += var7; -+ float var9 = par1 - this.smoothCamPartialTicks; -+ this.smoothCamPartialTicks = par1; -+ var6 = this.smoothCamFilterX * var9; -+ var7 = this.smoothCamFilterY * var9; -+ this.mc.thePlayer.setAngles(var6, var7 * (float)var8); -+ } -+ else -+ { -+ this.mc.thePlayer.setAngles(var6, var7 * (float)var8); -+ } -+ } - -+ this.mc.mcProfiler.endSection(); -+ -+ } -+ - /** - * Will update any inputs that effect the camera angle (mouse) and then render the world and GUI - */ -@@ -999,6 +1050,29 @@ - Config.setNewRelease((String)null); - } - -+ if (var2 != null) -+ { -+ if (checkAspectRatio && this.mc.vrSettings.useVRRenderer) -+ { -+ if (this.mc.hmdInfo != null && !this.mc.hmdInfo.getHMDInfo().isFakeData) -+ { -+ int hmdScreenWidthPixels = this.mc.hmdInfo.getHMDInfo().HResolution; -+ int hmdScreenHeightPixels = this.mc.hmdInfo.getHMDInfo().VResolution; -+ -+ DisplayMode e = Display.getDisplayMode(); -+ if (hmdScreenWidthPixels != e.getWidth() || hmdScreenHeightPixels != e.getHeight()) -+ { -+ this.mc.printChatMessage("Warning: Non-native display resolution, perspective may be skewed! Ideally set your display to full-screen " + hmdScreenWidthPixels + "x" + hmdScreenHeightPixels + "."); -+ } -+ } -+ } -+ checkAspectRatio = false; -+ } -+ else -+ { -+ checkAspectRatio = true; -+ } -+ - if (this.mc.currentScreen instanceof GuiMainMenu) - { - this.updateMainMenu((GuiMainMenu)this.mc.currentScreen); -@@ -1028,7 +1102,7 @@ - { - if (Minecraft.getSystemTime() - this.prevFrameTime > 500L) - { -- this.mc.displayInGameMenu(); -+ this.mc.displayInGameMenu(); - } - } - else -@@ -1036,124 +1110,98 @@ - this.prevFrameTime = Minecraft.getSystemTime(); - } - -- this.mc.mcProfiler.startSection("mouse"); -+ updateCamera( par1, var14 ); - -- if (this.mc.inGameHasFocus && var14) -+ if (!this.mc.skipRenderWorld) - { -- this.mc.mouseHelper.mouseXYChange(); -- float var4 = this.mc.gameSettings.mouseSensitivity * 0.6F + 0.2F; -- float var5 = var4 * var4 * var4 * 8.0F; -- float var6 = (float)this.mc.mouseHelper.deltaX * var5; -- float var7 = (float)this.mc.mouseHelper.deltaY * var5; -- byte var8 = 1; -- -- if (this.mc.gameSettings.invertMouse) -- { -- var8 = -1; -- } -- -- if (this.mc.gameSettings.smoothCamera) -- { -- this.smoothCamYaw += var6; -- this.smoothCamPitch += var7; -- float var9 = par1 - this.smoothCamPartialTicks; -- this.smoothCamPartialTicks = par1; -- var6 = this.smoothCamFilterX * var9; -- var7 = this.smoothCamFilterY * var9; -- this.mc.thePlayer.setAngles(var6, var7 * (float)var8); -- } -- else -- { -- this.mc.thePlayer.setAngles(var6, var7 * (float)var8); -- } -+ renderGUIandWorld(par1); - } - -- this.mc.mcProfiler.endSection(); -+ this.waitForServerThread(); - -- if (!this.mc.skipRenderWorld) -+ if (this.mc.gameSettings.showDebugInfo != this.lastShowDebugInfo) - { -- anaglyphEnable = this.mc.gameSettings.anaglyph; -- ScaledResolution var15 = new ScaledResolution(this.mc.gameSettings, this.mc.displayWidth, this.mc.displayHeight); -- int var16 = var15.getScaledWidth(); -- int var17 = var15.getScaledHeight(); -- int var18 = Mouse.getX() * var16 / this.mc.displayWidth; -- int var20 = var17 - Mouse.getY() * var17 / this.mc.displayHeight - 1; -- int var19 = performanceToFps(this.mc.gameSettings.limitFramerate); -+ this.showExtendedDebugInfo = this.mc.gameSettings.showDebugProfilerChart; -+ this.lastShowDebugInfo = this.mc.gameSettings.showDebugInfo; -+ } - -- if (this.mc.theWorld != null) -- { -- this.mc.mcProfiler.startSection("level"); -+ if (this.mc.gameSettings.showDebugInfo) -+ { -+ this.showLagometer(this.mc.mcProfiler.timeTickNano, this.mc.mcProfiler.timeUpdateChunksNano); -+ } - -- if (this.mc.gameSettings.limitFramerate == 0) -- { -- this.renderWorld(par1, 0L); -- } -- else -- { -- this.renderWorld(par1, this.renderEndNanoTime + (long)(1000000000 / var19)); -- } -+ if (this.mc.gameSettings.ofProfiler) -+ { -+ this.mc.gameSettings.showDebugProfilerChart = true; -+ } -+ } - -- this.renderEndNanoTime = System.nanoTime(); -- this.mc.mcProfiler.endStartSection("gui"); -+ protected void renderGUIandWorld(float par1) -+ { -+ anaglyphEnable = this.mc.gameSettings.anaglyph; -+ ScaledResolution var15 = new ScaledResolution(this.mc.gameSettings, this.mc.displayWidth, this.mc.displayHeight); -+ int var16 = var15.getScaledWidth(); -+ int var17 = var15.getScaledHeight(); -+ int var18 = Mouse.getX() * var16 / this.mc.displayWidth; -+ int var20 = var17 - Mouse.getY() * var17 / this.mc.displayHeight - 1; -+ int var19 = performanceToFps(this.mc.gameSettings.limitFramerate); - -- if (!this.mc.gameSettings.hideGUI || this.mc.currentScreen != null) -- { -- this.mc.ingameGUI.renderGameOverlay(par1, this.mc.currentScreen != null, var18, var20); -- } -+ if (this.mc.theWorld != null) -+ { -+ this.mc.mcProfiler.startSection("level"); - -- this.mc.mcProfiler.endSection(); -+ if (this.mc.gameSettings.limitFramerate == 0) -+ { -+ this.renderWorld(par1, 0L); - } - else - { -- GL11.glViewport(0, 0, this.mc.displayWidth, this.mc.displayHeight); -- GL11.glMatrixMode(GL11.GL_PROJECTION); -- GL11.glLoadIdentity(); -- GL11.glMatrixMode(GL11.GL_MODELVIEW); -- GL11.glLoadIdentity(); -- this.setupOverlayRendering(); -- this.renderEndNanoTime = System.nanoTime(); -+ this.renderWorld(par1, this.renderEndNanoTime + (long)(1000000000 / var19)); - } - -- if (this.mc.currentScreen != null) -- { -- GL11.glClear(GL11.GL_DEPTH_BUFFER_BIT); -+ this.renderEndNanoTime = System.nanoTime(); -+ this.mc.mcProfiler.endStartSection("gui"); - -- try -- { -- this.mc.currentScreen.drawScreen(var18, var20, par1); -- } -- catch (Throwable var13) -- { -- CrashReport var11 = CrashReport.makeCrashReport(var13, "Rendering screen"); -- CrashReportCategory var12 = var11.makeCategory("Screen render details"); -- var12.addCrashSectionCallable("Screen name", new CallableScreenName(this)); -- var12.addCrashSectionCallable("Mouse location", new CallableMouseLocation(this, var18, var20)); -- var12.addCrashSectionCallable("Screen size", new CallableScreenSize(this, var15)); -- throw new ReportedException(var11); -- } -+ if (!this.mc.gameSettings.hideGUI || this.mc.currentScreen != null) -+ { -+ this.mc.ingameGUI.renderGameOverlay(par1, this.mc.currentScreen != null, var18, var20); - } -- } -- -- this.waitForServerThread(); - -- if (this.mc.gameSettings.showDebugInfo != this.lastShowDebugInfo) -- { -- this.showExtendedDebugInfo = this.mc.gameSettings.showDebugProfilerChart; -- this.lastShowDebugInfo = this.mc.gameSettings.showDebugInfo; -+ this.mc.mcProfiler.endSection(); - } -- -- if (this.mc.gameSettings.showDebugInfo) -+ else - { -- this.showLagometer(this.mc.mcProfiler.timeTickNano, this.mc.mcProfiler.timeUpdateChunksNano); -+ GL11.glViewport(0, 0, this.mc.displayWidth, this.mc.displayHeight); -+ GL11.glMatrixMode(GL11.GL_PROJECTION); -+ GL11.glLoadIdentity(); -+ GL11.glMatrixMode(GL11.GL_MODELVIEW); -+ GL11.glLoadIdentity(); -+ this.setupOverlayRendering(); -+ this.renderEndNanoTime = System.nanoTime(); - } - -- if (this.mc.gameSettings.ofProfiler) -+ if (this.mc.currentScreen != null) - { -- this.mc.gameSettings.showDebugProfilerChart = true; -+ GL11.glClear(GL11.GL_DEPTH_BUFFER_BIT); -+ -+ try -+ { -+ this.mc.currentScreen.drawScreen(var18, var20, par1); -+ GL11.glDisable(GL11.GL_LIGHTING); -+ } -+ catch (Throwable var13) -+ { -+ CrashReport var11 = CrashReport.makeCrashReport(var13, "Rendering screen"); -+ CrashReportCategory var12 = var11.makeCategory("Screen render details"); -+ var12.addCrashSectionCallable("Screen name", new CallableScreenName(this)); -+ var12.addCrashSectionCallable("Mouse location", new CallableMouseLocation(this, var18, var20)); -+ var12.addCrashSectionCallable("Screen size", new CallableScreenSize(this, var15)); -+ throw new ReportedException(var11); -+ } - } - } - -- private void waitForServerThread() -+ protected void waitForServerThread() - { - this.serverWaitTimeCurrent = 0; - -@@ -1600,7 +1648,7 @@ - /** - * Render clouds if enabled - */ -- private void renderCloudsCheck(RenderGlobal par1RenderGlobal, float par2) -+ protected void renderCloudsCheck(RenderGlobal par1RenderGlobal, float par2) - { - if (this.mc.gameSettings.shouldRenderClouds()) - { -@@ -1904,7 +1952,7 @@ - /** - * calculates fog and calls glClearColor - */ -- private void updateFogColor(float par1) -+ protected void updateFogColor(float par1) - { - WorldClient var2 = this.mc.theWorld; - EntityLivingBase var3 = this.mc.renderViewEntity; -@@ -2115,7 +2163,7 @@ - * Sets up the fog to be rendered. If the arg passed in is -1 the fog starts at 0 and goes to 80% of far plane - * distance and is used for sky rendering. - */ -- private void setupFog(int par1, float par2) -+ protected void setupFog(int par1, float par2) - { - EntityLivingBase var3 = this.mc.renderViewEntity; - boolean var4 = false; -@@ -2293,25 +2341,14 @@ - { - Minecraft var1 = Config.getMinecraft(); - -- if (var1.currentScreen != null && var1.currentScreen instanceof GuiMainMenu) -- { -- return 35; -- } -- else if (var1.theWorld == null) -+ int var2 = Config.getGameSettings().ofLimitFramerateFine; -+ -+ if (var2 <= 0) - { -- return 35; -+ var2 = 10000; - } -- else -- { -- int var2 = Config.getGameSettings().ofLimitFramerateFine; - -- if (var2 <= 0) -- { -- var2 = 10000; -- } -- -- return var2; -- } -+ return var2; - } - - /** +--- a/net/minecraft/src/EntityRenderer.java ++++ b/net/minecraft/src/EntityRenderer.java +@@ -9,29 +9,31 @@ + import org.lwjgl.input.Keyboard; + import org.lwjgl.input.Mouse; + import org.lwjgl.opengl.Display; ++import org.lwjgl.opengl.DisplayMode; + import org.lwjgl.opengl.GL11; + import org.lwjgl.opengl.GLContext; + import org.lwjgl.util.glu.Project; + + public class EntityRenderer + { +- private static final ResourceLocation locationRainPng = new ResourceLocation("textures/environment/rain.png"); +- private static final ResourceLocation locationSnowPng = new ResourceLocation("textures/environment/snow.png"); ++ protected static final ResourceLocation locationRainPng = new ResourceLocation("textures/environment/rain.png"); ++ protected static final ResourceLocation locationSnowPng = new ResourceLocation("textures/environment/snow.png"); + public static boolean anaglyphEnable; + + /** Anaglyph field (0=R, 1=GB) */ + public static int anaglyphField; + + /** A reference to the Minecraft object. */ +- private Minecraft mc; +- private float farPlaneDistance; ++ protected Minecraft mc; ++ protected float farPlaneDistance = 0.0F; ++ protected float prevFarPlaneDistance = 0.0F; + public ItemRenderer itemRenderer; + + /** Entity renderer update count */ +- private int rendererUpdateCount; ++ protected int rendererUpdateCount; + + /** Pointed entity */ +- private Entity pointedEntity; ++ protected Entity pointedEntity; + private MouseFilter mouseFilterXAxis = new MouseFilter(); + private MouseFilter mouseFilterYAxis = new MouseFilter(); + +@@ -46,33 +48,32 @@ + + /** Mouse filter dummy 4 */ + private MouseFilter mouseFilterDummy4 = new MouseFilter(); +- private float thirdPersonDistance = 4.0F; ++ protected float thirdPersonDistance = 4.0F; + + /** Third person distance temp */ +- private float thirdPersonDistanceTemp = 4.0F; +- private float debugCamYaw; +- private float prevDebugCamYaw; +- private float debugCamPitch; +- private float prevDebugCamPitch; ++ protected float thirdPersonDistanceTemp = 4.0F; ++ protected float debugCamYaw = 0.0F; ++ protected float prevDebugCamYaw = 0.0F; ++ protected float debugCamPitch = 0.0F; ++ protected float prevDebugCamPitch = 0.0F; + + /** Smooth cam yaw */ +- private float smoothCamYaw; ++ protected float smoothCamYaw; + + /** Smooth cam pitch */ + private float smoothCamPitch; + + /** Smooth cam filter X */ +- private float smoothCamFilterX; ++ protected float smoothCamFilterX; + + /** Smooth cam filter Y */ +- private float smoothCamFilterY; ++ protected float smoothCamFilterY; + + /** Smooth cam partial ticks */ +- private float smoothCamPartialTicks; ++ protected float smoothCamPartialTicks; + private float debugCamFOV; + private float prevDebugCamFOV; + private float camRoll; +- private float prevCamRoll; + + /** + * The texture id of the blocklight/skylight texture used for lighting effects +@@ -97,37 +98,44 @@ + private float field_82832_V; + + /** Cloud fog mode */ +- private boolean cloudFog; +- private double cameraZoom = 1.0D; +- private double cameraYaw; +- private double cameraPitch; ++ protected boolean cloudFog = false; ++ protected double cameraZoom = 1.0D; ++ ++ protected float cameraYaw = 0.0F; //head + body ++ protected float cameraPitch = 0.0F; //head + additional input(moues if enabled) ++ protected float cameraRoll = 0.0F; ++ protected float prevCamYaw = 0.0F; ++ protected float prevCamPitch = 0.0F; ++ protected float prevCamRoll = 0.0F; ++ ++ protected boolean checkAspectRatio = true; + + /** Previous frame time in milliseconds */ + private long prevFrameTime = Minecraft.getSystemTime(); + + /** End time of last render (ns) */ +- private long renderEndNanoTime; ++ private long renderEndNanoTime = 0L; + + /** + * Is set, updateCameraAndRender() calls updateLightmap(); set by updateTorchFlicker() + */ +- private boolean lightmapUpdateNeeded; ++ protected boolean lightmapUpdateNeeded = false; + + /** Torch flicker X */ +- float torchFlickerX; ++ float torchFlickerX = 0.0F; + + /** Torch flicker DX */ +- float torchFlickerDX; ++ float torchFlickerDX = 0.0F; + + /** Torch flicker Y */ +- float torchFlickerY; ++ float torchFlickerY = 0.0F; + + /** Torch flicker DY */ +- float torchFlickerDY; ++ float torchFlickerDY = 0.0F; + private Random random = new Random(); + + /** Rain sound counter */ +- private int rainSoundCounter; ++ private int rainSoundCounter = 0; + + /** Rain X coords */ + float[] rainXCoords; +@@ -139,13 +147,13 @@ + FloatBuffer fogColorBuffer = GLAllocation.createDirectFloatBuffer(16); + + /** red component of the fog color */ +- float fogColorRed; ++ protected float fogColorRed; + + /** green component of the fog color */ +- float fogColorGreen; ++ protected float fogColorGreen; + + /** blue component of the fog color */ +- float fogColorBlue; ++ protected float fogColorBlue; + + /** Fog color 2 */ + private float fogColor2; +@@ -158,11 +166,11 @@ + */ + public int debugViewDirection; + private boolean initialized = false; +- private World updatedWorld = null; ++ protected World updatedWorld = null; + private boolean showDebugInfo = false; + public boolean fogStandard = false; +- private long lastServerTime = 0L; +- private int lastServerTicks = 0; ++ protected long lastServerTime = 0L; ++ protected int lastServerTicks = 0; + private int serverWaitTime = 0; + private int serverWaitTimeCurrent = 0; + private float avgServerTimeDiff = 0.0F; +@@ -277,61 +285,67 @@ + } + + Vec3 var7 = this.mc.renderViewEntity.getLook(par1); +- Vec3 var8 = var6.addVector(var7.xCoord * var2, var7.yCoord * var2, var7.zCoord * var2); +- this.pointedEntity = null; +- float var9 = 1.0F; +- List var10 = this.mc.theWorld.getEntitiesWithinAABBExcludingEntity(this.mc.renderViewEntity, this.mc.renderViewEntity.boundingBox.addCoord(var7.xCoord * var2, var7.yCoord * var2, var7.zCoord * var2).expand((double)var9, (double)var9, (double)var9)); +- double var11 = var4; ++ getPointedEntity(var6, var7, var2, var4); ++ } ++ } ++ ++ protected void getPointedEntity( Vec3 var6, Vec3 var7, double var2, double var4 ) ++ { ++ Vec3 var8 = var6.addVector(var7.xCoord * var2, var7.yCoord * var2, var7.zCoord * var2); ++ ++ this.pointedEntity = null; ++ float var9 = 1.0F; ++ List var10 = this.mc.theWorld.getEntitiesWithinAABBExcludingEntity(this.mc.renderViewEntity, this.mc.renderViewEntity.boundingBox.addCoord(var7.xCoord * var2, var7.yCoord * var2, var7.zCoord * var2).expand((double)var9, (double)var9, (double)var9)); ++ double var11 = var4; + +- for (int var13 = 0; var13 < var10.size(); ++var13) ++ for (int var13 = 0; var13 < var10.size(); ++var13) ++ { ++ Entity var14 = (Entity)var10.get(var13); ++ ++ if (var14.canBeCollidedWith()) + { +- Entity var14 = (Entity)var10.get(var13); ++ float var15 = var14.getCollisionBorderSize(); ++ AxisAlignedBB var16 = var14.boundingBox.expand((double)var15, (double)var15, (double)var15); ++ MovingObjectPosition var17 = var16.calculateIntercept(var6, var8); + +- if (var14.canBeCollidedWith()) ++ if (var16.isVecInside(var6)) + { +- float var15 = var14.getCollisionBorderSize(); +- AxisAlignedBB var16 = var14.boundingBox.expand((double)var15, (double)var15, (double)var15); +- MovingObjectPosition var17 = var16.calculateIntercept(var6, var8); +- +- if (var16.isVecInside(var6)) ++ if (0.0D < var11 || var11 == 0.0D) + { +- if (0.0D < var11 || var11 == 0.0D) +- { +- this.pointedEntity = var14; +- var11 = 0.0D; +- } ++ this.pointedEntity = var14; ++ var11 = 0.0D; + } +- else if (var17 != null) +- { +- double var18 = var6.distanceTo(var17.hitVec); ++ } ++ else if (var17 != null) ++ { ++ double var18 = var6.distanceTo(var17.hitVec); + +- if (var18 < var11 || var11 == 0.0D) ++ if (var18 < var11 || var11 == 0.0D) ++ { ++ if (var14 == this.mc.renderViewEntity.ridingEntity) + { +- if (var14 == this.mc.renderViewEntity.ridingEntity) +- { +- if (var11 == 0.0D) +- { +- this.pointedEntity = var14; +- } +- } +- else ++ if (var11 == 0.0D) + { + this.pointedEntity = var14; +- var11 = var18; + } + } ++ else ++ { ++ this.pointedEntity = var14; ++ var11 = var18; ++ } + } + } + } ++ } + +- if (this.pointedEntity != null && (var11 < var4 || this.mc.objectMouseOver == null)) +- { +- this.mc.objectMouseOver = new MovingObjectPosition(this.pointedEntity); ++ if (this.pointedEntity != null && (var11 < var4 || this.mc.objectMouseOver == null)) ++ { ++ this.mc.objectMouseOver = new MovingObjectPosition(this.pointedEntity); + +- if (this.pointedEntity instanceof EntityLivingBase) +- { +- this.mc.pointedEntityLiving = (EntityLivingBase)this.pointedEntity; +- } ++ if (this.pointedEntity instanceof EntityLivingBase) ++ { ++ this.mc.pointedEntityLiving = (EntityLivingBase)this.pointedEntity; + } + } + } +@@ -437,7 +451,7 @@ + } + } + +- private void hurtCameraEffect(float par1) ++ protected void hurtCameraEffect(float par1) + { + EntityLivingBase var2 = this.mc.renderViewEntity; + float var3 = (float)var2.hurtTime - par1; +@@ -463,7 +477,7 @@ + /** + * Setups all the GL settings for view bobbing. Args: partialTickTime + */ +- private void setupViewBobbing(float par1) ++ protected void setupViewBobbing(float par1) + { + if (this.mc.renderViewEntity instanceof EntityPlayer) + { +@@ -823,7 +837,7 @@ + this.lightmapUpdateNeeded = true; + } + +- private void updateLightmap(float par1) ++ protected void updateLightmap(float par1) + { + WorldClient var2 = this.mc.theWorld; + +@@ -975,7 +989,45 @@ + int var3 = par1EntityPlayer.getActivePotionEffect(Potion.nightVision).getDuration(); + return var3 > 200 ? 1.0F : 0.7F + MathHelper.sin(((float)var3 - par2) * (float)Math.PI * 0.2F) * 0.3F; + } ++ ++ protected void updateCamera( float par1, boolean var14 ) ++ { ++ this.mc.mcProfiler.startSection("mouse"); ++ ++ if (this.mc.inGameHasFocus && var14) ++ { ++ this.mc.mouseHelper.mouseXYChange(); ++ float var4 = this.mc.gameSettings.mouseSensitivity * 0.6F + 0.2F; ++ float var5 = var4 * var4 * var4 * 8.0F; ++ float var6 = (float)this.mc.mouseHelper.deltaX * var5; ++ float var7 = (float)this.mc.mouseHelper.deltaY * var5; ++ byte var8 = 1; ++ ++ if (this.mc.gameSettings.invertMouse) ++ { ++ var8 = -1; ++ } + ++ if (this.mc.gameSettings.smoothCamera) ++ { ++ this.smoothCamYaw += var6; ++ this.smoothCamPitch += var7; ++ float var9 = par1 - this.smoothCamPartialTicks; ++ this.smoothCamPartialTicks = par1; ++ var6 = this.smoothCamFilterX * var9; ++ var7 = this.smoothCamFilterY * var9; ++ this.mc.thePlayer.setAngles(var6, var7 * (float)var8); ++ } ++ else ++ { ++ this.mc.thePlayer.setAngles(var6, var7 * (float)var8); ++ } ++ } ++ ++ this.mc.mcProfiler.endSection(); ++ ++ } ++ + /** + * Will update any inputs that effect the camera angle (mouse) and then render the world and GUI + */ +@@ -999,6 +1051,29 @@ + Config.setNewRelease((String)null); + } + ++ if (var2 != null) ++ { ++ if (checkAspectRatio && this.mc.vrSettings.useVRRenderer) ++ { ++ if (this.mc.hmdInfo != null && !this.mc.hmdInfo.getHMDInfo().isFakeData) ++ { ++ int hmdScreenWidthPixels = this.mc.hmdInfo.getHMDInfo().HResolution; ++ int hmdScreenHeightPixels = this.mc.hmdInfo.getHMDInfo().VResolution; ++ ++ DisplayMode e = Display.getDisplayMode(); ++ if (hmdScreenWidthPixels != e.getWidth() || hmdScreenHeightPixels != e.getHeight()) ++ { ++ this.mc.printChatMessage("Warning: Non-native display resolution, perspective may be skewed! Ideally set your display to full-screen " + hmdScreenWidthPixels + "x" + hmdScreenHeightPixels + "."); ++ } ++ } ++ } ++ checkAspectRatio = false; ++ } ++ else ++ { ++ checkAspectRatio = true; ++ } ++ + if (this.mc.currentScreen instanceof GuiMainMenu) + { + this.updateMainMenu((GuiMainMenu)this.mc.currentScreen); +@@ -1036,124 +1111,98 @@ + this.prevFrameTime = Minecraft.getSystemTime(); + } + +- this.mc.mcProfiler.startSection("mouse"); ++ updateCamera( par1, var14 ); + +- if (this.mc.inGameHasFocus && var14) ++ if (!this.mc.skipRenderWorld) + { +- this.mc.mouseHelper.mouseXYChange(); +- float var4 = this.mc.gameSettings.mouseSensitivity * 0.6F + 0.2F; +- float var5 = var4 * var4 * var4 * 8.0F; +- float var6 = (float)this.mc.mouseHelper.deltaX * var5; +- float var7 = (float)this.mc.mouseHelper.deltaY * var5; +- byte var8 = 1; +- +- if (this.mc.gameSettings.invertMouse) +- { +- var8 = -1; +- } +- +- if (this.mc.gameSettings.smoothCamera) +- { +- this.smoothCamYaw += var6; +- this.smoothCamPitch += var7; +- float var9 = par1 - this.smoothCamPartialTicks; +- this.smoothCamPartialTicks = par1; +- var6 = this.smoothCamFilterX * var9; +- var7 = this.smoothCamFilterY * var9; +- this.mc.thePlayer.setAngles(var6, var7 * (float)var8); +- } +- else +- { +- this.mc.thePlayer.setAngles(var6, var7 * (float)var8); +- } ++ renderGUIandWorld(par1); + } + +- this.mc.mcProfiler.endSection(); ++ this.waitForServerThread(); + +- if (!this.mc.skipRenderWorld) ++ if (this.mc.gameSettings.showDebugInfo != this.lastShowDebugInfo) + { +- anaglyphEnable = this.mc.gameSettings.anaglyph; +- ScaledResolution var15 = new ScaledResolution(this.mc.gameSettings, this.mc.displayWidth, this.mc.displayHeight); +- int var16 = var15.getScaledWidth(); +- int var17 = var15.getScaledHeight(); +- int var18 = Mouse.getX() * var16 / this.mc.displayWidth; +- int var20 = var17 - Mouse.getY() * var17 / this.mc.displayHeight - 1; +- int var19 = performanceToFps(this.mc.gameSettings.limitFramerate); ++ this.showExtendedDebugInfo = this.mc.gameSettings.showDebugProfilerChart; ++ this.lastShowDebugInfo = this.mc.gameSettings.showDebugInfo; ++ } + +- if (this.mc.theWorld != null) +- { +- this.mc.mcProfiler.startSection("level"); ++ if (this.mc.gameSettings.showDebugInfo) ++ { ++ this.showLagometer(this.mc.mcProfiler.timeTickNano, this.mc.mcProfiler.timeUpdateChunksNano); ++ } + +- if (this.mc.gameSettings.limitFramerate == 0) +- { +- this.renderWorld(par1, 0L); +- } +- else +- { +- this.renderWorld(par1, this.renderEndNanoTime + (long)(1000000000 / var19)); +- } ++ if (this.mc.gameSettings.ofProfiler) ++ { ++ this.mc.gameSettings.showDebugProfilerChart = true; ++ } ++ } + +- this.renderEndNanoTime = System.nanoTime(); +- this.mc.mcProfiler.endStartSection("gui"); ++ protected void renderGUIandWorld(float par1) ++ { ++ anaglyphEnable = this.mc.gameSettings.anaglyph; ++ ScaledResolution var15 = new ScaledResolution(this.mc.gameSettings, this.mc.displayWidth, this.mc.displayHeight); ++ int var16 = var15.getScaledWidth(); ++ int var17 = var15.getScaledHeight(); ++ int var18 = Mouse.getX() * var16 / this.mc.displayWidth; ++ int var20 = var17 - Mouse.getY() * var17 / this.mc.displayHeight - 1; ++ int var19 = performanceToFps(this.mc.gameSettings.limitFramerate); + +- if (!this.mc.gameSettings.hideGUI || this.mc.currentScreen != null) +- { +- this.mc.ingameGUI.renderGameOverlay(par1, this.mc.currentScreen != null, var18, var20); +- } ++ if (this.mc.theWorld != null) ++ { ++ this.mc.mcProfiler.startSection("level"); + +- this.mc.mcProfiler.endSection(); ++ if (this.mc.gameSettings.limitFramerate == 0) ++ { ++ this.renderWorld(par1, 0L); + } + else + { +- GL11.glViewport(0, 0, this.mc.displayWidth, this.mc.displayHeight); +- GL11.glMatrixMode(GL11.GL_PROJECTION); +- GL11.glLoadIdentity(); +- GL11.glMatrixMode(GL11.GL_MODELVIEW); +- GL11.glLoadIdentity(); +- this.setupOverlayRendering(); +- this.renderEndNanoTime = System.nanoTime(); ++ this.renderWorld(par1, this.renderEndNanoTime + (long)(1000000000 / var19)); + } + +- if (this.mc.currentScreen != null) +- { +- GL11.glClear(GL11.GL_DEPTH_BUFFER_BIT); ++ this.renderEndNanoTime = System.nanoTime(); ++ this.mc.mcProfiler.endStartSection("gui"); + +- try +- { +- this.mc.currentScreen.drawScreen(var18, var20, par1); +- } +- catch (Throwable var13) +- { +- CrashReport var11 = CrashReport.makeCrashReport(var13, "Rendering screen"); +- CrashReportCategory var12 = var11.makeCategory("Screen render details"); +- var12.addCrashSectionCallable("Screen name", new CallableScreenName(this)); +- var12.addCrashSectionCallable("Mouse location", new CallableMouseLocation(this, var18, var20)); +- var12.addCrashSectionCallable("Screen size", new CallableScreenSize(this, var15)); +- throw new ReportedException(var11); +- } ++ if (!this.mc.gameSettings.hideGUI || this.mc.currentScreen != null) ++ { ++ this.mc.ingameGUI.renderGameOverlay(par1, this.mc.currentScreen != null, var18, var20); + } +- } +- +- this.waitForServerThread(); + +- if (this.mc.gameSettings.showDebugInfo != this.lastShowDebugInfo) +- { +- this.showExtendedDebugInfo = this.mc.gameSettings.showDebugProfilerChart; +- this.lastShowDebugInfo = this.mc.gameSettings.showDebugInfo; ++ this.mc.mcProfiler.endSection(); + } +- +- if (this.mc.gameSettings.showDebugInfo) ++ else + { +- this.showLagometer(this.mc.mcProfiler.timeTickNano, this.mc.mcProfiler.timeUpdateChunksNano); ++ GL11.glViewport(0, 0, this.mc.displayWidth, this.mc.displayHeight); ++ GL11.glMatrixMode(GL11.GL_PROJECTION); ++ GL11.glLoadIdentity(); ++ GL11.glMatrixMode(GL11.GL_MODELVIEW); ++ GL11.glLoadIdentity(); ++ this.setupOverlayRendering(); ++ this.renderEndNanoTime = System.nanoTime(); + } + +- if (this.mc.gameSettings.ofProfiler) ++ if (this.mc.currentScreen != null) + { +- this.mc.gameSettings.showDebugProfilerChart = true; ++ GL11.glClear(GL11.GL_DEPTH_BUFFER_BIT); ++ ++ try ++ { ++ this.mc.currentScreen.drawScreen(var18, var20, par1); ++ GL11.glDisable(GL11.GL_LIGHTING); ++ } ++ catch (Throwable var13) ++ { ++ CrashReport var11 = CrashReport.makeCrashReport(var13, "Rendering screen"); ++ CrashReportCategory var12 = var11.makeCategory("Screen render details"); ++ var12.addCrashSectionCallable("Screen name", new CallableScreenName(this)); ++ var12.addCrashSectionCallable("Mouse location", new CallableMouseLocation(this, var18, var20)); ++ var12.addCrashSectionCallable("Screen size", new CallableScreenSize(this, var15)); ++ throw new ReportedException(var11); ++ } + } + } + +- private void waitForServerThread() ++ protected void waitForServerThread() + { + this.serverWaitTimeCurrent = 0; + +@@ -1466,7 +1515,14 @@ + Reflector.callVoid(Reflector.ForgeHooksClient_setRenderPass, new Object[] {Integer.valueOf(-1)}); + } + ++ this.enableLightmap((double)par1); ++ this.mc.mcProfiler.endStartSection("litParticles"); ++ var6.renderLitParticles(var4, par1); + RenderHelper.disableStandardItemLighting(); ++ this.setupFog(0, par1); ++ this.mc.mcProfiler.endStartSection("particles"); ++ var6.renderParticles(var4, par1); ++ this.disableLightmap((double)par1); + + if (this.mc.objectMouseOver != null && var4.isInsideOfMaterial(Material.water) && var4 instanceof EntityPlayer && !this.mc.gameSettings.hideGUI) + { +@@ -1614,7 +1670,7 @@ + /** + * Render clouds if enabled + */ +- private void renderCloudsCheck(RenderGlobal par1RenderGlobal, float par2) ++ protected void renderCloudsCheck(RenderGlobal par1RenderGlobal, float par2) + { + if (this.mc.gameSettings.shouldRenderClouds()) + { +@@ -1918,7 +1974,7 @@ + /** + * calculates fog and calls glClearColor + */ +- private void updateFogColor(float par1) ++ protected void updateFogColor(float par1) + { + WorldClient var2 = this.mc.theWorld; + EntityLivingBase var3 = this.mc.renderViewEntity; +@@ -2132,7 +2188,7 @@ + * Sets up the fog to be rendered. If the arg passed in is -1 the fog starts at 0 and goes to 80% of far plane + * distance and is used for sky rendering. + */ +- private void setupFog(int par1, float par2) ++ protected void setupFog(int par1, float par2) + { + EntityLivingBase var3 = this.mc.renderViewEntity; + boolean var4 = false; +@@ -2310,25 +2366,14 @@ + { + Minecraft var1 = Config.getMinecraft(); + +- if (var1.currentScreen != null && var1.currentScreen instanceof GuiMainMenu) +- { +- return 35; +- } +- else if (var1.theWorld == null) ++ int var2 = Config.getGameSettings().ofLimitFramerateFine; ++ ++ if (var2 <= 0) + { +- return 35; ++ var2 = 10000; + } +- else +- { +- int var2 = Config.getGameSettings().ofLimitFramerateFine; + +- if (var2 <= 0) +- { +- var2 = 10000; +- } +- +- return var2; +- } ++ return var2; + } + + /** diff --git a/patches/net/minecraft/src/EnumOptions.java.patch b/patches/net/minecraft/src/EnumOptions.java.patch index 70253f57..1b5c04e9 100644 --- a/patches/net/minecraft/src/EnumOptions.java.patch +++ b/patches/net/minecraft/src/EnumOptions.java.patch @@ -1,101 +1,101 @@ ---- a/net/minecraft/src/EnumOptions.java -+++ b/net/minecraft/src/EnumOptions.java -@@ -87,7 +87,7 @@ - CUSTOM_COLORS("Custom Colors", false, false), - SHOW_CAPES("Show Capes", false, false), - CONNECTED_TEXTURES("Connected Textures", false, false), -- AA_LEVEL("Antialiasing", false, false), -+ AA_LEVEL("MSAA Antialiasing", false, false), - AF_LEVEL("Anisotropic Filtering", false, false), - RENDER_DISTANCE_FINE("Render Distance", true, false), - ANIMATED_TEXTURES("Textures Animated", false, false), -@@ -97,7 +97,88 @@ - HELD_ITEM_TOOLTIPS("Held Item Tooltips", false, false), - DROPPED_ITEMS("Dropped Items", false, false), - LAZY_CHUNK_LOADING("Lazy Chunk Loading", false, false), -- CUSTOM_SKY("Custom Sky", false, false); -+ CUSTOM_SKY("Custom Sky", false, false), -+ // Minecrift below here -+ -+ //General -+ USE_VR("VR mode", false, true), -+ HUD_SCALE("HUD Scale", true, false), -+ HUD_DISTANCE("HUD Distance", true, false), -+ HUD_PITCH("HUD Vertical Offset", true, false), -+ HUD_YAW("HUD Horiz. Offset", true, false), -+ HUD_LOCK_TO("HUD Orientation Lock", false, true), -+ HUD_OPACITY("HUD Opacity", true, false), -+ HUD_HIDE("Hide HUD (F1)", false, true), -+ HUD_OCCLUSION("HUD Occlusion", false, true), -+ HEAD_TRACKING("Head Tracking", false, true), -+ DUMMY("Dummy", false, true), -+ VR_HEAD_ORIENTATION("Head Orientation", false, true), -+ VR_HEAD_POSITION("Head Position", false, true), -+ VR_CONTROLLER("Controller", false, true), -+ CROSSHAIR_SCALE("Crosshair Size", true, false), -+ CROSSHAIR_ALWAYS_SHOW("Show Crosshair", false, true), -+ CROSSHAIR_ROLL("Roll Crosshair", false, true), -+ BLOCK_OUTLINE_ALWAYS_SHOW("Show Block Outline", false, true), -+ CHAT_OFFSET_X("Chat Offset X",true,false), -+ CHAT_OFFSET_Y("Chat Offset Y",true,false), -+ -+ // Player -+ EYE_HEIGHT("Eye Height", true, false), -+ EYE_PROTRUSION("Eye Protrusion", true, false), -+ NECK_LENGTH("Neck Length", true, false), -+ RENDER_OWN_HEADWEAR("Render Own Headwear", false, true), -+ RENDER_FULL_FIRST_PERSON_MODEL("First Person Model", false, true), -+ RENDER_PLAYER_OFFSET("View Body Offset", true, false), -+ IPD("IPD", true, false), -+ OCULUS_PROFILE("Use Oculus Profile", false, false), -+ OCULUS_PROFILE_NAME("Name", false, true), -+ OCULUS_PROFILE_GENDER("Gender", false, true), -+ -+ //HMD/render -+ USE_DISTORTION("Distortion", false, true), -+ CHROM_AB_CORRECTION("Chrom. Ab. Correction", false, true), -+ TEXTURE_LOOKUP_OPT("Dist. Method", false, true), -+ FXAA("FXAA", false, true), -+ FOV_SCALE_FACTOR("FOV Scale", true, false), -+ LENS_SEPARATION_SCALE_FACTOR("Lens Sep. Scale", true, false), -+ DISTORTION_FIT_POINT("Distortion Border", true, false), -+ ASPECT_RATIO_CORRECTION("Asp. Correction", false, false), -+ SUPERSAMPLING("FSAA", false, true), -+ SUPERSAMPLE_SCALEFACTOR("FSAA Render Scale", true, false), -+ -+ //Head orientation tracking -+ HEAD_TRACK_PREDICTION("Head Track Prediction", false, true), -+ HEAD_TRACK_SENSITIVITY("Head Track Sensitivity", true, false), -+ HEAD_TRACK_PREDICTION_TIME("Prediction time", true, false), -+ -+ //eye center position tracking -+ POS_TRACK_HYDRALOC("Position", false, false), -+ POS_TRACK_HYDRA_OFFSET_X("Hydra X Offset", true, false), -+ POS_TRACK_HYDRA_OFFSET_Y("Hydra Y Offset", true, false), -+ POS_TRACK_HYDRA_OFFSET_Z("Hydra Z Offset", true, false), -+ POS_TRACK_OFFSET_SET_DEFAULT("Default Offsets", false, true), -+ POS_TRACK_HYDRA_DISTANCE_SCALE("Dist. Scale", true, false), -+ POS_TRACK_HYDRA_USE_CONTROLLER_ONE("Controller", false, true), -+ POS_TRACK_HYDRA_AT_BACKOFHEAD_IS_POINTING_LEFT("Hydra Direction", false, true), -+ HYDRA_USE_FILTER("Filter", false, true), -+ POS_TRACK_Y_AXIS_DISTANCE_SKEW("Distance Skew Angle", true, false), -+ -+ //Movement/aiming controls -+ DECOUPLE_LOOK_MOVE("Decouple Look/Move", false, true), -+ MOVEMENT_MULTIPLIER("Move. Speed Multiplier", true, false), -+ PITCH_AFFECTS_CAMERA("Pitch Affects Camera", false, true), -+ JOYSTICK_SENSITIVITY("Joystick Sensitivity",true,false), -+ JOYSTICK_DEADZONE("Joystick Deadzone",true,false), -+ KEYHOLE_WIDTH("Keyhole Width",true,false), -+ KEYHOLE_HEIGHT("Keyhole Height",true,false), -+ KEYHOLE_HEAD_RELATIVE("Keyhole Moves With Head",false,true), -+ MOVEAIM_HYDRA_USE_CONTROLLER_ONE("Controller", false, true), -+ JOYSTICK_AIM_TYPE("Aim Type", false, false), -+ AIM_PITCH_OFFSET("Vertical Crosshair Offset",true,false), -+ -+ // Calibration -+ CALIBRATION_STRATEGY("Initial Calibration", false, false); -+ - private final boolean enumFloat; - private final boolean enumBoolean; - private final String enumString; +--- a/net/minecraft/src/EnumOptions.java ++++ b/net/minecraft/src/EnumOptions.java +@@ -87,7 +87,7 @@ + CUSTOM_COLORS("Custom Colors", false, false), + SHOW_CAPES("Show Capes", false, false), + CONNECTED_TEXTURES("Connected Textures", false, false), +- AA_LEVEL("Antialiasing", false, false), ++ AA_LEVEL("MSAA Antialiasing", false, false), + AF_LEVEL("Anisotropic Filtering", false, false), + RENDER_DISTANCE_FINE("Render Distance", true, false), + ANIMATED_TEXTURES("Textures Animated", false, false), +@@ -97,7 +97,88 @@ + HELD_ITEM_TOOLTIPS("Held Item Tooltips", false, false), + DROPPED_ITEMS("Dropped Items", false, false), + LAZY_CHUNK_LOADING("Lazy Chunk Loading", false, false), +- CUSTOM_SKY("Custom Sky", false, false); ++ CUSTOM_SKY("Custom Sky", false, false), ++ // Minecrift below here ++ ++ //General ++ USE_VR("VR mode", false, true), ++ HUD_SCALE("HUD Scale", true, false), ++ HUD_DISTANCE("HUD Distance", true, false), ++ HUD_PITCH("HUD Vertical Offset", true, false), ++ HUD_YAW("HUD Horiz. Offset", true, false), ++ HUD_LOCK_TO("HUD Orientation Lock", false, true), ++ HUD_OPACITY("HUD Opacity", true, false), ++ HUD_HIDE("Hide HUD (F1)", false, true), ++ HUD_OCCLUSION("HUD Occlusion", false, true), ++ HEAD_TRACKING("Head Tracking", false, true), ++ DUMMY("Dummy", false, true), ++ VR_HEAD_ORIENTATION("Head Orientation", false, true), ++ VR_HEAD_POSITION("Head Position", false, true), ++ VR_CONTROLLER("Controller", false, true), ++ CROSSHAIR_SCALE("Crosshair Size", true, false), ++ CROSSHAIR_ALWAYS_SHOW("Show Crosshair", false, true), ++ CROSSHAIR_ROLL("Roll Crosshair", false, true), ++ BLOCK_OUTLINE_ALWAYS_SHOW("Show Block Outline", false, true), ++ CHAT_OFFSET_X("Chat Offset X",true,false), ++ CHAT_OFFSET_Y("Chat Offset Y",true,false), ++ ++ // Player ++ EYE_HEIGHT("Eye Height", true, false), ++ EYE_PROTRUSION("Eye Protrusion", true, false), ++ NECK_LENGTH("Neck Length", true, false), ++ RENDER_OWN_HEADWEAR("Render Own Headwear", false, true), ++ RENDER_FULL_FIRST_PERSON_MODEL("First Person Model", false, true), ++ RENDER_PLAYER_OFFSET("View Body Offset", true, false), ++ IPD("IPD", true, false), ++ OCULUS_PROFILE("Use Oculus Profile", false, false), ++ OCULUS_PROFILE_NAME("Name", false, true), ++ OCULUS_PROFILE_GENDER("Gender", false, true), ++ ++ //HMD/render ++ USE_DISTORTION("Distortion", false, true), ++ CHROM_AB_CORRECTION("Chrom. Ab. Correction", false, true), ++ TEXTURE_LOOKUP_OPT("Dist. Method", false, true), ++ FXAA("FXAA", false, true), ++ FOV_SCALE_FACTOR("FOV Scale", true, false), ++ LENS_SEPARATION_SCALE_FACTOR("Lens Sep. Scale", true, false), ++ DISTORTION_FIT_POINT("Distortion Border", true, false), ++ ASPECT_RATIO_CORRECTION("Asp. Correction", false, false), ++ SUPERSAMPLING("FSAA", false, true), ++ SUPERSAMPLE_SCALEFACTOR("FSAA Render Scale", true, false), ++ ++ //Head orientation tracking ++ HEAD_TRACK_PREDICTION("Head Track Prediction", false, true), ++ HEAD_TRACK_SENSITIVITY("Head Track Sensitivity", true, false), ++ HEAD_TRACK_PREDICTION_TIME("Prediction time", true, false), ++ ++ //eye center position tracking ++ POS_TRACK_HYDRALOC("Position", false, false), ++ POS_TRACK_HYDRA_OFFSET_X("Hydra X Offset", true, false), ++ POS_TRACK_HYDRA_OFFSET_Y("Hydra Y Offset", true, false), ++ POS_TRACK_HYDRA_OFFSET_Z("Hydra Z Offset", true, false), ++ POS_TRACK_OFFSET_SET_DEFAULT("Default Offsets", false, true), ++ POS_TRACK_HYDRA_DISTANCE_SCALE("Dist. Scale", true, false), ++ POS_TRACK_HYDRA_USE_CONTROLLER_ONE("Controller", false, true), ++ POS_TRACK_HYDRA_AT_BACKOFHEAD_IS_POINTING_LEFT("Hydra Direction", false, true), ++ HYDRA_USE_FILTER("Filter", false, true), ++ POS_TRACK_Y_AXIS_DISTANCE_SKEW("Distance Skew Angle", true, false), ++ ++ //Movement/aiming controls ++ DECOUPLE_LOOK_MOVE("Decouple Look/Move", false, true), ++ MOVEMENT_MULTIPLIER("Move. Speed Multiplier", true, false), ++ PITCH_AFFECTS_CAMERA("Pitch Affects Camera", false, true), ++ JOYSTICK_SENSITIVITY("Joystick Sensitivity",true,false), ++ JOYSTICK_DEADZONE("Joystick Deadzone",true,false), ++ KEYHOLE_WIDTH("Keyhole Width",true,false), ++ KEYHOLE_HEIGHT("Keyhole Height",true,false), ++ KEYHOLE_HEAD_RELATIVE("Keyhole Moves With Head",false,true), ++ MOVEAIM_HYDRA_USE_CONTROLLER_ONE("Controller", false, true), ++ JOYSTICK_AIM_TYPE("Aim Type", false, false), ++ AIM_PITCH_OFFSET("Vertical Crosshair Offset",true,false), ++ ++ // Calibration ++ CALIBRATION_STRATEGY("Initial Calibration", false, false); ++ + private final boolean enumFloat; + private final boolean enumBoolean; + private final String enumString; diff --git a/patches/net/minecraft/src/GameSettings.java.patch b/patches/net/minecraft/src/GameSettings.java.patch index 2e029c90..fe2ad698 100644 --- a/patches/net/minecraft/src/GameSettings.java.patch +++ b/patches/net/minecraft/src/GameSettings.java.patch @@ -1,52 +1,52 @@ ---- a/net/minecraft/src/GameSettings.java -+++ b/net/minecraft/src/GameSettings.java -@@ -216,6 +216,10 @@ - this.mc = par1Minecraft; - this.optionsFile = new File(par2File, "options.txt"); - this.optionsFileOF = new File(par2File, "optionsof.txt"); -+ -+ // Setup the Optifine or general option defaults specific to Minecrift -+ setupMinecriftDefaults(); -+ - this.loadOptions(); - Config.initGameSettings(this); - } -@@ -230,6 +234,28 @@ - this.noclipRate = 1.0F; - this.debugCamRate = 1.0F; - this.language = "en_US"; -+ -+ // Setup the Optifine or general option defaults specific to Minecrift -+ setupMinecriftDefaults(); -+ } -+ -+ protected void setupMinecriftDefaults() -+ { -+ this.ofMipmapLevel = 1; // Mipmap level 1 -+ this.ofMipmapType = 1; // Mipmap type 'Linear' -+ this.ofChunkLoading = 1; // Smooth chunk loading -+ this.ofClouds = 1; // Flat clouds by default. 'Fancy' (previous default) seems to cause a disproportionate fps hit. -+ this.advancedOpengl = true; -+ this.ofOcclusionFancy = false; -+ -+ // Max FPS -+ this.ofLimitFramerateFine = 0; -+ this.limitFramerate = 0; -+ this.enableVsync = false; -+ -+ // Fullscreen -+ this.fullScreen = true; -+ this.ofFullscreenMode = "Default"; - } - - public String getKeyBindingDescription(int par1) -@@ -2600,6 +2626,9 @@ - this.updateWaterOpacity(); - this.mc.renderGlobal.setAllRenderersVisible(); - this.mc.func_110436_a(); -+ -+ setupMinecriftDefaults(); -+ - this.saveOptions(); - } - +--- a/net/minecraft/src/GameSettings.java ++++ b/net/minecraft/src/GameSettings.java +@@ -216,6 +216,10 @@ + this.mc = par1Minecraft; + this.optionsFile = new File(par2File, "options.txt"); + this.optionsFileOF = new File(par2File, "optionsof.txt"); ++ ++ // Setup the Optifine or general option defaults specific to Minecrift ++ setupMinecriftDefaults(); ++ + this.loadOptions(); + Config.initGameSettings(this); + } +@@ -230,6 +234,28 @@ + this.noclipRate = 1.0F; + this.debugCamRate = 1.0F; + this.language = "en_US"; ++ ++ // Setup the Optifine or general option defaults specific to Minecrift ++ setupMinecriftDefaults(); ++ } ++ ++ protected void setupMinecriftDefaults() ++ { ++ this.ofMipmapLevel = 1; // Mipmap level 1 ++ this.ofMipmapType = 1; // Mipmap type 'Linear' ++ this.ofChunkLoading = 1; // Smooth chunk loading ++ this.ofClouds = 1; // Flat clouds by default. 'Fancy' (previous default) seems to cause a disproportionate fps hit. ++ this.advancedOpengl = true; ++ this.ofOcclusionFancy = false; ++ ++ // Max FPS ++ this.ofLimitFramerateFine = 0; ++ this.limitFramerate = 0; ++ this.enableVsync = false; ++ ++ // Fullscreen ++ this.fullScreen = true; ++ this.ofFullscreenMode = "Default"; + } + + public String getKeyBindingDescription(int par1) +@@ -2649,6 +2675,9 @@ + this.updateWaterOpacity(); + this.mc.renderGlobal.setAllRenderersVisible(); + this.mc.refreshResources(); ++ ++ setupMinecriftDefaults(); ++ + this.saveOptions(); + } + diff --git a/patches/net/minecraft/src/GuiAchievements.java.patch b/patches/net/minecraft/src/GuiAchievements.java.patch index 0e438f62..2c2473f8 100644 --- a/patches/net/minecraft/src/GuiAchievements.java.patch +++ b/patches/net/minecraft/src/GuiAchievements.java.patch @@ -1,13 +1,13 @@ ---- a/net/minecraft/src/GuiAchievements.java -+++ b/net/minecraft/src/GuiAchievements.java -@@ -415,8 +415,8 @@ - { - String var33 = I18n.func_135053_a(var30.getName()); - String var35 = var30.getDescription(); -- var41 = par1 + 12; -- var25 = par2 - 4; -+ var41 = par1 - 40; //+ 12; -+ var25 = par2 + 12; //- 4; - - if (this.statFileWriter.canUnlockAchievement(var30)) - { +--- a/net/minecraft/src/GuiAchievements.java ++++ b/net/minecraft/src/GuiAchievements.java +@@ -415,8 +415,8 @@ + { + String var33 = I18n.getString(var30.getName()); + String var35 = var30.getDescription(); +- var41 = par1 + 12; +- var25 = par2 - 4; ++ var41 = par1 - 40; //+ 12; ++ var25 = par2 + 12; //- 4; + + if (this.statFileWriter.canUnlockAchievement(var30)) + { diff --git a/patches/net/minecraft/src/GuiIngame.java.patch b/patches/net/minecraft/src/GuiIngame.java.patch index cdb112c5..d73a7a28 100644 --- a/patches/net/minecraft/src/GuiIngame.java.patch +++ b/patches/net/minecraft/src/GuiIngame.java.patch @@ -1,34 +1,34 @@ ---- a/net/minecraft/src/GuiIngame.java -+++ b/net/minecraft/src/GuiIngame.java -@@ -64,13 +64,6 @@ - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); - } - -- ItemStack var9 = this.mc.thePlayer.inventory.armorItemInSlot(3); -- -- if (this.mc.gameSettings.thirdPersonView == 0 && var9 != null && var9.itemID == Block.pumpkin.blockID) -- { -- this.renderPumpkinBlur(var6, var7); -- } -- - if (!this.mc.thePlayer.isPotionActive(Potion.confusion)) - { - float var10 = this.mc.thePlayer.prevTimeInPortal + (this.mc.thePlayer.timeInPortal - this.mc.thePlayer.prevTimeInPortal) * par1; -@@ -94,10 +87,13 @@ - this.drawTexturedModalRect(var6 / 2 - 91, var7 - 22, 0, 0, 182, 22); - this.drawTexturedModalRect(var6 / 2 - 91 - 1 + var31.currentItem * 20, var7 - 22 - 1, 0, 22, 24, 22); - this.mc.func_110434_K().func_110577_a(field_110324_m); -- GL11.glEnable(GL11.GL_BLEND); -- GL11.glBlendFunc(GL11.GL_ONE_MINUS_DST_COLOR, GL11.GL_ONE_MINUS_SRC_COLOR); -- this.drawTexturedModalRect(var6 / 2 - 7, var7 / 2 - 7, 0, 0, 16, 16); -- GL11.glDisable(GL11.GL_BLEND); -+ if( !this.mc.vrSettings.useVRRenderer ) -+ { -+ GL11.glEnable(GL11.GL_BLEND); -+ GL11.glBlendFunc(GL11.GL_ONE_MINUS_DST_COLOR, GL11.GL_ONE_MINUS_SRC_COLOR); -+ this.drawTexturedModalRect(var6 / 2 - 7, var7 / 2 - 7, 0, 0, 16, 16); -+ GL11.glDisable(GL11.GL_BLEND); -+ } - this.mc.mcProfiler.startSection("bossHealth"); - this.renderBossHealth(); - this.mc.mcProfiler.endSection(); +--- a/net/minecraft/src/GuiIngame.java ++++ b/net/minecraft/src/GuiIngame.java +@@ -64,13 +64,6 @@ + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + } + +- ItemStack var9 = this.mc.thePlayer.inventory.armorItemInSlot(3); +- +- if (this.mc.gameSettings.thirdPersonView == 0 && var9 != null && var9.itemID == Block.pumpkin.blockID) +- { +- this.renderPumpkinBlur(var6, var7); +- } +- + if (!this.mc.thePlayer.isPotionActive(Potion.confusion)) + { + float var10 = this.mc.thePlayer.prevTimeInPortal + (this.mc.thePlayer.timeInPortal - this.mc.thePlayer.prevTimeInPortal) * par1; +@@ -94,10 +87,13 @@ + this.drawTexturedModalRect(var6 / 2 - 91, var7 - 22, 0, 0, 182, 22); + this.drawTexturedModalRect(var6 / 2 - 91 - 1 + var31.currentItem * 20, var7 - 22 - 1, 0, 22, 24, 22); + this.mc.getTextureManager().bindTexture(icons); +- GL11.glEnable(GL11.GL_BLEND); +- GL11.glBlendFunc(GL11.GL_ONE_MINUS_DST_COLOR, GL11.GL_ONE_MINUS_SRC_COLOR); +- this.drawTexturedModalRect(var6 / 2 - 7, var7 / 2 - 7, 0, 0, 16, 16); +- GL11.glDisable(GL11.GL_BLEND); ++ if( !this.mc.vrSettings.useVRRenderer ) ++ { ++ GL11.glEnable(GL11.GL_BLEND); ++ GL11.glBlendFunc(GL11.GL_ONE_MINUS_DST_COLOR, GL11.GL_ONE_MINUS_SRC_COLOR); ++ this.drawTexturedModalRect(var6 / 2 - 7, var7 / 2 - 7, 0, 0, 16, 16); ++ GL11.glDisable(GL11.GL_BLEND); ++ } + this.mc.mcProfiler.startSection("bossHealth"); + this.renderBossHealth(); + this.mc.mcProfiler.endSection(); diff --git a/patches/net/minecraft/src/GuiNewChat.java.patch b/patches/net/minecraft/src/GuiNewChat.java.patch index 8b58b278..6e54645f 100644 --- a/patches/net/minecraft/src/GuiNewChat.java.patch +++ b/patches/net/minecraft/src/GuiNewChat.java.patch @@ -1,40 +1,40 @@ ---- a/net/minecraft/src/GuiNewChat.java -+++ b/net/minecraft/src/GuiNewChat.java -@@ -5,6 +5,8 @@ - import java.util.List; - import org.lwjgl.opengl.GL11; - -+import com.mtbs3d.minecrift.settings.VRSettings; -+ - public class GuiNewChat extends Gui - { - /** The Minecraft instance. */ -@@ -28,7 +30,7 @@ - { - if (this.mc.gameSettings.chatVisibility != 2) - { -- int var2 = this.func_96127_i(); -+ int var2 = this.func_96127_i(); //number of rows - boolean var3 = false; - int var4 = 0; - int var5 = this.field_96134_d.size(); -@@ -41,10 +43,16 @@ - var3 = true; - } - -- float var7 = this.func_96131_h(); -- int var8 = MathHelper.ceiling_float_int((float)this.func_96126_f() / var7); -+ float var7 = this.func_96131_h();//chat scale -+ int chatWidthPixels = this.func_96126_f() ; -+ int chatFullHeightPixels = func_96130_b(this.mc.gameSettings.chatHeightFocused ); -+ int var8 = MathHelper.ceiling_float_int((float)chatWidthPixels/ var7); -+ -+ ScaledResolution res = new ScaledResolution(this.mc.gameSettings, this.mc.displayWidth, this.mc.displayHeight); -+ int offsetX = (int)(VRSettings.inst.chatOffsetX*(res.getScaledWidth() - chatWidthPixels -2 )); -+ int offsetY = -(int)(VRSettings.inst.chatOffsetY*(res.getScaledHeight() - chatFullHeightPixels -20 )); - GL11.glPushMatrix(); -- GL11.glTranslatef(2.0F, 20.0F, 0.0F); -+ GL11.glTranslatef(2.0F + offsetX, 20 + offsetY, 0.0F); - GL11.glScalef(var7, var7, 1.0F); - int var9; - int var11; +--- a/net/minecraft/src/GuiNewChat.java ++++ b/net/minecraft/src/GuiNewChat.java +@@ -5,6 +5,8 @@ + import java.util.List; + import org.lwjgl.opengl.GL11; + ++import com.mtbs3d.minecrift.settings.VRSettings; ++ + public class GuiNewChat extends Gui + { + /** The Minecraft instance. */ +@@ -28,7 +30,7 @@ + { + if (this.mc.gameSettings.chatVisibility != 2) + { +- int var2 = this.func_96127_i(); ++ int var2 = this.func_96127_i(); //number of rows + boolean var3 = false; + int var4 = 0; + int var5 = this.field_96134_d.size(); +@@ -41,10 +43,16 @@ + var3 = true; + } + +- float var7 = this.func_96131_h(); +- int var8 = MathHelper.ceiling_float_int((float)this.func_96126_f() / var7); ++ float var7 = this.func_96131_h();//chat scale ++ int chatWidthPixels = this.func_96126_f() ; ++ int chatFullHeightPixels = func_96130_b(this.mc.gameSettings.chatHeightFocused ); ++ int var8 = MathHelper.ceiling_float_int((float)chatWidthPixels/ var7); ++ ++ ScaledResolution res = new ScaledResolution(this.mc.gameSettings, this.mc.displayWidth, this.mc.displayHeight); ++ int offsetX = (int)(VRSettings.inst.chatOffsetX*(res.getScaledWidth() - chatWidthPixels -2 )); ++ int offsetY = -(int)(VRSettings.inst.chatOffsetY*(res.getScaledHeight() - chatFullHeightPixels -20 )); + GL11.glPushMatrix(); +- GL11.glTranslatef(2.0F, 20.0F, 0.0F); ++ GL11.glTranslatef(2.0F + offsetX, 20 + offsetY, 0.0F); + GL11.glScalef(var7, var7, 1.0F); + int var9; + int var11; diff --git a/patches/net/minecraft/src/GuiOptions.java.patch b/patches/net/minecraft/src/GuiOptions.java.patch index 5afc4c78..c0c927aa 100644 --- a/patches/net/minecraft/src/GuiOptions.java.patch +++ b/patches/net/minecraft/src/GuiOptions.java.patch @@ -1,61 +1,55 @@ ---- a/net/minecraft/src/GuiOptions.java -+++ b/net/minecraft/src/GuiOptions.java -@@ -1,11 +1,13 @@ - package net.minecraft.src; - -+import com.mtbs3d.minecrift.gui.GuiMinecriftSettings; -+ - public class GuiOptions extends GuiScreen - { - /** - * An array of options that can be changed directly from the options GUI. - */ -- private static final EnumOptions[] relevantOptions = new EnumOptions[] {EnumOptions.MUSIC, EnumOptions.SOUND, EnumOptions.INVERT_MOUSE, EnumOptions.SENSITIVITY, EnumOptions.FOV, EnumOptions.DIFFICULTY, EnumOptions.TOUCHSCREEN}; -+ private static final EnumOptions[] relevantOptions = new EnumOptions[] {EnumOptions.MUSIC, EnumOptions.SOUND, EnumOptions.INVERT_MOUSE, EnumOptions.SENSITIVITY, EnumOptions.TOUCHSCREEN, EnumOptions.DIFFICULTY, EnumOptions.FOV}; - - /** - * A reference to the screen object that created this. Used for navigating between screens. -@@ -37,8 +39,13 @@ - for (int var4 = 0; var4 < var3; ++var4) - { - EnumOptions var5 = var2[var4]; -- -- if (var5.getEnumFloat()) -+ if (var5.getEnumString().equalsIgnoreCase("options.fov")) // Replace FOV slider with 'Minecrift settings' button -+ { -+ // Minecrift settings -+ GuiSmallButton var7 = new GuiSmallButton(666, this.width / 2 - 155 + var1 % 2 * 160, this.height / 6 - 12 + 24 * (var1 >> 1), var5, "VR Settings..."); -+ this.buttonList.add(var7); -+ } -+ else if (var5.getEnumFloat()) - { - this.buttonList.add(new GuiSlider(var5.returnEnumOrdinal(), this.width / 2 - 155 + var1 % 2 * 160, this.height / 6 - 12 + 24 * (var1 >> 1), var5, this.options.getKeyBinding(var5), this.options.getOptionFloatValue(var5))); - } -@@ -58,7 +65,7 @@ - ++var1; - } - -- this.buttonList.add(new GuiButton(101, this.width / 2 - 152, this.height / 6 + 96 - 6, 150, 20, I18n.func_135053_a("options.video"))); -+ this.buttonList.add(new GuiButton(101, this.width / 2 - 152, this.height / 6 + 96 - 6, 150, 20, "OptiFine Settings...")); - this.buttonList.add(new GuiButton(100, this.width / 2 + 2, this.height / 6 + 96 - 6, 150, 20, I18n.func_135053_a("options.controls"))); - this.buttonList.add(new GuiButton(102, this.width / 2 - 152, this.height / 6 + 120 - 6, 150, 20, I18n.func_135053_a("options.language"))); - this.buttonList.add(new GuiButton(103, this.width / 2 + 2, this.height / 6 + 120 - 6, 150, 20, I18n.func_135053_a("options.multiplayer.title"))); -@@ -121,6 +128,12 @@ - this.mc.gameSettings.saveOptions(); - this.mc.displayGuiScreen(new GuiScreenTemporaryResourcePackSelect(this, this.options)); - } -+ -+ if (par1GuiButton.id == 666) -+ { -+ this.mc.gameSettings.saveOptions(); -+ this.mc.displayGuiScreen(new GuiMinecriftSettings(this, this.mc.vrSettings)); -+ } - } - } - -@@ -133,4 +146,5 @@ - this.drawCenteredString(this.fontRenderer, this.screenTitle, this.width / 2, 15, 16777215); - super.drawScreen(par1, par2, par3); - } -+ - } +--- a/net/minecraft/src/GuiOptions.java ++++ b/net/minecraft/src/GuiOptions.java +@@ -1,11 +1,13 @@ + package net.minecraft.src; + ++import com.mtbs3d.minecrift.gui.GuiMinecriftSettings; ++ + public class GuiOptions extends GuiScreen + { + /** + * An array of options that can be changed directly from the options GUI. + */ +- private static final EnumOptions[] relevantOptions = new EnumOptions[] {EnumOptions.MUSIC, EnumOptions.SOUND, EnumOptions.INVERT_MOUSE, EnumOptions.SENSITIVITY, EnumOptions.FOV, EnumOptions.DIFFICULTY, EnumOptions.TOUCHSCREEN}; ++ private static final EnumOptions[] relevantOptions = new EnumOptions[] {EnumOptions.MUSIC, EnumOptions.SOUND, EnumOptions.INVERT_MOUSE, EnumOptions.SENSITIVITY, EnumOptions.TOUCHSCREEN, EnumOptions.DIFFICULTY, EnumOptions.FOV}; + + /** + * A reference to the screen object that created this. Used for navigating between screens. +@@ -37,8 +39,13 @@ + for (int var4 = 0; var4 < var3; ++var4) + { + EnumOptions var5 = var2[var4]; +- +- if (var5.getEnumFloat()) ++ if (var5.getEnumString().equalsIgnoreCase("options.fov")) // Replace FOV slider with 'Minecrift settings' button ++ { ++ // Minecrift settings ++ GuiSmallButton var7 = new GuiSmallButton(666, this.width / 2 - 155 + var1 % 2 * 160, this.height / 6 - 12 + 24 * (var1 >> 1), var5, "VR Settings..."); ++ this.buttonList.add(var7); ++ } ++ else if (var5.getEnumFloat()) + { + this.buttonList.add(new GuiSlider(var5.returnEnumOrdinal(), this.width / 2 - 155 + var1 % 2 * 160, this.height / 6 - 12 + 24 * (var1 >> 1), var5, this.options.getKeyBinding(var5), this.options.getOptionFloatValue(var5))); + } +@@ -58,7 +65,7 @@ + ++var1; + } + +- this.buttonList.add(new GuiButton(101, this.width / 2 - 152, this.height / 6 + 96 - 6, 150, 20, I18n.getString("options.video"))); ++ this.buttonList.add(new GuiButton(101, this.width / 2 - 152, this.height / 6 + 96 - 6, 150, 20, "OptiFine Settings...")); + this.buttonList.add(new GuiButton(100, this.width / 2 + 2, this.height / 6 + 96 - 6, 150, 20, I18n.getString("options.controls"))); + this.buttonList.add(new GuiButton(102, this.width / 2 - 152, this.height / 6 + 120 - 6, 150, 20, I18n.getString("options.language"))); + this.buttonList.add(new GuiButton(103, this.width / 2 + 2, this.height / 6 + 120 - 6, 150, 20, I18n.getString("options.multiplayer.title"))); +@@ -121,6 +128,12 @@ + this.mc.gameSettings.saveOptions(); + this.mc.displayGuiScreen(new GuiScreenTemporaryResourcePackSelect(this, this.options)); + } ++ ++ if (par1GuiButton.id == 666) ++ { ++ this.mc.gameSettings.saveOptions(); ++ this.mc.displayGuiScreen(new GuiMinecriftSettings(this, this.mc.vrSettings)); ++ } + } + } + diff --git a/patches/net/minecraft/src/GuiPerformanceSettingsOF.java.patch b/patches/net/minecraft/src/GuiPerformanceSettingsOF.java.patch index d538b69a..09002f7c 100644 --- a/patches/net/minecraft/src/GuiPerformanceSettingsOF.java.patch +++ b/patches/net/minecraft/src/GuiPerformanceSettingsOF.java.patch @@ -1,11 +1,11 @@ ---- a/net/minecraft/src/GuiPerformanceSettingsOF.java -+++ b/net/minecraft/src/GuiPerformanceSettingsOF.java -@@ -133,7 +133,7 @@ - - private String[] getTooltipLines(String btnName) - { -- return btnName.equals("Smooth FPS") ? new String[] {"Stabilizes FPS by flushing the graphic driver buffers", " OFF - no stabilization, FPS may fluctuate", " ON - FPS stabilization", "This option is graphic driver dependant and its effect", "is not always visible"}: (btnName.equals("Smooth World") ? new String[] {"Removes lag spikes caused by the internal server.", " OFF - no stabilization, FPS may fluctuate", " ON - FPS stabilization", "Stabilizes FPS by distributing the internal server load.", "Effective only for local worlds and single-core CPU."}: (btnName.equals("Load Far") ? new String[] {"Loads the world chunks at distance Far.", "Switching the render distance does not cause all chunks ", "to be loaded again.", " OFF - world chunks loaded up to render distance", " ON - world chunks loaded at distance Far, allows", " fast render distance switching"}: (btnName.equals("Preloaded Chunks") ? new String[] {"Defines an area in which no chunks will be loaded", " OFF - after 5m new chunks will be loaded", " 2 - after 32m new chunks will be loaded", " 8 - after 128m new chunks will be loaded", "Higher values need more time to load all the chunks"}: (btnName.equals("Chunk Updates") ? new String[] {"Chunk updates per frame", " 1 - (default) slower world loading, higher FPS", " 3 - faster world loading, lower FPS", " 5 - fastest world loading, lowest FPS"}: (btnName.equals("Dynamic Updates") ? new String[] {"Dynamic chunk updates", " OFF - (default) standard chunk updates per frame", " ON - more updates while the player is standing still", "Dynamic updates force more chunk updates while", "the player is standing still to load the world faster."}: (btnName.equals("Lazy Chunk Loading") ? new String[] {"Lazy Chunk Loading", " OFF - default server chunk loading", " ON - lazy server chunk loading (smoother)", "Smooths the integrated server chunk loading by", "distributing the chunks over several ticks.", "Turn it OFF if parts of the world do not load correctly.", "Effective only for local worlds and single-core CPU."}: null)))))); -+ return btnName.equals("Smooth FPS") ? new String[] {"Stabilizes FPS by flushing the graphic driver buffers", " OFF - no stabilization, FPS may fluctuate but", " overall FPS will be higher", " ON - FPS stabilization, however FPS will be lower", "This option is graphic driver dependant and its effect", "is not always visible. If ON glFlush is called", "before each sensor poll"}: (btnName.equals("Smooth World") ? new String[] {"Removes lag spikes caused by the internal server.", " OFF - no stabilization, FPS may fluctuate", " ON - FPS stabilization", "Stabilizes FPS by distributing the internal server load.", "Effective only for local worlds and single-core CPU."}: (btnName.equals("Load Far") ? new String[] {"Loads the world chunks at distance Far.", "Switching the render distance does not cause all chunks ", "to be loaded again.", " OFF - world chunks loaded up to render distance", " ON - world chunks loaded at distance Far, allows", " fast render distance switching"}: (btnName.equals("Preloaded Chunks") ? new String[] {"Defines an area in which no chunks will be loaded", " OFF - after 5m new chunks will be loaded", " 2 - after 32m new chunks will be loaded", " 8 - after 128m new chunks will be loaded", "Higher values need more time to load all the chunks"}: (btnName.equals("Chunk Updates") ? new String[] {"Chunk updates per frame", " 1 - (default) slower world loading, higher FPS", " 3 - faster world loading, lower FPS", " 5 - fastest world loading, lowest FPS"}: (btnName.equals("Dynamic Updates") ? new String[] {"Dynamic chunk updates", " OFF - (default) standard chunk updates per frame", " ON - more updates while the player is standing still", "Dynamic updates force more chunk updates while", "the player is standing still to load the world faster."}: (btnName.equals("Lazy Chunk Loading") ? new String[] {"Lazy Chunk Loading", " OFF - default server chunk loading", " ON - lazy server chunk loading (smoother)", "Smooths the integrated server chunk loading by", "distributing the chunks over several ticks.", "Turn it OFF if parts of the world do not load correctly.", "Effective only for local worlds and single-core CPU."}: null)))))); - } - - private String getButtonName(String displayString) +--- a/net/minecraft/src/GuiPerformanceSettingsOF.java ++++ b/net/minecraft/src/GuiPerformanceSettingsOF.java +@@ -133,7 +133,7 @@ + + private String[] getTooltipLines(String btnName) + { +- return btnName.equals("Smooth FPS") ? new String[] {"Stabilizes FPS by flushing the graphic driver buffers", " OFF - no stabilization, FPS may fluctuate", " ON - FPS stabilization", "This option is graphic driver dependant and its effect", "is not always visible"}: (btnName.equals("Smooth World") ? new String[] {"Removes lag spikes caused by the internal server.", " OFF - no stabilization, FPS may fluctuate", " ON - FPS stabilization", "Stabilizes FPS by distributing the internal server load.", "Effective only for local worlds and single-core CPU."}: (btnName.equals("Load Far") ? new String[] {"Loads the world chunks at distance Far.", "Switching the render distance does not cause all chunks ", "to be loaded again.", " OFF - world chunks loaded up to render distance", " ON - world chunks loaded at distance Far, allows", " fast render distance switching"}: (btnName.equals("Preloaded Chunks") ? new String[] {"Defines an area in which no chunks will be loaded", " OFF - after 5m new chunks will be loaded", " 2 - after 32m new chunks will be loaded", " 8 - after 128m new chunks will be loaded", "Higher values need more time to load all the chunks"}: (btnName.equals("Chunk Updates") ? new String[] {"Chunk updates per frame", " 1 - (default) slower world loading, higher FPS", " 3 - faster world loading, lower FPS", " 5 - fastest world loading, lowest FPS"}: (btnName.equals("Dynamic Updates") ? new String[] {"Dynamic chunk updates", " OFF - (default) standard chunk updates per frame", " ON - more updates while the player is standing still", "Dynamic updates force more chunk updates while", "the player is standing still to load the world faster."}: (btnName.equals("Lazy Chunk Loading") ? new String[] {"Lazy Chunk Loading", " OFF - default server chunk loading", " ON - lazy server chunk loading (smoother)", "Smooths the integrated server chunk loading by", "distributing the chunks over several ticks.", "Turn it OFF if parts of the world do not load correctly.", "Effective only for local worlds and single-core CPU."}: null)))))); ++ return btnName.equals("Smooth FPS") ? new String[] {"Stabilizes FPS by flushing the graphic driver buffers", " OFF - no stabilization, FPS may fluctuate but", " overall FPS will be higher", " ON - FPS stabilization, however FPS will be lower", "This option is graphic driver dependant and its effect", "is not always visible. If ON glFlush is called", "before each sensor poll"}: (btnName.equals("Smooth World") ? new String[] {"Removes lag spikes caused by the internal server.", " OFF - no stabilization, FPS may fluctuate", " ON - FPS stabilization", "Stabilizes FPS by distributing the internal server load.", "Effective only for local worlds and single-core CPU."}: (btnName.equals("Load Far") ? new String[] {"Loads the world chunks at distance Far.", "Switching the render distance does not cause all chunks ", "to be loaded again.", " OFF - world chunks loaded up to render distance", " ON - world chunks loaded at distance Far, allows", " fast render distance switching"}: (btnName.equals("Preloaded Chunks") ? new String[] {"Defines an area in which no chunks will be loaded", " OFF - after 5m new chunks will be loaded", " 2 - after 32m new chunks will be loaded", " 8 - after 128m new chunks will be loaded", "Higher values need more time to load all the chunks"}: (btnName.equals("Chunk Updates") ? new String[] {"Chunk updates per frame", " 1 - (default) slower world loading, higher FPS", " 3 - faster world loading, lower FPS", " 5 - fastest world loading, lowest FPS"}: (btnName.equals("Dynamic Updates") ? new String[] {"Dynamic chunk updates", " OFF - (default) standard chunk updates per frame", " ON - more updates while the player is standing still", "Dynamic updates force more chunk updates while", "the player is standing still to load the world faster."}: (btnName.equals("Lazy Chunk Loading") ? new String[] {"Lazy Chunk Loading", " OFF - default server chunk loading", " ON - lazy server chunk loading (smoother)", "Smooths the integrated server chunk loading by", "distributing the chunks over several ticks.", "Turn it OFF if parts of the world do not load correctly.", "Effective only for local worlds and single-core CPU."}: null)))))); + } + + private String getButtonName(String displayString) diff --git a/patches/net/minecraft/src/GuiQualitySettingsOF.java.patch b/patches/net/minecraft/src/GuiQualitySettingsOF.java.patch index 6e40b3ab..d1485f2a 100644 --- a/patches/net/minecraft/src/GuiQualitySettingsOF.java.patch +++ b/patches/net/minecraft/src/GuiQualitySettingsOF.java.patch @@ -1,11 +1,11 @@ ---- a/net/minecraft/src/GuiQualitySettingsOF.java -+++ b/net/minecraft/src/GuiQualitySettingsOF.java -@@ -140,7 +140,7 @@ - - private String[] getTooltipLines(String btnName) - { -- return btnName.equals("Mipmap Level") ? new String[] {"Visual effect which makes distant objects look better", "by smoothing the texture details", " OFF - no smoothing", " 1 - minimum smoothing", " 4 - maximum smoothing", "This option usually does not affect the performance."}: (btnName.equals("Mipmap Type") ? new String[] {"Visual effect which makes distant objects look better", "by smoothing the texture details", " Nearest - rough smoothing", " Linear - fine smoothing", "This option usually does not affect the performance."}: (btnName.equals("Anisotropic Filtering") ? new String[] {"Anisotropic Filtering", " OFF - (default) standard texture detail (faster)", " 2-16 - finer details in mipmapped textures (slower)", "The Anisotropic Filtering restores details in mipmapped", "textures. Higher values may decrease the FPS."}: (btnName.equals("Antialiasing") ? new String[] {"Antialiasing", " OFF - (default) no antialiasing (faster)", " 2-16 - antialiased lines and edges (slower)", "The Antialiasing smooths jagged lines and ", "sharp color transitions.", "Higher values may substantially decrease the FPS.", "Not all levels are supported by all graphics cards.", "Effective after a RESTART!"}: (btnName.equals("Clear Water") ? new String[] {"Clear Water", " ON - clear, transparent water", " OFF - default water"}: (btnName.equals("Better Grass") ? new String[] {"Better Grass", " OFF - default side grass texture, fastest", " Fast - full side grass texture, slower", " Fancy - dynamic side grass texture, slowest"}: (btnName.equals("Better Snow") ? new String[] {"Better Snow", " OFF - default snow, faster", " ON - better snow, slower", "Shows snow under transparent blocks (fence, tall grass)", "when bordering with snow blocks"}: (btnName.equals("Random Mobs") ? new String[] {"Random Mobs", " OFF - no random mobs, faster", " ON - random mobs, slower", "Random mobs uses random textures for the game creatures.", "It needs a texture pack which has multiple mob textures."}: (btnName.equals("Swamp Colors") ? new String[] {"Swamp Colors", " ON - use swamp colors (default), slower", " OFF - do not use swamp colors, faster", "The swamp colors affect grass, leaves, vines and water."}: (btnName.equals("Smooth Biomes") ? new String[] {"Smooth Biomes", " ON - smoothing of biome borders (default), slower", " OFF - no smoothing of biome borders, faster", "The smoothing of biome borders is done by sampling and", "averaging the color of all surrounding blocks.", "Affected are grass, leaves, vines and water."}: (btnName.equals("Custom Fonts") ? new String[] {"Custom Fonts", " ON - uses custom fonts (default), slower", " OFF - uses default font, faster", "The custom fonts are supplied by the current", "texture pack"}: (btnName.equals("Custom Colors") ? new String[] {"Custom Colors", " ON - uses custom colors (default), slower", " OFF - uses default colors, faster", "The custom colors are supplied by the current", "texture pack"}: (btnName.equals("Show Capes") ? new String[] {"Show Capes", " ON - show player capes (default)", " OFF - do not show player capes"}: (btnName.equals("Connected Textures") ? new String[] {"Connected Textures", " OFF - no connected textures (default)", " Fast - fast connected textures", " Fancy - fancy connected textures", "Connected textures joins the textures of glass,", "sandstone and bookshelves when placed next to", "each other. The connected textures are supplied", "by the current texture pack."}: (btnName.equals("Far View") ? new String[] {"Far View", " OFF - (default) standard view distance", " ON - 3x view distance", "Far View is very resource demanding!", "3x view distance => 9x chunks to be loaded => FPS / 9", "Standard view distances: 32, 64, 128, 256", "Far view distances: 96, 192, 384, 512"}: (btnName.equals("Natural Textures") ? new String[] {"Natural Textures", " OFF - no natural textures (default)", " ON - use natural textures", "Natural textures remove the gridlike pattern", "created by repeating blocks of the same type.", "It uses rotated and flipped variants of the base", "block texture. The configuration for the natural", "textures is supplied by the current texture pack"}: (btnName.equals("Custom Sky") ? new String[] {"Custom Sky", " ON - custom sky textures (default), slow", " OFF - default sky, faster", "The custom sky textures are supplied by the current", "texture pack"}: null)))))))))))))))); -+ return btnName.equals("Mipmap Level") ? new String[] {"Visual effect which makes distant objects look better", "by smoothing the texture details", " OFF - no smoothing", " 1 - minimum smoothing", " 4 - maximum smoothing", "This option usually does not affect the performance."}: (btnName.equals("Mipmap Type") ? new String[] {"Visual effect which makes distant objects look better", "by smoothing the texture details", " Nearest - rough smoothing", " Linear - fine smoothing", "This option usually does not affect the performance."}: (btnName.equals("Anisotropic Filtering") ? new String[] {"Anisotropic Filtering", " OFF - (default) standard texture detail (faster)", " 2-16 - finer details in mipmapped textures (slower)", "The Anisotropic Filtering restores details in mipmapped", "textures. Higher values may decrease the FPS."}: (btnName.equals("MSAA Antialiasing") ? new String[] {"MSAA Antialiasing", " OFF - (default) no antialiasing (faster - recommended)", " 2-16 - antialiased lines and edges (slower)", "The Antialiasing smooths jagged lines and ", "sharp color transitions.", "Higher values may substantially decrease the FPS.", "Recommend you use Minecrift FSAA or FXAA instead.", "Effective after a RESTART!"}: (btnName.equals("Clear Water") ? new String[] {"Clear Water", " ON - clear, transparent water", " OFF - default water"}: (btnName.equals("Better Grass") ? new String[] {"Better Grass", " OFF - default side grass texture, fastest", " Fast - full side grass texture, slower", " Fancy - dynamic side grass texture, slowest"}: (btnName.equals("Better Snow") ? new String[] {"Better Snow", " OFF - default snow, faster", " ON - better snow, slower", "Shows snow under transparent blocks (fence, tall grass)", "when bordering with snow blocks"}: (btnName.equals("Random Mobs") ? new String[] {"Random Mobs", " OFF - no random mobs, faster", " ON - random mobs, slower", "Random mobs uses random textures for the game creatures.", "It needs a texture pack which has multiple mob textures."}: (btnName.equals("Swamp Colors") ? new String[] {"Swamp Colors", " ON - use swamp colors (default), slower", " OFF - do not use swamp colors, faster", "The swamp colors affect grass, leaves, vines and water."}: (btnName.equals("Smooth Biomes") ? new String[] {"Smooth Biomes", " ON - smoothing of biome borders (default), slower", " OFF - no smoothing of biome borders, faster", "The smoothing of biome borders is done by sampling and", "averaging the color of all surrounding blocks.", "Affected are grass, leaves, vines and water."}: (btnName.equals("Custom Fonts") ? new String[] {"Custom Fonts", " ON - uses custom fonts (default), slower", " OFF - uses default font, faster", "The custom fonts are supplied by the current", "texture pack"}: (btnName.equals("Custom Colors") ? new String[] {"Custom Colors", " ON - uses custom colors (default), slower", " OFF - uses default colors, faster", "The custom colors are supplied by the current", "texture pack"}: (btnName.equals("Show Capes") ? new String[] {"Show Capes", " ON - show player capes (default)", " OFF - do not show player capes"}: (btnName.equals("Connected Textures") ? new String[] {"Connected Textures", " OFF - no connected textures (default)", " Fast - fast connected textures", " Fancy - fancy connected textures", "Connected textures joins the textures of glass,", "sandstone and bookshelves when placed next to", "each other. The connected textures are supplied", "by the current texture pack."}: (btnName.equals("Far View") ? new String[] {"Far View", " OFF - (default) standard view distance", " ON - 3x view distance", "Far View is very resource demanding!", "3x view distance => 9x chunks to be loaded => FPS / 9", "Standard view distances: 32, 64, 128, 256", "Far view distances: 96, 192, 384, 512"}: (btnName.equals("Natural Textures") ? new String[] {"Natural Textures", " OFF - no natural textures (default)", " ON - use natural textures", "Natural textures remove the gridlike pattern", "created by repeating blocks of the same type.", "It uses rotated and flipped variants of the base", "block texture. The configuration for the natural", "textures is supplied by the current texture pack"}: (btnName.equals("Custom Sky") ? new String[] {"Custom Sky", " ON - custom sky textures (default), slow", " OFF - default sky, faster", "The custom sky textures are supplied by the current", "texture pack"}: null)))))))))))))))); - } - - private String getButtonName(String displayString) +--- a/net/minecraft/src/GuiQualitySettingsOF.java ++++ b/net/minecraft/src/GuiQualitySettingsOF.java +@@ -140,7 +140,7 @@ + + private String[] getTooltipLines(String btnName) + { +- return btnName.equals("Mipmap Level") ? new String[] {"Visual effect which makes distant objects look better", "by smoothing the texture details", " OFF - no smoothing", " 1 - minimum smoothing", " 4 - maximum smoothing", "This option usually does not affect the performance."}: (btnName.equals("Mipmap Type") ? new String[] {"Visual effect which makes distant objects look better", "by smoothing the texture details", " Nearest - rough smoothing", " Linear - fine smoothing", "This option usually does not affect the performance."}: (btnName.equals("Anisotropic Filtering") ? new String[] {"Anisotropic Filtering", " OFF - (default) standard texture detail (faster)", " 2-16 - finer details in mipmapped textures (slower)", "The Anisotropic Filtering restores details in mipmapped", "textures. Higher values may decrease the FPS."}: (btnName.equals("Antialiasing") ? new String[] {"Antialiasing", " OFF - (default) no antialiasing (faster)", " 2-16 - antialiased lines and edges (slower)", "The Antialiasing smooths jagged lines and ", "sharp color transitions.", "Higher values may substantially decrease the FPS.", "Not all levels are supported by all graphics cards.", "Effective after a RESTART!"}: (btnName.equals("Clear Water") ? new String[] {"Clear Water", " ON - clear, transparent water", " OFF - default water"}: (btnName.equals("Better Grass") ? new String[] {"Better Grass", " OFF - default side grass texture, fastest", " Fast - full side grass texture, slower", " Fancy - dynamic side grass texture, slowest"}: (btnName.equals("Better Snow") ? new String[] {"Better Snow", " OFF - default snow, faster", " ON - better snow, slower", "Shows snow under transparent blocks (fence, tall grass)", "when bordering with snow blocks"}: (btnName.equals("Random Mobs") ? new String[] {"Random Mobs", " OFF - no random mobs, faster", " ON - random mobs, slower", "Random mobs uses random textures for the game creatures.", "It needs a texture pack which has multiple mob textures."}: (btnName.equals("Swamp Colors") ? new String[] {"Swamp Colors", " ON - use swamp colors (default), slower", " OFF - do not use swamp colors, faster", "The swamp colors affect grass, leaves, vines and water."}: (btnName.equals("Smooth Biomes") ? new String[] {"Smooth Biomes", " ON - smoothing of biome borders (default), slower", " OFF - no smoothing of biome borders, faster", "The smoothing of biome borders is done by sampling and", "averaging the color of all surrounding blocks.", "Affected are grass, leaves, vines and water."}: (btnName.equals("Custom Fonts") ? new String[] {"Custom Fonts", " ON - uses custom fonts (default), slower", " OFF - uses default font, faster", "The custom fonts are supplied by the current", "texture pack"}: (btnName.equals("Custom Colors") ? new String[] {"Custom Colors", " ON - uses custom colors (default), slower", " OFF - uses default colors, faster", "The custom colors are supplied by the current", "texture pack"}: (btnName.equals("Show Capes") ? new String[] {"Show Capes", " ON - show player capes (default)", " OFF - do not show player capes"}: (btnName.equals("Connected Textures") ? new String[] {"Connected Textures", " OFF - no connected textures (default)", " Fast - fast connected textures", " Fancy - fancy connected textures", "Connected textures joins the textures of glass,", "sandstone and bookshelves when placed next to", "each other. The connected textures are supplied", "by the current texture pack."}: (btnName.equals("Far View") ? new String[] {"Far View", " OFF - (default) standard view distance", " ON - 3x view distance", "Far View is very resource demanding!", "3x view distance => 9x chunks to be loaded => FPS / 9", "Standard view distances: 32, 64, 128, 256", "Far view distances: 96, 192, 384, 512"}: (btnName.equals("Natural Textures") ? new String[] {"Natural Textures", " OFF - no natural textures (default)", " ON - use natural textures", "Natural textures remove the gridlike pattern", "created by repeating blocks of the same type.", "It uses rotated and flipped variants of the base", "block texture. The configuration for the natural", "textures is supplied by the current texture pack"}: (btnName.equals("Custom Sky") ? new String[] {"Custom Sky", " ON - custom sky textures (default), slow", " OFF - default sky, faster", "The custom sky textures are supplied by the current", "texture pack"}: null)))))))))))))))); ++ return btnName.equals("Mipmap Level") ? new String[] {"Visual effect which makes distant objects look better", "by smoothing the texture details", " OFF - no smoothing", " 1 - minimum smoothing", " 4 - maximum smoothing", "This option usually does not affect the performance."}: (btnName.equals("Mipmap Type") ? new String[] {"Visual effect which makes distant objects look better", "by smoothing the texture details", " Nearest - rough smoothing", " Linear - fine smoothing", "This option usually does not affect the performance."}: (btnName.equals("Anisotropic Filtering") ? new String[] {"Anisotropic Filtering", " OFF - (default) standard texture detail (faster)", " 2-16 - finer details in mipmapped textures (slower)", "The Anisotropic Filtering restores details in mipmapped", "textures. Higher values may decrease the FPS."}: (btnName.equals("MSAA Antialiasing") ? new String[] {"MSAA Antialiasing", " OFF - (default) no antialiasing (faster - recommended)", " 2-16 - antialiased lines and edges (slower)", "The Antialiasing smooths jagged lines and ", "sharp color transitions.", "Higher values may substantially decrease the FPS.", "Recommend you use Minecrift FSAA or FXAA instead.", "Effective after a RESTART!"}: (btnName.equals("Clear Water") ? new String[] {"Clear Water", " ON - clear, transparent water", " OFF - default water"}: (btnName.equals("Better Grass") ? new String[] {"Better Grass", " OFF - default side grass texture, fastest", " Fast - full side grass texture, slower", " Fancy - dynamic side grass texture, slowest"}: (btnName.equals("Better Snow") ? new String[] {"Better Snow", " OFF - default snow, faster", " ON - better snow, slower", "Shows snow under transparent blocks (fence, tall grass)", "when bordering with snow blocks"}: (btnName.equals("Random Mobs") ? new String[] {"Random Mobs", " OFF - no random mobs, faster", " ON - random mobs, slower", "Random mobs uses random textures for the game creatures.", "It needs a texture pack which has multiple mob textures."}: (btnName.equals("Swamp Colors") ? new String[] {"Swamp Colors", " ON - use swamp colors (default), slower", " OFF - do not use swamp colors, faster", "The swamp colors affect grass, leaves, vines and water."}: (btnName.equals("Smooth Biomes") ? new String[] {"Smooth Biomes", " ON - smoothing of biome borders (default), slower", " OFF - no smoothing of biome borders, faster", "The smoothing of biome borders is done by sampling and", "averaging the color of all surrounding blocks.", "Affected are grass, leaves, vines and water."}: (btnName.equals("Custom Fonts") ? new String[] {"Custom Fonts", " ON - uses custom fonts (default), slower", " OFF - uses default font, faster", "The custom fonts are supplied by the current", "texture pack"}: (btnName.equals("Custom Colors") ? new String[] {"Custom Colors", " ON - uses custom colors (default), slower", " OFF - uses default colors, faster", "The custom colors are supplied by the current", "texture pack"}: (btnName.equals("Show Capes") ? new String[] {"Show Capes", " ON - show player capes (default)", " OFF - do not show player capes"}: (btnName.equals("Connected Textures") ? new String[] {"Connected Textures", " OFF - no connected textures (default)", " Fast - fast connected textures", " Fancy - fancy connected textures", "Connected textures joins the textures of glass,", "sandstone and bookshelves when placed next to", "each other. The connected textures are supplied", "by the current texture pack."}: (btnName.equals("Far View") ? new String[] {"Far View", " OFF - (default) standard view distance", " ON - 3x view distance", "Far View is very resource demanding!", "3x view distance => 9x chunks to be loaded => FPS / 9", "Standard view distances: 32, 64, 128, 256", "Far view distances: 96, 192, 384, 512"}: (btnName.equals("Natural Textures") ? new String[] {"Natural Textures", " OFF - no natural textures (default)", " ON - use natural textures", "Natural textures remove the gridlike pattern", "created by repeating blocks of the same type.", "It uses rotated and flipped variants of the base", "block texture. The configuration for the natural", "textures is supplied by the current texture pack"}: (btnName.equals("Custom Sky") ? new String[] {"Custom Sky", " ON - custom sky textures (default), slow", " OFF - default sky, faster", "The custom sky textures are supplied by the current", "texture pack"}: null)))))))))))))))); + } + + private String getButtonName(String displayString) diff --git a/patches/net/minecraft/src/GuiScreen.java.patch b/patches/net/minecraft/src/GuiScreen.java.patch index a2f01c18..6753d473 100644 --- a/patches/net/minecraft/src/GuiScreen.java.patch +++ b/patches/net/minecraft/src/GuiScreen.java.patch @@ -1,127 +1,100 @@ ---- a/net/minecraft/src/GuiScreen.java -+++ b/net/minecraft/src/GuiScreen.java -@@ -23,7 +23,7 @@ - public int height; - - /** A list of all the buttons in this container. */ -- protected List buttonList = new ArrayList(); -+ public List buttonList = new ArrayList(); - public boolean allowUserInput; - - /** The FontRenderer used by GuiScreen */ -@@ -35,6 +35,12 @@ - private long lastMouseEvent; - private int field_92018_d; - -+ public int mouseOffsetX = 0; -+ public int mouseOffsetY = 0; -+ -+ public int joystickX = 0; -+ public int joystickY = 0; -+ - /** - * Draws the screen and all the components in it. - */ -@@ -42,7 +48,7 @@ - { - for (int var4 = 0; var4 < this.buttonList.size(); ++var4) - { -- GuiButton var5 = (GuiButton)this.buttonList.get(var4); -+ GuiButton var5 = this.buttonList.get(var4); - var5.drawButton(this.mc, par1, par2); - } - } -@@ -106,7 +112,7 @@ - { - for (int var4 = 0; var4 < this.buttonList.size(); ++var4) - { -- GuiButton var5 = (GuiButton)this.buttonList.get(var4); -+ GuiButton var5 = this.buttonList.get(var4); - - if (var5.mousePressed(this.mc, par1, par2)) - { -@@ -171,21 +177,72 @@ - this.handleMouseInput(); - } - -- while (Keyboard.next()) -+ while (Keyboard.isCreated() && Keyboard.next()) - { - this.handleKeyboardInput(); - } - } -+ -+ public void mouseDown( int rawX, int rawY, int button ) -+ { -+ int var1 = rawX * this.width / this.mc.displayFBWidth; -+ int var2 = this.height - rawY * this.height / this.mc.displayFBHeight - 1; -+ this.eventButton = button; -+ this.lastMouseEvent = Minecraft.getSystemTime(); -+ mouseClicked(var1, var2, button); -+ } -+ -+ public void mouseUp( int rawX, int rawY, int button ) -+ { -+ int var1 = rawX * this.width / this.mc.displayFBWidth; -+ int var2 = this.height - rawY * this.height / this.mc.displayFBHeight - 1; -+ mouseMovedOrUp(var1, var2, button); -+ } -+ -+ public void mouseDrag( int rawX, int rawY ) -+ { -+ int var1 = rawX * this.width / this.mc.displayFBWidth; -+ int var2 = this.height - rawY * this.height / this.mc.displayFBHeight - 1; -+ long var3 = Minecraft.getSystemTime() - this.lastMouseEvent; -+ this.mouseClickMove(var1, var2, this.eventButton, var3); -+ } -+ -+ public void mouseGuiDown( int guiX, int guiY, int button ) -+ { -+ this.eventButton = button; -+ this.lastMouseEvent = Minecraft.getSystemTime(); -+ mouseClicked(guiX, guiY, button); -+ } -+ -+ public void mouseGuiUp( int guiX, int guiY, int button ) -+ { -+ mouseMovedOrUp(guiX, guiY, button); -+ } -+ -+ public void mouseGuiDrag( int guiX, int guiY ) -+ { -+ long var3 = Minecraft.getSystemTime() - this.lastMouseEvent; -+ this.mouseClickMove(guiX, guiY, this.eventButton, var3); -+ } - - /** - * Handles mouse input. - */ - public void handleMouseInput() - { -- int var1 = Mouse.getEventX() * this.width / this.mc.displayWidth; -- int var2 = this.height - Mouse.getEventY() * this.height / this.mc.displayHeight - 1; -+ int var1 = ( Mouse.getEventX() + mouseOffsetX ) * this.width / this.mc.displayFBWidth; -+ int var2 = this.height - ( Mouse.getEventY() + mouseOffsetY) * this.height/ this.mc.displayFBHeight - 1; - int var3 = Mouse.getEventButton(); - -+ mouseOffsetX = 0; -+ mouseOffsetY = 0; -+ if( joystickX > 0 ) -+ { -+ var1 = joystickX; -+ var2 = joystickY; -+ joystickX = 0; -+ joystickY = 0; -+ } - if (Minecraft.field_142025_a && var3 == 0 && (Keyboard.isKeyDown(29) || Keyboard.isKeyDown(157))) - { - var3 = 1; -@@ -261,7 +318,7 @@ - { - if (this.mc.theWorld != null) - { -- this.drawGradientRect(0, 0, this.width, this.height, -1072689136, -804253680); -+ this.drawGradientRect(0, 0, this.width, this.height, 0, 0); - } - else - { +--- a/net/minecraft/src/GuiScreen.java ++++ b/net/minecraft/src/GuiScreen.java +@@ -23,7 +23,7 @@ + public int height; + + /** A list of all the buttons in this container. */ +- protected List buttonList = new ArrayList(); ++ public List buttonList = new ArrayList(); + public boolean allowUserInput; + + /** The FontRenderer used by GuiScreen */ +@@ -35,6 +35,12 @@ + private long lastMouseEvent; + private int field_92018_d; + ++ public int mouseOffsetX = 0; ++ public int mouseOffsetY = 0; ++ ++ public int joystickX = 0; ++ public int joystickY = 0; ++ + /** + * Draws the screen and all the components in it. + */ +@@ -171,21 +177,72 @@ + this.handleMouseInput(); + } + +- while (Keyboard.next()) ++ while (Keyboard.isCreated() && Keyboard.next()) + { + this.handleKeyboardInput(); + } + } ++ ++ public void mouseDown( int rawX, int rawY, int button ) ++ { ++ int var1 = rawX * this.width / this.mc.displayFBWidth; ++ int var2 = this.height - rawY * this.height / this.mc.displayFBHeight - 1; ++ this.eventButton = button; ++ this.lastMouseEvent = Minecraft.getSystemTime(); ++ mouseClicked(var1, var2, button); ++ } ++ ++ public void mouseUp( int rawX, int rawY, int button ) ++ { ++ int var1 = rawX * this.width / this.mc.displayFBWidth; ++ int var2 = this.height - rawY * this.height / this.mc.displayFBHeight - 1; ++ mouseMovedOrUp(var1, var2, button); ++ } ++ ++ public void mouseDrag( int rawX, int rawY ) ++ { ++ int var1 = rawX * this.width / this.mc.displayFBWidth; ++ int var2 = this.height - rawY * this.height / this.mc.displayFBHeight - 1; ++ long var3 = Minecraft.getSystemTime() - this.lastMouseEvent; ++ this.mouseClickMove(var1, var2, this.eventButton, var3); ++ } ++ ++ public void mouseGuiDown( int guiX, int guiY, int button ) ++ { ++ this.eventButton = button; ++ this.lastMouseEvent = Minecraft.getSystemTime(); ++ mouseClicked(guiX, guiY, button); ++ } ++ ++ public void mouseGuiUp( int guiX, int guiY, int button ) ++ { ++ mouseMovedOrUp(guiX, guiY, button); ++ } ++ ++ public void mouseGuiDrag( int guiX, int guiY ) ++ { ++ long var3 = Minecraft.getSystemTime() - this.lastMouseEvent; ++ this.mouseClickMove(guiX, guiY, this.eventButton, var3); ++ } + + /** + * Handles mouse input. + */ + public void handleMouseInput() + { +- int var1 = Mouse.getEventX() * this.width / this.mc.displayWidth; +- int var2 = this.height - Mouse.getEventY() * this.height / this.mc.displayHeight - 1; ++ int var1 = ( Mouse.getEventX() + mouseOffsetX ) * this.width / this.mc.displayFBWidth; ++ int var2 = this.height - ( Mouse.getEventY() + mouseOffsetY) * this.height/ this.mc.displayFBHeight - 1; + int var3 = Mouse.getEventButton(); + ++ mouseOffsetX = 0; ++ mouseOffsetY = 0; ++ if( joystickX > 0 ) ++ { ++ var1 = joystickX; ++ var2 = joystickY; ++ joystickX = 0; ++ joystickY = 0; ++ } + if (Minecraft.isRunningOnMac && var3 == 0 && (Keyboard.isKeyDown(29) || Keyboard.isKeyDown(157))) + { + var3 = 1; diff --git a/patches/net/minecraft/src/GuiSlot.java.patch b/patches/net/minecraft/src/GuiSlot.java.patch index 3594bdbd..67b31d4b 100644 --- a/patches/net/minecraft/src/GuiSlot.java.patch +++ b/patches/net/minecraft/src/GuiSlot.java.patch @@ -1,62 +1,62 @@ ---- a/net/minecraft/src/GuiSlot.java -+++ b/net/minecraft/src/GuiSlot.java -@@ -62,6 +62,18 @@ - private boolean showSelectionBox = true; - private boolean field_77243_s; - private int field_77242_t; -+ -+ public int publicGetSize() { return getSize(); } -+ public int select( int item, boolean dblClick) { -+ amountScrolled = item * slotHeight; -+ bindAmountScrolled(); -+ elementClicked(item, dblClick); -+ -+ if( !dblClick ) { -+ return (int)(this.top + 4 - this.amountScrolled + (item+0.5) * this.slotHeight + this.field_77242_t); -+ } -+ return 0; -+ }; - - public GuiSlot(Minecraft par1Minecraft, int par2, int par3, int par4, int par5, int par6) - { -@@ -326,16 +338,7 @@ - GL11.glDisable(GL11.GL_LIGHTING); - GL11.glDisable(GL11.GL_FOG); - Tessellator var18 = Tessellator.instance; -- this.mc.func_110434_K().func_110577_a(Gui.field_110325_k); -- GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); -- float var17 = 32.0F; -- var18.startDrawingQuads(); -- var18.setColorOpaque_I(2105376); -- var18.addVertexWithUV((double)this.left, (double)this.bottom, 0.0D, (double)((float)this.left / var17), (double)((float)(this.bottom + (int)this.amountScrolled) / var17)); -- var18.addVertexWithUV((double)this.right, (double)this.bottom, 0.0D, (double)((float)this.right / var17), (double)((float)(this.bottom + (int)this.amountScrolled) / var17)); -- var18.addVertexWithUV((double)this.right, (double)this.top, 0.0D, (double)((float)this.right / var17), (double)((float)(this.top + (int)this.amountScrolled) / var17)); -- var18.addVertexWithUV((double)this.left, (double)this.top, 0.0D, (double)((float)this.left / var17), (double)((float)(this.top + (int)this.amountScrolled) / var17)); -- var18.draw(); -+ drawContainerBackground(var18); - var9 = this.width / 2 - 92 - 16; - var10 = this.top + 4 - (int)this.amountScrolled; - -@@ -456,7 +459,21 @@ - GL11.glDisable(GL11.GL_BLEND); - } - -- protected int getScrollBarX() -+ protected void drawContainerBackground(Tessellator var18) { -+ /* Forge compatibility */ -+ this.mc.func_110434_K().func_110577_a(Gui.field_110325_k); -+ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); -+ float var17 = 32.0F; -+ var18.startDrawingQuads(); -+ var18.setColorOpaque_I(2105376); -+ var18.addVertexWithUV((double)this.left, (double)this.bottom, 0.0D, (double)((float)this.left / var17), (double)((float)(this.bottom + (int)this.amountScrolled) / var17)); -+ var18.addVertexWithUV((double)this.right, (double)this.bottom, 0.0D, (double)((float)this.right / var17), (double)((float)(this.bottom + (int)this.amountScrolled) / var17)); -+ var18.addVertexWithUV((double)this.right, (double)this.top, 0.0D, (double)((float)this.right / var17), (double)((float)(this.top + (int)this.amountScrolled) / var17)); -+ var18.addVertexWithUV((double)this.left, (double)this.top, 0.0D, (double)((float)this.left / var17), (double)((float)(this.top + (int)this.amountScrolled) / var17)); -+ var18.draw(); -+ } -+ -+ protected int getScrollBarX() - { - return this.width / 2 + 124; - } +--- a/net/minecraft/src/GuiSlot.java ++++ b/net/minecraft/src/GuiSlot.java +@@ -62,6 +62,18 @@ + private boolean showSelectionBox = true; + private boolean field_77243_s; + private int field_77242_t; ++ ++ public int publicGetSize() { return getSize(); } ++ public int select( int item, boolean dblClick) { ++ amountScrolled = item * slotHeight; ++ bindAmountScrolled(); ++ elementClicked(item, dblClick); ++ ++ if( !dblClick ) { ++ return (int)(this.top + 4 - this.amountScrolled + (item+0.5) * this.slotHeight + this.field_77242_t); ++ } ++ return 0; ++ }; + + public GuiSlot(Minecraft par1Minecraft, int par2, int par3, int par4, int par5, int par6) + { +@@ -326,16 +338,7 @@ + GL11.glDisable(GL11.GL_LIGHTING); + GL11.glDisable(GL11.GL_FOG); + Tessellator var18 = Tessellator.instance; +- this.mc.getTextureManager().bindTexture(Gui.optionsBackground); +- GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); +- float var17 = 32.0F; +- var18.startDrawingQuads(); +- var18.setColorOpaque_I(2105376); +- var18.addVertexWithUV((double)this.left, (double)this.bottom, 0.0D, (double)((float)this.left / var17), (double)((float)(this.bottom + (int)this.amountScrolled) / var17)); +- var18.addVertexWithUV((double)this.right, (double)this.bottom, 0.0D, (double)((float)this.right / var17), (double)((float)(this.bottom + (int)this.amountScrolled) / var17)); +- var18.addVertexWithUV((double)this.right, (double)this.top, 0.0D, (double)((float)this.right / var17), (double)((float)(this.top + (int)this.amountScrolled) / var17)); +- var18.addVertexWithUV((double)this.left, (double)this.top, 0.0D, (double)((float)this.left / var17), (double)((float)(this.top + (int)this.amountScrolled) / var17)); +- var18.draw(); ++ drawContainerBackground(var18); + var9 = this.width / 2 - 92 - 16; + var10 = this.top + 4 - (int)this.amountScrolled; + +@@ -456,7 +459,21 @@ + GL11.glDisable(GL11.GL_BLEND); + } + +- protected int getScrollBarX() ++ protected void drawContainerBackground(Tessellator var18) { ++ /* Forge compatibility */ ++ this.mc.getTextureManager().bindTexture(Gui.optionsBackground); ++ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); ++ float var17 = 32.0F; ++ var18.startDrawingQuads(); ++ var18.setColorOpaque_I(2105376); ++ var18.addVertexWithUV((double)this.left, (double)this.bottom, 0.0D, (double)((float)this.left / var17), (double)((float)(this.bottom + (int)this.amountScrolled) / var17)); ++ var18.addVertexWithUV((double)this.right, (double)this.bottom, 0.0D, (double)((float)this.right / var17), (double)((float)(this.bottom + (int)this.amountScrolled) / var17)); ++ var18.addVertexWithUV((double)this.right, (double)this.top, 0.0D, (double)((float)this.right / var17), (double)((float)(this.top + (int)this.amountScrolled) / var17)); ++ var18.addVertexWithUV((double)this.left, (double)this.top, 0.0D, (double)((float)this.left / var17), (double)((float)(this.top + (int)this.amountScrolled) / var17)); ++ var18.draw(); ++ } ++ ++ protected int getScrollBarX() + { + return this.width / 2 + 124; + } diff --git a/patches/net/minecraft/src/Minecraft.java.patch b/patches/net/minecraft/src/Minecraft.java.patch index d2da2ef5..0d3c3c38 100644 --- a/patches/net/minecraft/src/Minecraft.java.patch +++ b/patches/net/minecraft/src/Minecraft.java.patch @@ -1,1133 +1,1106 @@ ---- a/net/minecraft/src/Minecraft.java -+++ b/net/minecraft/src/Minecraft.java -@@ -5,6 +5,7 @@ - import java.io.File; - import java.io.IOException; - import java.net.Proxy; -+import java.lang.reflect.InvocationTargetException; - import java.nio.ByteBuffer; - import java.text.DecimalFormat; - import java.text.SimpleDateFormat; -@@ -15,8 +16,14 @@ - import java.util.Iterator; - import java.util.List; - import javax.imageio.ImageIO; -+ -+import net.aib42.mumblelink.MumbleLink; - import net.minecraft.client.ClientBrandRetriever; - import net.minecraft.server.MinecraftServer; -+ -+import com.mtbs3d.minecrift.*; -+ -+import de.fruitfly.ovr.UserProfileData; - import org.lwjgl.LWJGLException; - import org.lwjgl.Sys; - import org.lwjgl.input.Keyboard; -@@ -30,6 +37,17 @@ - import org.lwjgl.opengl.PixelFormat; - import org.lwjgl.util.glu.GLU; - -+import com.mtbs3d.minecrift.api.IHMDInfo; -+import com.mtbs3d.minecrift.api.ICenterEyePositionProvider; -+import com.mtbs3d.minecrift.api.IBodyAimController; -+import com.mtbs3d.minecrift.api.IOrientationProvider; -+import com.mtbs3d.minecrift.gui.GuiMinecriftSettings; -+import com.mtbs3d.minecrift.settings.VRSettings; -+import com.mtbs3d.minecrift.api.PluginManager; -+import com.mtbs3d.minecrift.control.ControlBinding; -+import com.mtbs3d.minecrift.control.JoystickAim; -+ -+ - public class Minecraft implements IPlayerUsage - { - private static final ResourceLocation field_110444_H = new ResourceLocation("textures/gui/title/mojang.png"); -@@ -55,8 +73,15 @@ - - /** Instance of CrashReport. */ - private CrashReport crashReporter; -+ -+ /* Size of GUI framebuffer */ - public int displayWidth; - public int displayHeight; -+ -+ /* Actual size of the display buffer, only different than displayWidth when using VRRenderer */ -+ public int displayFBWidth; -+ public int displayFBHeight; -+ - private Timer timer = new Timer(20.0F); - - /** Instance of PlayerUsageSnooper. */ -@@ -85,6 +110,8 @@ - public GuiScreen currentScreen; - public LoadingScreenRenderer loadingScreen; - public EntityRenderer entityRenderer; -+ public VRRenderer vrRenderer; -+ public MumbleLink mumbleLink; - - /** Mouse left click counter */ - private int leftClickCounter; -@@ -110,6 +137,7 @@ - - /** The game settings that currently hold effect. */ - public GameSettings gameSettings; -+ public VRSettings vrSettings; - public SoundManager sndManager; - - /** Mouse helper instance. */ -@@ -119,12 +147,13 @@ - private final String field_110447_Z; - private final Proxy field_110453_aa; - private ISaveFormat saveLoader; -- -+ -+ private boolean resetMouse = false; - /** - * This is set to fpsCounter every debug screen update, and is shown on the debug screen. It's also sent as part of - * the usage snooping. - */ -- private static int debugFPS; -+ public static int debugFPS; - - /** - * When you place a block, it's set to 6, decremented once per tick, when it's 0, you can place another block. -@@ -186,6 +215,21 @@ - /** Profiler currently displayed in the debug screen pie chart */ - private String debugProfilerName = "root"; - -+ /** Active VR HMDInfo Plugin **/ -+ public IHMDInfo hmdInfo; -+ -+ /** Active VR Head Tracker Plugin **/ -+ public IOrientationProvider headTracker; -+ -+ /** Active VR Eye Position Tracker Plugin **/ -+ public ICenterEyePositionProvider positionTracker; -+ -+ /** Active VR view/aim/move controller Plugin **/ -+ public IBodyAimController lookaimController; -+ private int mouseFBX; -+ private int mouseFBY; -+ -+ - public Minecraft(Session par1Session, int par2, int par3, boolean par4, boolean par5, File par6File, File par7File, File par8File, Proxy par9Proxy, String par10Str) - { - theMinecraft = this; -@@ -202,8 +246,7 @@ - this.field_94139_O.logInfo("Setting user: " + par1Session.func_111285_a()); - this.field_94139_O.logInfo("(Session ID is " + par1Session.func_111286_b() + ")"); - this.isDemo = par5; -- this.displayWidth = par2; -- this.displayHeight = par3; -+ resize( par2, par3 ); - this.tempDisplayWidth = par2; - this.tempDisplayHeight = par3; - this.fullscreen = par4; -@@ -262,36 +305,29 @@ - private void startGame() throws LWJGLException - { - this.gameSettings = new GameSettings(this, this.mcDataDir); -+ this.vrSettings = new VRSettings(this, this.mcDataDir); -+ - - if (this.gameSettings.overrideHeight > 0 && this.gameSettings.overrideWidth > 0) - { -- this.displayWidth = this.gameSettings.overrideWidth; -- this.displayHeight = this.gameSettings.overrideHeight; -+ this.displayFBWidth = this.gameSettings.overrideWidth; -+ this.displayFBHeight = this.gameSettings.overrideHeight; - } - -+ Display.setResizable(true); -+ Display.setTitle("Minecraft 1.6.2 VR"); -+ - if (this.fullscreen) - { -- Display.setFullscreen(true); -- this.displayWidth = Display.getDisplayMode().getWidth(); -- this.displayHeight = Display.getDisplayMode().getHeight(); -- -- if (this.displayWidth <= 0) -- { -- this.displayWidth = 1; -- } -- -- if (this.displayHeight <= 0) -- { -- this.displayHeight = 1; -- } -+ // Set (or not) fullscreen mode -+ setFullscreen(this.fullscreen); -+ resize( Display.getDisplayMode().getWidth(), Display.getDisplayMode().getHeight() ); - } - else - { -- Display.setDisplayMode(new DisplayMode(this.displayWidth, this.displayHeight)); -+ Display.setDisplayMode(new DisplayMode(this.displayFBWidth, this.displayFBHeight)); - } - -- Display.setResizable(true); -- Display.setTitle("Minecraft 1.6.2"); - this.getLogAgent().logInfo("LWJGL Version: " + Sys.getVersion()); - - if (Util.func_110647_a() != EnumOS.MACOS) -@@ -350,6 +386,19 @@ - this.field_110451_am.func_110542_a(this.sndManager); - this.loadScreen(); - this.fontRenderer = new FontRenderer(this.gameSettings, new ResourceLocation("textures/font/ascii.png"), this.renderEngine, false); -+ -+ Object fmlClientHandler = null; -+ if( Reflector.FMLClientHandler_instance.exists()) -+ { -+ fmlClientHandler = Reflector.call( Reflector.FMLClientHandler_instance, new Object[0]); -+ } -+ -+ if( fmlClientHandler != null) -+ { -+ //One of these should work... -+ Reflector.callVoid(fmlClientHandler, Reflector.FMLClientHandler_beginMinecraftLoading2, new Object[]{this,this.field_110449_ao,this.field_110451_am}); -+ Reflector.callVoid(fmlClientHandler, Reflector.FMLClientHandler_beginMinecraftLoading, new Object[]{this,this.field_110449_ao}); -+ } - - if (this.gameSettings.language != null) - { -@@ -363,10 +412,37 @@ - this.field_110451_am.func_110542_a(new GrassColorReloadListener()); - this.field_110451_am.func_110542_a(new FoliageColorReloadListener()); - RenderManager.instance.itemRenderer = new ItemRenderer(this); -- this.entityRenderer = new EntityRenderer(this); - this.statFileWriter = new StatFileWriter(this.session, this.mcDataDir); - AchievementList.openInventory.setStatStringFormatter(new StatStringFormatKeyInv(this)); - this.mouseHelper = new MouseHelper(); -+ -+ try { -+ Class.forName("com.mtbs3d.minecrift.MCHydra").newInstance();//creates and registers MCHydra if it can be (if the libraries are found) -+ } catch (NoClassDefFoundError e1) { -+ System.err.println("Couldn't load Razer Hydra libraries (Sixense-Java): "+e1.toString()); -+ } catch( Exception e1) { -+ System.err.println("Couldn't load Razer Hydra libraries (Sixense-Java): "+e1.toString()); -+ } -+ try { -+ MumbleLink.loadLibrary(); -+ mumbleLink = new MumbleLink("MinecraftVR", "Minecraft VR"); -+ mumbleLink.setIdentityAndContext(this.session.func_111285_a(), "Minecraft"/*TODO: get the servername? */); -+ } catch( Exception e ) { -+ System.err.println("Couldn't load MumbleLink"+e.toString()); -+ } -+ new MCController(); -+ new MCMouse(); //create and register mouse ILookAimMoveController plugin -+ new NullCenterEyePosition(); //create and register "None" head position plugin -+ PluginManager.register(new MCOculus()); // create and register new plugin -+ -+ hmdInfo = PluginManager.configureHMD(this.vrSettings.hmdPluginID); -+ headTracker = PluginManager.configureOrientation(this.vrSettings.headTrackerPluginID); -+ positionTracker = PluginManager.configurePosition(this.vrSettings.headPositionPluginID); -+ lookaimController = PluginManager.configureController(this.vrSettings.controllerPluginID); -+ -+ //uses mouseHelper -+ setUseVRRenderer( vrSettings.useVRRenderer ); -+ - this.checkGLError("Pre startup"); - GL11.glEnable(GL11.GL_TEXTURE_2D); - GL11.glShadeModel(GL11.GL_SMOOTH); -@@ -383,15 +459,45 @@ - this.renderGlobal = new RenderGlobal(this); - this.renderEngine.func_130088_a(TextureMap.field_110575_b, new TextureMap(0, "textures/blocks")); - this.renderEngine.func_130088_a(TextureMap.field_110576_c, new TextureMap(1, "textures/items")); -- GL11.glViewport(0, 0, this.displayWidth, this.displayHeight); -+ GL11.glViewport(0, 0, this.displayFBWidth, this.displayHeight); - this.effectRenderer = new EffectRenderer(this.theWorld, this.renderEngine); -+ -+ if( fmlClientHandler != null ) -+ { -+ Reflector.callVoid(fmlClientHandler, Reflector.FMLClientHandler_finishMinecraftLoading, new Object[0]); -+ } -+ -+ - this.checkGLError("Post startup"); -- this.ingameGUI = new GuiIngame(this); -+ if( Reflector.ForgeGuiIngame.exists()) -+ { -+ try { -+ this.ingameGUI = (GuiIngame)Reflector.ForgeGuiIngame_Constructor.getTargetConstructor().newInstance(new Object[]{this}); -+ } catch (IllegalArgumentException e) { -+ e.printStackTrace(); -+ } catch (InstantiationException e) { -+ e.printStackTrace(); -+ } catch (IllegalAccessException e) { -+ e.printStackTrace(); -+ } catch (InvocationTargetException e) { -+ e.printStackTrace(); -+ } -+ } -+ else -+ { -+ this.ingameGUI = new GuiIngame(this); -+ } -+ - - if (this.serverName != null) - { - this.displayGuiScreen(new GuiConnecting(new GuiMainMenu(), this, this.serverName, this.serverPort)); - } -+ else if (!this.vrSettings.useVRRenderer ) -+ { -+ -+ this.displayGuiScreen(new GuiMinecriftSettings( new GuiMainMenu(), vrSettings) ); -+ } - else - { - this.displayGuiScreen(new GuiMainMenu()); -@@ -403,6 +509,11 @@ - { - this.toggleFullscreen(); - } -+ -+ if( fmlClientHandler != null ) -+ { -+ Reflector.callVoid(fmlClientHandler, Reflector.FMLClientHandler_onInitializationComplete, new Object[0]); -+ } - } - - public void func_110436_a() -@@ -495,8 +606,7 @@ - } - - Display.setDisplayMode(var2); -- this.displayWidth = var2.getWidth(); -- this.displayHeight = var2.getHeight(); -+ resize(var2.getWidth(),var2.getHeight()); - } - - /** -@@ -595,21 +705,28 @@ - { - this.setIngameNotInFocus(); - ScaledResolution var2 = new ScaledResolution(this.gameSettings, this.displayWidth, this.displayHeight); -- int var3 = var2.getScaledWidth(); -- int var4 = var2.getScaledHeight(); -- ((GuiScreen)par1GuiScreen).setWorldAndResolution(this, var3, var4); -+ int width = var2.getScaledWidth(); -+ int height = var2.getScaledHeight(); -+ ((GuiScreen)par1GuiScreen).setWorldAndResolution(this, width, height); - this.skipRenderWorld = false; -+ - } - else - { - this.setIngameFocus(); - } -+ -+ if ((par1GuiScreen instanceof GuiMainMenu && this.theWorld == null) || -+ (par1GuiScreen instanceof GuiDisconnected && this.theWorld == null)) -+ { -+ this.setIngameNotInFocus(); // TODO: Ensure disconnected menu has mouse pointer! -+ } - } - - /** - * Checks for an OpenGL error. If there is one, prints the error ID and error string. - */ -- private void checkGLError(String par1Str) -+ public void checkGLError(String par1Str) - { - int var2 = GL11.glGetError(); - -@@ -622,6 +739,15 @@ - } - } - -+ -+ public void printChatMessage(String message) -+ { -+ if (this.theWorld != null) -+ { -+ this.ingameGUI.getChatGUI().printChatMessage("\u00a7e[Minecrift]\u00a7f " + message); -+ } -+ } -+ - /** - * Shuts down the minecraft applet by stopping the resource downloads, and clearing up GL stuff; called when the - * application (or web page) is exited. -@@ -652,6 +778,8 @@ - } - - this.sndManager.closeMinecraft(); -+ -+ PluginManager.destroyAll(); - } - finally - { -@@ -683,6 +811,7 @@ - return; - } - -+ ControlBinding.CreateBindingList(this.gameSettings); - try - { - while (this.running) -@@ -782,7 +911,8 @@ - this.checkGLError("Pre render"); - RenderBlocks.fancyGrass = this.gameSettings.fancyGraphics; - this.mcProfiler.endStartSection("sound"); -- this.sndManager.setListener(this.thePlayer, this.timer.renderPartialTicks); -+ if(!this.vrSettings.useVRRenderer) -+ this.sndManager.setListener(this.thePlayer, this.timer.renderPartialTicks); - - if (!this.isGamePaused) - { -@@ -808,9 +938,44 @@ - - if (!this.skipRenderWorld) - { -+ Object fmlCommonHandler = null; -+ if( Reflector.FMLCommonHandler_instance.exists()) -+ { -+ fmlCommonHandler = Reflector.call(Reflector.FMLCommonHandler_instance, new Object[0]); -+ } -+ if( fmlCommonHandler != null ) -+ { -+ Reflector.callVoid(fmlCommonHandler, Reflector.FMLCommonHandler_onRenderTickStart, new Object[]{this.timer.renderPartialTicks}); -+ } - this.mcProfiler.endStartSection("gameRenderer"); -+ -+ -+ //VR mouse hack: transform the mouse coordinates from screen (framebuffer) size to GUI framebuffer coordinates -+ int mouseX=0; -+ int mouseY=0; -+ if(this.vrSettings.useVRRenderer) -+ { -+ mouseX = Mouse.getX(); -+ mouseY = Mouse.getY(); -+ Mouse.setCursorPosition(mouseX*this.displayWidth/this.displayFBWidth, mouseY*this.displayHeight/this.displayFBHeight); -+ } - this.entityRenderer.updateCameraAndRender(this.timer.renderPartialTicks); -+ -+ if(this.vrSettings.useVRRenderer) -+ { -+ if( resetMouse ) { -+ Mouse.setCursorPosition(this.mouseFBX, this.mouseFBY); -+ resetMouse = false; -+ } else { -+ Mouse.setCursorPosition(mouseX, mouseY); -+ } -+ } -+ - this.mcProfiler.endSection(); -+ if( fmlCommonHandler != null ) -+ { -+ Reflector.callVoid(fmlCommonHandler, Reflector.FMLCommonHandler_onRenderTickEnd, new Object[]{this.timer.renderPartialTicks}); -+ } - } - - GL11.glFlush(); -@@ -837,7 +1002,7 @@ - this.prevFrameTime = System.nanoTime(); - } - -- this.guiAchievement.updateAchievementWindow(); -+ //this.guiAchievement.updateAchievementWindow(); - this.mcProfiler.startSection("root"); - Thread.yield(); - -@@ -850,20 +1015,9 @@ - - if (!this.fullscreen && Display.wasResized()) - { -- this.displayWidth = Display.getWidth(); -- this.displayHeight = Display.getHeight(); -- -- if (this.displayWidth <= 0) -- { -- this.displayWidth = 1; -- } -- -- if (this.displayHeight <= 0) -- { -- this.displayHeight = 1; -- } -- -- this.resize(this.displayWidth, this.displayHeight); -+ this.displayFBWidth = Display.getWidth(); -+ this.displayFBHeight = Display.getHeight(); -+ this.resize(this.displayFBWidth, this.displayFBHeight); - } - - this.checkGLError("Post render"); -@@ -901,7 +1055,7 @@ - - private int func_90020_K() - { -- return this.currentScreen != null && this.currentScreen instanceof GuiMainMenu ? 2 : this.gameSettings.limitFramerate; -+ return this.gameSettings.limitFramerate; - } - - public void freeMemory() -@@ -950,7 +1104,7 @@ - if (!this.isTakingScreenshot) - { - this.isTakingScreenshot = true; -- this.ingameGUI.getChatGUI().printChatMessage(ScreenShotHelper.saveScreenshot(this.mcDataDir, this.displayWidth, this.displayHeight)); -+ this.ingameGUI.getChatGUI().printChatMessage(ScreenShotHelper.saveScreenshot(this.mcDataDir, this.displayFBWidth, this.displayFBHeight)); - } - } - else -@@ -1009,7 +1163,7 @@ - GL11.glMatrixMode(GL11.GL_PROJECTION); - GL11.glEnable(GL11.GL_COLOR_MATERIAL); - GL11.glLoadIdentity(); -- GL11.glOrtho(0.0D, (double)this.displayWidth, (double)this.displayHeight, 0.0D, 1000.0D, 3000.0D); -+ GL11.glOrtho(0.0D, (double)this.displayFBWidth, (double)this.displayFBHeight, 0.0D, 1000.0D, 3000.0D); - GL11.glMatrixMode(GL11.GL_MODELVIEW); - GL11.glLoadIdentity(); - GL11.glTranslatef(0.0F, 0.0F, -2000.0F); -@@ -1017,8 +1171,8 @@ - GL11.glDisable(GL11.GL_TEXTURE_2D); - Tessellator var5 = Tessellator.instance; - short var6 = 160; -- int var7 = this.displayWidth - var6 - 10; -- int var8 = this.displayHeight - var6 * 2; -+ int var7 = this.displayFBWidth - var6 - 10; -+ int var8 = this.displayFBHeight - var6 * 2; - GL11.glEnable(GL11.GL_BLEND); - var5.startDrawingQuads(); - var5.setColorRGBA_I(0, 200); -@@ -1139,15 +1293,25 @@ - } - - /** -- * Resets the player keystate, disables the ingame focus, and ungrabs the mouse cursor. -+ * Resets the player keystate, disables the ingame focus, and ungrabs the mouse - */ - public void setIngameNotInFocus() - { -- if (this.inGameHasFocus) -+ if( this.inGameHasFocus ) - { -- KeyBinding.unPressAllKeys(); -- this.inGameHasFocus = false; -- this.mouseHelper.ungrabMouseCursor(); -+ KeyBinding.unPressAllKeys(); -+ this.inGameHasFocus = false; -+ if( vrSettings.useVRRenderer ) -+ { -+ int var1 = Display.getWidth(); -+ int var2 = Display.getHeight(); -+ -+ Mouse.setCursorPosition(var1 / 2, var2 / 2); -+ } -+ else -+ { -+ this.mouseHelper.ungrabMouseCursor(); -+ } - } - } - -@@ -1158,6 +1322,7 @@ - { - if (this.currentScreen == null) - { -+ - this.displayGuiScreen(new GuiIngameMenu()); - - if (this.isSingleplayer() && !this.theIntegratedServer.getPublic()) -@@ -1200,7 +1365,7 @@ - * Called whenever the mouse is clicked. Button clicked is 0 for left clicking and 1 for right clicking. Args: - * buttonClicked - */ -- private void clickMouse(int par1) -+ public void clickMouse(int par1) - { - if (par1 != 0 || this.leftClickCounter <= 0) - { -@@ -1290,46 +1455,25 @@ - */ - public void toggleFullscreen() - { -+ this.fullscreen = !this.fullscreen; -+ this.gameSettings.fullScreen = this.fullscreen; -+ this.gameSettings.saveOptions(); -+ setFullscreen(this.fullscreen); -+ } -+ -+ public void setFullscreen(boolean enable) -+ { - try - { -- this.fullscreen = !this.fullscreen; -- -- if (this.fullscreen) -+ if (enable) - { - this.func_110441_Q(); -- this.displayWidth = Display.getDisplayMode().getWidth(); -- this.displayHeight = Display.getDisplayMode().getHeight(); -- -- if (this.displayWidth <= 0) -- { -- this.displayWidth = 1; -- } -- -- if (this.displayHeight <= 0) -- { -- this.displayHeight = 1; -- } -+ resize(Display.getDisplayMode().getWidth(), Display.getDisplayMode().getHeight()); - } - else - { - Display.setDisplayMode(new DisplayMode(this.tempDisplayWidth, this.tempDisplayHeight)); -- this.displayWidth = this.tempDisplayWidth; -- this.displayHeight = this.tempDisplayHeight; -- -- if (this.displayWidth <= 0) -- { -- this.displayWidth = 1; -- } -- -- if (this.displayHeight <= 0) -- { -- this.displayHeight = 1; -- } -- } -- -- if (this.currentScreen != null) -- { -- this.resize(this.displayWidth, this.displayHeight); -+ resize( this.tempDisplayWidth, this.tempDisplayHeight ); - } - - Display.setFullscreen(this.fullscreen); -@@ -1345,17 +1489,35 @@ - /** - * Called to resize the current screen. - */ -- private void resize(int par1, int par2) -+ public void resize(int par1, int par2) - { -- this.displayWidth = par1 <= 0 ? 1 : par1; -- this.displayHeight = par2 <= 0 ? 1 : par2; -+ this.displayFBWidth = par1 <= 0 ? 1 : par1; -+ this.displayFBHeight = par2 <= 0 ? 1 : par2; - -- if (this.currentScreen != null) -+ if ( this.gameSettings != null ) - { -- ScaledResolution var3 = new ScaledResolution(this.gameSettings, par1, par2); -+ if( this.vrSettings.useVRRenderer ) -+ { -+ // Ensure use resolution multiplier for screen sizes > 1920X1200 -+ this.displayWidth = this.displayFBWidth * 2; -+ this.displayHeight = this.displayFBHeight * 2; -+ } -+ else -+ { -+ this.displayWidth = this.displayFBWidth; -+ this.displayHeight = this.displayFBHeight; -+ } -+ ScaledResolution var3 = new ScaledResolution(this.gameSettings, this.displayWidth, this.displayHeight); - int var4 = var3.getScaledWidth(); - int var5 = var3.getScaledHeight(); -- this.currentScreen.setWorldAndResolution(this, var4, var5); -+ -+ if(this.currentScreen != null) -+ this.currentScreen.setWorldAndResolution(this, var4, var5); -+ } -+ else -+ { -+ this.displayWidth = this.displayFBWidth; -+ this.displayHeight = this.displayFBHeight; - } - } - -@@ -1364,10 +1526,24 @@ - */ - public void runTick() - { -+ Object fmlCommonHandler = null; -+ if( Reflector.FMLCommonHandler_instance.exists()) -+ { -+ fmlCommonHandler = Reflector.call(Reflector.FMLCommonHandler_instance, new Object[0]); -+ } -+ if( fmlCommonHandler != null && Reflector.FMLSide.exists() ) -+ { -+ Object client = Reflector.FMLSide.getTargetClass().getEnumConstants()[0];//Client -+ Reflector.callVoid(fmlCommonHandler, Reflector.FMLCommonHandler_rescheduleTicks, new Object[]{client}); -+ } - if (this.rightClickDelayTimer > 0) - { - --this.rightClickDelayTimer; - } -+ if( fmlCommonHandler != null ) -+ { -+ Reflector.callVoid(fmlCommonHandler, Reflector.FMLCommonHandler_onPreClientTick, new Object[0]); -+ } - - this.mcProfiler.startSection("stats"); - this.statFileWriter.func_77449_e(); -@@ -1375,6 +1551,8 @@ - - if (!this.isGamePaused) - { -+ if( JoystickAim.selectedJoystickMode != null ) -+ JoystickAim.selectedJoystickMode.updateTick(); - this.ingameGUI.updateTick(); - } - -@@ -1394,21 +1572,24 @@ - this.renderEngine.func_110550_d(); - } - -- if (this.currentScreen == null && this.thePlayer != null) -+ if (this.theWorld == null) // TODO: Only display if world null - otherwise display in render - { -- if (this.thePlayer.func_110143_aJ() <= 0.0F) -+ if (this.currentScreen == null && this.thePlayer != null) - { -- this.displayGuiScreen((GuiScreen)null); -+ if (this.thePlayer.func_110143_aJ() <= 0.0F) -+ { -+ this.displayGuiScreen((GuiScreen)null); -+ } -+ else if (this.thePlayer.isPlayerSleeping() && this.theWorld != null) -+ { -+ this.displayGuiScreen(new GuiSleepMP()); -+ } - } -- else if (this.thePlayer.isPlayerSleeping() && this.theWorld != null) -+ else if (this.currentScreen != null && this.currentScreen instanceof GuiSleepMP && !this.thePlayer.isPlayerSleeping()) - { -- this.displayGuiScreen(new GuiSleepMP()); -+ this.displayGuiScreen((GuiScreen)null); - } - } -- else if (this.currentScreen != null && this.currentScreen instanceof GuiSleepMP && !this.thePlayer.isPlayerSleeping()) -- { -- this.displayGuiScreen((GuiScreen)null); -- } - - if (this.currentScreen != null) - { -@@ -1504,7 +1685,7 @@ - } - else if (this.currentScreen != null) - { -- this.currentScreen.handleMouseInput(); -+ this.currentScreen.handleInput(); - } - } - } -@@ -1562,6 +1743,11 @@ - this.displayInGameMenu(); - } - -+ if (vrSettings.useVRRenderer) -+ { -+ VRHotkeys.handleKeyboardInputs(this); -+ } -+ - if (Keyboard.getEventKey() == 31 && Keyboard.isKeyDown(61)) - { - this.func_110436_a(); -@@ -1605,7 +1791,7 @@ - this.gameSettings.hideGUI = !this.gameSettings.hideGUI; - } - -- if (Keyboard.getEventKey() == 61) -+ if (Keyboard.getEventKey() == Keyboard.KEY_F3) - { - this.gameSettings.showDebugInfo = !this.gameSettings.showDebugInfo; - this.gameSettings.showDebugProfilerChart = GuiScreen.isShiftKeyDown(); -@@ -1738,6 +1924,12 @@ - - this.sendClickBlockToController(0, this.currentScreen == null && this.gameSettings.keyBindAttack.pressed && this.inGameHasFocus); - } -+ else if( this.vrSettings.useVRRenderer ) -+ { -+ // TODO: No way to go back to the first buffered keyboard event e.g. Keyboard.first()? -+ // Don't bother with buffered events, just read the current keyboard state -+ VRHotkeys.handleKeyboardInputs(this); -+ } - - if (this.theWorld != null) - { -@@ -1824,6 +2016,11 @@ - this.myNetworkManager.processReadPackets(); - } - -+ if( fmlCommonHandler != null ) -+ { -+ Reflector.callVoid(fmlCommonHandler, Reflector.FMLCommonHandler_onPostClientTick, new Object[0]); -+ } -+ - this.mcProfiler.endSection(); - this.systemTime = getSystemTime(); - } -@@ -1850,8 +2047,43 @@ - } - - this.statFileWriter.readStat(StatList.startGameStat, 1); -+ -+ boolean fmlGameData = Reflector.FMLGameData.exists(); -+ if( fmlGameData ) -+ { -+ Reflector.callVoid(Reflector.FMLGameData_initializeServerGate, new Object[]{2}); -+ } -+ -+ - this.theIntegratedServer = new IntegratedServer(this, par1Str, par2Str, par3WorldSettings); - this.theIntegratedServer.startServerThread(); -+ -+ if( fmlGameData ) -+ { -+ Object idDifferences = Reflector.call(Reflector.FMLGameData_gateWorldLoadingForValidation, new Object[0]); -+ if( idDifferences == null ) -+ { -+ System.out.println("idDiff == null, continueLoading"); -+ Reflector.call(Reflector.FMLGameData_releaseGate, new Object[]{true}); -+ continueWorldLoading(); -+ } -+ else -+ { -+ Object var1 = Reflector.call(Reflector.FMLClientHandler_instance, new Object[0]); -+ Reflector.call( var1, Reflector.FMLClientHandler_warnIDMismatch, new Object[]{idDifferences, true }); -+ } -+ -+ } -+ else -+ { -+ System.out.println("fmlGameData == null , continueLoading"); -+ continueWorldLoading(); -+ } -+ } -+ -+ public void continueWorldLoading() -+ { -+ - this.integratedServerIsRunning = true; - this.loadingScreen.displayProgressMessage(I18n.func_135053_a("menu.loadingLevel")); - -@@ -1905,6 +2137,11 @@ - public void loadWorld(WorldClient par1WorldClient, String par2Str) - { - this.statFileWriter.syncStats(); -+ -+ if (this.theWorld != null && Reflector.EventBus.exists()) -+ { -+ Reflector.postForgeBusEvent(Reflector.WorldEvent_Unload_Constructor, new Object[] {this.theWorld}); -+ } - - if (par1WorldClient == null) - { -@@ -1941,6 +2178,7 @@ - { - this.setServerData((ServerData)null); - this.integratedServerIsRunning = false; -+ this.setIngameNotInFocus(); - } - - this.sndManager.playStreaming((String)null, 0.0F, 0.0F, 0.0F); -@@ -2096,107 +2334,114 @@ - if (this.objectMouseOver != null) - { - boolean var1 = this.thePlayer.capabilities.isCreativeMode; -- int var3 = 0; -- boolean var4 = false; -- int var2; - int var5; -- -- if (this.objectMouseOver.typeOfHit == EnumMovingObjectType.TILE) -- { -- var5 = this.objectMouseOver.blockX; -- int var6 = this.objectMouseOver.blockY; -- int var7 = this.objectMouseOver.blockZ; -- Block var8 = Block.blocksList[this.theWorld.getBlockId(var5, var6, var7)]; -- -- if (var8 == null) -- { -- return; -- } -- -- var2 = var8.idPicked(this.theWorld, var5, var6, var7); -- -- if (var2 == 0) -- { -- return; -- } -- -- var4 = Item.itemsList[var2].getHasSubtypes(); -- int var9 = var2 < 256 && !Block.blocksList[var8.blockID].isFlowerPot() ? var2 : var8.blockID; -- var3 = Block.blocksList[var9].getDamageValue(this.theWorld, var5, var6, var7); -- } -- else -+ if(!Reflector.ForgeHooks_onPickBlock.exists()) - { -- if (this.objectMouseOver.typeOfHit != EnumMovingObjectType.ENTITY || this.objectMouseOver.entityHit == null || !var1) -- { -- return; -- } -- -- if (this.objectMouseOver.entityHit instanceof EntityPainting) -- { -- var2 = Item.painting.itemID; -- } -+ int var3 = 0; -+ boolean var4 = false; -+ int var2; -+ -+ if (this.objectMouseOver.typeOfHit == EnumMovingObjectType.TILE) -+ { -+ var5 = this.objectMouseOver.blockX; -+ int var6 = this.objectMouseOver.blockY; -+ int var7 = this.objectMouseOver.blockZ; -+ Block var8 = Block.blocksList[this.theWorld.getBlockId(var5, var6, var7)]; -+ -+ if (var8 == null) -+ { -+ return; -+ } -+ -+ var2 = var8.idPicked(this.theWorld, var5, var6, var7); -+ -+ if (var2 == 0) -+ { -+ return; -+ } -+ -+ var4 = Item.itemsList[var2].getHasSubtypes(); -+ int var9 = var2 < 256 && !Block.blocksList[var8.blockID].isFlowerPot() ? var2 : var8.blockID; -+ var3 = Block.blocksList[var9].getDamageValue(this.theWorld, var5, var6, var7); -+ } -+ else -+ { -+ if (this.objectMouseOver.typeOfHit != EnumMovingObjectType.ENTITY || this.objectMouseOver.entityHit == null || !var1) -+ { -+ return; -+ } -+ -+ if (this.objectMouseOver.entityHit instanceof EntityPainting) -+ { -+ var2 = Item.painting.itemID; -+ } - else if (this.objectMouseOver.entityHit instanceof EntityLeashKnot) - { - var2 = Item.field_111214_ch.itemID; - } -- else if (this.objectMouseOver.entityHit instanceof EntityItemFrame) -- { -- EntityItemFrame var10 = (EntityItemFrame)this.objectMouseOver.entityHit; -- -- if (var10.getDisplayedItem() == null) -- { -- var2 = Item.itemFrame.itemID; -- } -- else -- { -- var2 = var10.getDisplayedItem().itemID; -- var3 = var10.getDisplayedItem().getItemDamage(); -- var4 = true; -- } -- } -- else if (this.objectMouseOver.entityHit instanceof EntityMinecart) -- { -- EntityMinecart var11 = (EntityMinecart)this.objectMouseOver.entityHit; -- -- if (var11.getMinecartType() == 2) -- { -- var2 = Item.minecartPowered.itemID; -- } -- else if (var11.getMinecartType() == 1) -- { -- var2 = Item.minecartCrate.itemID; -- } -- else if (var11.getMinecartType() == 3) -- { -- var2 = Item.minecartTnt.itemID; -- } -- else if (var11.getMinecartType() == 5) -- { -- var2 = Item.minecartHopper.itemID; -- } -- else -- { -- var2 = Item.minecartEmpty.itemID; -- } -- } -- else if (this.objectMouseOver.entityHit instanceof EntityBoat) -- { -- var2 = Item.boat.itemID; -- } -- else -- { -- var2 = Item.monsterPlacer.itemID; -- var3 = EntityList.getEntityID(this.objectMouseOver.entityHit); -- var4 = true; -- -- if (var3 <= 0 || !EntityList.entityEggs.containsKey(Integer.valueOf(var3))) -- { -- return; -- } -- } -- } -- -- this.thePlayer.inventory.setCurrentItem(var2, var3, var4, var1); -+ else if (this.objectMouseOver.entityHit instanceof EntityItemFrame) -+ { -+ EntityItemFrame var10 = (EntityItemFrame)this.objectMouseOver.entityHit; -+ -+ if (var10.getDisplayedItem() == null) -+ { -+ var2 = Item.itemFrame.itemID; -+ } -+ else -+ { -+ var2 = var10.getDisplayedItem().itemID; -+ var3 = var10.getDisplayedItem().getItemDamage(); -+ var4 = true; -+ } -+ } -+ else if (this.objectMouseOver.entityHit instanceof EntityMinecart) -+ { -+ EntityMinecart var11 = (EntityMinecart)this.objectMouseOver.entityHit; -+ -+ if (var11.getMinecartType() == 2) -+ { -+ var2 = Item.minecartPowered.itemID; -+ } -+ else if (var11.getMinecartType() == 1) -+ { -+ var2 = Item.minecartCrate.itemID; -+ } -+ else if (var11.getMinecartType() == 3) -+ { -+ var2 = Item.minecartTnt.itemID; -+ } -+ else if (var11.getMinecartType() == 5) -+ { -+ var2 = Item.minecartHopper.itemID; -+ } -+ else -+ { -+ var2 = Item.minecartEmpty.itemID; -+ } -+ } -+ else if (this.objectMouseOver.entityHit instanceof EntityBoat) -+ { -+ var2 = Item.boat.itemID; -+ } -+ else -+ { -+ var2 = Item.monsterPlacer.itemID; -+ var3 = EntityList.getEntityID(this.objectMouseOver.entityHit); -+ var4 = true; -+ -+ if (var3 <= 0 || !EntityList.entityEggs.containsKey(Integer.valueOf(var3))) -+ { -+ return; -+ } -+ } -+ } -+ -+ this.thePlayer.inventory.setCurrentItem(var2, var3, var4, var1); -+ } -+ else if (!Reflector.callBoolean(Reflector.ForgeHooks_onPickBlock, new Object[]{this.objectMouseOver,this.thePlayer,this.theWorld})) -+ { -+ return; -+ } - - if (var1) - { -@@ -2282,8 +2527,13 @@ - /** - * Used in the usage snooper. - */ -+ private static int max_texture_size = -1; - public static int getGLMaximumTextureSize() - { -+ if (max_texture_size != -1) -+ { -+ return max_texture_size; -+ } - for (int var0 = 16384; var0 > 0; var0 >>= 1) - { - GL11.glTexImage2D(GL11.GL_PROXY_TEXTURE_2D, 0, GL11.GL_RGBA, var0, var0, 0, GL11.GL_RGBA, GL11.GL_UNSIGNED_BYTE, (ByteBuffer)null); -@@ -2291,6 +2541,7 @@ - - if (var1 != 0) - { -+ max_texture_size = var0; - return var0; - } - } -@@ -2376,7 +2627,7 @@ - { - return this.field_94139_O; - } -- -+ - public Session func_110432_I() - { - return this.session; -@@ -2416,4 +2667,63 @@ - { - return par0Minecraft.field_135017_as; - } -+ -+ public void setUseVRRenderer( boolean useVRRenderer ) -+ { -+ if( useVRRenderer ) -+ { -+ //Need HMDInfo, OrientationProvider and HeadPositionProvider -+ if( hmdInfo != null && headTracker != null && positionTracker != null && lookaimController != null ) -+ { -+ // Get profile data first... -+ UserProfileData profile = hmdInfo.getProfileData(); -+ if (profile != null) -+ { -+ this.vrSettings.setOculusProfileIpd(profile._ipd); -+ this.vrSettings.setOculusProfilePlayerEyeHeight(profile._eyeHeight); -+ } -+ -+ // ...then set IPD -+ hmdInfo.setIPD(this.vrSettings.getIPD()); -+ if (this.vrRenderer != null) -+ this.vrRenderer._FBOInitialised = false; -+ -+ // Set configured headtracker parameters -+ headTracker.setPrediction(this.vrSettings.headTrackPredictionTimeSecs, this.vrSettings.useHeadTrackPrediction); -+ //headTracker.setMagRefDistance(this.vrSettings.magRefDistance); -+ -+ // Set configured position tracker parameters -+ positionTracker.setPrediction(0.0f, this.vrSettings.hydraUseFilter); // TODO: Need a more generic param -+ -+ if( this.vrRenderer == null ) -+ { -+ this.vrRenderer = new VRRenderer(this, guiAchievement); -+ } -+ this.entityRenderer = this.vrRenderer; -+ this.mouseHelper.grabMouseCursor(); -+ } -+ else -+ { -+ this.vrRenderer = null; -+ this.vrSettings.useVRRenderer = false; //Can't for some reason -+ this.entityRenderer = new EntityRenderer(this); -+ this.mouseHelper.ungrabMouseCursor(); -+ } -+ } -+ else -+ { -+ this.entityRenderer = new EntityRenderer(this); -+ this.mouseHelper.ungrabMouseCursor(); -+ } -+ -+ //Either way, resize framebuffers to be correct size -+ resize(this.displayFBWidth,this.displayFBHeight); -+ } -+ -+ public void resetMousePos(int mouseFBX, int mouseFBY ) { -+ resetMouse = true; -+ this.mouseFBX = mouseFBX; -+ this.mouseFBY = mouseFBY; -+ } -+ - } +--- a/net/minecraft/src/Minecraft.java ++++ b/net/minecraft/src/Minecraft.java +@@ -5,6 +5,7 @@ + import java.io.File; + import java.io.IOException; + import java.net.Proxy; ++import java.lang.reflect.InvocationTargetException; + import java.nio.ByteBuffer; + import java.text.DecimalFormat; + import java.text.SimpleDateFormat; +@@ -15,8 +16,14 @@ + import java.util.Iterator; + import java.util.List; + import javax.imageio.ImageIO; ++ ++import net.aib42.mumblelink.MumbleLink; + import net.minecraft.client.ClientBrandRetriever; + import net.minecraft.server.MinecraftServer; ++ ++import com.mtbs3d.minecrift.*; ++ ++import de.fruitfly.ovr.UserProfileData; + import org.lwjgl.LWJGLException; + import org.lwjgl.Sys; + import org.lwjgl.input.Keyboard; +@@ -30,6 +37,17 @@ + import org.lwjgl.opengl.PixelFormat; + import org.lwjgl.util.glu.GLU; + ++import com.mtbs3d.minecrift.api.IHMDInfo; ++import com.mtbs3d.minecrift.api.ICenterEyePositionProvider; ++import com.mtbs3d.minecrift.api.IBodyAimController; ++import com.mtbs3d.minecrift.api.IOrientationProvider; ++import com.mtbs3d.minecrift.gui.GuiMinecriftSettings; ++import com.mtbs3d.minecrift.settings.VRSettings; ++import com.mtbs3d.minecrift.api.PluginManager; ++import com.mtbs3d.minecrift.control.ControlBinding; ++import com.mtbs3d.minecrift.control.JoystickAim; ++ ++ + public class Minecraft implements IPlayerUsage + { + private static final ResourceLocation locationMojangPng = new ResourceLocation("textures/gui/title/mojang.png"); +@@ -55,8 +73,15 @@ + + /** Instance of CrashReport. */ + private CrashReport crashReporter; ++ ++ /* Size of GUI framebuffer */ + public int displayWidth; + public int displayHeight; ++ ++ /* Actual size of the display buffer, only different than displayWidth when using VRRenderer */ ++ public int displayFBWidth; ++ public int displayFBHeight; ++ + private Timer timer = new Timer(20.0F); + + /** Instance of PlayerUsageSnooper. */ +@@ -85,6 +110,8 @@ + public GuiScreen currentScreen; + public LoadingScreenRenderer loadingScreen; + public EntityRenderer entityRenderer; ++ public VRRenderer vrRenderer; ++ public MumbleLink mumbleLink; + + /** Mouse left click counter */ + private int leftClickCounter; +@@ -110,6 +137,7 @@ + + /** The game settings that currently hold effect. */ + public GameSettings gameSettings; ++ public VRSettings vrSettings; + public SoundManager sndManager; + + /** Mouse helper instance. */ +@@ -119,12 +147,13 @@ + private final String launchedVersion; + private final Proxy proxy; + private ISaveFormat saveLoader; +- ++ ++ private boolean resetMouse = false; + /** + * This is set to fpsCounter every debug screen update, and is shown on the debug screen. It's also sent as part of + * the usage snooping. + */ +- private static int debugFPS; ++ public static int debugFPS; + + /** + * When you place a block, it's set to 6, decremented once per tick, when it's 0, you can place another block. +@@ -186,6 +215,21 @@ + /** Profiler currently displayed in the debug screen pie chart */ + private String debugProfilerName = "root"; + ++ /** Active VR HMDInfo Plugin **/ ++ public IHMDInfo hmdInfo; ++ ++ /** Active VR Head Tracker Plugin **/ ++ public IOrientationProvider headTracker; ++ ++ /** Active VR Eye Position Tracker Plugin **/ ++ public ICenterEyePositionProvider positionTracker; ++ ++ /** Active VR view/aim/move controller Plugin **/ ++ public IBodyAimController lookaimController; ++ private int mouseFBX; ++ private int mouseFBY; ++ ++ + public Minecraft(Session par1Session, int par2, int par3, boolean par4, boolean par5, File par6File, File par7File, File par8File, Proxy par9Proxy, String par10Str) + { + theMinecraft = this; +@@ -202,8 +246,7 @@ + this.mcLogAgent.logInfo("Setting user: " + par1Session.getUsername()); + this.mcLogAgent.logInfo("(Session ID is " + par1Session.getSessionID() + ")"); + this.isDemo = par5; +- this.displayWidth = par2; +- this.displayHeight = par3; ++ resize( par2, par3 ); + this.tempDisplayWidth = par2; + this.tempDisplayHeight = par3; + this.fullscreen = par4; +@@ -262,36 +305,29 @@ + private void startGame() throws LWJGLException + { + this.gameSettings = new GameSettings(this, this.mcDataDir); ++ this.vrSettings = new VRSettings(this, this.mcDataDir); ++ + + if (this.gameSettings.overrideHeight > 0 && this.gameSettings.overrideWidth > 0) + { +- this.displayWidth = this.gameSettings.overrideWidth; +- this.displayHeight = this.gameSettings.overrideHeight; ++ this.displayFBWidth = this.gameSettings.overrideWidth; ++ this.displayFBHeight = this.gameSettings.overrideHeight; + } + ++ Display.setResizable(true); ++ Display.setTitle("Minecraft 1.6.4 VR"); ++ + if (this.fullscreen) + { +- Display.setFullscreen(true); +- this.displayWidth = Display.getDisplayMode().getWidth(); +- this.displayHeight = Display.getDisplayMode().getHeight(); +- +- if (this.displayWidth <= 0) +- { +- this.displayWidth = 1; +- } +- +- if (this.displayHeight <= 0) +- { +- this.displayHeight = 1; +- } ++ // Set (or not) fullscreen mode ++ setFullscreen(this.fullscreen); ++ resize( Display.getDisplayMode().getWidth(), Display.getDisplayMode().getHeight() ); + } + else + { +- Display.setDisplayMode(new DisplayMode(this.displayWidth, this.displayHeight)); ++ Display.setDisplayMode(new DisplayMode(this.displayFBWidth, this.displayFBHeight)); + } + +- Display.setResizable(true); +- Display.setTitle("Minecraft 1.6.4"); + this.getLogAgent().logInfo("LWJGL Version: " + Sys.getVersion()); + + if (Util.getOSType() != EnumOS.MACOS) +@@ -350,6 +386,19 @@ + this.mcResourceManager.registerReloadListener(this.sndManager); + this.loadScreen(); + this.fontRenderer = new FontRenderer(this.gameSettings, new ResourceLocation("textures/font/ascii.png"), this.renderEngine, false); ++ ++ Object fmlClientHandler = null; ++ if( Reflector.FMLClientHandler_instance.exists()) ++ { ++ fmlClientHandler = Reflector.call( Reflector.FMLClientHandler_instance, new Object[0]); ++ } ++ ++ if( fmlClientHandler != null) ++ { ++ //One of these should work... ++ Reflector.callVoid(fmlClientHandler, Reflector.FMLClientHandler_beginMinecraftLoading2, new Object[] {this, this.defaultResourcePacks, this.mcResourceManager}); ++ Reflector.callVoid(fmlClientHandler, Reflector.FMLClientHandler_beginMinecraftLoading, new Object[] {this, this.defaultResourcePacks}); ++ } + + if (this.gameSettings.language != null) + { +@@ -363,10 +412,37 @@ + this.mcResourceManager.registerReloadListener(new GrassColorReloadListener()); + this.mcResourceManager.registerReloadListener(new FoliageColorReloadListener()); + RenderManager.instance.itemRenderer = new ItemRenderer(this); +- this.entityRenderer = new EntityRenderer(this); + this.statFileWriter = new StatFileWriter(this.session, this.mcDataDir); + AchievementList.openInventory.setStatStringFormatter(new StatStringFormatKeyInv(this)); + this.mouseHelper = new MouseHelper(); ++ ++ try { ++ Class.forName("com.mtbs3d.minecrift.MCHydra").newInstance();//creates and registers MCHydra if it can be (if the libraries are found) ++ } catch (NoClassDefFoundError e1) { ++ System.err.println("Couldn't load Razer Hydra libraries (Sixense-Java): "+e1.toString()); ++ } catch( Exception e1) { ++ System.err.println("Couldn't load Razer Hydra libraries (Sixense-Java): "+e1.toString()); ++ } ++ try { ++ MumbleLink.loadLibrary(); ++ mumbleLink = new MumbleLink("MinecraftVR", "Minecraft VR"); ++ mumbleLink.setIdentityAndContext(this.session.getUsername(), "Minecraft"/*TODO: get the servername? */); ++ } catch( Exception e ) { ++ System.err.println("Couldn't load MumbleLink"+e.toString()); ++ } ++ new MCController(); ++ new MCMouse(); //create and register mouse ILookAimMoveController plugin ++ new NullCenterEyePosition(); //create and register "None" head position plugin ++ PluginManager.register(new MCOculus()); // create and register new plugin ++ ++ hmdInfo = PluginManager.configureHMD(this.vrSettings.hmdPluginID); ++ headTracker = PluginManager.configureOrientation(this.vrSettings.headTrackerPluginID); ++ positionTracker = PluginManager.configurePosition(this.vrSettings.headPositionPluginID); ++ lookaimController = PluginManager.configureController(this.vrSettings.controllerPluginID); ++ ++ //uses mouseHelper ++ setUseVRRenderer( vrSettings.useVRRenderer ); ++ + this.checkGLError("Pre startup"); + GL11.glEnable(GL11.GL_TEXTURE_2D); + GL11.glShadeModel(GL11.GL_SMOOTH); +@@ -383,15 +459,45 @@ + this.renderGlobal = new RenderGlobal(this); + this.renderEngine.loadTextureMap(TextureMap.locationBlocksTexture, new TextureMap(0, "textures/blocks")); + this.renderEngine.loadTextureMap(TextureMap.locationItemsTexture, new TextureMap(1, "textures/items")); +- GL11.glViewport(0, 0, this.displayWidth, this.displayHeight); ++ GL11.glViewport(0, 0, this.displayFBWidth, this.displayHeight); + this.effectRenderer = new EffectRenderer(this.theWorld, this.renderEngine); ++ ++ if( fmlClientHandler != null ) ++ { ++ Reflector.callVoid(fmlClientHandler, Reflector.FMLClientHandler_finishMinecraftLoading, new Object[0]); ++ } ++ ++ + this.checkGLError("Post startup"); +- this.ingameGUI = new GuiIngame(this); ++ if( Reflector.ForgeGuiIngame.exists()) ++ { ++ try { ++ this.ingameGUI = (GuiIngame)Reflector.ForgeGuiIngame_Constructor.getTargetConstructor().newInstance(new Object[]{this}); ++ } catch (IllegalArgumentException e) { ++ e.printStackTrace(); ++ } catch (InstantiationException e) { ++ e.printStackTrace(); ++ } catch (IllegalAccessException e) { ++ e.printStackTrace(); ++ } catch (InvocationTargetException e) { ++ e.printStackTrace(); ++ } ++ } ++ else ++ { ++ this.ingameGUI = new GuiIngame(this); ++ } ++ + + if (this.serverName != null) + { + this.displayGuiScreen(new GuiConnecting(new GuiMainMenu(), this, this.serverName, this.serverPort)); + } ++ else if (!this.vrSettings.useVRRenderer ) ++ { ++ ++ this.displayGuiScreen(new GuiMinecriftSettings( new GuiMainMenu(), vrSettings) ); ++ } + else + { + this.displayGuiScreen(new GuiMainMenu()); +@@ -403,6 +509,11 @@ + { + this.toggleFullscreen(); + } ++ ++ if( fmlClientHandler != null ) ++ { ++ Reflector.callVoid(fmlClientHandler, Reflector.FMLClientHandler_onInitializationComplete, new Object[0]); ++ } + } + + public void refreshResources() +@@ -495,8 +606,7 @@ + } + + Display.setDisplayMode(var2); +- this.displayWidth = var2.getWidth(); +- this.displayHeight = var2.getHeight(); ++ resize(var2.getWidth(),var2.getHeight()); + } + + /** +@@ -595,21 +705,27 @@ + { + this.setIngameNotInFocus(); + ScaledResolution var2 = new ScaledResolution(this.gameSettings, this.displayWidth, this.displayHeight); +- int var3 = var2.getScaledWidth(); +- int var4 = var2.getScaledHeight(); +- ((GuiScreen)par1GuiScreen).setWorldAndResolution(this, var3, var4); ++ int width = var2.getScaledWidth(); ++ int height = var2.getScaledHeight(); ++ ((GuiScreen)par1GuiScreen).setWorldAndResolution(this, width, height); + this.skipRenderWorld = false; + } + else + { + this.setIngameFocus(); + } ++ ++ if ((par1GuiScreen instanceof GuiMainMenu && this.theWorld == null) || ++ (par1GuiScreen instanceof GuiDisconnected && this.theWorld == null)) ++ { ++ this.setIngameNotInFocus(); // TODO: Ensure disconnected menu has mouse pointer! ++ } + } + + /** + * Checks for an OpenGL error. If there is one, prints the error ID and error string. + */ +- private void checkGLError(String par1Str) ++ public void checkGLError(String par1Str) + { + int var2 = GL11.glGetError(); + +@@ -622,6 +738,15 @@ + } + } + ++ ++ public void printChatMessage(String message) ++ { ++ if (this.theWorld != null) ++ { ++ this.ingameGUI.getChatGUI().printChatMessage("\u00a7e[Minecrift]\u00a7f " + message); ++ } ++ } ++ + /** + * Shuts down the minecraft applet by stopping the resource downloads, and clearing up GL stuff; called when the + * application (or web page) is exited. +@@ -652,6 +777,8 @@ + } + + this.sndManager.cleanup(); ++ ++ PluginManager.destroyAll(); + } + finally + { +@@ -683,6 +810,7 @@ + return; + } + ++ ControlBinding.CreateBindingList(this.gameSettings); + try + { + while (this.running) +@@ -782,7 +910,8 @@ + this.checkGLError("Pre render"); + RenderBlocks.fancyGrass = this.gameSettings.fancyGraphics; + this.mcProfiler.endStartSection("sound"); +- this.sndManager.setListener(this.thePlayer, this.timer.renderPartialTicks); ++ if(!this.vrSettings.useVRRenderer) ++ this.sndManager.setListener(this.thePlayer, this.timer.renderPartialTicks); + + if (!this.isGamePaused) + { +@@ -808,9 +937,44 @@ + + if (!this.skipRenderWorld) + { ++ Object fmlCommonHandler = null; ++ if( Reflector.FMLCommonHandler_instance.exists()) ++ { ++ fmlCommonHandler = Reflector.call(Reflector.FMLCommonHandler_instance, new Object[0]); ++ } ++ if( fmlCommonHandler != null ) ++ { ++ Reflector.callVoid(fmlCommonHandler, Reflector.FMLCommonHandler_onRenderTickStart, new Object[]{this.timer.renderPartialTicks}); ++ } + this.mcProfiler.endStartSection("gameRenderer"); ++ ++ ++ //VR mouse hack: transform the mouse coordinates from screen (framebuffer) size to GUI framebuffer coordinates ++ int mouseX=0; ++ int mouseY=0; ++ if(this.vrSettings.useVRRenderer) ++ { ++ mouseX = Mouse.getX(); ++ mouseY = Mouse.getY(); ++ Mouse.setCursorPosition(mouseX*this.displayWidth/this.displayFBWidth, mouseY*this.displayHeight/this.displayFBHeight); ++ } + this.entityRenderer.updateCameraAndRender(this.timer.renderPartialTicks); ++ ++ if(this.vrSettings.useVRRenderer) ++ { ++ if( resetMouse ) { ++ Mouse.setCursorPosition(this.mouseFBX, this.mouseFBY); ++ resetMouse = false; ++ } else { ++ Mouse.setCursorPosition(mouseX, mouseY); ++ } ++ } ++ + this.mcProfiler.endSection(); ++ if( fmlCommonHandler != null ) ++ { ++ Reflector.callVoid(fmlCommonHandler, Reflector.FMLCommonHandler_onRenderTickEnd, new Object[]{this.timer.renderPartialTicks}); ++ } + } + + GL11.glFlush(); +@@ -837,7 +1001,7 @@ + this.prevFrameTime = System.nanoTime(); + } + +- this.guiAchievement.updateAchievementWindow(); ++ //this.guiAchievement.updateAchievementWindow(); + this.mcProfiler.startSection("root"); + Thread.yield(); + +@@ -850,20 +1014,9 @@ + + if (!this.fullscreen && Display.wasResized()) + { +- this.displayWidth = Display.getWidth(); +- this.displayHeight = Display.getHeight(); +- +- if (this.displayWidth <= 0) +- { +- this.displayWidth = 1; +- } +- +- if (this.displayHeight <= 0) +- { +- this.displayHeight = 1; +- } +- +- this.resize(this.displayWidth, this.displayHeight); ++ this.displayFBWidth = Display.getWidth(); ++ this.displayFBHeight = Display.getHeight(); ++ this.resize(this.displayFBWidth, this.displayFBHeight); + } + + this.checkGLError("Post render"); +@@ -901,7 +1054,7 @@ + + private int getLimitFramerate() + { +- return this.currentScreen != null && this.currentScreen instanceof GuiMainMenu ? 2 : this.gameSettings.limitFramerate; ++ return this.gameSettings.limitFramerate; + } + + public void freeMemory() +@@ -950,7 +1103,7 @@ + if (!this.isTakingScreenshot) + { + this.isTakingScreenshot = true; +- this.ingameGUI.getChatGUI().printChatMessage(ScreenShotHelper.saveScreenshot(this.mcDataDir, this.displayWidth, this.displayHeight)); ++ this.ingameGUI.getChatGUI().printChatMessage(ScreenShotHelper.saveScreenshot(this.mcDataDir, this.displayFBWidth, this.displayFBHeight)); + } + } + else +@@ -1009,7 +1162,7 @@ + GL11.glMatrixMode(GL11.GL_PROJECTION); + GL11.glEnable(GL11.GL_COLOR_MATERIAL); + GL11.glLoadIdentity(); +- GL11.glOrtho(0.0D, (double)this.displayWidth, (double)this.displayHeight, 0.0D, 1000.0D, 3000.0D); ++ GL11.glOrtho(0.0D, (double)this.displayFBWidth, (double)this.displayFBHeight, 0.0D, 1000.0D, 3000.0D); + GL11.glMatrixMode(GL11.GL_MODELVIEW); + GL11.glLoadIdentity(); + GL11.glTranslatef(0.0F, 0.0F, -2000.0F); +@@ -1017,8 +1170,8 @@ + GL11.glDisable(GL11.GL_TEXTURE_2D); + Tessellator var5 = Tessellator.instance; + short var6 = 160; +- int var7 = this.displayWidth - var6 - 10; +- int var8 = this.displayHeight - var6 * 2; ++ int var7 = this.displayFBWidth - var6 - 10; ++ int var8 = this.displayFBHeight - var6 * 2; + GL11.glEnable(GL11.GL_BLEND); + var5.startDrawingQuads(); + var5.setColorRGBA_I(0, 200); +@@ -1145,9 +1298,19 @@ + { + if (this.inGameHasFocus) + { +- KeyBinding.unPressAllKeys(); +- this.inGameHasFocus = false; +- this.mouseHelper.ungrabMouseCursor(); ++ KeyBinding.unPressAllKeys(); ++ this.inGameHasFocus = false; ++ if( vrSettings.useVRRenderer ) ++ { ++ int var1 = Display.getWidth(); ++ int var2 = Display.getHeight(); ++ ++ Mouse.setCursorPosition(var1 / 2, var2 / 2); ++ } ++ else ++ { ++ this.mouseHelper.ungrabMouseCursor(); ++ } + } + } + +@@ -1200,7 +1363,7 @@ + * Called whenever the mouse is clicked. Button clicked is 0 for left clicking and 1 for right clicking. Args: + * buttonClicked + */ +- private void clickMouse(int par1) ++ public void clickMouse(int par1) + { + if (par1 != 0 || this.leftClickCounter <= 0) + { +@@ -1290,46 +1453,25 @@ + */ + public void toggleFullscreen() + { ++ this.fullscreen = !this.fullscreen; ++ this.gameSettings.fullScreen = this.fullscreen; ++ this.gameSettings.saveOptions(); ++ setFullscreen(this.fullscreen); ++ } ++ ++ public void setFullscreen(boolean enable) ++ { + try + { +- this.fullscreen = !this.fullscreen; +- +- if (this.fullscreen) ++ if (enable) + { + this.updateDisplayMode(); +- this.displayWidth = Display.getDisplayMode().getWidth(); +- this.displayHeight = Display.getDisplayMode().getHeight(); +- +- if (this.displayWidth <= 0) +- { +- this.displayWidth = 1; +- } +- +- if (this.displayHeight <= 0) +- { +- this.displayHeight = 1; +- } ++ resize(Display.getDisplayMode().getWidth(), Display.getDisplayMode().getHeight()); + } + else + { + Display.setDisplayMode(new DisplayMode(this.tempDisplayWidth, this.tempDisplayHeight)); +- this.displayWidth = this.tempDisplayWidth; +- this.displayHeight = this.tempDisplayHeight; +- +- if (this.displayWidth <= 0) +- { +- this.displayWidth = 1; +- } +- +- if (this.displayHeight <= 0) +- { +- this.displayHeight = 1; +- } +- } +- +- if (this.currentScreen != null) +- { +- this.resize(this.displayWidth, this.displayHeight); ++ resize( this.tempDisplayWidth, this.tempDisplayHeight ); + } + + Display.setFullscreen(this.fullscreen); +@@ -1345,17 +1487,35 @@ + /** + * Called to resize the current screen. + */ +- private void resize(int par1, int par2) ++ public void resize(int par1, int par2) + { +- this.displayWidth = par1 <= 0 ? 1 : par1; +- this.displayHeight = par2 <= 0 ? 1 : par2; ++ this.displayFBWidth = par1 <= 0 ? 1 : par1; ++ this.displayFBHeight = par2 <= 0 ? 1 : par2; + +- if (this.currentScreen != null) ++ if ( this.gameSettings != null ) + { +- ScaledResolution var3 = new ScaledResolution(this.gameSettings, par1, par2); ++ if( this.vrSettings.useVRRenderer ) ++ { ++ // Ensure use resolution multiplier for screen sizes > 1920X1200 ++ this.displayWidth = this.displayFBWidth * 2; ++ this.displayHeight = this.displayFBHeight * 2; ++ } ++ else ++ { ++ this.displayWidth = this.displayFBWidth; ++ this.displayHeight = this.displayFBHeight; ++ } ++ ScaledResolution var3 = new ScaledResolution(this.gameSettings, this.displayWidth, this.displayHeight); + int var4 = var3.getScaledWidth(); + int var5 = var3.getScaledHeight(); +- this.currentScreen.setWorldAndResolution(this, var4, var5); ++ ++ if(this.currentScreen != null) ++ this.currentScreen.setWorldAndResolution(this, var4, var5); ++ } ++ else ++ { ++ this.displayWidth = this.displayFBWidth; ++ this.displayHeight = this.displayFBHeight; + } + } + +@@ -1364,10 +1524,24 @@ + */ + public void runTick() + { ++ Object fmlCommonHandler = null; ++ if( Reflector.FMLCommonHandler_instance.exists()) ++ { ++ fmlCommonHandler = Reflector.call(Reflector.FMLCommonHandler_instance, new Object[0]); ++ } ++ if( fmlCommonHandler != null && Reflector.FMLSide.exists() ) ++ { ++ Object client = Reflector.FMLSide.getTargetClass().getEnumConstants()[0];//Client ++ Reflector.callVoid(fmlCommonHandler, Reflector.FMLCommonHandler_rescheduleTicks, new Object[]{client}); ++ } + if (this.rightClickDelayTimer > 0) + { + --this.rightClickDelayTimer; + } ++ if( fmlCommonHandler != null ) ++ { ++ Reflector.callVoid(fmlCommonHandler, Reflector.FMLCommonHandler_onPreClientTick, new Object[0]); ++ } + + this.mcProfiler.startSection("stats"); + this.statFileWriter.func_77449_e(); +@@ -1375,6 +1549,8 @@ + + if (!this.isGamePaused) + { ++ if( JoystickAim.selectedJoystickMode != null ) ++ JoystickAim.selectedJoystickMode.updateTick(); + this.ingameGUI.updateTick(); + } + +@@ -1394,21 +1570,24 @@ + this.renderEngine.tick(); + } + +- if (this.currentScreen == null && this.thePlayer != null) ++ if (this.theWorld == null) // TODO: Only display if world null - otherwise display in render + { +- if (this.thePlayer.getHealth() <= 0.0F) ++ if (this.currentScreen == null && this.thePlayer != null) + { +- this.displayGuiScreen((GuiScreen)null); ++ if (this.thePlayer.getHealth() <= 0.0F) ++ { ++ this.displayGuiScreen((GuiScreen)null); ++ } ++ else if (this.thePlayer.isPlayerSleeping() && this.theWorld != null) ++ { ++ this.displayGuiScreen(new GuiSleepMP()); ++ } + } +- else if (this.thePlayer.isPlayerSleeping() && this.theWorld != null) ++ else if (this.currentScreen != null && this.currentScreen instanceof GuiSleepMP && !this.thePlayer.isPlayerSleeping()) + { +- this.displayGuiScreen(new GuiSleepMP()); ++ this.displayGuiScreen((GuiScreen)null); + } + } +- else if (this.currentScreen != null && this.currentScreen instanceof GuiSleepMP && !this.thePlayer.isPlayerSleeping()) +- { +- this.displayGuiScreen((GuiScreen)null); +- } + + if (this.currentScreen != null) + { +@@ -1504,7 +1683,7 @@ + } + else if (this.currentScreen != null) + { +- this.currentScreen.handleMouseInput(); ++ this.currentScreen.handleInput(); + } + } + } +@@ -1562,6 +1741,11 @@ + this.displayInGameMenu(); + } + ++ if (vrSettings.useVRRenderer) ++ { ++ VRHotkeys.handleKeyboardInputs(this); ++ } ++ + if (Keyboard.getEventKey() == 31 && Keyboard.isKeyDown(61)) + { + this.refreshResources(); +@@ -1607,6 +1791,7 @@ + + if (Keyboard.getEventKey() == 61) + { ++ // F3 + this.gameSettings.showDebugInfo = !this.gameSettings.showDebugInfo; + this.gameSettings.showDebugProfilerChart = GuiScreen.isShiftKeyDown(); + } +@@ -1738,6 +1923,12 @@ + + this.sendClickBlockToController(0, this.currentScreen == null && this.gameSettings.keyBindAttack.pressed && this.inGameHasFocus); + } ++ else if( this.vrSettings.useVRRenderer ) ++ { ++ // TODO: No way to go back to the first buffered keyboard event e.g. Keyboard.first()? ++ // Don't bother with buffered events, just read the current keyboard state ++ VRHotkeys.handleKeyboardInputs(this); ++ } + + if (this.theWorld != null) + { +@@ -1824,6 +2015,11 @@ + this.myNetworkManager.processReadPackets(); + } + ++ if( fmlCommonHandler != null ) ++ { ++ Reflector.callVoid(fmlCommonHandler, Reflector.FMLCommonHandler_onPostClientTick, new Object[0]); ++ } ++ + this.mcProfiler.endSection(); + this.systemTime = getSystemTime(); + } +@@ -1850,8 +2046,43 @@ + } + + this.statFileWriter.readStat(StatList.startGameStat, 1); ++ ++ boolean fmlGameData = Reflector.FMLGameData.exists(); ++ if( fmlGameData ) ++ { ++ Reflector.callVoid(Reflector.FMLGameData_initializeServerGate, new Object[]{2}); ++ } ++ ++ + this.theIntegratedServer = new IntegratedServer(this, par1Str, par2Str, par3WorldSettings); + this.theIntegratedServer.startServerThread(); ++ ++ if( fmlGameData ) ++ { ++ Object idDifferences = Reflector.call(Reflector.FMLGameData_gateWorldLoadingForValidation, new Object[0]); ++ if( idDifferences == null ) ++ { ++ System.out.println("idDiff == null, continueLoading"); ++ Reflector.call(Reflector.FMLGameData_releaseGate, new Object[]{true}); ++ continueWorldLoading(); ++ } ++ else ++ { ++ Object var1 = Reflector.call(Reflector.FMLClientHandler_instance, new Object[0]); ++ Reflector.call( var1, Reflector.FMLClientHandler_warnIDMismatch, new Object[]{idDifferences, true }); ++ } ++ ++ } ++ else ++ { ++ System.out.println("fmlGameData == null , continueLoading"); ++ continueWorldLoading(); ++ } ++ } ++ ++ public void continueWorldLoading() ++ { ++ + this.integratedServerIsRunning = true; + this.loadingScreen.displayProgressMessage(I18n.getString("menu.loadingLevel")); + +@@ -1905,6 +2136,11 @@ + public void loadWorld(WorldClient par1WorldClient, String par2Str) + { + this.statFileWriter.syncStats(); ++ ++ if (this.theWorld != null && Reflector.EventBus.exists()) ++ { ++ Reflector.postForgeBusEvent(Reflector.WorldEvent_Unload_Constructor, new Object[] {this.theWorld}); ++ } + + if (par1WorldClient == null) + { +@@ -1941,6 +2177,7 @@ + { + this.setServerData((ServerData)null); + this.integratedServerIsRunning = false; ++ this.setIngameNotInFocus(); + } + + this.sndManager.playStreaming((String)null, 0.0F, 0.0F, 0.0F); +@@ -2096,107 +2333,114 @@ + if (this.objectMouseOver != null) + { + boolean var1 = this.thePlayer.capabilities.isCreativeMode; +- int var3 = 0; +- boolean var4 = false; +- int var2; + int var5; +- +- if (this.objectMouseOver.typeOfHit == EnumMovingObjectType.TILE) +- { +- var5 = this.objectMouseOver.blockX; +- int var6 = this.objectMouseOver.blockY; +- int var7 = this.objectMouseOver.blockZ; +- Block var8 = Block.blocksList[this.theWorld.getBlockId(var5, var6, var7)]; +- +- if (var8 == null) +- { +- return; +- } +- +- var2 = var8.idPicked(this.theWorld, var5, var6, var7); +- +- if (var2 == 0) +- { +- return; +- } +- +- var4 = Item.itemsList[var2].getHasSubtypes(); +- int var9 = var2 < 256 && !Block.blocksList[var8.blockID].isFlowerPot() ? var2 : var8.blockID; +- var3 = Block.blocksList[var9].getDamageValue(this.theWorld, var5, var6, var7); +- } +- else ++ if(!Reflector.ForgeHooks_onPickBlock.exists()) + { +- if (this.objectMouseOver.typeOfHit != EnumMovingObjectType.ENTITY || this.objectMouseOver.entityHit == null || !var1) +- { +- return; +- } +- +- if (this.objectMouseOver.entityHit instanceof EntityPainting) +- { +- var2 = Item.painting.itemID; +- } ++ int var3 = 0; ++ boolean var4 = false; ++ int var2; ++ ++ if (this.objectMouseOver.typeOfHit == EnumMovingObjectType.TILE) ++ { ++ var5 = this.objectMouseOver.blockX; ++ int var6 = this.objectMouseOver.blockY; ++ int var7 = this.objectMouseOver.blockZ; ++ Block var8 = Block.blocksList[this.theWorld.getBlockId(var5, var6, var7)]; ++ ++ if (var8 == null) ++ { ++ return; ++ } ++ ++ var2 = var8.idPicked(this.theWorld, var5, var6, var7); ++ ++ if (var2 == 0) ++ { ++ return; ++ } ++ ++ var4 = Item.itemsList[var2].getHasSubtypes(); ++ int var9 = var2 < 256 && !Block.blocksList[var8.blockID].isFlowerPot() ? var2 : var8.blockID; ++ var3 = Block.blocksList[var9].getDamageValue(this.theWorld, var5, var6, var7); ++ } ++ else ++ { ++ if (this.objectMouseOver.typeOfHit != EnumMovingObjectType.ENTITY || this.objectMouseOver.entityHit == null || !var1) ++ { ++ return; ++ } ++ ++ if (this.objectMouseOver.entityHit instanceof EntityPainting) ++ { ++ var2 = Item.painting.itemID; ++ } + else if (this.objectMouseOver.entityHit instanceof EntityLeashKnot) + { + var2 = Item.leash.itemID; + } +- else if (this.objectMouseOver.entityHit instanceof EntityItemFrame) +- { +- EntityItemFrame var10 = (EntityItemFrame)this.objectMouseOver.entityHit; +- +- if (var10.getDisplayedItem() == null) +- { +- var2 = Item.itemFrame.itemID; +- } +- else +- { +- var2 = var10.getDisplayedItem().itemID; +- var3 = var10.getDisplayedItem().getItemDamage(); +- var4 = true; +- } +- } +- else if (this.objectMouseOver.entityHit instanceof EntityMinecart) +- { +- EntityMinecart var11 = (EntityMinecart)this.objectMouseOver.entityHit; +- +- if (var11.getMinecartType() == 2) +- { +- var2 = Item.minecartPowered.itemID; +- } +- else if (var11.getMinecartType() == 1) +- { +- var2 = Item.minecartCrate.itemID; +- } +- else if (var11.getMinecartType() == 3) +- { +- var2 = Item.minecartTnt.itemID; +- } +- else if (var11.getMinecartType() == 5) +- { +- var2 = Item.minecartHopper.itemID; +- } +- else +- { +- var2 = Item.minecartEmpty.itemID; +- } +- } +- else if (this.objectMouseOver.entityHit instanceof EntityBoat) +- { +- var2 = Item.boat.itemID; +- } +- else +- { +- var2 = Item.monsterPlacer.itemID; +- var3 = EntityList.getEntityID(this.objectMouseOver.entityHit); +- var4 = true; +- +- if (var3 <= 0 || !EntityList.entityEggs.containsKey(Integer.valueOf(var3))) +- { +- return; +- } +- } +- } +- +- this.thePlayer.inventory.setCurrentItem(var2, var3, var4, var1); ++ else if (this.objectMouseOver.entityHit instanceof EntityItemFrame) ++ { ++ EntityItemFrame var10 = (EntityItemFrame)this.objectMouseOver.entityHit; ++ ++ if (var10.getDisplayedItem() == null) ++ { ++ var2 = Item.itemFrame.itemID; ++ } ++ else ++ { ++ var2 = var10.getDisplayedItem().itemID; ++ var3 = var10.getDisplayedItem().getItemDamage(); ++ var4 = true; ++ } ++ } ++ else if (this.objectMouseOver.entityHit instanceof EntityMinecart) ++ { ++ EntityMinecart var11 = (EntityMinecart)this.objectMouseOver.entityHit; ++ ++ if (var11.getMinecartType() == 2) ++ { ++ var2 = Item.minecartPowered.itemID; ++ } ++ else if (var11.getMinecartType() == 1) ++ { ++ var2 = Item.minecartCrate.itemID; ++ } ++ else if (var11.getMinecartType() == 3) ++ { ++ var2 = Item.minecartTnt.itemID; ++ } ++ else if (var11.getMinecartType() == 5) ++ { ++ var2 = Item.minecartHopper.itemID; ++ } ++ else ++ { ++ var2 = Item.minecartEmpty.itemID; ++ } ++ } ++ else if (this.objectMouseOver.entityHit instanceof EntityBoat) ++ { ++ var2 = Item.boat.itemID; ++ } ++ else ++ { ++ var2 = Item.monsterPlacer.itemID; ++ var3 = EntityList.getEntityID(this.objectMouseOver.entityHit); ++ var4 = true; ++ ++ if (var3 <= 0 || !EntityList.entityEggs.containsKey(Integer.valueOf(var3))) ++ { ++ return; ++ } ++ } ++ } ++ ++ this.thePlayer.inventory.setCurrentItem(var2, var3, var4, var1); ++ } ++ else if (!Reflector.callBoolean(Reflector.ForgeHooks_onPickBlock, new Object[]{this.objectMouseOver,this.thePlayer,this.theWorld})) ++ { ++ return; ++ } + + if (var1) + { +@@ -2282,8 +2526,13 @@ + /** + * Used in the usage snooper. + */ ++ private static int max_texture_size = -1; + public static int getGLMaximumTextureSize() + { ++ if (max_texture_size != -1) ++ { ++ return max_texture_size; ++ } + for (int var0 = 16384; var0 > 0; var0 >>= 1) + { + GL11.glTexImage2D(GL11.GL_PROXY_TEXTURE_2D, 0, GL11.GL_RGBA, var0, var0, 0, GL11.GL_RGBA, GL11.GL_UNSIGNED_BYTE, (ByteBuffer)null); +@@ -2291,6 +2540,7 @@ + + if (var1 != 0) + { ++ max_texture_size = var0; + return var0; + } + } +@@ -2416,4 +2666,63 @@ + { + return par0Minecraft.mcLanguageManager; + } ++ ++ public void setUseVRRenderer( boolean useVRRenderer ) ++ { ++ if( useVRRenderer ) ++ { ++ //Need HMDInfo, OrientationProvider and HeadPositionProvider ++ if( hmdInfo != null && headTracker != null && positionTracker != null && lookaimController != null ) ++ { ++ // Get profile data first... ++ UserProfileData profile = hmdInfo.getProfileData(); ++ if (profile != null) ++ { ++ this.vrSettings.setOculusProfileIpd(profile._ipd); ++ this.vrSettings.setOculusProfilePlayerEyeHeight(profile._eyeHeight); ++ } ++ ++ // ...then set IPD ++ hmdInfo.setIPD(this.vrSettings.getIPD()); ++ if (this.vrRenderer != null) ++ this.vrRenderer._FBOInitialised = false; ++ ++ // Set configured headtracker parameters ++ headTracker.setPrediction(this.vrSettings.headTrackPredictionTimeSecs, this.vrSettings.useHeadTrackPrediction); ++ //headTracker.setMagRefDistance(this.vrSettings.magRefDistance); ++ ++ // Set configured position tracker parameters ++ positionTracker.setPrediction(0.0f, this.vrSettings.hydraUseFilter); // TODO: Need a more generic param ++ ++ if( this.vrRenderer == null ) ++ { ++ this.vrRenderer = new VRRenderer(this, guiAchievement); ++ } ++ this.entityRenderer = this.vrRenderer; ++ this.mouseHelper.grabMouseCursor(); ++ } ++ else ++ { ++ this.vrRenderer = null; ++ this.vrSettings.useVRRenderer = false; //Can't for some reason ++ this.entityRenderer = new EntityRenderer(this); ++ this.mouseHelper.ungrabMouseCursor(); ++ } ++ } ++ else ++ { ++ this.entityRenderer = new EntityRenderer(this); ++ this.mouseHelper.ungrabMouseCursor(); ++ } ++ ++ //Either way, resize framebuffers to be correct size ++ resize(this.displayFBWidth,this.displayFBHeight); ++ } ++ ++ public void resetMousePos(int mouseFBX, int mouseFBY ) { ++ resetMouse = true; ++ this.mouseFBX = mouseFBX; ++ this.mouseFBY = mouseFBY; ++ } ++ + } diff --git a/patches/net/minecraft/src/ModelBiped.java.patch b/patches/net/minecraft/src/ModelBiped.java.patch index 90a28416..b2255f2f 100644 --- a/patches/net/minecraft/src/ModelBiped.java.patch +++ b/patches/net/minecraft/src/ModelBiped.java.patch @@ -1,47 +1,47 @@ ---- a/net/minecraft/src/ModelBiped.java -+++ b/net/minecraft/src/ModelBiped.java -@@ -4,6 +4,9 @@ - - public class ModelBiped extends ModelBase - { -+ public boolean _renderHead = true; // TODO: How to stop head rendering! -+ public boolean _renderHeadWear = true; // TODO: How to stop head wear rendering? -+ public float vrOffset = 0.0F; - public ModelRenderer bipedHead; - public ModelRenderer bipedHeadwear; - public ModelRenderer bipedBody; -@@ -84,7 +87,6 @@ - GL11.glPushMatrix(); - GL11.glScalef(1.5F / var8, 1.5F / var8, 1.5F / var8); - GL11.glTranslatef(0.0F, 16.0F * par7, 0.0F); -- this.bipedHead.render(par7); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glScalef(1.0F / var8, 1.0F / var8, 1.0F / var8); -@@ -94,18 +96,23 @@ - this.bipedLeftArm.render(par7); - this.bipedRightLeg.render(par7); - this.bipedLeftLeg.render(par7); -- this.bipedHeadwear.render(par7); -+ if (_renderHeadWear) -+ this.bipedHeadwear.render(par7); - GL11.glPopMatrix(); - } - else - { -- this.bipedHead.render(par7); -+ GL11.glTranslatef(0.0F, 0.0F, vrOffset ); -+ if (_renderHead) -+ this.bipedHead.render(par7); - this.bipedBody.render(par7); - this.bipedRightArm.render(par7); - this.bipedLeftArm.render(par7); - this.bipedRightLeg.render(par7); - this.bipedLeftLeg.render(par7); -- this.bipedHeadwear.render(par7); -+ if (_renderHeadWear) -+ this.bipedHeadwear.render(par7); -+ GL11.glTranslatef(0.0F, 0.0F, -vrOffset ); - } - } - +--- a/net/minecraft/src/ModelBiped.java ++++ b/net/minecraft/src/ModelBiped.java +@@ -4,6 +4,9 @@ + + public class ModelBiped extends ModelBase + { ++ public boolean _renderHead = true; ++ public boolean _renderHeadWear = true; ++ public float vrOffset = 0.0F; + public ModelRenderer bipedHead; + public ModelRenderer bipedHeadwear; + public ModelRenderer bipedBody; +@@ -84,7 +87,6 @@ + GL11.glPushMatrix(); + GL11.glScalef(1.5F / var8, 1.5F / var8, 1.5F / var8); + GL11.glTranslatef(0.0F, 16.0F * par7, 0.0F); +- this.bipedHead.render(par7); + GL11.glPopMatrix(); + GL11.glPushMatrix(); + GL11.glScalef(1.0F / var8, 1.0F / var8, 1.0F / var8); +@@ -94,18 +96,23 @@ + this.bipedLeftArm.render(par7); + this.bipedRightLeg.render(par7); + this.bipedLeftLeg.render(par7); +- this.bipedHeadwear.render(par7); ++ if (_renderHeadWear) ++ this.bipedHeadwear.render(par7); + GL11.glPopMatrix(); + } + else + { +- this.bipedHead.render(par7); ++ GL11.glTranslatef(0.0F, 0.0F, vrOffset ); ++ if (_renderHead) ++ this.bipedHead.render(par7); + this.bipedBody.render(par7); + this.bipedRightArm.render(par7); + this.bipedLeftArm.render(par7); + this.bipedRightLeg.render(par7); + this.bipedLeftLeg.render(par7); +- this.bipedHeadwear.render(par7); ++ if (_renderHeadWear) ++ this.bipedHeadwear.render(par7); ++ GL11.glTranslatef(0.0F, 0.0F, -vrOffset ); + } + } + diff --git a/patches/net/minecraft/src/MovementInput.java.patch b/patches/net/minecraft/src/MovementInput.java.patch index 32e3cb8e..038947fc 100644 --- a/patches/net/minecraft/src/MovementInput.java.patch +++ b/patches/net/minecraft/src/MovementInput.java.patch @@ -1,11 +1,11 @@ ---- a/net/minecraft/src/MovementInput.java -+++ b/net/minecraft/src/MovementInput.java -@@ -14,5 +14,8 @@ - public boolean jump; - public boolean sneak; - -+ public float baseMoveStrafe = 0.0F; -+ public float baseMoveForward = 0.0F; -+ - public void updatePlayerMoveState() {} - } +--- a/net/minecraft/src/MovementInput.java ++++ b/net/minecraft/src/MovementInput.java +@@ -14,5 +14,8 @@ + public boolean jump; + public boolean sneak; + ++ public float baseMoveStrafe = 0.0F; ++ public float baseMoveForward = 0.0F; ++ + public void updatePlayerMoveState() {} + } diff --git a/patches/net/minecraft/src/MovementInputFromOptions.java.patch b/patches/net/minecraft/src/MovementInputFromOptions.java.patch index f78f13ab..2ae71176 100644 --- a/patches/net/minecraft/src/MovementInputFromOptions.java.patch +++ b/patches/net/minecraft/src/MovementInputFromOptions.java.patch @@ -1,22 +1,13 @@ ---- a/net/minecraft/src/MovementInputFromOptions.java -+++ b/net/minecraft/src/MovementInputFromOptions.java -@@ -3,16 +3,15 @@ - public class MovementInputFromOptions extends MovementInput - { - private GameSettings gameSettings; -- -- public MovementInputFromOptions(GameSettings par1GameSettings) -+ public MovementInputFromOptions(GameSettings par1GameSettings) - { - this.gameSettings = par1GameSettings; - } - - public void updatePlayerMoveState() - { -- this.moveStrafe = 0.0F; -- this.moveForward = 0.0F; -+ this.moveStrafe = baseMoveStrafe; -+ this.moveForward = baseMoveForward; - - if (this.gameSettings.keyBindForward.pressed) - { +--- a/net/minecraft/src/MovementInputFromOptions.java ++++ b/net/minecraft/src/MovementInputFromOptions.java +@@ -11,8 +11,8 @@ + + public void updatePlayerMoveState() + { +- this.moveStrafe = 0.0F; +- this.moveForward = 0.0F; ++ this.moveStrafe = baseMoveStrafe; ++ this.moveForward = baseMoveForward; + + if (this.gameSettings.keyBindForward.pressed) + { diff --git a/patches/net/minecraft/src/RandomMobs.java.patch b/patches/net/minecraft/src/RandomMobs.java.patch new file mode 100644 index 00000000..d003ebdd --- /dev/null +++ b/patches/net/minecraft/src/RandomMobs.java.patch @@ -0,0 +1,63 @@ +--- a/net/minecraft/src/RandomMobs.java ++++ b/net/minecraft/src/RandomMobs.java +@@ -99,7 +99,7 @@ + } + else + { +- ResourceLocation name; ++ ResourceLocation uuidLow; + + try + { +@@ -117,37 +117,38 @@ + } + + Entity entity = renderGlobal.renderedEntity; ++ ResourceLocation name1; + + if (entity == null) + { +- name = loc; +- return name; ++ name1 = loc; ++ return name1; + } + +- if (entity instanceof EntityLiving) ++ if (!(entity instanceof EntityLiving)) + { +- String name1 = loc.getResourcePath(); ++ name1 = loc; ++ return name1; ++ } + +- if (!name1.startsWith("textures/entity/")) +- { +- ResourceLocation uuidLow1 = loc; +- return uuidLow1; +- } ++ String name = loc.getResourcePath(); + +- long uuidLow = entity.getUniqueID().getLeastSignificantBits(); +- int id = (int)(uuidLow & 2147483647L); ++ if (name.startsWith("textures/entity/")) ++ { ++ long uuidLow1 = entity.getUniqueID().getLeastSignificantBits(); ++ int id = (int)(uuidLow1 & 2147483647L); + ResourceLocation var6 = getTextureLocation(loc, id); + return var6; + } + +- name = loc; ++ uuidLow = loc; + } + finally + { + working = false; + } + +- return name; ++ return uuidLow; + } + } + diff --git a/patches/net/minecraft/src/Reflector.java.patch b/patches/net/minecraft/src/Reflector.java.patch index 2b18c822..03a4af2c 100644 --- a/patches/net/minecraft/src/Reflector.java.patch +++ b/patches/net/minecraft/src/Reflector.java.patch @@ -1,64 +1,70 @@ ---- a/net/minecraft/src/Reflector.java -+++ b/net/minecraft/src/Reflector.java -@@ -32,6 +32,8 @@ - public static ReflectorMethod ForgeHooks_onLivingFall = new ReflectorMethod(ForgeHooks, "onLivingFall"); - public static ReflectorMethod ForgeHooks_onLivingJump = new ReflectorMethod(ForgeHooks, "onLivingJump"); - public static ReflectorMethod ForgeHooks_isLivingOnLadder = new ReflectorMethod(ForgeHooks, "isLivingOnLadder", new Class[] {Block.class, World.class, Integer.TYPE, Integer.TYPE, Integer.TYPE, EntityLiving.class}); -+ public static ReflectorMethod ForgeHooks_getTotalArmorValue = new ReflectorMethod(ForgeHooks, "getTotalArmorValue"); -+ public static ReflectorMethod ForgeHooks_onPickBlock = new ReflectorMethod(ForgeHooks, "onPickBlock"); - public static ReflectorClass ForgeHooksClient = new ReflectorClass("net.minecraftforge.client.ForgeHooksClient"); - public static ReflectorMethod ForgeHooksClient_onDrawBlockHighlight = new ReflectorMethod(ForgeHooksClient, "onDrawBlockHighlight"); - public static ReflectorMethod ForgeHooksClient_orientBedCamera = new ReflectorMethod(ForgeHooksClient, "orientBedCamera"); -@@ -42,12 +44,27 @@ - public static ReflectorMethod ForgeHooksClient_onTextureStitchedPre = new ReflectorMethod(ForgeHooksClient, "onTextureStitchedPre"); - public static ReflectorMethod ForgeHooksClient_onTextureStitchedPost = new ReflectorMethod(ForgeHooksClient, "onTextureStitchedPost"); - public static ReflectorClass FMLCommonHandler = new ReflectorClass("cpw.mods.fml.common.FMLCommonHandler"); -+ public static ReflectorClass FMLSide = new ReflectorClass("cpw.mods.fml.relauncher.Side"); - public static ReflectorMethod FMLCommonHandler_instance = new ReflectorMethod(FMLCommonHandler, "instance"); - public static ReflectorMethod FMLCommonHandler_handleServerStarting = new ReflectorMethod(FMLCommonHandler, "handleServerStarting"); - public static ReflectorMethod FMLCommonHandler_handleServerAboutToStart = new ReflectorMethod(FMLCommonHandler, "handleServerAboutToStart"); -+ public static ReflectorMethod FMLCommonHandler_onRenderTickStart= new ReflectorMethod(FMLCommonHandler, "onRenderTickStart"); -+ public static ReflectorMethod FMLCommonHandler_onRenderTickEnd= new ReflectorMethod(FMLCommonHandler, "onRenderTickEnd"); -+ public static ReflectorMethod FMLCommonHandler_rescheduleTicks= new ReflectorMethod(FMLCommonHandler, "rescheduleTicks"); -+ public static ReflectorMethod FMLCommonHandler_onPreClientTick= new ReflectorMethod(FMLCommonHandler, "onPreClientTick"); -+ public static ReflectorMethod FMLCommonHandler_onPostClientTick= new ReflectorMethod(FMLCommonHandler, "onPostClientTick"); - public static ReflectorClass FMLClientHandler = new ReflectorClass("cpw.mods.fml.client.FMLClientHandler"); - public static ReflectorMethod FMLClientHandler_instance = new ReflectorMethod(FMLClientHandler, "instance"); - public static ReflectorMethod FMLClientHandler_isLoading = new ReflectorMethod(FMLClientHandler, "isLoading"); -+ public static ReflectorMethod FMLClientHandler_beginMinecraftLoading = new ReflectorMethod(FMLClientHandler, "beginMinecraftLoading"); -+ public static ReflectorMethod FMLClientHandler_beginMinecraftLoading2 = new ReflectorMethod(FMLClientHandler, "beginMinecraftLoading"); -+ public static ReflectorMethod FMLClientHandler_finishMinecraftLoading = new ReflectorMethod(FMLClientHandler, "finishMinecraftLoading"); -+ public static ReflectorMethod FMLClientHandler_onInitializationComplete = new ReflectorMethod(FMLClientHandler, "onInitializationComplete"); -+ public static ReflectorMethod FMLClientHandler_warnIDMismatch = new ReflectorMethod(FMLClientHandler, "warnIDMismatch"); -+ public static ReflectorClass FMLGameData = new ReflectorClass("cpw.mods.fml.common.registry.GameData"); -+ public static ReflectorMethod FMLGameData_initializeServerGate = new ReflectorMethod(FMLGameData, "initializeServerGate"); -+ public static ReflectorMethod FMLGameData_gateWorldLoadingForValidation = new ReflectorMethod(FMLGameData, "gateWorldLoadingForValidation"); -+ public static ReflectorMethod FMLGameData_releaseGate = new ReflectorMethod(FMLGameData, "releaseGate"); - public static ReflectorClass ForgeWorldProvider = new ReflectorClass(WorldProvider.class); - public static ReflectorMethod ForgeWorldProvider_getSkyRenderer = new ReflectorMethod(ForgeWorldProvider, "getSkyRenderer"); - public static ReflectorMethod ForgeWorldProvider_getCloudRenderer = new ReflectorMethod(ForgeWorldProvider, "getCloudRenderer"); -@@ -56,7 +73,9 @@ - public static ReflectorClass DimensionManager = new ReflectorClass("net.minecraftforge.common.DimensionManager"); - public static ReflectorMethod DimensionManager_getStaticDimensionIDs = new ReflectorMethod(DimensionManager, "getStaticDimensionIDs"); - public static ReflectorClass WorldEvent_Load = new ReflectorClass("net.minecraftforge.event.world.WorldEvent$Load"); -+ public static ReflectorClass WorldEvent_Unload = new ReflectorClass("net.minecraftforge.event.world.WorldEvent$Load"); - public static ReflectorConstructor WorldEvent_Load_Constructor = new ReflectorConstructor(WorldEvent_Load, new Class[] {World.class}); -+ public static ReflectorConstructor WorldEvent_Unload_Constructor = new ReflectorConstructor(WorldEvent_Load, new Class[] {World.class}); - public static ReflectorClass EventBus = new ReflectorClass("net.minecraftforge.event.EventBus"); - public static ReflectorMethod EventBus_post = new ReflectorMethod(EventBus, "post"); - public static ReflectorClass ChunkWatchEvent_UnWatch = new ReflectorClass("net.minecraftforge.event.world.ChunkWatchEvent$UnWatch"); -@@ -70,8 +89,14 @@ - public static ReflectorField ForgeEntity_capturedDrops = new ReflectorField(ForgeEntity, "capturedDrops"); - public static ReflectorClass ForgeItem = new ReflectorClass(Item.class); - public static ReflectorMethod ForgeItem_onEntitySwing = new ReflectorMethod(ForgeItem, "onEntitySwing"); -+ public static ReflectorMethod ForgeItem_getFontRenderer = new ReflectorMethod(ForgeItem, "getFontRenderer"); -+ public static ReflectorMethod ForgeItem_getRenderPasses = new ReflectorMethod(ForgeItem, "getRenderPasses"); - public static ReflectorClass ForgePotionEffect = new ReflectorClass(PotionEffect.class); - public static ReflectorMethod ForgePotionEffect_isCurativeItem = new ReflectorMethod(ForgePotionEffect, "isCurativeItem"); -+ public static ReflectorClass ForgeGuiIngame = new ReflectorClass("net.minecraftforge.client.GuiIngameForge"); -+ public static ReflectorConstructor ForgeGuiIngame_Constructor = new ReflectorConstructor(ForgeGuiIngame, new Class[]{Minecraft.class}); -+ public static ReflectorField ForgeGuiIngame_renderCrosshairs = new ReflectorField(ForgeGuiIngame, "renderCrosshairs"); -+ public static ReflectorField ForgeGuiIngame_renderHelmet = new ReflectorField(ForgeGuiIngame, "renderHelmet"); - - public static void callVoid(ReflectorMethod refMethod, Object ... params) - { +--- a/net/minecraft/src/Reflector.java ++++ b/net/minecraft/src/Reflector.java +@@ -33,6 +33,9 @@ + public static ReflectorMethod ForgeHooks_onLivingDrops = new ReflectorMethod(ForgeHooks, "onLivingDrops"); + public static ReflectorMethod ForgeHooks_onLivingFall = new ReflectorMethod(ForgeHooks, "onLivingFall"); + public static ReflectorMethod ForgeHooks_onLivingJump = new ReflectorMethod(ForgeHooks, "onLivingJump"); ++ public static ReflectorMethod ForgeHooks_isLivingOnLadder = new ReflectorMethod(ForgeHooks, "isLivingOnLadder", new Class[] {Block.class, World.class, Integer.TYPE, Integer.TYPE, Integer.TYPE, EntityLiving.class}); ++ public static ReflectorMethod ForgeHooks_getTotalArmorValue = new ReflectorMethod(ForgeHooks, "getTotalArmorValue"); ++ public static ReflectorMethod ForgeHooks_onPickBlock = new ReflectorMethod(ForgeHooks, "onPickBlock"); + public static ReflectorClass MinecraftForgeClient = new ReflectorClass("net.minecraftforge.client.MinecraftForgeClient"); + public static ReflectorMethod MinecraftForgeClient_getRenderPass = new ReflectorMethod(MinecraftForgeClient, "getRenderPass"); + public static ReflectorClass ForgeHooksClient = new ReflectorClass("net.minecraftforge.client.ForgeHooksClient"); +@@ -40,16 +43,32 @@ + public static ReflectorMethod ForgeHooksClient_orientBedCamera = new ReflectorMethod(ForgeHooksClient, "orientBedCamera"); + public static ReflectorMethod ForgeHooksClient_dispatchRenderLast = new ReflectorMethod(ForgeHooksClient, "dispatchRenderLast"); + public static ReflectorMethod ForgeHooksClient_onTextureLoadPre = new ReflectorMethod(ForgeHooksClient, "onTextureLoadPre"); ++ public static ReflectorMethod ForgeHooksClient_onTextureLoad = new ReflectorMethod(ForgeHooksClient, "onTextureLoad"); + public static ReflectorMethod ForgeHooksClient_setRenderPass = new ReflectorMethod(ForgeHooksClient, "setRenderPass"); + public static ReflectorMethod ForgeHooksClient_onTextureStitchedPre = new ReflectorMethod(ForgeHooksClient, "onTextureStitchedPre"); + public static ReflectorMethod ForgeHooksClient_onTextureStitchedPost = new ReflectorMethod(ForgeHooksClient, "onTextureStitchedPost"); + public static ReflectorClass FMLCommonHandler = new ReflectorClass("cpw.mods.fml.common.FMLCommonHandler"); ++ public static ReflectorClass FMLSide = new ReflectorClass("cpw.mods.fml.relauncher.Side"); + public static ReflectorMethod FMLCommonHandler_instance = new ReflectorMethod(FMLCommonHandler, "instance"); + public static ReflectorMethod FMLCommonHandler_handleServerStarting = new ReflectorMethod(FMLCommonHandler, "handleServerStarting"); + public static ReflectorMethod FMLCommonHandler_handleServerAboutToStart = new ReflectorMethod(FMLCommonHandler, "handleServerAboutToStart"); ++ public static ReflectorMethod FMLCommonHandler_onRenderTickStart= new ReflectorMethod(FMLCommonHandler, "onRenderTickStart"); ++ public static ReflectorMethod FMLCommonHandler_onRenderTickEnd= new ReflectorMethod(FMLCommonHandler, "onRenderTickEnd"); ++ public static ReflectorMethod FMLCommonHandler_rescheduleTicks= new ReflectorMethod(FMLCommonHandler, "rescheduleTicks"); ++ public static ReflectorMethod FMLCommonHandler_onPreClientTick= new ReflectorMethod(FMLCommonHandler, "onPreClientTick"); ++ public static ReflectorMethod FMLCommonHandler_onPostClientTick= new ReflectorMethod(FMLCommonHandler, "onPostClientTick"); + public static ReflectorClass FMLClientHandler = new ReflectorClass("cpw.mods.fml.client.FMLClientHandler"); + public static ReflectorMethod FMLClientHandler_instance = new ReflectorMethod(FMLClientHandler, "instance"); + public static ReflectorMethod FMLClientHandler_isLoading = new ReflectorMethod(FMLClientHandler, "isLoading"); ++ public static ReflectorMethod FMLClientHandler_beginMinecraftLoading = new ReflectorMethod(FMLClientHandler, "beginMinecraftLoading"); ++ public static ReflectorMethod FMLClientHandler_beginMinecraftLoading2 = new ReflectorMethod(FMLClientHandler, "beginMinecraftLoading"); ++ public static ReflectorMethod FMLClientHandler_finishMinecraftLoading = new ReflectorMethod(FMLClientHandler, "finishMinecraftLoading"); ++ public static ReflectorMethod FMLClientHandler_onInitializationComplete = new ReflectorMethod(FMLClientHandler, "onInitializationComplete"); ++ public static ReflectorMethod FMLClientHandler_warnIDMismatch = new ReflectorMethod(FMLClientHandler, "warnIDMismatch"); ++ public static ReflectorClass FMLGameData = new ReflectorClass("cpw.mods.fml.common.registry.GameData"); ++ public static ReflectorMethod FMLGameData_initializeServerGate = new ReflectorMethod(FMLGameData, "initializeServerGate"); ++ public static ReflectorMethod FMLGameData_gateWorldLoadingForValidation = new ReflectorMethod(FMLGameData, "gateWorldLoadingForValidation"); ++ public static ReflectorMethod FMLGameData_releaseGate = new ReflectorMethod(FMLGameData, "releaseGate"); + public static ReflectorClass ForgeWorldProvider = new ReflectorClass(WorldProvider.class); + public static ReflectorMethod ForgeWorldProvider_getSkyRenderer = new ReflectorMethod(ForgeWorldProvider, "getSkyRenderer"); + public static ReflectorMethod ForgeWorldProvider_getCloudRenderer = new ReflectorMethod(ForgeWorldProvider, "getCloudRenderer"); +@@ -58,7 +77,9 @@ + public static ReflectorClass DimensionManager = new ReflectorClass("net.minecraftforge.common.DimensionManager"); + public static ReflectorMethod DimensionManager_getStaticDimensionIDs = new ReflectorMethod(DimensionManager, "getStaticDimensionIDs"); + public static ReflectorClass WorldEvent_Load = new ReflectorClass("net.minecraftforge.event.world.WorldEvent$Load"); ++ public static ReflectorClass WorldEvent_Unload = new ReflectorClass("net.minecraftforge.event.world.WorldEvent$Load"); + public static ReflectorConstructor WorldEvent_Load_Constructor = new ReflectorConstructor(WorldEvent_Load, new Class[] {World.class}); ++ public static ReflectorConstructor WorldEvent_Unload_Constructor = new ReflectorConstructor(WorldEvent_Load, new Class[] {World.class}); + public static ReflectorClass EventBus = new ReflectorClass("net.minecraftforge.event.EventBus"); + public static ReflectorMethod EventBus_post = new ReflectorMethod(EventBus, "post"); + public static ReflectorClass ChunkWatchEvent_UnWatch = new ReflectorClass("net.minecraftforge.event.world.ChunkWatchEvent$UnWatch"); +@@ -75,8 +96,14 @@ + public static ReflectorMethod ForgeTileEntity_shouldRenderInPass = new ReflectorMethod(ForgeTileEntity, "shouldRenderInPass"); + public static ReflectorClass ForgeItem = new ReflectorClass(Item.class); + public static ReflectorMethod ForgeItem_onEntitySwing = new ReflectorMethod(ForgeItem, "onEntitySwing"); ++ public static ReflectorMethod ForgeItem_getFontRenderer = new ReflectorMethod(ForgeItem, "getFontRenderer"); ++ public static ReflectorMethod ForgeItem_getRenderPasses = new ReflectorMethod(ForgeItem, "getRenderPasses"); + public static ReflectorClass ForgePotionEffect = new ReflectorClass(PotionEffect.class); + public static ReflectorMethod ForgePotionEffect_isCurativeItem = new ReflectorMethod(ForgePotionEffect, "isCurativeItem"); ++ public static ReflectorClass ForgeGuiIngame = new ReflectorClass("net.minecraftforge.client.GuiIngameForge"); ++ public static ReflectorConstructor ForgeGuiIngame_Constructor = new ReflectorConstructor(ForgeGuiIngame, new Class[]{Minecraft.class}); ++ public static ReflectorField ForgeGuiIngame_renderCrosshairs = new ReflectorField(ForgeGuiIngame, "renderCrosshairs"); ++ public static ReflectorField ForgeGuiIngame_renderHelmet = new ReflectorField(ForgeGuiIngame, "renderHelmet"); + + public static void callVoid(ReflectorMethod refMethod, Object ... params) + { diff --git a/patches/net/minecraft/src/RenderGlobal.java.patch b/patches/net/minecraft/src/RenderGlobal.java.patch index 0bc66b6c..093afa10 100644 --- a/patches/net/minecraft/src/RenderGlobal.java.patch +++ b/patches/net/minecraft/src/RenderGlobal.java.patch @@ -1,80 +1,68 @@ ---- a/net/minecraft/src/RenderGlobal.java -+++ b/net/minecraft/src/RenderGlobal.java -@@ -339,12 +339,14 @@ - var1 = var3; - } - -+ // TODO: Set chunk renderer attribs for greater draw distance - this.prevReposX = -9999.0D; - this.prevReposY = -9999.0D; - this.prevReposZ = -9999.0D; - this.renderChunksWide = var1 / 16 + 1; - this.renderChunksTall = 16; - this.renderChunksDeep = var1 / 16 + 1; -+ - this.worldRenderers = new WorldRenderer[this.renderChunksWide * this.renderChunksTall * this.renderChunksDeep]; - this.sortedWorldRenderers = new WorldRenderer[this.renderChunksWide * this.renderChunksTall * this.renderChunksDeep]; - int var4 = 0; -@@ -470,20 +472,30 @@ - for (var6 = 0; var6 < var5.size(); ++var6) - { - var7 = (Entity)var5.get(var6); -- boolean var9 = var7.isInRangeToRenderVec3D(par1Vec3) && (var7.ignoreFrustumCheck || par2ICamera.isBoundingBoxInFrustum(var7.boundingBox) || var7.riddenByEntity == this.mc.thePlayer); -+ boolean render = var7.isInRangeToRenderVec3D(par1Vec3) && (var7.ignoreFrustumCheck || par2ICamera.isBoundingBoxInFrustum(var7.boundingBox) || var7.riddenByEntity == this.mc.thePlayer); - -- if (!var9 && var7 instanceof EntityLiving) -+ if (!render && var7 instanceof EntityLiving) - { - EntityLiving var10 = (EntityLiving)var7; - - if (var10.func_110167_bD() && var10.func_110166_bE() != null) - { - Entity var11 = var10.func_110166_bE(); -- var9 = par2ICamera.isBoundingBoxInFrustum(var11.boundingBox); -+ render = par2ICamera.isBoundingBoxInFrustum(var11.boundingBox); - } - } - -- if (var9 && (var7 != this.mc.renderViewEntity || this.mc.gameSettings.thirdPersonView != 0 || this.mc.renderViewEntity.isPlayerSleeping()) && this.theWorld.blockExists(MathHelper.floor_double(var7.posX), 0, MathHelper.floor_double(var7.posZ))) -+ -+ RenderPlayer renderPlayer = (RenderPlayer)RenderManager.instance.getEntityRenderObject(this.mc.thePlayer); -+ -+ if (var7 == this.mc.renderViewEntity && this.mc.gameSettings.thirdPersonView == 0 && !mc.renderViewEntity.isPlayerSleeping() ) -+ { -+ renderPlayer.setVR(true,this.mc.vrSettings.renderHeadWear, this.mc.vrSettings.renderPlayerOffset); -+ if (this.mc.vrSettings.renderFullFirstPersonModel == false || this.mc.vrSettings.useVRRenderer == false) -+ render = false; -+ } -+ -+ if (render) - { - ++this.countEntitiesRendered; - -@@ -496,6 +508,11 @@ - RenderManager.instance.renderEntity(var7, par3); - this.renderedEntity = null; - } -+ -+ if (var7 == this.mc.renderViewEntity && this.mc.gameSettings.thirdPersonView == 0 && !mc.renderViewEntity.isPlayerSleeping() ) -+ { -+ renderPlayer.setVR(false,true,0.0F); -+ } - } - - this.mc.gameSettings.fancyGraphics = var8; -@@ -731,10 +748,11 @@ - RenderHelper.disableStandardItemLighting(); - WrUpdates.preRender(this, par1EntityLivingBase); - -- if (this.mc.gameSettings.ofSmoothFps && par2 == 0) -- { -- GL11.glFinish(); -- } -+ // VR renderer already calls this. -+// if (this.mc.gameSettings.ofSmoothFps && par2 == 0) -+// { -+// GL11.glFinish(); -+// } - - byte var42 = 0; - int var44 = 0; +--- a/net/minecraft/src/RenderGlobal.java ++++ b/net/minecraft/src/RenderGlobal.java +@@ -508,21 +508,31 @@ + + if (!var5 || Reflector.callBoolean(var9, Reflector.ForgeEntity_shouldRenderInPass, new Object[] {Integer.valueOf(var4)})) + { +- boolean var11 = var9.isInRangeToRenderVec3D(par1Vec3) && (var9.ignoreFrustumCheck || par2ICamera.isBoundingBoxInFrustum(var9.boundingBox) || var9.riddenByEntity == this.mc.thePlayer); ++ boolean render = var9.isInRangeToRenderVec3D(par1Vec3) && (var9.ignoreFrustumCheck || par2ICamera.isBoundingBoxInFrustum(var9.boundingBox) || var9.riddenByEntity == this.mc.thePlayer); + +- if (!var11 && var9 instanceof EntityLiving) ++ if (!render && var9 instanceof EntityLiving) + { + EntityLiving var12 = (EntityLiving)var9; + + if (var12.getLeashed() && var12.getLeashedToEntity() != null) + { + Entity var13 = var12.getLeashedToEntity(); +- var11 = par2ICamera.isBoundingBoxInFrustum(var13.boundingBox); ++ render = par2ICamera.isBoundingBoxInFrustum(var13.boundingBox); + } + } + +- if (var11 && (var9 != this.mc.renderViewEntity || this.mc.gameSettings.thirdPersonView != 0 || this.mc.renderViewEntity.isPlayerSleeping()) && this.theWorld.blockExists(MathHelper.floor_double(var9.posX), 0, MathHelper.floor_double(var9.posZ))) ++ // Minecrift - logic to determine whether to render head, headwear etc... ++ RenderPlayer renderPlayer = (RenderPlayer)RenderManager.instance.getEntityRenderObject(this.mc.thePlayer); ++ ++ if (render && (var9 == this.mc.renderViewEntity && this.mc.gameSettings.thirdPersonView == 0 && !mc.renderViewEntity.isPlayerSleeping()) && this.theWorld.blockExists(MathHelper.floor_double(var9.posX), 0, MathHelper.floor_double(var9.posZ))) + { ++ renderPlayer.setVR(true,this.mc.vrSettings.renderHeadWear, this.mc.vrSettings.renderPlayerOffset); ++ if (this.mc.vrSettings.renderFullFirstPersonModel == false || this.mc.vrSettings.useVRRenderer == false) ++ render = false; ++ } ++ ++ if (render) ++ { + ++this.countEntitiesRendered; + + if (var9.getClass() == EntityItemFrame.class) +@@ -534,7 +544,12 @@ + RenderManager.instance.renderEntity(var9, par3); + this.renderedEntity = null; + } +- } ++ ++ if (var9 == this.mc.renderViewEntity && this.mc.gameSettings.thirdPersonView == 0 && !mc.renderViewEntity.isPlayerSleeping() ) ++ { ++ renderPlayer.setVR(false,true,0.0F); ++ } ++ } + } + + this.mc.gameSettings.fancyGraphics = var10; +@@ -779,10 +794,11 @@ + RenderHelper.disableStandardItemLighting(); + WrUpdates.preRender(this, par1EntityLivingBase); + +- if (this.mc.gameSettings.ofSmoothFps && par2 == 0) +- { +- GL11.glFinish(); +- } ++ // VR renderer already calls this. ++// if (this.mc.gameSettings.ofSmoothFps && par2 == 0) ++// { ++// GL11.glFinish(); ++// } + + byte var42 = 0; + int var44 = 0; diff --git a/patches/net/minecraft/src/RenderPlayer.java.patch b/patches/net/minecraft/src/RenderPlayer.java.patch index 11785472..0040fd66 100644 --- a/patches/net/minecraft/src/RenderPlayer.java.patch +++ b/patches/net/minecraft/src/RenderPlayer.java.patch @@ -1,75 +1,69 @@ ---- a/net/minecraft/src/RenderPlayer.java -+++ b/net/minecraft/src/RenderPlayer.java -@@ -8,6 +8,9 @@ - private ModelBiped modelBipedMain; - private ModelBiped modelArmorChestplate; - private ModelBiped modelArmor; -+ private float vrOffset; -+ public static float NAME_TAG_RANGE = 64.0f; -+ public static float NAME_TAG_RANGE_SNEAK = 32.0f; - - public RenderPlayer() - { -@@ -17,6 +20,14 @@ - this.modelArmor = new ModelBiped(0.5F); - } - -+ public void setVR(boolean vrMode, boolean renderHeadWear, float offset) { -+ -+ vrOffset = vrMode? offset : 0.0F; -+ this.modelBipedMain.vrOffset = this.modelArmorChestplate.vrOffset = this.modelArmor.vrOffset = vrOffset; -+ this.modelBipedMain._renderHead = this.modelArmorChestplate._renderHead = this.modelArmor._renderHead = !vrMode; -+ this.modelBipedMain._renderHeadWear = this.modelArmorChestplate._renderHeadWear = this.modelArmor._renderHeadWear = renderHeadWear; -+ } -+ - /** - * Set the specified armor model as the player model. Args: player, armorSlot, partialTick - */ -@@ -150,9 +161,17 @@ - this.modelBipedMain.bipedHead.postRender(0.0625F); - float var5; - -- if (var4.getItem().itemID < 256) -+ if (var4 != null && var4.getItem() instanceof ItemBlock ) - { -- if (RenderBlocks.renderItemIn3d(Block.blocksList[var4.itemID].getRenderType())) -+ boolean render3D = false; -+ if( false ) -+ { -+ //TODO: forge compatibility -+ //IItemRenderer customRenderer = MinecraftForgeClient.getItemRenderer(itemstack, EQUIPPED); -+ -+ } -+ -+ if (render3D || RenderBlocks.renderItemIn3d(Block.blocksList[var4.itemID].getRenderType())) - { - var5 = 0.625F; - GL11.glTranslatef(0.0F, -0.25F, 0.0F); -@@ -258,6 +277,7 @@ - if (var28 != null) - { - GL11.glPushMatrix(); -+ GL11.glTranslatef(0, 0, vrOffset); - this.modelBipedMain.bipedRightArm.postRender(0.0625F); - GL11.glTranslatef(-0.0625F, 0.4375F, 0.0625F); - -@@ -332,7 +352,12 @@ - - if (var28.getItem().requiresMultipleRenderPasses()) - { -- for (var33 = 0; var33 <= 1; ++var33) -+ int renderPasses = 1; -+ if( Reflector.ForgeItem.exists() ) -+ { -+ renderPasses = Reflector.callInt(var28.getItem(), Reflector.ForgeItem_getRenderPasses,new Object[]{var28.getItemDamage()}); -+ } -+ for (var33 = 0; var33 <= renderPasses; ++var33) - { - int var11 = var28.getItem().getColorFromItemStack(var28, var33); - var32 = (float)(var11 >> 16 & 255) / 255.0F; -@@ -495,4 +520,5 @@ - { - this.func_130009_a((AbstractClientPlayer)par1Entity, par2, par4, par6, par8, par9); - } -+ - } +--- a/net/minecraft/src/RenderPlayer.java ++++ b/net/minecraft/src/RenderPlayer.java +@@ -8,6 +8,9 @@ + private ModelBiped modelBipedMain; + private ModelBiped modelArmorChestplate; + private ModelBiped modelArmor; ++ private float vrOffset; ++ public static float NAME_TAG_RANGE = 64.0f; ++ public static float NAME_TAG_RANGE_SNEAK = 32.0f; + + public RenderPlayer() + { +@@ -17,6 +20,14 @@ + this.modelArmor = new ModelBiped(0.5F); + } + ++ public void setVR(boolean vrMode, boolean renderHeadWear, float offset) { ++ ++ vrOffset = vrMode? offset : 0.0F; ++ this.modelBipedMain.vrOffset = this.modelArmorChestplate.vrOffset = this.modelArmor.vrOffset = vrOffset; ++ this.modelBipedMain._renderHead = this.modelArmorChestplate._renderHead = this.modelArmor._renderHead = !vrMode; ++ this.modelBipedMain._renderHeadWear = this.modelArmorChestplate._renderHeadWear = this.modelArmor._renderHeadWear = renderHeadWear; ++ } ++ + /** + * Set the specified armor model as the player model. Args: player, armorSlot, partialTick + */ +@@ -150,9 +161,17 @@ + this.modelBipedMain.bipedHead.postRender(0.0625F); + float var5; + +- if (var4.getItem().itemID < 256) ++ if (var4 != null && var4.getItem() instanceof ItemBlock ) + { +- if (RenderBlocks.renderItemIn3d(Block.blocksList[var4.itemID].getRenderType())) ++ boolean render3D = false; ++ if( false ) ++ { ++ //TODO: forge compatibility ++ //IItemRenderer customRenderer = MinecraftForgeClient.getItemRenderer(itemstack, EQUIPPED); ++ ++ } ++ ++ if (render3D || RenderBlocks.renderItemIn3d(Block.blocksList[var4.itemID].getRenderType())) + { + var5 = 0.625F; + GL11.glTranslatef(0.0F, -0.25F, 0.0F); +@@ -258,6 +277,7 @@ + if (var28 != null) + { + GL11.glPushMatrix(); ++ GL11.glTranslatef(0, 0, vrOffset); + this.modelBipedMain.bipedRightArm.postRender(0.0625F); + GL11.glTranslatef(-0.0625F, 0.4375F, 0.0625F); + +@@ -332,7 +352,12 @@ + + if (var28.getItem().requiresMultipleRenderPasses()) + { +- for (var33 = 0; var33 <= 1; ++var33) ++ int renderPasses = 1; ++ if( Reflector.ForgeItem.exists() ) ++ { ++ renderPasses = Reflector.callInt(var28.getItem(), Reflector.ForgeItem_getRenderPasses,new Object[]{var28.getItemDamage()}); ++ } ++ for (var33 = 0; var33 <= renderPasses; ++var33) + { + int var11 = var28.getItem().getColorFromItemStack(var28, var33); + var32 = (float)(var11 >> 16 & 255) / 255.0F; diff --git a/patches/net/minecraft/src/ScaledResolution.java.patch b/patches/net/minecraft/src/ScaledResolution.java.patch index 7e1fb8be..51ca5345 100644 --- a/patches/net/minecraft/src/ScaledResolution.java.patch +++ b/patches/net/minecraft/src/ScaledResolution.java.patch @@ -1,11 +1,11 @@ ---- a/net/minecraft/src/ScaledResolution.java -+++ b/net/minecraft/src/ScaledResolution.java -@@ -6,7 +6,7 @@ - private int scaledHeight; - private double scaledWidthD; - private double scaledHeightD; -- private int scaleFactor; -+ public int scaleFactor; - - public ScaledResolution(GameSettings par1GameSettings, int par2, int par3) - { +--- a/net/minecraft/src/ScaledResolution.java ++++ b/net/minecraft/src/ScaledResolution.java +@@ -6,7 +6,7 @@ + private int scaledHeight; + private double scaledWidthD; + private double scaledHeightD; +- private int scaleFactor; ++ public int scaleFactor; + + public ScaledResolution(GameSettings par1GameSettings, int par2, int par3) + { diff --git a/patches/net/minecraft/src/ScreenChatOptions.java.patch b/patches/net/minecraft/src/ScreenChatOptions.java.patch index d56aa376..22691af4 100644 --- a/patches/net/minecraft/src/ScreenChatOptions.java.patch +++ b/patches/net/minecraft/src/ScreenChatOptions.java.patch @@ -1,61 +1,61 @@ ---- a/net/minecraft/src/ScreenChatOptions.java -+++ b/net/minecraft/src/ScreenChatOptions.java -@@ -1,5 +1,7 @@ - package net.minecraft.src; - -+import com.mtbs3d.minecrift.settings.VRSettings; -+ - public class ScreenChatOptions extends GuiScreen - { - /** An array of all EnumOptions which are to do with chat. */ -@@ -21,6 +23,29 @@ - this.theSettings = par2GameSettings; - } - -+ class GuiVRSlider extends GuiSlider { -+ -+ private EnumOptions vrOption; -+ public GuiVRSlider(int par1, int par2, int par3, -+ EnumOptions par4EnumOptions, String par5Str, float par6) { -+ super(par1, par2, par3, par4EnumOptions, par5Str, par6); -+ vrOption = par4EnumOptions; -+ } -+ -+ protected void mouseDragged(Minecraft par1Minecraft, int par2, int par3) -+ { -+ super.mouseDragged(par1Minecraft, par2, par3); -+ VRSettings.inst.setOptionFloatValue(vrOption, sliderValue); -+ this.displayString = par1Minecraft.vrSettings.getKeyBinding(this.vrOption); -+ } -+ public boolean mousePressed(Minecraft par1Minecraft, int par2, int par3) { -+ boolean ret = super.mousePressed(par1Minecraft, par2, par3); -+ VRSettings.inst.setOptionFloatValue(vrOption, sliderValue); -+ this.displayString = par1Minecraft.vrSettings.getKeyBinding(this.vrOption); -+ return ret; -+ } -+ } -+ - /** - * Adds the buttons (and other controls) to the screen in question. - */ -@@ -49,6 +74,11 @@ - - ++var1; - } -+ -+ this.buttonList.add(new GuiVRSlider(300, this.width / 2 - 155 + var1 % 2 * 160, this.height / 6 + 24 * (var1 >> 1), EnumOptions.CHAT_OFFSET_X, VRSettings.inst.getKeyBinding(EnumOptions.CHAT_OFFSET_X), VRSettings.inst.getOptionFloatValue(EnumOptions.CHAT_OFFSET_X))); -+ ++var1; -+ this.buttonList.add(new GuiVRSlider(301, this.width / 2 - 155 + var1 % 2 * 160, this.height / 6 + 24 * (var1 >> 1), EnumOptions.CHAT_OFFSET_Y, VRSettings.inst.getKeyBinding(EnumOptions.CHAT_OFFSET_Y), VRSettings.inst.getOptionFloatValue(EnumOptions.CHAT_OFFSET_Y))); -+ ++var1; - - if (var1 % 2 == 1) - { -@@ -76,7 +106,7 @@ - ++var1; - } - -- this.buttonList.add(new GuiButton(200, this.width / 2 - 100, this.height / 6 + 168, I18n.func_135053_a("gui.done"))); -+ this.buttonList.add(new GuiButton(200, this.width / 2 - 100, this.height / 6 + 192, I18n.func_135053_a("gui.done"))); - } - - /** +--- a/net/minecraft/src/ScreenChatOptions.java ++++ b/net/minecraft/src/ScreenChatOptions.java +@@ -1,5 +1,7 @@ + package net.minecraft.src; + ++import com.mtbs3d.minecrift.settings.VRSettings; ++ + public class ScreenChatOptions extends GuiScreen + { + /** An array of all EnumOptions which are to do with chat. */ +@@ -21,6 +23,29 @@ + this.theSettings = par2GameSettings; + } + ++ class GuiVRSlider extends GuiSlider { ++ ++ private EnumOptions vrOption; ++ public GuiVRSlider(int par1, int par2, int par3, ++ EnumOptions par4EnumOptions, String par5Str, float par6) { ++ super(par1, par2, par3, par4EnumOptions, par5Str, par6); ++ vrOption = par4EnumOptions; ++ } ++ ++ protected void mouseDragged(Minecraft par1Minecraft, int par2, int par3) ++ { ++ super.mouseDragged(par1Minecraft, par2, par3); ++ VRSettings.inst.setOptionFloatValue(vrOption, sliderValue); ++ this.displayString = par1Minecraft.vrSettings.getKeyBinding(this.vrOption); ++ } ++ public boolean mousePressed(Minecraft par1Minecraft, int par2, int par3) { ++ boolean ret = super.mousePressed(par1Minecraft, par2, par3); ++ VRSettings.inst.setOptionFloatValue(vrOption, sliderValue); ++ this.displayString = par1Minecraft.vrSettings.getKeyBinding(this.vrOption); ++ return ret; ++ } ++ } ++ + /** + * Adds the buttons (and other controls) to the screen in question. + */ +@@ -49,6 +74,11 @@ + + ++var1; + } ++ ++ this.buttonList.add(new GuiVRSlider(300, this.width / 2 - 155 + var1 % 2 * 160, this.height / 6 + 24 * (var1 >> 1), EnumOptions.CHAT_OFFSET_X, VRSettings.inst.getKeyBinding(EnumOptions.CHAT_OFFSET_X), VRSettings.inst.getOptionFloatValue(EnumOptions.CHAT_OFFSET_X))); ++ ++var1; ++ this.buttonList.add(new GuiVRSlider(301, this.width / 2 - 155 + var1 % 2 * 160, this.height / 6 + 24 * (var1 >> 1), EnumOptions.CHAT_OFFSET_Y, VRSettings.inst.getKeyBinding(EnumOptions.CHAT_OFFSET_Y), VRSettings.inst.getOptionFloatValue(EnumOptions.CHAT_OFFSET_Y))); ++ ++var1; + + if (var1 % 2 == 1) + { +@@ -76,7 +106,7 @@ + ++var1; + } + +- this.buttonList.add(new GuiButton(200, this.width / 2 - 100, this.height / 6 + 168, I18n.getString("gui.done"))); ++ this.buttonList.add(new GuiButton(200, this.width / 2 - 100, this.height / 6 + 192, I18n.getString("gui.done"))); + } + + /** diff --git a/patches/net/minecraft/src/SoundManager.java.patch b/patches/net/minecraft/src/SoundManager.java.patch index 6965fc00..48de77fb 100644 --- a/patches/net/minecraft/src/SoundManager.java.patch +++ b/patches/net/minecraft/src/SoundManager.java.patch @@ -1,11 +1,11 @@ ---- a/net/minecraft/src/SoundManager.java -+++ b/net/minecraft/src/SoundManager.java -@@ -21,7 +21,7 @@ - private static final String[] field_130084_a = new String[] {"ogg"}; - - /** A reference to the sound system. */ -- private SoundSystem sndSystem; -+ public SoundSystem sndSystem; - - /** Set to true when the SoundManager has been initialised. */ - private boolean loaded; +--- a/net/minecraft/src/SoundManager.java ++++ b/net/minecraft/src/SoundManager.java +@@ -21,7 +21,7 @@ + private static final String[] field_130084_a = new String[] {"ogg"}; + + /** A reference to the sound system. */ +- private SoundSystem sndSystem; ++ public SoundSystem sndSystem; + + /** Set to true when the SoundManager has been initialised. */ + private boolean loaded; diff --git a/patches/net/minecraft/src/StringTranslate.java.patch b/patches/net/minecraft/src/StringTranslate.java.patch index 1c4108b6..a0e5a998 100644 --- a/patches/net/minecraft/src/StringTranslate.java.patch +++ b/patches/net/minecraft/src/StringTranslate.java.patch @@ -1,11 +1,11 @@ ---- a/net/minecraft/src/StringTranslate.java -+++ b/net/minecraft/src/StringTranslate.java -@@ -54,7 +54,7 @@ - /** - * Return the StringTranslate singleton instance - */ -- static StringTranslate getInstance() -+ public static StringTranslate getInstance() - { - return instance; - } +--- a/net/minecraft/src/StringTranslate.java ++++ b/net/minecraft/src/StringTranslate.java +@@ -54,7 +54,7 @@ + /** + * Return the StringTranslate singleton instance + */ +- static StringTranslate getInstance() ++ public static StringTranslate getInstance() + { + return instance; + } diff --git a/patches/net/minecraft/src/ThreadDownloadImage.java.patch b/patches/net/minecraft/src/ThreadDownloadImage.java.patch new file mode 100644 index 00000000..6db26d54 --- /dev/null +++ b/patches/net/minecraft/src/ThreadDownloadImage.java.patch @@ -0,0 +1,36 @@ +--- a/net/minecraft/src/ThreadDownloadImage.java ++++ b/net/minecraft/src/ThreadDownloadImage.java +@@ -30,23 +30,24 @@ + conn.setDoOutput(false); + conn.connect(); + +- if (conn.getResponseCode() / 100 == 2) ++ if (conn.getResponseCode() / 100 != 2) + { +- BufferedImage var2 = ImageIO.read(conn.getInputStream()); ++ return; ++ } + +- if (this.imageBuffer != null) +- { +- var2 = this.imageBuffer.parseUserSkin(var2); +- } ++ BufferedImage var2 = ImageIO.read(conn.getInputStream()); + +- this.parent.getBufferedImage(var2); +- return; ++ if (this.imageBuffer != null) ++ { ++ var2 = this.imageBuffer.parseUserSkin(var2); + } ++ ++ this.parent.getBufferedImage(var2); ++ return; + } + catch (Exception var7) + { + System.out.println(var7.getClass().getName() + ": " + var7.getMessage()); +- return; + } + finally + { diff --git a/patches/net/minecraft/src/ThreadDownloadImageDataINNER1.java.patch b/patches/net/minecraft/src/ThreadDownloadImageDataINNER1.java.patch new file mode 100644 index 00000000..4c1f6f14 --- /dev/null +++ b/patches/net/minecraft/src/ThreadDownloadImageDataINNER1.java.patch @@ -0,0 +1,35 @@ +--- a/net/minecraft/src/ThreadDownloadImageDataINNER1.java ++++ b/net/minecraft/src/ThreadDownloadImageDataINNER1.java +@@ -25,23 +25,23 @@ + var1.setDoOutput(false); + var1.connect(); + +- if (var1.getResponseCode() / 100 == 2) ++ if (var1.getResponseCode() / 100 != 2) + { +- BufferedImage var2 = ImageIO.read(var1.getInputStream()); ++ return; ++ } + +- if (ThreadDownloadImageData.getImageBuffer(this.theThreadDownloadImageData) != null) +- { +- var2 = ThreadDownloadImageData.getImageBuffer(this.theThreadDownloadImageData).parseUserSkin(var2); +- } ++ BufferedImage var2 = ImageIO.read(var1.getInputStream()); + +- this.theThreadDownloadImageData.getBufferedImage(var2); +- return; ++ if (ThreadDownloadImageData.getImageBuffer(this.theThreadDownloadImageData) != null) ++ { ++ var2 = ThreadDownloadImageData.getImageBuffer(this.theThreadDownloadImageData).parseUserSkin(var2); + } ++ ++ this.theThreadDownloadImageData.getBufferedImage(var2); + } + catch (Exception var6) + { + var6.printStackTrace(); +- return; + } + finally + { diff --git a/patches/net/minecraft/src/VersionCheckThread.java.patch b/patches/net/minecraft/src/VersionCheckThread.java.patch new file mode 100644 index 00000000..3ef50613 --- /dev/null +++ b/patches/net/minecraft/src/VersionCheckThread.java.patch @@ -0,0 +1,26 @@ +--- a/net/minecraft/src/VersionCheckThread.java ++++ b/net/minecraft/src/VersionCheckThread.java +@@ -26,16 +26,16 @@ + in.close(); + String[] verLines = Config.tokenize(verStr, "\n\r"); + +- if (verLines.length >= 1) ++ if (verLines.length < 1) + { +- String newVer = verLines[0]; +- Config.dbg("Version found: " + newVer); ++ return; ++ } + +- if (Config.compareRelease(newVer, "C6") <= 0) +- { +- return; +- } ++ String newVer = verLines[0]; ++ Config.dbg("Version found: " + newVer); + ++ if (Config.compareRelease(newVer, "C6") > 0) ++ { + Config.setNewRelease(newVer); + return; + } diff --git a/src/com/mtbs3d/minecrift/VRRenderer.java b/src/com/mtbs3d/minecrift/VRRenderer.java index 3120a46f..13a8631a 100644 --- a/src/com/mtbs3d/minecrift/VRRenderer.java +++ b/src/com/mtbs3d/minecrift/VRRenderer.java @@ -1394,7 +1394,7 @@ public void renderWorld(float renderPartialTicks, long nextFrameTime, int render this.mc.mcProfiler.endStartSection("prepareterrain"); this.setupFog(0, renderPartialTicks); GL11.glEnable(GL11.GL_FOG); - this.mc.func_110434_K().func_110577_a(TextureMap.field_110575_b); + this.mc.getTextureManager().bindTexture(TextureMap.locationBlocksTexture); RenderHelper.disableStandardItemLighting(); this.mc.mcProfiler.endStartSection("terrain"); renderGlobal.sortAndRender(renderViewEntity, 0, (double) renderPartialTicks); @@ -1437,7 +1437,7 @@ public void renderWorld(float renderPartialTicks, long nextFrameTime, int render GL11.glEnable(GL11.GL_BLEND); GL11.glDisable(GL11.GL_CULL_FACE); - this.mc.func_110434_K().func_110577_a(TextureMap.field_110575_b); + this.mc.getTextureManager().bindTexture(TextureMap.locationBlocksTexture); WrUpdates.resumeBackgroundUpdates(); GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); @@ -1553,7 +1553,7 @@ public void renderWorld(float renderPartialTicks, long nextFrameTime, int render GL11.glDisable(GL11.GL_DEPTH_TEST); GL11.glEnable(GL11.GL_BLEND); GL11.glBlendFunc(GL11.GL_ONE_MINUS_DST_COLOR, GL11.GL_ONE_MINUS_SRC_COLOR); - this.mc.func_110434_K().func_110577_a(Gui.field_110324_m); + this.mc.getTextureManager().bindTexture(Gui.icons); float var7 = 0.00390625F; float var8 = 0.00390625F; @@ -2127,7 +2127,7 @@ private void drawMouseQuad( int mouseX, int mouseY ) GL11.glDisable(GL11.GL_DEPTH_TEST); GL11.glColor3f(1, 1, 1); this.mc.mcProfiler.endStartSection("mouse pointer"); - this.mc.func_110434_K().func_110577_a(Gui.field_110324_m); + this.mc.getTextureManager().bindTexture(Gui.icons); this.mc.ingameGUI.drawTexturedModalRect(mouseX - 7, mouseY - 7, 0, 0, 16, 16); GL11.glEnable(GL11.GL_BLEND); diff --git a/src/com/mtbs3d/minecrift/settings/VRSettings.java b/src/com/mtbs3d/minecrift/settings/VRSettings.java index ec0f7d9c..434d89d7 100644 --- a/src/com/mtbs3d/minecrift/settings/VRSettings.java +++ b/src/com/mtbs3d/minecrift/settings/VRSettings.java @@ -569,7 +569,7 @@ public void loadOptions() public String getKeyBinding( EnumOptions par1EnumOptions ) { - String var2 = I18n.func_135053_a(par1EnumOptions.getEnumString()); + String var2 = I18n.getString(par1EnumOptions.getEnumString()); if (var2 == null) { diff --git a/src/com/mtbs3d/minecrift/utils/SessionID.java b/src/com/mtbs3d/minecrift/utils/SessionID.java new file mode 100644 index 00000000..a858e2ce --- /dev/null +++ b/src/com/mtbs3d/minecrift/utils/SessionID.java @@ -0,0 +1,83 @@ +package com.mtbs3d.minecrift.utils; + +import net.minecraft.src.Session; + +import java.io.*; +import java.net.*; +import java.util.UUID; + +public class SessionID +{ + public static final Session GetSSID(String username, String password) + { + byte[] b = null; + String jsonEncoded = + "{\"agent\":{\"name\":\"Minecraft\",\"version\":1},\"username\":\"" + + username + + "\",\"password\":\"" + + password + "\"}"; + String response = executePost("https://authserver.mojang.com/authenticate", jsonEncoded); + if (response == null || response.isEmpty()) + return null; + + // Session ID = "token::" + // Username will probably *not be an email address + String[] pieces = response.split("\""); + String sessionID = "token:" + pieces[3] + ":" + pieces[13]; // TODO: Get these values based on json field name, not just index location (which may change and then be invalid!) + String userName = pieces[17]; + Session session = new Session(userName, sessionID); + return session; + } + + public static String executePost(String targetURL, String urlParameters) + { + URL url; + HttpURLConnection connection = null; + try { + //Create connection + url = new URL(targetURL); + connection = (HttpURLConnection)url.openConnection(); + connection.setRequestMethod("POST"); + connection.setRequestProperty("Content-Type", + "application/json"); + + connection.setRequestProperty("Content-Length", "" + + Integer.toString(urlParameters.getBytes().length)); + connection.setRequestProperty("Content-Language", "en-US"); + + connection.setUseCaches (false); + connection.setDoInput(true); + connection.setDoOutput(true); + + //Send request + DataOutputStream wr = new DataOutputStream ( + connection.getOutputStream ()); + wr.writeBytes (urlParameters); + wr.flush (); + wr.close (); + + //Get Response + InputStream is = connection.getInputStream(); + BufferedReader rd = new BufferedReader(new InputStreamReader(is)); + String line; + StringBuffer response = new StringBuffer(); + while((line = rd.readLine()) != null) { + response.append(line); + response.append('\r'); + } + rd.close(); + return response.toString(); + + } catch (Exception e) { + + e.printStackTrace(); + return null; + + } finally { + + if(connection != null) { + connection.disconnect(); + } + } + } +} \ No newline at end of file diff --git a/sync-public.sh b/sync-public.sh index 4250ca74..64229f90 100755 --- a/sync-public.sh +++ b/sync-public.sh @@ -18,7 +18,7 @@ REV=$1 } PUBLIC=$(cat .public_rev) -WORK_TREE=mcp804/src/minecraft +WORK_TREE=mcp811/src/minecraft export GIT_DIR=$WORK_TREE/.git if [ "$#" -ne 1 ] ; then git rev-list --reverse $PUBLIC..master | while read REV; do diff --git a/test.sh b/test.sh index 84589db5..a5b546e9 100644 --- a/test.sh +++ b/test.sh @@ -1 +1 @@ -./getchanges.sh && ./build.sh && java -jar minecrift-1.6.2-LOCAL-installer.jar && minecraft +./getchanges.sh && ./build.sh && java -jar minecrift-1.6.4-LOCAL-installer.jar && minecraft