Skip to content

Commit b1e8d70

Browse files
authored
Add config options for CommandAPI/CommandAPI#642 (#17)
1 parent 47f5e92 commit b1e8d70

File tree

1 file changed

+78
-14
lines changed

1 file changed

+78
-14
lines changed

docs/en/user-setup/config.md

Lines changed: 78 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,13 @@ silent-logs: false
3131
# Messages
3232
# Controls messages that the CommandAPI displays to players
3333
messages:
34-
35-
# Missing executor implementation (default: "This command has no implementations for %s")
36-
# The message to display to senders when a command has no executor. Available
37-
# parameters are:
38-
# %s - the executor class (lowercase)
39-
# %S - the executor class (normal case)
40-
missing-executor-implementation: This command has no implementations for %s
34+
35+
# Missing executor implementation (default: "This command has no implementations for %s")
36+
# The message to display to senders when a command has no executor. Available
37+
# parameters are:
38+
# %s - the executor class (lowercase)
39+
# %S - the executor class (normal case)
40+
missing-executor-implementation: This command has no implementations for %s
4141

4242
# Create dispatcher JSON (default: false)
4343
# If "true", the CommandAPI creates a command_registration.json file showing the
@@ -63,6 +63,20 @@ skip-initial-datapack-reload: true
6363
# function which allows CommandAPI commands to be used in datapacks.
6464
hook-paper-reload: false
6565

66+
# Turn on the CommandAPI's plugin messaging functionality (default: false)
67+
# If "false", the CommandAPI will not listen to incoming plugin messages
68+
# and attempts to send plugin messages will fail. Enabling networking by
69+
# setting this to "true" is currently only useful for allowing command
70+
# requirements on Velocity.
71+
enable-networking: false
72+
73+
# Turn exceptions while sending and receiving packets into warnings (default: false)
74+
# If "false", the CommandAPI will throw an exception when receiving malformed packets
75+
# or if it tries to send a packet but cannot. If "true", these problems will be logged
76+
# as a warning, which does not include the stacktrace. Additionally, warnings can be hidden
77+
# by setting silent logs to "true".
78+
make-networking-exceptions-warnings: false
79+
6680
# Plugins to convert (default: [])
6781
# Controls the list of plugins to process for command conversion.
6882
plugins-to-convert: []
@@ -94,13 +108,13 @@ silent-logs: false
94108
# Messages
95109
# Controls messages that the CommandAPI displays to players
96110
messages:
97-
98-
# Missing executor implementation (default: "This command has no implementations for %s")
99-
# The message to display to senders when a command has no executor. Available
100-
# parameters are:
101-
# %s - the executor class (lowercase)
102-
# %S - the executor class (normal case)
103-
missing-executor-implementation: This command has no implementations for %s
111+
112+
# Missing executor implementation (default: "This command has no implementations for %s")
113+
# The message to display to senders when a command has no executor. Available
114+
# parameters are:
115+
# %s - the executor class (lowercase)
116+
# %S - the executor class (normal case)
117+
missing-executor-implementation: This command has no implementations for %s
104118

105119
# Create dispatcher JSON (default: false)
106120
# If "true", the CommandAPI creates a command_registration.json file showing the
@@ -120,6 +134,20 @@ fallback-to-latest-nms: false
120134
# is set to "true" and /minecraft:reload is run.
121135
skip-initial-datapack-reload: true
122136

137+
# Turn on the CommandAPI's plugin messaging functionality (default: false)
138+
# If "false", the CommandAPI will not listen to incoming plugin messages
139+
# and attempts to send plugin messages will fail. Enabling networking by
140+
# setting this to "true" is currently only useful for allowing command
141+
# requirements on Velocity.
142+
enable-networking: false
143+
144+
# Turn exceptions while sending and receiving packets into warnings (default: false)
145+
# If "false", the CommandAPI will throw an exception when receiving malformed packets
146+
# or if it tries to send a packet but cannot. If "true", these problems will be logged
147+
# as a warning, which does not include the stacktrace. Additionally, warnings can be hidden
148+
# by setting silent logs to "true".
149+
make-networking-exceptions-warnings: false
150+
123151
# Plugins to convert (default: [])
124152
# Controls the list of plugins to process for command conversion.
125153
plugins-to-convert: []
@@ -305,6 +333,42 @@ hook-paper-reload: true
305333

306334
</div>
307335

336+
### `enable-networking`
337+
338+
Controls whether the CommandAPI's plugin messaging functionality is enabled.
339+
340+
By default, this is set to `false`, and the CommandAPI will not attempt to to send or receive any plugin messages. At the moment, the only intended usecase for enabling networking is to allow [command requirements](../create-commands/requirements.md) to work on a [Velocity](../velocity/intro.md#updating-requirements) proxy server.
341+
342+
**Default value**
343+
344+
```yaml
345+
enable-networking: false
346+
```
347+
348+
**Example value**
349+
350+
```yaml
351+
enable-networking: true
352+
```
353+
354+
### `make-networking-exceptions-warnings`
355+
356+
Controls whether the CommandAPI will throw an exception or log a warning when networking errors occur.
357+
358+
By default, this is set to `false`, so the CommandAPI will throw an exception when receiving malformed packets or if it tries to send a packet but cannot. If `true`, these problems will be logged as a warning, which reduces the length in the log by omitting the stack trace. Additionally, these warnings will be hidden completely if [`silent-logs`](#silent-logs) is also `true`.
359+
360+
**Default value**
361+
362+
```yaml
363+
make-networking-exceptions-warnings: false
364+
```
365+
366+
**Example value**
367+
368+
```yaml
369+
make-networking-exceptions-warnings: true
370+
```
371+
308372
### `plugins-to-convert`
309373

310374
Controls the list of plugins to process for command conversion. See [Command conversion](command-conversion/conversion) for more information.

0 commit comments

Comments
 (0)