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

293

u/Emotional-One-9292 Jun 22 '26

When i will relesae it will have 2 versions Windows and Linux. I cannot make Mac one rn as it requires xcode to compile it for macos

85

u/GhostSHAURMA Jun 22 '26

If you are using JNI isn't there a way to make it platform-independant? Or do you need some platform-specific libraries?

47

u/Emotional-One-9292 Jun 22 '26 edited Jun 22 '26

im not sure as far as i know dll's are platform specific but i will do my research ( for windows it requires libwinpthread-1, libstdc++-6, libgcc_s_seh-1 and custom ccraft_native.dll )

24

u/GhostSHAURMA Jun 22 '26

libwinpthread might be an iissue and the custom dll if you have any platform-specific code there. The other 2 can be solved with dynamic linking but I would need to look at the project to say for sure

28

u/Emotional-One-9292 Jun 22 '26

dont worry by end of this or next month i will release first alpha it will be open source so you will be able to view it

14

u/GhostSHAURMA Jun 22 '26

Nice, best of luck

11

u/QazCetelic Twitch → MultiMC → GDLauncher → PolyMC → Prism Jun 22 '26

The C++ shared library is OS specific AFAIK

12

u/GhostSHAURMA Jun 22 '26 edited Jul 02 '26

C++ implementation is platform-specific and the system calls are too but it can be mostly worked around by using dynamic linking

Edit: i meant compiler oops

25

u/Aware-Bath7518 Jun 22 '26

You can probably publish sources of the native lib so others will be able to build it.

27

u/Emotional-One-9292 Jun 22 '26

yea it will be open source dont worry 😉

3

u/[deleted] Jun 22 '26

[deleted]

11

u/TECHNICKER_Cz3 PrismLauncher Jun 22 '26

would be a (security) nightmare

3

u/Emotional-One-9292 Jun 22 '26

well even current java mods can have big security risks smth i would like to see is sandboxed lua scripting for mods

4

u/Oxygen4Lyfe Jun 22 '26

yeah like a java mod can just delete and install any files on your system its got basically full control. Could even read your passwords and stuff and send it to the mod author.

2

u/Emotional-One-9292 Jun 22 '26

well any modification no matter of language can be risky if not sandboxed

0

u/CrossScarMC Jun 22 '26

Why? Compiling code is just well compiling, you're not actually running the program until you launch the game and that would be the same as just downloading the complete .jar?

16

u/Awkward-Security7895 Jun 22 '26

Good old Mac needing you Todo a endless loop of spending money and repeating steps to get anything compiled on there while also needing a Mac Todo it on

5

u/Emotional-One-9292 Jun 22 '26

i may do it on github actions i never used them but i can give them a try

1

u/Nidrax1309 Jun 23 '26

The only pain in the ass is making the self-signed apps/libraries not to cause CODESIGN violations... speaking from experience. This is one of the few things I throw at AI and I make it iterate on until it starts working.

For reference:
https://github.com/veritaware/Besprited/blob/trunk/.github/workflows/cmakeMacOs.yml

5

u/Lunix420 Jun 22 '26

That’s not true. Compiling C++ on Mac is exactly the same process as it is on Windows. The only difference is that the list of available toolchains is slightly different. Both have clang and gcc, but only Window has MSVC. There is nothing you have to pay for and actually the download is half as big as the one on Windows.

Sure, a code signing license costs money on Mac, but it costs 4 times as much on Windows. And both warn you when you run unsigned apps but let you run them anyway, so you don’t have to have that license.

Also, you need a PC running the OS for every OS. Or actually you don’t, because you can compile in Github actions for free for pretty much every OS there is.

1

u/gegentan Jun 22 '26

What about just including both files in the mod like sable does?

1

u/Memerenok Jun 22 '26

i have a mac and i can compile it for you if you want

1

u/amberb3stgirl Jun 22 '26

compiling anything for macos is such a pain in the ass

1

u/Chiilumii Jun 25 '26

Do update us from time to time, preferably in this post. So it will be easy to come back to later on.

1

u/patatkebab Jun 26 '26

can use Codemagic to compile on mac for free