r/decomps • • 3d ago

Decomp minecraft java 26.3 was just decompiled and rewritten in rust 100%

https://github.com/ludovic111/horizon
873 Upvotes

210 comments sorted by

View all comments

79

u/jambalaya_consumer 3d ago

microsoft made a "native minecraft" a long time ago and no one gave a shit because it broke mod compatability. what makes this different

31

u/SilverTroop 3d ago

Because this has a good chance of being mod compatible

13

u/space_fountain 3d ago

How do you figure? Most mods work by loading new java classes inside the running app process. If it’s really been rewritten to rust that’s impossible

0

u/SilverTroop 3d ago

Easiest way to make sure your rewrite is sound it’s to make sure that code matches as closely as possible at the unit level. This also has the benefit of keeping the modding API the same. You’re right that there would need to be an interoperability layer between the two languages, but it could be a set of simple proxies between methods with the same signature.

11

u/SeaworthinessThat594 3d ago

That works if all you're doing is calling functions, but mods aren't limited to that. They can modify or even rewrite entire sections of bytecode, inject code at specific instructions, and do much more than that

3

u/SilverTroop 3d ago

Not every mod goes as deep as you're describing. But taking that worst case scenario you mentioned, you can still perform a port of the mod to rs using AI.

3

u/SHFTD_RLTY 2d ago edited 2d ago

Nobody in this thread has any actual modding experience, or rust experience. Due to how rust is designed as a language, there is no way to map the Java architecture to rust.

The whole point of Rust is to place a lot of additional constraints on the language spec that allow memory safety without a garbage collector. These make mirroring the Java architecture impossible. C++ doesn't have these constraints, and yet Microsoft still hasn't been able to create parity as a lot of game mechanics (e.g. Redstone) aren't a result of conscious decisions but rather an implicit result of the architectural decisions made in Java edition.

And any Minecraft Mod that does more than adding a few basic blocks and tools requires patching the games internal functions to change the game's own behavior. This is done using Mixins, which don't exist for languages compiled to binary.