Skip to content

Commit 904d3cb

Browse files
committed
Add various links
1 parent f98cb96 commit 904d3cb

File tree

3 files changed

+16
-13
lines changed

3 files changed

+16
-13
lines changed

docs/paper/dev/api/command-api/arguments/adventure.mdx

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import SignedMessageMp4 from "./assets/vanilla-arguments/signedmessage.mp4";
1111

1212
# Adventure Library Arguments
1313
These arguments return a class from the `net.kyori` package. They are technically not native to Minecraft or Bukkit, but as Paper includes the Adventure library, they are
14-
usually widely used in the Paper ecosystem.
14+
widely used in the Paper ecosystem.
1515

1616
## Component argument
1717
:::note
@@ -46,8 +46,8 @@ public static LiteralCommandNode<CommandSourceStack> componentArgument() {
4646

4747

4848
## Key argument
49-
The key argument allows a user to put in any artificial (namespaced) key, ensuring its validity. This returns a `net.kyori.adventure.key.Key` from the Adventure library,
50-
which can be used at various other places in the Bukkit/Paper API.
49+
The key argument allows a user to put in any artificial (namespaced) key, ensuring its validity. This returns a [`Key`](https://jd.advntr.dev/key/latest/net/kyori/adventure/key/Key.html),
50+
which can be used at various other places in the Paper API.
5151

5252
### Example usage
5353
```java
@@ -73,7 +73,8 @@ public static LiteralCommandNode<CommandSourceStack> keyArgument() {
7373

7474
## Named color argument
7575
This argument provides the user with the ability to select between the 16 built-in "named" text colors. This argument returns a
76-
`net.kyori.adventure.text.format.NamedTextColor` which you can use for styling components.
76+
[`NamedTextColor`](https://javadoc.io/doc/net.kyori/adventure-api/latest/net/kyori/adventure/text/format/NamedTextColor.html),
77+
which you can use for applying a color to components.
7778

7879
### Example usage
7980
```java
@@ -102,13 +103,12 @@ public static LiteralCommandNode<CommandSourceStack> namedColorArgument() {
102103
:::note
103104

104105
Similar to the component argument, this argument is not really appropriate for general user input, as it also follows the JSON format for displaying components. Most users
105-
106106
do not know how to use that format and thus its general usage is not advised.
107107

108108
:::
109109

110-
The style argument returns its value in the form of an `net.kyori.adventure.text.format.Style` object. This can be applied to any component using `Component#style(Style)`.
111-
Whilst the JSON input allows for the `text` field, its content is completely ignored.
110+
The style argument returns its value in the form of a [`Style`](https://javadoc.io/doc/net.kyori/adventure-api/latest/net/kyori/adventure/text/format/Style.html) object.
111+
This can be applied to any component using `Component#style(Style)`. Whilst the JSON input allows for the `text` field, its content is completely ignored.
112112

113113
### Example usage
114114
```java
@@ -142,19 +142,22 @@ A signed message argument returns a `SignedMessageResolver`. In order to call it
142142
* The argument name
143143
* The `CommandContext<CommandSourceStack>` object
144144

145-
The resolved value is a `CompletableFuture<SignedMessage>`, whose `SignedMessage` value you can handle using a `thenAccept(Consumer<T>)`. Inside of the consumer, you can send the signed message to players or work with it in other ways.
145+
The resolved value is a `CompletableFuture<SignedMessage>`, whose [`SignedMessage`](https://javadoc.io/doc/net.kyori/adventure-api/latest/net/kyori/adventure/chat/SignedMessage.html)
146+
value you can handle using `thenAccept(Consumer<T>)`. Inside of the consumer, you can send the signed message to players or work with it in other ways.
146147

147148
:::warning
148149

149150
By default, the consumer passed into `thenAccept` is not executed on the main thread, making it unsafe to use most of Paper API within it.
150-
If you need to use the API, you can schedule a task to be run on the next available tick. For this you can use the <Javadoc name="org.bukkit.scheduler.BukkitScheduler#getMainThreadExecutor(org.bukkit.plugin.Plugin)">main thread executor</Javadoc>.
151+
If you need to use the API, you can schedule a task to be run on the next available tick. For this you can use the
152+
<Javadoc name="org.bukkit.scheduler.BukkitScheduler#getMainThreadExecutor(org.bukkit.plugin.Plugin)">main thread executor</Javadoc>.
151153
You can read up on that [here](../../scheduler.mdx).
152154

153155
:::
154156

155157
:::note
156158

157-
A non-player sender is not capable of sending a signed message, which means that the resolved `CompletableFuture` will never be completed. You should make sure that only players can use your argument with `.requires(ctx -> ctx.getSender() instanceof Player)` on your `SignedArgument`. You may
159+
A non-player sender is not capable of sending a signed message, which means that the resolved `CompletableFuture` will never be completed.
160+
You should make sure that only players can use your argument with `.requires(ctx -> ctx.getSender() instanceof Player)` on your `SignedArgument`. You may
158161
add a fallback greedy string argument for non-player senders if you want the argument to execute regardless of signing.
159162

160163
:::

docs/paper/dev/api/command-api/basics/command-tree.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,8 @@ stateDiagram-v2
5959
```
6060
</p>
6161

62-
It is important to remember that this tree-like structure is not only important for Brigadier. It is a fairly often used concept. Paper's included **Adventure API** also operates using
63-
a tree. Why is this important for using Brigadier though? Well, it allows for explicit command declaration. Being at a node, you know exactly where you are. That means you do not have
62+
It is important to remember that this tree-like structure is not only important for Brigadier. It is a fairly often used concept. Paper's included [Adventure API](../../component-api/intro.mdx)
63+
also operates using a tree. Why is this important for using Brigadier though? Well, it allows for explicit command declaration. Being at a node, you know exactly where you are. That means you do not have
6464
to, like in standard Bukkit way, first check whether the amount of arguments is 2 and the first argument is `tphere`. Because you are at that exact `tphere` node, you can just start writing
6565
your logic. If you want to learn more about the execute logic of Brigadier commands, it is suggested that you check out [command executors](./executors).
6666

docs/paper/dev/api/command-api/misc/basic-command.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ public class BroadcastCommand implements BasicCommand {
8383
}
8484
```
8585

86-
Our permission is set to `example.broadcast.use`. In order to give yourself that permission, it is suggested that you use a plugin like **LuckPerms** or just give yourself
86+
Our permission is set to `example.broadcast.use`. In order to give yourself that permission, it is suggested that you use a plugin like [LuckPerms](https://luckperms.net) or just give yourself
8787
operator permissions. You can also set this permission to be `true` by default. For this, please check out the [plugin.yml documentation](../../../getting-started/plugin-yml.mdx).
8888

8989
Now, in our `execute` method, we can retrieve the name of the executor of that command. If we do not find one, we can just get the name of the command sender, like this:

0 commit comments

Comments
 (0)