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

Show parent comments

0

u/boringfantasy Aug 05 '26

I’m not a vibe coder lol. I review AI code and so do my colleagues. It’s not GPT 3.5 anymore, stop burying your head in the sand.

5

u/gargamel1497 Developer Aug 05 '26

I don't use AI and I never will.

I actually want to be a good programmer and not a vibe coder. I want to be the author of my code.

The overengineered serialization code, even though it runs like ass, is something I'm rather proud of. Because I wrote it. I designed it. I implemented it.

Vibe coders don't get that feeling. Or if they do, it's fake. It's not their code that they are writing.

0

u/boringfantasy Aug 05 '26

Alright it’s your right! But in industry, it’s going to impact your productivity if you don’t use it and you may get subpar performance reviews. Most of us are just trying to get through the day. We still care about quality; but speed is incredibly important these days also.

3

u/gargamel1497 Developer Aug 05 '26

Yeah, you gotta type fast or your latest javascript framework will become outdated even before you fully switch to it lol.

2

u/boringfantasy Aug 05 '26

We work in C++ and Go mostly.

Most of us are just trying to make ends meet. We can’t all moral grandstand.

4

u/Kurtisdede Aug 05 '26

You have to keep in mind that you're probably talking to a teenager who doesn't know how the sector works.

1

u/boringfantasy Aug 05 '26

Yeah fair enough.