Back

Iron devlog 1: Some history

The story of how Iron (the server software I made, not the metal etc.) as it currently is came to be.

June 22, 2024


Welcome! I’ll go ahead and try something different from what I usually do in this blog: detailed development logs.

This series is about Iron (originally known as goserver), a Minecraft Classic server implementation written in Go.

I’ll start with the story of how it got to where it is now.

Here we go!

A far away dream

The history of Iron dates back to 2021.

Back then, I was just starting to learn Go and I didn’t really know what I was doing… at all.

But I decided, as a fun little project, to make a bot which connects to a Minecraft Classic (0.30) server and spam rickroll links in the chat, because funny.

I never used it on anything other than a localhost testing server, and never released the source code for that, but that was my first experience writing anything which uses the Minecraft Classic multiplayer protocol, and the actual purpose of that project was to learn it.

Then I had an idea. What if I made my own server-side implementation of the multiplayer protocol too?

This idea stuck with me for a long time. A very long time, in fact.

At the time, however, I figured this would be nearly impossible to get right, because (knowing that level.dat files do this) I figured that they sent a serialized representation of the com.mojang.minecraft.level.Level Java class to the client, meaning that a server-side implementation would have to reimplement that Java-specific serializer. That’s also why I didn’t bother adding block data support to my client-side implementation.

So, for a while I gave up on it, and thought that perhaps some day I’d get around to it.

That day was August 23, 2022.

That’s when I decided to give it a try, because I realized while reading the code of existing server-side implementations that the world data (in this case at least) is not a serialized Java class, but is actually just a basic byte array!

Then I started writing the code.

A small prototype

During that day, I created a directory in my home directory called “goserver” and started building an implementation. I had no idea how quickly that initial prototype would turn into a fully usable program.

By the second day of development, I had it successfully generating a flat world and sending it to game clients.

Then I implemented world saving, perlin noise based terrain generation, chat messages, and eventually showing other online players! (that last one took a very long time, and if I recall correctly it still doesn’t work correctly on ClassiCube for mysterious reasons)

By the next week, I had something fully usable, and, dare I say it, almost production-ready.

However, I also had some problems with making it, and anyone who knows me IRL knows that school starts in late August for me, which in this case was about two days after I started the project. Worst possible timing.

Releasing the code

The thing is, I didn’t want this to just sit on my SSD and slowly bitrot - I wanted to build something useful!

So, on September 3, 2022, I created an email address with ProtonMail, a GitHub account, and then made a cool profile avatar with Inkscape, which is still my profile avatar to this day. (fun fact: I was originally going to use the username bitshifter, a reference to the bit shift hackery in goserver - looking back on this I’m glad I didn’t choose that name though…)

I didn’t have much time that day, and putting goserver on GitHub wasn’t on my mind at the time.

But then as the days went by I eventually started wanting to release at least some of my code. And goserver seemed to be a pretty good choice. So on September 5, 2022, I released the code for goserver with the MIT license, hoping that at least someone would find it useful, or at least cool. And I was right.

Within ONLY A FEW DAYS after releasing it, someone sent me an email about goserver (you can imagine my excitement when I read it), and that person is not only the first ever real user as far as I know but is also still in contact with me, although less frequently.

Committing like Sisyphus

Within the weeks after release, I made plenty of Git commits to the repository. From fixing bugs to adding huge new features, it was slowly but surely becoming something really useful.

But then I had to start focusing on school, and by September 18, 2022 goserver didn’t get any commits at all for over two weeks until October 5, 2022.

This pattern of committing less frequently over time would continue.

And by the end of 2022, I had mostly abandoned the project. And it stayed that way for almost a year.

Strangled by an octocat

Then I got an email from GitHub around June to July of 2023 telling me that they would start requiring 2FA in August.

I had already been mildly annoyed by Copilot literally stealing code in the past, but forcing me into 2FA was the straw that broke the camel’s back.

Around the same time, I started to also learn about the FSF philosophy and the GPL, and started to increasingly become more of a “free software” person than an “open source” person. So GitHub itself being nonfree also made me consider switching to a free as in freedom software forge too. (and no, Iron has not yet switched to any form of the GNU GPL, nor do I plan to do that as of writing this, but that’s not a definitive answer)

So I decided to switch to Codeberg, and I never gave in to GitHub’s demands, having moved everything of importance to me over to Codeberg and deleted the old GitHub repositories instead of just archiving them to make sure they don’t even get search results for my things going forward.

I could go on and on about the story about me switching to Codeberg, but that’s the general overview. Once you realize the full story though, it will make GitHub look MUCH worse than I think anyone reading this realizes. But that’s a story for another day.

Reviving the forgotten legend

A few months later, on September 30, 2023, I finally got around to cleaning up old legacy experiments and making some small improvements. But it was only a few small commits, nothing special.

And, once again, it remained that way for many months, until May 13, 2024 when SkyeForeverBlue made a pull request which fixed a small error in the README.md file. I found it pretty cool that there was demand for my little Minecraft Classic server program again, but I didn’t care enough to actually maintain it.

Or at least until June 17, 2024. That’s when I renamed the project to Iron (because goserver is way too generic and was never intended to be the permanent name) and started refactoring the codebase to catch up to my current standards for Go code.

What’s next

And here we are now, a few days after that. The plan is to rewrite almost all of the code from scratch and make goserv- I mean Iron, into a production-ready Minecraft Classic server (those words sound so weird when used together, don’t they?) which is a relatively lightweight and most importantly fun option for Minecraft Classic server software.

The biggest problem I’ve faced thus far is that my past self could not possibly figure out a task as simple as writing bytes to a socket in a way that didn’t suck. I initially did this by creating byte slice buffers for each packet and then reading/writing to/from each client socket as needed, but eventually I wrote an abstraction called PacketWriter/PacketReader, which somehow made things even worse.

I also plan on implementing TLS and WebSocket backends for the protocol code, allowing for better security and more interesting possibilities.

It might sound like a mess, but once you learn the quirks the Minecraft Classic server protocol is truely amazing and I highly recommend that anyone trying to get into networking should make their own implementation, starting with a client-side implementation like I did. Who knows - maybe some day, years from now, you’ll find yourself in the same position as me, trying to make the best possible multiplayer server software for it.

Or maybe you’ll start contributing to an existing project like ClassiCube (I definitely recommend trying out ClassiCube as well as trying out the original Minecraft 0.30 from 2009 with the Betacraft launcher) or, yes, Iron. Who knows.

While Minecraft 0.30 is almost 15 years old now, the legacy it had lives on to this day. It’s truely a beautiful demonstration of how less can be more. And I hope that it stays that way.