Skip to content

Commit c74c869

Browse files
committed
Update README
1 parent f9cf036 commit c74c869

File tree

1 file changed

+20
-2
lines changed

1 file changed

+20
-2
lines changed

README.md

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,5 +45,23 @@ Usage: `/sm:source (run)|(as <entity>)|(positioned <position>)|(rotated <rotatio
4545
Executes a given command from a modified source. For example, modifying the source's position will execute the command
4646
as if you were in that position. This command is really powerful, use it!
4747

48-
## Inner workings
49-
This mod internally uses (a fork of) the C library [cubiomes](https://github.com/Cubitect/cubiomes) by Cubitect. Java bindings for this library were created with (also a fork of) [jextract](https://github.com/openjdk/jextract). The bindings use the [Foreign Function & Memory API](https://openjdk.org/jeps/454) from [Project Panama](https://openjdk.org/projects/panama/). See [CreateJavaBindingsTask.java](https://github.com/xpple/SeedMapper/blob/master/buildSrc/src/main/java/dev/xpple/seedmapper/buildscript/CreateJavaBindingsTask.java) for the Gradle task that automates this. To build the mod locally, first install LLVM (version 13.0.0 is recommended) and set the environment variable `LLVM_HOME` to the directory where LLVM was installed. Then [build jextract](https://github.com/openjdk/jextract/?tab=readme-ov-file#building). The Java bindings will be created automatically when you build the mod.
48+
## Building from source
49+
This mod internally uses (a fork of) the C library [cubiomes](https://github.com/Cubitect/cubiomes) by Cubitect. Java bindings for this library were created with (also a fork of) [jextract](https://github.com/openjdk/jextract). The bindings use the [Foreign Function & Memory API](https://openjdk.org/jeps/454) from [Project Panama](https://openjdk.org/projects/panama/). See [CreateJavaBindingsTask.java](https://github.com/xpple/SeedMapper/blob/master/buildSrc/src/main/java/dev/xpple/seedmapper/buildscript/CreateJavaBindingsTask.java) for the Gradle task that automates this.
50+
51+
To build the mod locally, follow these steps:
52+
53+
1. Compile cubiomes to a shared library. The following is for Windows:
54+
```shell
55+
gcc -shared -o src/main/resources/cubiomes.dll src/main/c/noise.c src/main/c/biomes.c src/main/c/layers.c src/main/c/biomenoise.c src/main/c/generator.c src/main/c/finders.c src/main/c/util.c src/main/c/quadbase.c -O3
56+
```
57+
2. Install LLVM (version 13.0.0 is recommended) and set the environment variable `LLVM_HOME` to the directory where LLVM was installed.
58+
3. Compile jextract:
59+
```shell
60+
cd jextract
61+
./gradlew --stacktrace -Pjdk_home=$JAVA_HOME -Pllvm_home=$LLVM_HOME clean verify
62+
```
63+
4. Build the mod:
64+
```shell
65+
./gradlew build
66+
```
67+
You should find the Java bindings in `src/main/java/com/github/cubiomes`.

0 commit comments

Comments
 (0)