Skip to content
This repository was archived by the owner on Nov 28, 2025. It is now read-only.

Commit f1ddf02

Browse files
committed
add world creation wiki
1 parent 68470e1 commit f1ddf02

File tree

3 files changed

+24
-1
lines changed

3 files changed

+24
-1
lines changed

.vitepress/config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ export default defineConfig({
4949
{
5050
text: "World",
5151
items: [
52+
{ text: "Creating a World", link: "wiki/worlds" },
5253
{ text: "Blocks & Block States", link: "wiki/block-states" },
5354
{ text: "Batch Block Updates", link: "wiki/batch-block-updates" }
5455
],

wiki/quick-start.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Setting up a Dockyard server is easy! As DockyardMC is a library and not a stand
1818
}
1919

2020
dependencies {
21-
implementation("io.github.dockyardmc:dockyard:0.7.11")
21+
implementation("io.github.dockyardmc:dockyard:0.7.19")
2222
}
2323

2424
```

wiki/worlds.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Creating a World
2+
3+
You can create a world by calling `WorldManager.create`:
4+
5+
```kotlin
6+
val world = WorldManager.create("custom_world", FlatWorldGenerator(), DimensionTypes.OVERWORLD)
7+
```
8+
9+
You need to supply a world generator and dimension type. There are two world generators built into dockyard:
10+
- `FlatWorldGenerator`
11+
- `VoidWorldGenerator`
12+
13+
You can create your own generators by extending the `WorldGenerator` interface.
14+
15+
You can also use `WorldManager.createWithFuture` to create a world with provided `CompletableFuture<World>` which is called when the world is fully loaded:
16+
17+
```kotlin
18+
WorldManager.createWithFuture("custom_world", FlatWorldGenerator(), DimensionTypes.OVERWORLD).thenAccept { world ->
19+
world.defaultSpawnLocation = Location(0, 201, 0, world)
20+
DockyardServer.broadcastMessage("<lime>World ${world.name} loaded!")
21+
}
22+
```

0 commit comments

Comments
 (0)