Skip to content

Commit

Permalink
Add a reference page for each module
Browse files Browse the repository at this point in the history
  • Loading branch information
ex4dev committed Jan 7, 2024
1 parent a4724f2 commit 0bd37f7
Show file tree
Hide file tree
Showing 44 changed files with 192 additions and 0 deletions.
32 changes: 32 additions & 0 deletions src/content/docs/reference/game-modules/ActionBarModule.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
---
title: ActionBarModule
---
`ActionBarModule` provides a standard way of displaying information in the player's action bar. When multiple messages want to be displayed, they will all appear, with a separator between them.

## Usage
Import the module:
```kotlin
import com.bluedragonmc.server.module.gameplay.ActionBarModule
```
Use the module in your game's `initialize` function:
```kotlin
use(ActionBarModule(interval = 2, separator = Component.text(" | ", NamedTextColor.DARK_GRAY)))
```
The `interval` parameter defines the delay between each action bar update, in ticks.

Now, from any module, you can listen for the `ActionBarModule.CollectActionBarEvent` to add a message to the action bar.
```kotlin
eventNode.addListener(ActionBarModule.CollectActionBarEvent::class.java) { event ->
// Adding both these items will display "Hello World! | Hello World 2!" in the action bar
event.addItem(
Component.text("Hello World!")
)
event.addItem(
Component.text("Hello World 2!")
)
// You can also use event.player to get the specific player
}
```

## Considerations
- Games are not required to use `ActionBarModule`. If you are creating a module that is not specific to a single game, it is recommended to check if the module is present, falling back to `player.sendActionBar` if not.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
title: AnvilFileMapProviderModule
---
3 changes: 3 additions & 0 deletions src/content/docs/reference/game-modules/AwardsModule.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
title: AwardsModule
---
3 changes: 3 additions & 0 deletions src/content/docs/reference/game-modules/ChestLootModule.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
title: ChestLootModule
---
3 changes: 3 additions & 0 deletions src/content/docs/reference/game-modules/ChestModule.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
title: ChestModule
---
3 changes: 3 additions & 0 deletions src/content/docs/reference/game-modules/CombatZonesModule.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
title: CombatZonesModule
---
4 changes: 4 additions & 0 deletions src/content/docs/reference/game-modules/ConfigModule.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
title: ConfigModule
---
`ConfigModule` loads game configuration from .yml files. Configuration data can be loaded from both the game's JAR file and the map folder. This way, it is possible to change in-game values based on the map.
3 changes: 3 additions & 0 deletions src/content/docs/reference/game-modules/CosmeticsModule.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
title: CosmeticsModule
---
17 changes: 17 additions & 0 deletions src/content/docs/reference/game-modules/CountdownModule.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
title: CountdownModule
---
`CountdownModule` provides a visual countdown that is automatically displayed before the game starts. All of BlueDragon's minigames use it to handle the pregame state. The countdown starts automatically when enough players have joined, and stops automatically if enough players leave during the countdown to go below the minimum threshold.

## Usage
Import the module:
```kotlin
import com.bluedragonmc.server.module.minigame.CountdownModule
```
Use the module in your game's `initialize` function:
```kotlin
use(CountdownModule(threshold = 2, allowMoveDuringCountdown = true, countdownSeconds = 10))
```
Now, when the player count matches or exceeds the `threshold`, a countdown will automatically begin that lasts `countdownSeconds` seconds. If `allowMoveDuringCountdown` is `false`, players will not be able to move during the countdown, but they will still be able to look around.

