r/GoldenAgeMinecraft • u/gargamel1497 Developer • Aug 05 '26
Discussion The decay of the Java source code
The source code of the Java Edition is in decay. We can all experience it by looking at how unplayable modern versions are without performance mods.
But performance is not the only thing. Bad performance is a result of overengineered code.
When I was making mods for Indev and Infdev during the beginning of my career the codebase was very simple and well-structured. The main class contained a lot more than it ideally should, but it's the fate of all Java codebases and there is no running away from it.
A few weeks ago I was revisiting 1.11.2 Far Lands and I noticed that the code was now a bunch of Factories.
I haven't seen the latest source code (why would I?) but seeing the dramatic change I'd bet it's ridden with layers upon layers of abstraction, factories, and so on.
String IDs are a huge part of it. Old Minecraft used numeric IDs. Later, in 1.8 I believe, shortcuts were added, but they still just pointed to those numeric IDs.
In 1.13, everyone's least favourite version, the numeric IDs went away for the most part, replaced by stringId's which are by definition much slower.
Bad performance is a byproduct of "good code".
And, on a sidenote, the reason the LCE runs so well on such old hardware is partly because 4J didn't give a phick about good code.
In Java when they ran out of space in the texture atlas they removed it, implemented automatic atlas generation, and all that nonsense which only wastes CPU cycles and makes the thing slower.
4J just increased the size of the texture atlas. Yeah.
Old Minecraft had two classes. Iirc their names were Block and Item, and they stored the static instances of every single block and item in the game along with their IDs and such.
Modern Minecraft probably has registries instead of this. And yes, for mods it is a godsent, but not so for performance.
That's been some yapping about things most people don't care about, so sorry about that.
-15
u/gargamel1497 Developer Aug 05 '26
I agreen't.
Good code is bad as while it makes you feel good it's most often terribly slow.
Fast code taken to the extreme, in the meanwhile, is often completely unreadable and unmaintainable.
That's why a balance needs to be maintained, and that's what Notch's code did.
There were no factories, no unnecessary strings.
There were performance issues, of course, but it wasn't due to the "good code overhead" as there is now.
And while yes, chunk loading and entities are crucial, the rest is also important. Even with the most efficient rendering and worldgen mods I can still feel that modern Minecraft is just slower than old Minecraft.