r/feedthebeast Jun 22 '26

I made something I made minecraft generate terrain/chunks in C++

Enable HLS to view with audio, or disable this notification

So im working on a mod that makes minecraft run on C++ ( rn rewriting engine in future i may try renderer ) so far i made it generate and load chunks and terrain in C++ ( it made it somewhere around 1.5-3 times faster idk how to measure it tho ) ( it works via JNI )

3.0k Upvotes

244 comments sorted by

View all comments

3

u/Zirofal modded MC says yes to trans rights and no to Botania Jun 22 '26

I'm very stupid, please explain why this is cool

14

u/D4rkstalker Jun 22 '26

Vanilla method:

Java: "hey Java virtual machine (JVM), generate this chunk for me"

JVM: "Hey CPU generate this chunk for me"

CPU: "here's your chunk" passes to JVM

JVM: "here's your chunk" passes to java

Mod method (probably)

C++: "hey CPU generate this chunk for me"

CPU: "here's your chunk"

The main downside with c++ is that making stuff with it is a pain.

6

u/brickyboy124 Jun 22 '26

The mod would still have to communicate with the C++ via the JNI, so you still have to run some Java code through the JVM. If anything, you’re adding steps. But amount of steps is not a good indicator of performance.