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.
20
u/Sad-Fix-7915 Aug 05 '26
Performance-wise, vanilla 26.2 absolutely shit the fuck out of 1.13, 1.7.10, heck even b1.7.3 and Bedrock edition (*since renderdragon) and that's without Vulkan. Unless you are running the game on say a Pentium 4 with a 5400rpm HDD...?
Modding-wise?
Numeric IDs are not sustainable. Back in 1.12, beds were block entities due to that exact reason.
Modern Minecraft is primarily data-driven. World generation, terrain features, villager trades, enchantments, loots and so on are defined via datapacks. They are way more convenient, easier to work with, much more extensible and not gonna lie the "performance hit" you are talking about is barely noticable (if it even exist)
Registry system is a godsend you can't convince me otherwise.
Atlas stitching is slow, yes, but with the addition of respack atlas definition that is mitigated somewhat.
DFU is also really good (albeit overengineered I'd say), and performance is no longer a problem as in latest updates.
You legit can't tell me static instances of block/item and whatnot are better than a full fledged extensible registry system, with per-item properties and component being dynamic and can be re-used anywhere.
Good maintainable code > fast non-sustainable code