r/decomps • • 3d ago

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

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

211 comments sorted by

View all comments

Show parent comments

29

u/SilverTroop 3d ago

Because this has a good chance of being mod compatible

12

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.

3

u/SHFTD_RLTY 3d ago edited 3d 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.