Thought I'd post a guide on how to run Minecraft on LWJGL3 using the above.
The actual MC source code is not available but there is a nice tool called MCP
(really impressive what its able to provide modders, using some really cool magic). ATM (as far as I'm aware) the max version it supports is MC 1.7.10 so that is what we will use below.A. Setting up in Eclipse
1) Using MCP 9.08 for MC 1.7.10 - decompile MC & open in Eclipse
2) Fix the build errors on the build path, namely remove realms*.jar and authlib*.jar and add the new versions of the same (right click 'Client' -> properties -> libraries tab)
3) You should now be able to run Minecraft in Eclipse (will be using LWJGL2)B. Add Paulscode Sound System LWJGL Plugin
Since this library plugin which MC depends on uses LWJGL2 it also needs to be ported (source is only 3 classes)
1) Remove the librarylwjglopenal20100824.jar from the build path.
2) Grab the source code for the lwjgl plugin from paulscode site here
3) Copy the contents of the src folder from the above zip into the src folder of the Client project in Eclipse.
MC should continue to run as before at this pointC. Replacing LWJGL
1) Remove lwjgl-2*.jar and lwjgl_util-2*.jar from the build path.
2) Remove/Delete the LWJGL2 natives from the folder Client->jars->versions->1.7.10->1.7.10-natives folder (just the lwjgl and openal natives)
3) Grab the latest nightly build of LWJGL3 from lwjgl.org
4) Add LWJGL3's lwjgl.jar to the build path
5) Copy the relevant LWJGL3 natives to the same location where the LWJGL2 natives were (Client folder jars/versions/1.7.10/1.7.10-natives). This is because the native path is already set to this location and contains the other natives MC uses.D. Updating the Source
You could manually replace all the non opengl and openal imports from "import org.lwjgl.*" to "import org.lwjglx.*", however since there are so many references we can use some regexp magic to do it automatically for us.
1) Open Eclipses file search dialog (Ctrl + H and click the file search tab)
2) Enter the following regexp in the 'Containing Text' box:
(import org.lwjgl)(.BufferUtils;)|(import org.lwjgl)(.LWJGLException;)|(import org.lwjgl)(.Sys;)|(import org.lwjgl)(.opengl.ContextCapabilities;)|(import org.lwjgl)(.opengl.Display;)|(import org.lwjgl)(.opengl.DisplayMode;)|(import org.lwjgl)(.opengl.GLContext;)|(import org.lwjgl)(.opengl.OpenGLException;)|(import org.lwjgl)(.opengl.PixelFormat;)|(import org.lwjgl)(.openal.AL;)|(import org.lwjgl)(.input.Keyboard;)|(import org.lwjgl)(.input.Mouse;)|(import org.lwjgl)(.util.glu.GLU;)|(import org.lwjgl)(.util.glu.Project;)
3) make sure you tick the regular expression check box and in file name patterns choose *.java files only
4) click the 'Replace...' button and then in the 'With' box enter the following regexp and click OK
5) That should update all the relevant importsE. Adding LWJGLX and final fixes
1) Grab/download the source code for LWJGLX from here
and copy the contents its src folder into the src folder of the Client project
2) The above should fix all errors in the project except for two lines in Minecraft's OpenGlHelper class
3) On the first error line replace the "ARBShaderObjects" part with "org.lwjglx.opengl.ARBShaderObjectsx"
4) On the second error line replace the "GL20" part with "org.lwjglx.opengl.GL20x"
All errors should be fixed and MC should now run using LWJGL3.
Issues you may encounter
- On systems running in HiDPI resolutions (especially OS X), you may get a quarter sized screen, can be fixed by amending some of the glViewport calls to use Display.getFramebufferWidth() and Display.getFramebufferHeight().
- The textures on the ingame terrain blocks are black, not sure what the cause of this is yet, since not familiar with how its rendered in MC and what opengl calls the terrain code uses (and harder to isolate with decompiled code). I suspect it might be a LWJGL3 issue because we've only changed the windowing code and not touched any of the OpenGL calls. Another possibility is that there has been some API change in one of the LWJGL3 OpenGL calls but the method inputs have remained the same as LWJGL2 hence no errors were shown at compile time causing the output to be different.