
Microsoft open sources parts of Minecraft: Java Edition - aw1621107
https://minecraft.net/en-us/article/programmers-play-minecrafts-inner-workings
======
sleavey
Of note is the Minecraft website from 2011 [1], where Markus Persson said:
"Once sales start dying and a minimum time has passed, I will release the game
source code as some kind of open source. I'm not very happy with the draconian
nature of (L)GPL, nor do I believe the other licenses have much merit other
than to boost the egos of the original authors, so I might just possibly
release it all as public domain."

[1]
[http://web.archive.org/web/20110920065648/http://www.minecra...](http://web.archive.org/web/20110920065648/http://www.minecraft.net/game)

~~~
LolNoGenerics
He probably expected that sales would go down to irrelevant. That never
happened, instead he got an absurd deal. MS is open sourcing to satisfy
modders, eventually for more reach and cash. The intentions are very different
and it would be awful to blame notch for that.

~~~
TheKarateKid
The intentions may be different, but it doesn’t mean one of them has to be
bad. If MS makes money and users get to do more with the open source code,
it’s a win-win.

------
Sir_Cmpwn
Two of the most boring parts of Minecraft, unfortunately. Both are something
your average first year CS student could put together in a weekend or two.

If I can indulge in some self-promotion, I have written mountains of code
which implements many of Minecraft's behaviors down to the last detail, which
may be a more interesting candidate for study:

[https://github.com/sircmpwn/truecraft](https://github.com/sircmpwn/truecraft)

Seeing Balze3D open-sourced might end up being pretty cool, though.

~~~
lghh
> Both are something your average first year CS student could put together in
> a weekend or two.

Sometimes I see people and wonder which of these two things is true:

1\. They have no idea what the average developer actually is.

2\. They are lying to make it sound like they were elite when they were a
freshman in college.

~~~
Sir_Cmpwn
I did not go to college so I have to admit I'm not actually familiar with the
average freshman's skill level. That being said, these are basic and well-
understood problems solvable by the average, say, junior developer in the
industry. Less of a reach?

~~~
mclehman
Far, far lower than you're envisioning. There are certainly a lot of freshmen
who could easily do something at this level, but the average freshman would be
hopelessly lost (at least in my (recent) experience).

By the way, excellent work on Sway. I've been meaning to jump to i3 forever,
and decided to move to Wayland on my most recent install. I do have some bug
reports to send your way, though, I should get on that.

~~~
Sir_Cmpwn
Thanks! Please do send those along, though a patch is worth a thousand bug
reports.

~~~
mclehman
Indeed it is. I'm hoping to get the time to dig into it enough to submit a
patch, but school has me pretty busy at the moment.

------
aw1621107
The code is being open-sourced as MIT-licensed libraries. The libraries
mentioned in the article are Brigadier [0], a command parser and dispatcher,
and Data Fixer Upper [1], which is used to migrate older chunk data to newer
versions of Minecraft.

Apparently more libraries are in the pipeline to be open-sourced alone these
two. One possibility is Blaze3D, which is a rewrite of the rendering engine
that is planned on being included in Minecraft 1.14.

    
    
        [0]: https://github.com/Mojang/brigadier
        [1]: https://github.com/Mojang/DataFixerUpper

~~~
kristianp
Clickable links. If you indent text, that gets formatted as code.

[0]:
[https://github.com/Mojang/brigadier](https://github.com/Mojang/brigadier)

[1]:
[https://github.com/Mojang/DataFixerUpper](https://github.com/Mojang/DataFixerUpper)

~~~
erikb
Also the numbered quotation format is really without indentation. If I recall
correctly in restructuredText you can do the same to do quotations correctly,
and you could also put in strings instead of numbers, e.g. [<Author><Year>]
(might need Sphinx, a library on top of resT, or maybe a bibtex plugin).

~~~
aw1621107
Ah, is that the case? I just remember picking up the indentations for
references somewhere, and never really got around to finding out whether that
was the right way to do things. Looks like I need to change that habit

------
kccqzy
As some who loves the lens library in Haskell, this makes me in awe:

[https://github.com/Mojang/DataFixerUpper/tree/8b5f82ab78b30f...](https://github.com/Mojang/DataFixerUpper/tree/8b5f82ab78b30ff5813b3a7f3906cd3f4f732acf/src/main/java/com/mojang/datafixers/optics)

Profunctors, lenses, prisms, traversals… all there :)

~~~
suprfnk
Honest question, if you look at this:

[https://github.com/Mojang/DataFixerUpper/blob/8b5f82ab78b30f...](https://github.com/Mojang/DataFixerUpper/blob/8b5f82ab78b30ff5813b3a7f3906cd3f4f732acf/src/main/java/com/mojang/datafixers/optics/profunctors/ProfunctorFunctorWrapper.java)

Is that understandable to you? And does this really make solving some problems
easier?

I've dabbled a bit in Haskell, but never got further than functors,
applicatives and monads, and I always wonder whether this kind of stuff really
helps.

(It probably doesn't help that Java is very verbose, especially compared to
Haskell...)

~~~
bjz_
It probably could do with some examples, and better docs, but it seems like
they use this to update old chunks, which is a great use of lenses.

But yeah, you'd have to weigh that up against how ugly it turns out to be in
Java. It's not just because of the verbosity, it's the lack of being able to
abstract over type-level functions that makes it quite icky to implement these
abstractions in Java.

------
brylie
It would be really cool if Minecraft, Minetest [0], and Terasology [1]
development communities could somehow join together to create a cross-
compatibility between their games. There are a lot of open-source developers
in those communities who can combine efforts take voxel gaming to new heights.

[0] [https://minetest.net](https://minetest.net) [1]
[https://terasology.org/](https://terasology.org/)

~~~
fileeditview
Ha came here to leave a link to Terasology. A classmate created it back in the
study days. He went to work at a German game studio.

The project was joined by more and more contributers and has become really
impressive!

Minecraft-like games are not really my thing but I recommend it to most people
mentioning Minecraft :)

------
Cogito
Back when we were working on Bukkit, when Dinnerbone and the other three were
aquihired? by Mojang, one of the main things they wanted to do was implement a
proper modding interface into the game.

Lots of things conspired to make that not happen, undoubtably including
feature creep (because it was going to be the official mod api, it had to be
_correct_ not just good), but it finally looks like they're moving in that
direction.

------
bredren
Worked on a fairly major PvP minecraft community / mod website at the start of
this year. Minecraft PvP is sort of a competitive set of modifications that
build out entire networked games. The games use normal minecraft concepts like
item consumption. Almost all "fighting" is done with swords, with people
clicking their mouse very fast.

All of the mods were based on 1.7.10, which is pretty far back, looks like
1.13.1 is the latest.

There are still a lot of young people playing minecraft PvP, particularly
outside the US. But you could tell even then that Fortnite was eating up
younger players.

------
Immortalin
Minecraft's deobfuscated source is publicly available for viewing for those
who are interested through Minecraft's Mod Coder's Pack.

~~~
jtl999
Isn't that just reverse engineering and cleaver renaming based on what the
functions/variables actually do?

~~~
naikrovek
"just"

~~~
jtl999
So your implying that it's not trivial. I acknowledge that.

What I was implying is that a third party deobfuscation project by reverse
engineering with minimal input from the original developers would presumably
be different in terms of variable/function names, etc, comparing it to the
original source.

------
jarym
I looked at DataFixerUpper - should I be surprised that there appears not to
exist even a single test for this piece of engineering?

Boggles my mind that someone would engineer something so sophisticated and not
write even a high-level test script of some kind.

~~~
IanSanders
This comment is why people think twice before opensourcing their code

~~~
jarym
Maybe.. but this is a VERY sophisticated data migration utility.

It going wrong can mean crippled data!

I am certain /some/ code must exist to allow the authors to verify it does
what they want so my question is more: where is it?

------
grenoire
This seems to only be the command engine itself, which by the way is the sorry
excuse for modding support that Mojang put out after Notch's promises. Not
particularly exciting, but Blaze3D seems a little more interesting.

------
thx4allthestuff
Thank you for your hard work. I've enjoyed countless hours meditating while
chipping away at blocks that later went towards my castles. Anything further
that you choose to release, I thank you again. And thank you for providing the
venue to allow me to connect with my little brother, for that I can never
repay you.

------
zarify
Not really that surprising since there seems be a lot of focus on things like
Minecraft Education Edition, which isn't Java based.

(Which, as a teacher, I am finding a fantastic tool for both introductory
programming and other topics)

------
axiometry
Why did they choose to implement various functional programming concepts from
scratch? Were there really no suitable preexisting implementations at the
time?

------
travbrack
What is something one could develop with this source code that would have been
more difficult or impossible before?

------
jtl999
Interesting, but how much of this has been reverse engineered from decompiling
the Java classes already?

~~~
userbinator
That's what I thought too at first --- Java (and .NET) is so easy to decompile
that having the original source is not so much of a big deal.

------
yuhong
I remember BUILD 2015 when a Minecraft mod was used as a demo and the team
complained.

------
Kenji
Instead of open sourcing code, they should fix the Aquatic update. All
Minecraft versions after 1.13 are literally unplayable for me (mid to high end
gamer PC) due to freezes. Every 5 seconds, the game freezes for two seconds
for me. Increasing RAM for the JVM was useless. After the update, the game
needed more than 3GB of RAM when before it ran just fine on 1GB (I have 16GB
of RAM so no problem there, but the game still freezes). I have never seen
more broken updates except with Skype - which, now that I think about it,
makes perfect sense, considering it's also from Microsoft.

Why would I use their game library when they ship such incredibly broken
updates?

~~~
myrandomcomment
1m people play the game with no issues. Did you open a support case? Did you
open a bug? What’s the ID? Also giving more RAM to Java is a bad thing as GC
can cause lag. I run 1.13.1 on an old AMD 2ghz under Windows 7 with a Nvidia
cards from 2011 and get 30-90fps. Also runs fine on my 2017 MacBook and on an
intel compute stick (i5, 4gb ram, Win10 on a 4K screen). Something else is
your issue and you just see it in the game.

~~~
Kenji
I updated my Nvidia graphics driver and that fixed the issue. It's probably a
case of Minecraft using the OpenGL API wrong and the driver needing to
compensate for this broken usage of the API.

