Live data from Hacker News

Minecraft removing obfuscation in Java Edition

minecraft.net

341–350 of 478 posts

Re: Minecraft removing obfuscation in Java Edition

#341

It's extraordinary to me that Minecraft is both the game that has the most robust mod community out there and that the modders were working from obfuscated, decompiled Java binaries. With elaborate tooling to deobfuscate and then reobfuscate using the same mangled names. For over a decade! What dedication.

Java is pretty easy to decompile and it's not a huge amount of effort to poke into the generated JVM code and start doing things. If you have a decent idea of how VMs work, C-like languages work, and how object dispatch works it's really not that hard. Also the early modding scene for Minecraft was really fun. I was a huge Minecraft player at the time and was early into the deobfuscating -> modding scene and the comm…

Decompiling Java is trivial, as Java bytecode more or less maps directly to textual Java code. Deobfuscating is a monumental manual effort.

Re: Minecraft removing obfuscation in Java Edition

#342

Earlier quoted context omitted.

Not sure if I understand exactly what you mean by reified, but Minecraft has a ton of minigames based on server-side mods which clone other popular games. Sometimes popular Minecraft minigames/mods even get implemented as standalone games. Battle royale games were almost certainly heavily inspired by the Minecraft minigame which predates them. Factorio has the old industrialcraft mod as an acknowledged inspiration. V…

Arent battle royale games inspired by things like The Hunger Games or Battle Royale? All the server minigames like that that I recall from back in the days were named something like Hunger Games

