-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add documentation for InstanceModule implementations
- Loading branch information
Showing
6 changed files
with
101 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,20 @@ | ||
--- | ||
title: CustomGeneratorInstanceModule | ||
--- | ||
--- | ||
|
||
`CustomGeneratorInstanceModule` is an implementation of [`InstanceModule`](../instancemodule/) that creates a single instance for each game that automatically generates chunks using a custom [world generator](https://wiki.minestom.net/world/generation). | ||
|
||
## Usage | ||
Import the module: | ||
```kotlin | ||
import com.bluedragonmc.server.module.instance.CustomGeneratorInstanceModule | ||
``` | ||
Use the module in your game's `initialize` function: | ||
```kotlin | ||
// See Minestom documentation to learn more about world generators | ||
val myGenerator = ... | ||
use(CustomGeneratorInstanceModule(dimensionType = DimensionType.OVERWORLD, generator = myGenerator)) | ||
``` | ||
|
||
## Fullbright Dimension | ||
BlueDragon provides a custom dimension type with global maximum lighting. You can obtain a reference to this dimension type with `CustomGeneratorInstanceModule.getFullbrightDimension()`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,21 @@ | ||
--- | ||
title: InstanceContainerModule | ||
--- | ||
--- | ||
|
||
`InstanceContainerModule` is an implementation of [`InstanceModule`](../instancemodule/) that creates a single [`InstanceContainer`](https://wiki.minestom.net/world/instances#instancecontainer) for each game using a map loaded from an Anvil world. | ||
|
||
## Dependencies | ||
This module depends on the following modules: | ||
- [AnvilFileMapProviderModule](../anvilfilemapprovidermodule) | ||
|
||
## Usage | ||
Import the module: | ||
```kotlin | ||
import com.bluedragonmc.server.module.instance.InstanceContainerModule | ||
import com.bluedragonmc.server.module.map.AnvilFileMapProviderModule // dependency | ||
``` | ||
Use the module in your game's `initialize` function: | ||
```kotlin | ||
use(AnvilFileMapProviderModule("games/$name/$mapName")) // This is how you specify the path to the world folder | ||
use(InstanceContainerModule()) | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,25 @@ | ||
--- | ||
title: SharedInstanceModule | ||
--- | ||
--- | ||
|
||
`SharedInstanceModule` is an implementation of [`InstanceModule`](../instancemodule/) that creates a single [`SharedInstance`](https://wiki.minestom.net/world/instances#sharedinstance) for each game using a map loaded from an Anvil world. All instances on the same map of a game with this module will share the same block data, resulting in reduced memory usage compared to other instance modules. | ||
|
||
:::caution | ||
Changes to the map made in SharedInstances will also apply to all other SharedInstances using the same map. If the map can be modified in any way during gameplay, use [InstanceContainerModule](../instancecontainermodule) instead. | ||
::: | ||
|
||
## Dependencies | ||
This module depends on the following modules: | ||
- [AnvilFileMapProviderModule](../anvilfilemapprovidermodule) | ||
|
||
## Usage | ||
Import the module: | ||
```kotlin | ||
import com.bluedragonmc.server.module.instance.SharedInstanceModule | ||
import com.bluedragonmc.server.module.map.AnvilFileMapProviderModule // dependency | ||
``` | ||
Use the module in your game's `initialize` function: | ||
```kotlin | ||
use(AnvilFileMapProviderModule("games/$name/$mapName")) // This is how you specify the path to the world folder | ||
use(SharedInstanceModule()) | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters