Class KeyedWorldArgument<C>
java.lang.Object
cloud.commandframework.arguments.CommandArgument<C,org.bukkit.World>
cloud.commandframework.paper.argument.KeyedWorldArgument<C>
- Type Parameters:
C- Command sender type
- All Implemented Interfaces:
cloud.commandframework.keys.CloudKeyHolder<org.bukkit.World>,Comparable<cloud.commandframework.arguments.CommandArgument<?,?>>
public final class KeyedWorldArgument<C>
extends cloud.commandframework.arguments.CommandArgument<C,org.bukkit.World>
Argument type that parses Bukkit
worlds from a NamespacedKey.
Falls back to parsing by name, using the WorldArgument.WorldParser on server implementations where World
does not implement Keyed.
- Since:
- 1.6.0
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classBuilder forKeyedWorldArgument.static final classParser forworldsfrom theirNamespacedKey. -
Method Summary
Modifier and TypeMethodDescriptionstatic <C> @NonNull KeyedWorldArgument.Builder<C>Create a newKeyedWorldArgument.Builder.static <C> @NonNull KeyedWorldArgument<C>Create a new requiredKeyedWorldArgument.static <C> @NonNull KeyedWorldArgument<C>Create a new optionalKeyedWorldArgument.static <C> @NonNull KeyedWorldArgument<C>Create a newKeyedWorldArgumentwith the specified default value.Methods inherited from class cloud.commandframework.arguments.CommandArgument
addPreprocessor, compareTo, copy, equals, getDefaultDescription, getDefaultValue, getKey, getName, getOwningCommand, getParser, getSuggestionsProvider, getValueType, hasDefaultValue, hashCode, isArgumentRegistered, isRequired, ofType, ofType, preprocess, setArgumentRegistered, setOwningCommand, toString
-
Method Details
-
builder
Create a newKeyedWorldArgument.Builder.- Type Parameters:
C- Command sender type- Parameters:
name- Name of the argument- Returns:
- Created builder
- Since:
- 1.6.0
-
of
Create a new requiredKeyedWorldArgument.- Type Parameters:
C- Command sender type- Parameters:
name- Argument name- Returns:
- Created argument
- Since:
- 1.6.0
-
optional
Create a new optionalKeyedWorldArgument.- Type Parameters:
C- Command sender type- Parameters:
name- Argument name- Returns:
- Created argument
- Since:
- 1.6.0
-
optional
public static <C> @NonNull KeyedWorldArgument<C> optional(@NonNull String name, @NonNull org.bukkit.NamespacedKey defaultValue) Create a newKeyedWorldArgumentwith the specified default value.- Type Parameters:
C- Command sender type- Parameters:
name- Argument namedefaultValue- Default value- Returns:
- Created argument
- Since:
- 1.6.0
-