-
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.
Rename game modules folder, add documentation for some modules
- Loading branch information
Showing
50 changed files
with
115 additions
and
18 deletions.
There are no files selected for viewing
File renamed without changes.
File renamed without changes.
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 |
---|---|---|
@@ -0,0 +1,23 @@ | ||
--- | ||
title: AwardsModule | ||
--- | ||
`AwardsModule` is used to give the player coins and XP as a reward for doing well in games. XP is actually just the total number of coins you have earned, so if you earn 100 coins, you earn 100 XP at the same time. | ||
|
||
## Usage | ||
Import the module: | ||
```kotlin | ||
import com.bluedragonmc.server.module.database.AwardsModule | ||
``` | ||
Use the module in your game's `initialize` function: | ||
```kotlin | ||
use(AwardsModule()) | ||
``` | ||
|
||
### Custom Awards | ||
Now, you can use the `awardCoins` method to give coins and XP to the player. This will also send them a message letting them know that they earned coins, and a level up screen if the new XP got them to the next level. | ||
```kotlin | ||
getModule<AwardsModule>().awardCoins(player, amount, reason); | ||
``` | ||
|
||
### Award for Winning | ||
The [WinModule](../winmodule/) has a feature to automatically award coins at the end of a game. You still need to use `AwardsModule` for this feature to work. |
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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
--- | ||
title: ChestLootModule | ||
--- | ||
`ChestLootModule` adds items to the inventory of a chest when it is first opened. | ||
|
||
## Dependencies | ||
This module depends on the following modules: | ||
- [ChestModule](../chestmodule/) (has other dependencies) |
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 |
---|---|---|
@@ -0,0 +1,22 @@ | ||
--- | ||
title: ChestModule | ||
--- | ||
`ChestModule` assigns a `Menu` to every chest in the world and allows them to be accessed by interacting with the chest. Additionally, the module assigns an ender chest to every player, which can be accessed by interacting with any ender chest block. Combine with [ChestLootModule](../chestlootmodule/) to add auto-generated loot to chests. | ||
|
||
As stated in the Minestom README, this module is necessary for the following reason: | ||
> Minestom by default does not know what is a chest, you will have to tell him that it opens an inventory. Every "special blocks" (which aren't only visual) need a specialized handler. After applying this handler, you have a block that can be placed anywhere simply. However, all blocks are visually there, they just won't have interaction by default. | ||
## Dependencies | ||
This module depends on the following modules: | ||
- [GuiModule](../guimodule/) | ||
|
||
## Usage | ||
Import the module: | ||
```kotlin | ||
import com.bluedragonmc.server.module.vanilla.ChestModule | ||
``` | ||
Use the module in your game's `initialize` function: | ||
```kotlin | ||
use(ChestModule()) | ||
``` | ||
By default, every chest will start empty. The [ChestLootModule](../chestlootmodule/) can be used to add starting items to chests. Alternatively, you can implement your own loot system with `ChestPopulateEvent`, which is called just before a chest is opened for the first time. |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
26 changes: 26 additions & 0 deletions
26
src/content/docs/reference/Game Modules/FallDamageModule.md
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 |
---|---|---|
@@ -0,0 +1,26 @@ | ||
--- | ||
title: FallDamageModule | ||
--- | ||
`FallDamageModule` implements fall damage, similar to what you would see on a vanilla server. | ||
|
||
## Fall Damage Reduction | ||
Certain blocks reduce the amount of fall damage the player takes if they land on them: | ||
- Hay and honey blocks reduce fall damage by 20% | ||
- Beds reduce fall damage by 50% | ||
- Sweet berry bushes and cobwebs negate all fall damage | ||
- Slime blocks negate all fall damage if the player is not sneaking | ||
|
||
Certain armor enchantments further reduce fall damage: | ||
- Feather falling reduces fall damage by 12% per level | ||
- Protection reduces fall damage by 4% per level | ||
|
||
## Usage | ||
Import the module: | ||
```kotlin | ||
import com.bluedragonmc.server.module.vanilla.FallDamageModule | ||
``` | ||
Use the module in your game's `initialize` function: | ||
```kotlin | ||
use(FallDamageModule()) | ||
``` | ||
Fall damage will be active as long as the module is in use. |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
32 changes: 32 additions & 0 deletions
32
src/content/docs/reference/Game Modules/PlayerResetModule.md
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 |
---|---|---|
@@ -0,0 +1,32 @@ | ||
--- | ||
title: PlayerResetModule | ||
--- | ||
`PlayerResetModule` changes some basic attributes about the player when they join the game, to avoid having changes to the player persist in between games. | ||
> It is recommended to always use this module to ensure the player always starts in the same state. | ||
## Effects | ||
The module applies the following effects to the player upon joining the game | ||
- Change game mode (if the `defaultGameMode` parameter is set) | ||
- Clear inventory | ||
- Reset health/hunger | ||
- Reset movement speed | ||
- Clear potion effects | ||
- Disable flying | ||
- Stop fire damage | ||
- Disable glowing | ||
- Reset XP | ||
- Clear all tags | ||
|
||
## Usage | ||
Import the module: | ||
```kotlin | ||
import com.bluedragonmc.server.module.minigame.PlayerResetModule | ||
``` | ||
Use the module in your game's `initialize` function: | ||
```kotlin | ||
use(PlayerResetModule(defaultGameMode = GameMode.ADVENTURE)) | ||
``` | ||
Now, when a player joins the game, the effects listed above will be applied to them. If you ever want to do this manually, you can use the `resetPlayer` method: | ||
```kotlin | ||
getModule<PlayerResetModule>().resetPlayer(player, gameMode) | ||
``` |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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 |
---|---|---|
@@ -0,0 +1,4 @@ | ||
--- | ||
title: SpectatorModule | ||
--- | ||
`SpectatorModule` is used to manage spectators in a game. Spectators are considered to be "out of the game", and are generally not affected by events that occur inside the game. Many other modules use `SpectatorModule` to avoid taking action on spectators. |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.