You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -100,7 +100,7 @@ Commands.argument("player", new OppedPlayerArgument())
100
100
})
101
101
```
102
102
103
-
This is way more readable and easy to understand than without custom argument. And it is reusable! Hopefully, you now have a basic grasp of **why** you should use custom arguments.
103
+
This is way more readable and easy to understand when using a custom argument. And it is reusable! Hopefully, you now have a basic grasp of **why** you should use custom arguments.
|`ArgumentType<N> getNativeType()`| Here, you declare the underlying argument type which is used as a base for clientside argument validation |
147
-
|`T parse(final StringReader reader) throws CommandSyntaxException`| This method is used if `T parse(StringReader, S)`was not overwritten. In here you can run conversion and validation logic. |
148
-
| `default <S> T parse(final StringReader reader, final S source)` | If overwritten, this method will be preferred to `T parse(StringReader)`. It serves the same purpose, but allows to also include the source in the parsing logic.
149
-
|`default Collection<String> getExamples()`| This method should **not** be extended. It is used internally to differentiate certain argument types while parsing. |
150
-
|`default <S> CompletableFuture<Suggestions> listSuggestions(final CommandContext<S> context, final SuggestionsBuilder builder)`| This method is the equivalent of `RequiredArgumentBuilder#suggests(SuggestionProvider<S>)`. You can overwrite this method in order to send your own suggestions to the client. |
146
+
|`ArgumentType<N> getNativeType()`| Here, you declare the underlying argument type, which is used as a base for client-side argument validation.|
147
+
|`T parse(final StringReader reader) throws CommandSyntaxException`| This method is used if `T parse(StringReader, S)`is not overridden. In here, you can run conversion and validation logic. |
148
+
| `default <S> T parse(final StringReader reader, final S source)` | If overridden, this method will be preferred to `T parse(StringReader)`. It serves the same purpose, but allows including the source in the parsing logic.
149
+
|`default Collection<String> getExamples()`| This method should **not** be overridden. It is used internally to differentiate certain argument types while parsing. |
150
+
|`default <S> CompletableFuture<Suggestions> listSuggestions(final CommandContext<S> context, final SuggestionsBuilder builder)`| This method is the equivalent of `RequiredArgumentBuilder#suggests(SuggestionProvider<S>)`. You can override this method in order to send your own suggestions to the client. |
151
151
152
152
### A very basic implementation
153
153
```java
@@ -179,7 +179,7 @@ you can also manually read input. Here, we read an unquoted string, the same as
179
179
180
180
## `CustomArgumentType.Converted<T, N>`
181
181
In case that you need to parse the native type to your new type, you can instead use the `CustomArgumentType.Converted` interface.
182
-
This interface is an extension to the `CustomArgumentType` interface, which adds two new, overwritable methods:
182
+
This interface is an extension to the `CustomArgumentType` interface, which adds two new, overridable methods:
183
183
184
184
```java
185
185
T convert(N nativeType) throws CommandSyntaxException;
0 commit comments