Class OfflinePlayerArgument<C>
java.lang.Object
cloud.commandframework.arguments.CommandArgument<C,org.bukkit.OfflinePlayer>
cloud.commandframework.bukkit.parsers.OfflinePlayerArgument<C>
- Type Parameters:
C- Command sender type
- All Implemented Interfaces:
cloud.commandframework.keys.CloudKeyHolder<org.bukkit.OfflinePlayer>,Comparable<cloud.commandframework.arguments.CommandArgument<?,?>>
public final class OfflinePlayerArgument<C>
extends cloud.commandframework.arguments.CommandArgument<C,org.bukkit.OfflinePlayer>
Argument type that parses into
OfflinePlayer. This is not thread safe. This
may also result in a blocking request to get the UUID for the offline player.
Avoid using this type if possible.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classstatic final classOfflinePlayer parse exceptionstatic final class -
Method Summary
Modifier and TypeMethodDescriptionstatic <C> @NonNull OfflinePlayerArgument.Builder<C>Create a newOfflinePlayerArgument.Builder.static <C> @NonNull OfflinePlayerArgument.Builder<C>newBuilder(@NonNull String name) Deprecated.static <C> @NonNull cloud.commandframework.arguments.CommandArgument<C,org.bukkit.OfflinePlayer> Create a new required command componentstatic <C> @NonNull cloud.commandframework.arguments.CommandArgument<C,org.bukkit.OfflinePlayer> Create a new optional command componentstatic <C> @NonNull cloud.commandframework.arguments.CommandArgument<C,org.bukkit.OfflinePlayer> Create a new required command component with a default valueMethods 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
@API(status=STABLE, since="1.8.0") public static <C> @NonNull OfflinePlayerArgument.Builder<C> builder(@NonNull String name) Create a newOfflinePlayerArgument.Builder.- Type Parameters:
C- sender type- Parameters:
name- argument name- Returns:
- new
OfflinePlayerArgument.Builder - Since:
- 1.8.0
-
newBuilder
@API(status=DEPRECATED, since="1.8.0") @Deprecated public static <C> @NonNull OfflinePlayerArgument.Builder<C> newBuilder(@NonNull String name) Deprecated.preferbuilder(String)Create a new builder- Type Parameters:
C- Command sender type- Parameters:
name- Name of the argument- Returns:
- Created builder
-
of
public static <C> @NonNull cloud.commandframework.arguments.CommandArgument<C,org.bukkit.OfflinePlayer> of(@NonNull String name) Create a new required command component- Type Parameters:
C- Command sender type- Parameters:
name- Component name- Returns:
- Created component
-
optional
public static <C> @NonNull cloud.commandframework.arguments.CommandArgument<C,org.bukkit.OfflinePlayer> optional(@NonNull String name) Create a new optional command component- Type Parameters:
C- Command sender type- Parameters:
name- Component name- Returns:
- Created component
-
optional
public static <C> @NonNull cloud.commandframework.arguments.CommandArgument<C,org.bukkit.OfflinePlayer> optional(@NonNull String name, @NonNull String defaultPlayer) Create a new required command component with a default value- Type Parameters:
C- Command sender type- Parameters:
name- Component namedefaultPlayer- Default player- Returns:
- Created component
-
builder(String)