Skip to content

Commit

Permalink
feat: minecraft doc improvements & simple sender mapper information
Browse files Browse the repository at this point in the history
  • Loading branch information
broccolai committed Aug 8, 2024
1 parent b52dc77 commit 4e00ee5
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
5 changes: 5 additions & 0 deletions docs/minecraft/brigadier.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@ per-argument validation, coloring and syntax hinting.
<figcaption>Accurate Command Structure</figcaption>
</figure>

!!! warning "Alias Registration"

Only aliases for root nodes will be registered when using Brigadier. Due to how it's command
tree works it can quickly become inflated when sub-commands have aliases.

## CloudBrigadierManager

You can get an instance of `CloudBrigadierManager` from the command manager for your platform of choice.
Expand Down
15 changes: 15 additions & 0 deletions docs/minecraft/paper.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,11 @@ If the plugin is targeting older Paper versions or non-paper servers, then
{{ javadoc("https://javadoc.io/doc/org.incendo/cloud-paper/latest/org/incendo/cloud/paper/LegacyPaperCommandManager.html", "LegacyPaperCommandManager") }}
should be used.

!!! tip "Plugin Configuration Files"

Do not register your commands in your plugin.yml or paper-plugin.yml, Cloud handles the registration
itself and doing it yourself will cause issues.

### Legacy

The legacy command manager can be instantiated in two different ways.
Expand Down Expand Up @@ -132,3 +137,13 @@ if (commandManager.hasCapability(CloudBukkitCapabilities.NATIVE_BRIGADIER)) {
## Parsers

`cloud-paper` has access to all the parsers from [cloud-bukkit](bukkit.md#parsers).

## Provided Sender Mapper

Cloud includes a built-in sender mapper designed for the command manager. Due to the CommandSourceStack having no extensions it can be difficult to work, our sender mapper can be used like so:

```java
PaperCommandManager.builder(PaperSimpleSenderMapper.simpleSenderMapper())
```

This will give you access to Source with the included extensions: PlayerSource, ConsoleSource, EntitySource and GenericSource

0 comments on commit 4e00ee5

Please sign in to comment.