Thinking about a post Java 8 world
See original GitHub issueThinking about a post Java 8 world
It seems quite likely that minecraft will recieve an update of Java in the near future. The latest version of the launcher has support for alternate Java versions, and the latest snapshot dropped support for the old GPUs that were forcing the use of an ancient version of Java 8.
My guess is Java 16 will be the target, mainly due to having some neat features that I can see Mojang wanting to make use of, most notably records.
This issue is just a place to gather thoughts / be a todo list of what would would need to required to get the whole fabric toolchain updated to support this. In someways most of the work has already been done over time. Moving our CI/CD setup to github actions means we already test, build and release from Java 15. (While targeting Java 8)
A lot of the following items in the “todo list” assumes that records are being used as this is where most of the work left is. The following list is somewhat in order of what would need to be done, however some of the tasks can be done independently of each other, or even at a later date.
Items with a 🔍 emoji might already be done/need investigating.
Record mapping
-
Record fields and methods should be mapped as usual. Record components can just be based off the field names and reuse the field javadoc. This removes the need to update the mapping format and removes the pain with V1.
-
Tiny remapper and friends will need updating to support this.
Yarn/Intermediary
This section contains what would need to be done to get Yarn/Intermediary working.
- Matcher
- Support the above record changes.
- Support matching records 🔍
- Stitch
- Jar Merging - Used by Loom and Yarn
- Remove/dont update: Intermediary gen/updating as matcher can do this.
- Engima
- Add support for records in the mapping format
- 🔍 Check record remapping, I did brefily check this a while back and it seemed ok on the surface. I imagine the saving/loading will be missing.
- Intermediary
- Should generate the same field and method names for record components,
comp_x
?
- Should generate the same field and method names for record components,
- Yarn
- Should be quite easy once all the tools/libs are in place, just update them in the build.gradle
- Should be able to build and remap a namedJar before releasing intermediary or yarn!
- Should be quite easy once all the tools/libs are in place, just update them in the build.gradle
Fabric Loader
- Should just work in theory?
- Might have issues with a mismatching guava version assuming that gets updated at the time time
- Java 8 support should be kept here for the foreseeable future for older minecraft versions and other games.
Loom
- New branch
- Bump to build against J16 and Gradle 7 (Required for J16)
Fabric API
- Should be quite simple in theory, Just update loom / Target J16
- Modules? - Should not be forced onto modders.
Access Widener
- Sealed Classes support? Easy to do, still in preview so prob unlikely its being used.
There are going to be quite a few unforseen issues ontop of this, but I dont believe I have missed anything major. This clearly will take some time to handle, but it doesnt need to be perfect on the first go, we target snapshots so we have time to break things.
Feel free to point out stuff I’ve missed/provide ideas on things this is just what I have in my head.
PRs working to support this:
fabric-loom : Javadoc support for records intellij-fernflower : pulls in upstream changes containg a number of useful fixes.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:5
- Comments:26 (23 by maintainers)
Top GitHub Comments
Preview features wont be enabled, there is little to gain in j16 with them.
More precisely MC doesn’t appear to use any Java 16 feature yet, it looks like Java 8 code built with Javac 16. So the breakage is yet to come 😉