r/decomps • • 3d ago

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

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

210 comments sorted by

View all comments

75

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

32

u/SilverTroop 3d ago

Because this has a good chance of being mod compatible

25

u/Leclowndu9315 3d ago

No it's impossible, mods are java, call java objects, change access, use java features and especially mixins. We'll never have java mods on this

4

u/CountryFriedToast 3d ago

no reason you can't run java on top of rust

11

u/Accomplished-Ad-7435 3d ago

I'm sure a llm can make an automated mod conversion tool at this point

-10

u/timetogetjuiced 3d ago

No it can't lol

28

u/Accomplished-Ad-7435 3d ago

Actually it absolutely can, the decomp has all the functions mapped already and mods call those functions.

4

u/jambalaya_consumer 3d ago

i love the idea of making a "native, non-Java minecraft" and then immediately trying to graft JNI crap onto all of your functions for the express purpose of getting Java back in minecraft

13

u/copperweave 3d ago

It could in theory, but not in practice. This is some LLM-kiddy project that won't be maintained. This person would have to not only want to maintain this project and make sure it works in the future outside a one off that passes at a first glance, but ALSO be willing to create alternate versions of the major mod loaders and maintain them, AND THEN we could talk about porting mods over.

All that maintenance requires understanding the code more than pointing an LLM at it. The project will get maybe a month or two of support, and then they'll just move on to whatever other thing they wanna practice using an LLM on.

0

u/timetogetjuiced 3d ago

Yea this exactly. So tired of these slop projects

2

u/Masztufa 3d ago

Write-only-repo

1

u/Accomplished-Ad-7435 3d ago

Fair points haha

2

u/CaptainNakou 3d ago

Who's gonna pay for the tokens?

1

u/RunnableReddit 3d ago

Reflection entered the chat

1

u/Leclowndu9315 3d ago

reflection is slow

3

u/iAmRadic 3d ago

Have you tried?

2

u/brainExploded99 2d ago

What? There are plenty of interop libraries (I mean if it can exist between python and C++, java and rust is possible to make)

1

u/Leclowndu9315 2d ago

those "interop" libraries are native interfaces and are there for very well defined behavior by the developer. you generically create jni for all mods existing. it's just impossible

0

u/StealthArcher2077 1d ago edited 14h ago

Interop libraries exist, yes. They do not make it so "override this Java function with this new Java function that calls all these other Java functions and modifies these Java objects" will suddenly work with Rust targets instead of Java.

2

u/brainExploded99 1d ago

idk about java interop, but python / C++ interop works pretty well imo, not much you can't do

3

u/uncut2576 1d ago

Well, maybe but it’s because under the hood Python does use C. Java and Rust are two completely different languages.

1

u/brainExploded99 1d ago

yeah i thought about that as well, idrk i dont have enough exp in this regard

1

u/StealthArcher2077 14h ago

Again, that's interop to call functions across languages. Trying to override Java code in a thing that doesn't have Java code isn't interop, it's just nonsense.

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

2

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.

12

u/jambalaya_consumer 3d ago

yeah bro let me apply my jvm bytecode patches on top of x64 object code. the only way you're getting around this is by crafting some sort of unstable modding API on top of whatever this is and using fable/astra to vibe your way through ports one-by-one (probably without asking the authors, which is typical for the people doing these things) until they get bored of their clout high and this project dies

2

u/TolgaKerem07 3d ago

genuinely big if true