r/GoldenAgeMinecraft • 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.

0 Upvotes

38 comments sorted by

View all comments

2

u/Pannoniae Aug 05 '26

it's pure facts though :)