Yes. The Hunger Games film and book inspired by the Japanese film "Battle Royale" in turn, inspired the Minecraft minigame. But later battle royale games were inspired by the minigame, not the films directly. A shrinking world border, for instance, is pretty important to make the concept work (in a film, it doesn't actually have to work!).

Last man standing formats were perfectly possible in traditional FPS formats too, but they weren't really a thing because to actually be fun, the format needs

1. Big maps and lots of players (more than the typical FPS)

2. A "searching for loot" mechanic, where you can increase your chances of survival by looking for good items, making interesting risk/reward tradeoffs and discouraging just turtling up in the most defensible location.

3. Shrinking borders, to prevent an anticlimactic endgame of powerful players searching for hiding stragglers.

Minecraft basically had all three since 2014, and there were quite popular last man standing formats like UHC even before they had world border (and before the Hunger Games film came out).

Re: Minecraft removing obfuscation in Java Edition

#343
post #137

Earlier quoted context omitted.

More proof that you don't need the source code to modify software. Then again, Java has always been easy to decompile, and IMHO the biggest obstacle to understanding is the "object-oriented obfuscation" that's inherent in large codebases even when you have the original source.

First time I have heard of object-oriented obfuscation. I get it, but in general I don't get the OO hate. It's all about the problem domain imo. I can't imagine building something like a graphics framework without some subtyping. Unfortunately, people often use crap examples for OO. The worst is probably employee, where employee and contractor are subtypes of worker, or some other chicanery like that. Of course in th…

[dead]

Re: Minecraft removing obfuscation in Java Edition

#344

Earlier quoted context omitted.

> I think the OO hatred comes from how academia and certain enterprise organisations for our industry picked it up and taught it like a religion. This, this, this. So much this. Back when I was in uni, Sun had donated basically an entire lab of those computers terminals that you used to sign in to with a smart card (I forgot the name). In exchange, the uni agreed to teach all classes related to programming in Java, a…

> One of the professors actually said C was dead because Java was clearly superior. In our uni (around 1998/99) all professors said that except the Haskell teacher who indeed called Java a mistake (but c also).

Turns out everyone was completely wrong except for that one guy working in Haskell.

Tale as old as time.

Re: Minecraft removing obfuscation in Java Edition

#345
post #226

Earlier quoted context omitted.

It's very useful in C++, funnily enough. This is because I can have a non-templated interface base class, then a templated impl class. Then my templated impl header can be very heavy without killing my build times since only the interface base class is #included. Not sure if this is as common in Java.

Using more complex architecture (which requires more human time to understand) to merely make build time shorter is a ridiculous choice.

For a large project this could save hours of developer time.

C++ is a hell of a language.

Re: Minecraft removing obfuscation in Java Edition

#346
post #275

Earlier quoted context omitted.

Yeah in some ways the obfuscation and mappings are similar to minification and sourcemaps in javascript.

And minification in JavaScript only reduces the amount of bytes that has to be sent over the wire, it doesn't improve runtime performance.

According to the v8 devs it also can increase parsing performance

> Our scanner can only do so much however. As a developer you can further improve parsing performance by increasing the information density of your programs. The easiest way to do so is by minifying your source code, stripping out unnecessary whitespace, and to avoid non-ASCII identifiers where possible.

https://v8.dev/blog/scanner

Re: Minecraft removing obfuscation in Java Edition

#347
post #120

Earlier quoted context omitted.

As someone whose kid has pulled me into the world of using mods (though not (yet) making them for Java Edition) I think this PSA is worth sharing of how to use minecraft mods without pain and with minimal risk, in case anyone is getting started, or has gotten started and finds it frustrating: 1. Use MultiMC to manage instances with various mods, since mods are rarely compatible with each other, and since each version…

> 3. Curseforge's website and modrinth both seem to be legit places to get mods from. I personally find the installable Curseforge program itself to be bad and spammy, and would never use that, but the site still lets you directly download the jars you need, and lets you check "Dependencies" to find out what other mods you need. PrismLauncher, a popular MultiMC fork, has direct integration with Curseforge and Modrint…

PrismLauncher is excellent, it feels like it found the right level of abstraction. Automates chores without black-boxing what it's doing.

And there's a makedeb for it! https://mpr.makedeb.org/packages/prismlauncher

Re: Minecraft removing obfuscation in Java Edition

#348

It's extraordinary to me that Minecraft is both the game that has the most robust mod community out there and that the modders were working from obfuscated, decompiled Java binaries. With elaborate tooling to deobfuscate and then reobfuscate using the same mangled names. For over a decade! What dedication.

Me too. Having only a vague familiarity with the game, I thought that mods were using some official plugin system. I had no idea that minecraft modders (presumably kids/teens?) were not only reverse engineering things but also creating an entire ecosystem to work around proguard.

Actually more common than you might think.

Bethesda games have the same ecosystem - they do provide an official plugin system, but since modders aren't content with the restrictions of that system, they reverse engineered the game(s, this has been going on since Oblivion) and made a script extender that hacks the game in-memory to inject scripts (hence the name).

Re: Minecraft removing obfuscation in Java Edition

#349

Earlier quoted context omitted.

Very few people use mojang mappings -- the two big modloaders, forge and fabric (and their derivatives) have their own mappings respectively, due to the restrictions of the mojang mappings. It's possible to use the mojang mappings, but much less common.

PaperMC exclusively uses Mojang mappings, and it's the most popular loader for server-side modding these days.

Paper isn’t a mod loader, it uses Fabric under the hood. Also, what makes you think it’s the most popular server? I thought it was fading. I switched my server from Paper to Fabric years ago.

Re: Minecraft removing obfuscation in Java Edition

#350

There is always one thing that I found so facintating with the modding scene in Minecraft. Because Minecraft does not have a modding api but the java byte code can be changed. People simply developed their own way of creating an API. There are 2 main modding APIs. Forge/Neo-Forge and Fabric. [1]Fabric uses Mix-ins while [2]Forge uses a more event based system that is added to the source code of minecraft where they a…

> I wonder from a modding perspective would it be better if all public methods are just the API users can call and they themselves create a way for mods to exist? It's the way vintage story implemented modding. They developed the whole game as engine + modapi + hooking engine for stuff outside of hookapi. Then most of gameplay is implemented as mods on top of engine using api and hooking. And those tools are open sou…

You are right! I totally forgot about Vintage Story, I only read about it briefly.

> ... you can't really open all the interfaces and expect it to be stable without making some huge trade offs.

Another game I often play with a huge open interface is Crusader Kings 3 and paradox games in general. Most of the gameplay is implemented in their scripting language for the engine. But as you said when the game gets a big update most mods simply dont work anymore.

If the support of the community dies down many mods with much work and craft dont get updated anymore and rot away as the game gets updates. Quite sad actually.

Thats why I also quite like Star Wars Empire at War mods. The game does not get any updates anymore. The API here is mostly frozen, even old mods still work.

Post reply on HN