public interface Sender<T>
| Modifier and Type | Method and Description |
|---|---|
boolean |
hasPermission(@NotNull java.lang.String permission)
Check if this sender has a specific permission.
|
boolean |
isExpectedType(@NotNull BladeCommand command)
Check if this wrapped sender is of the expected type for the given command.
|
@NotNull java.lang.String |
name()
Get the name of this sender.
|
<S> S |
parseAs(@NotNull java.lang.Class<S> clazz)
Attempt to "parse" (or convert) the underlying platform-specific sender
type to the given class type.
|
T |
rawSender()
Get the raw platform instance of this wrapped sender.
|
@NotNull java.lang.Object |
underlyingSender()
Get the underlying platform-specific sender object.
|
@NotNull java.lang.Class<?> |
underlyingSenderType()
Get the class type of the underlying sender.
|
@NotNull T rawSender()
This is the actual platform-specific sender type, such as a Player, CommandSource, etc.
@ApiStatus.Internal @NotNull @NotNull java.lang.Object underlyingSender()
On most platforms, this will be the same as getSender(),
but some platforms may use proxies or dynamic types. (e.g. Fabric's CommandSource)
@ApiStatus.Internal @NotNull @NotNull java.lang.Class<?> underlyingSenderType()
On most platforms, this will be the same as getSender().getClass(),
but some platforms may use proxies or dynamic types. (e.g. Fabric's CommandSource)
@NotNull @NotNull java.lang.String name()
boolean hasPermission(@NotNull
@NotNull java.lang.String permission)
permission - the permission to check@Nullable
<S> S parseAs(@NotNull
@NotNull java.lang.Class<S> clazz)
If the conversion is not possible, this method will return null.
clazz - the class to parse the sender as@ApiStatus.Internal
boolean isExpectedType(@NotNull
@NotNull BladeCommand command)
command - the command to check against