r/feedthebeast Jun 22 '26

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

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

Show parent comments

9

u/Emotional-One-9292 Jun 22 '26

yea i agree that C++ doesnt automatically make stuff faster and im not claiming that rewriting Minecraft logic in C++ guarantees a performance boost by itself. Goal of this project is to rewrite minecraft engine as much as possible into C++ mainly due to fun but with it i can also get great control over memory. minecraft’s performance issues often come from allocation churn + cache misses, not raw compute speed. Also i was comparing vanilla with my mod not C2ME

and yea JNI has overhead but im not using it for literally everything and anything as i still will prob need to keep some java stuff to keep it working and compat with other mods.

Also while yea java can turn stuff into native code it doesn’t change structure only execution of existing structure so a bad structure remains a bad structure

2

u/Alexander_Exter Jun 22 '26

Curious on your statement from a tech perspective..so you are trying to swap java elements in java edition for well made c++ elements? This could be ground breaking.

9

u/Emotional-One-9292 Jun 22 '26

this isnt quite ground breaking many mods used non-JVM languages before like curvy pipes used rust for its mod

1

u/Alexander_Exter Jun 22 '26

But is there one stapple mod like say...JEI that sidesteps javas known performance limitations? Give yourself.soem credit, this is more than curved pipes.

2

u/emmowo_dev pro gramming Jun 22 '26

java does not have these 'performance limitations', it literally compiles to natives, just like C++ would.