When the countdown reaches 0, the module will call `GameStartEvent`, change the game state to `INGAME`, and display a "GO!" title on the screen.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
title: CustomGeneratorInstanceModule
---
3 changes: 3 additions & 0 deletions src/content/docs/reference/game-modules/CutsceneModule.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
title: CutsceneModule
---
3 changes: 3 additions & 0 deletions src/content/docs/reference/game-modules/DoorsModule.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
title: DoorsModule
---
3 changes: 3 additions & 0 deletions src/content/docs/reference/game-modules/DoubleJumpModule.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
title: DoubleJumpModule
---
3 changes: 3 additions & 0 deletions src/content/docs/reference/game-modules/FallDamageModule.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
title: FallDamageModule
---
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
title: FireworkRocketModule
---
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
title: GlobalCosmeticModule
---
3 changes: 3 additions & 0 deletions src/content/docs/reference/game-modules/GuiModule.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
title: GuiModule
---
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
title: InstanceContainerModule
---
3 changes: 3 additions & 0 deletions src/content/docs/reference/game-modules/InstanceModule.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
title: InstanceModule
---
3 changes: 3 additions & 0 deletions src/content/docs/reference/game-modules/InstanceTimeModule.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
title: InstanceTimeModule
---
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
title: InstantRespawnModule
---
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
title: InventoryPermissionsModule
---
3 changes: 3 additions & 0 deletions src/content/docs/reference/game-modules/ItemDropModule.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
title: ItemDropModule
---
3 changes: 3 additions & 0 deletions src/content/docs/reference/game-modules/ItemPickupModule.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
title: ItemPickupModule
---
3 changes: 3 additions & 0 deletions src/content/docs/reference/game-modules/KitsModule.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
title: KitsModule
---
3 changes: 3 additions & 0 deletions src/content/docs/reference/game-modules/MOTDModule.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
title: MOTDModule
---
3 changes: 3 additions & 0 deletions src/content/docs/reference/game-modules/MapZonesModule.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
title: MapZonesModule
---
3 changes: 3 additions & 0 deletions src/content/docs/reference/game-modules/MaxHealthModule.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
title: MaxHealthModule
---
3 changes: 3 additions & 0 deletions src/content/docs/reference/game-modules/NPCModule.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
title: NPCModule
---
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
title: NaturalRegenerationModule
---
19 changes: 19 additions & 0 deletions src/content/docs/reference/game-modules/OldCombatModule.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
title: OldCombatModule
---
`OldCombatModule` is a reimplementation of Minecraft combat features. It handles damage and knockback similar to vanilla Minecraft. It does not include most of the newer 1.9+ combat mechanics, such as shields and the attack cooldown. However, it does include the increased axe damage found in newer versions.

## Parameters
- `allowDamage`: Set to `false` to make all hits deal no damage.
- `allowKnockback`: Set to `false` to make all hits deal no knockback.

## Usage
Import the module:
```kotlin
import com.bluedragonmc.server.module.combat.OldCombatModule
```
In your game's `initialize` function, include the module like this:
```kotlin
use(OldCombatModule(allowDamage = true, allowKnockback = true))
```
Combat will be enabled once the module is used.
3 changes: 3 additions & 0 deletions src/content/docs/reference/game-modules/PlayerResetModule.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
title: PlayerResetModule
---
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
title: SharedInstanceModule
---
3 changes: 3 additions & 0 deletions src/content/docs/reference/game-modules/ShopModule.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
title: ShopModule
---
3 changes: 3 additions & 0 deletions src/content/docs/reference/game-modules/SidebarModule.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
title: SidebarModule
---
3 changes: 3 additions & 0 deletions src/content/docs/reference/game-modules/SpawnpointModule.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
title: SpawnpointModule
---
3 changes: 3 additions & 0 deletions src/content/docs/reference/game-modules/SpectatorModule.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
title: SpectatorModule
---
3 changes: 3 additions & 0 deletions src/content/docs/reference/game-modules/StatisticsModule.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
title: StatisticsModule
---
3 changes: 3 additions & 0 deletions src/content/docs/reference/game-modules/TeamModule.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
title: TeamModule
---
3 changes: 3 additions & 0 deletions src/content/docs/reference/game-modules/TimedRespawnModule.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
title: TimedRespawnModule
---
3 changes: 3 additions & 0 deletions src/content/docs/reference/game-modules/VoidDeathModule.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
title: VoidDeathModule
---
3 changes: 3 additions & 0 deletions src/content/docs/reference/game-modules/WeatherModule.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
title: WeatherModule
---
3 changes: 3 additions & 0 deletions src/content/docs/reference/game-modules/WinModule.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
title: WinModule
---
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
title: WorldPermissionsModule
---

0 comments on commit 0bd37f7

Please sign in to comment.