Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SteelWorldGen

GitHub License* GitHub last commit Minestom version

Uses SteelMC as a library to implement vanilla Minecraft world generation in a Minestom world generator.

* SteelMC is licensed under the AGPLv3 license. Only the Java libraries in this repo are Apache-2.0. See LICENSE.md for more details.

How it works

steel-provider/src/lib.rs contains some functions that interact with SteelMC to bring chunks through the full generation process outside of a normal server environment. Those functions are compiled into a standalone executable (steel-provider/src/main.rs), which acts as a "dumb" server that exclusively handles chunk generation.

The Java side is split into two modules in java-client: the bridge module is a standalone client library that connects to the steel-provider server, and the minestom module adapts it into a Minestom world generator. Each Generator#generate() call sends a small packet with the seed and chunk coordinates and then reads a response containing the generated chunk's sections in Minecraft's own network format.

The server can be used standalone. Currently, only a Java client exists, but other clients could easily be made as long as they understand how to decode the data structures in Minecraft's chunk data packet. For more details on the protocol, see steel-provider/PROTOCOL.md.

Installation

Latest version

repositories {
   maven(url = "https://reposilite.bluedragonmc.com/releases")
}

dependencies {
   implementation("com.bluedragonmc:steelworldgen-minestom:$VERSION")
}

If you only need to talk to a steel-provider server without Minestom, depend on com.bluedragonmc:steelworldgen-bridge instead.

Usage

Instance instance = MinecraftServer.getInstanceManager().createInstanceContainer();

long seed = 42L;
instance.setGenerator(SteelWorldGenProvider.getGenerator(seed));
instance.setChunkSupplier(LightingChunk::new);

For a full example, see the java-client/demo directory. You can run the demo locally with mise run demo. You'll probably want to use the --release flag (mise run demo --release). Chunk generation gets MUCH faster at the expense of a longer compilation time.

Building from Source

  1. Install mise

    We use mise to manage tools (like Java and Gradle) and to define tasks like you would in a Makefile. It's configured in mise.toml.

  2. Run mise run build

    For a release (optimized) build, use mise run build --release.

    By default the Rust binary is built natively with cargo build. To instead cross-compile a fully static binary using cargo-zigbuild, pass --static (mise run build --release --static).

    The Java library will be built to java-client/minestom/build/libs/minestom-dev.jar. If you want to publish it to a Maven repository, modify the hostname in java-client/minestom/build.gradle.kts and run mise run publish (or mise run publishToMavenLocal to run gradle publishToMavenLocal).

AI Disclosure

The Rust portion of this project was written with a lot of AI assistance.

About

Vanilla Minecraft world generation in Minestom using SteelMC as a library

Topics

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages