Interface Sender
-
- All Superinterfaces:
com.github.siroshun09.adventureextender.MessageReceivable
- All Known Subinterfaces:
ConsoleSender
- All Known Implementing Classes:
BukkitSender,BungeeSender,PaperSender
public interface Sender extends com.github.siroshun09.adventureextender.MessageReceivable
Interface that wraps a CommandSender that is different on different platforms.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description @NotNull StringgetName()Gets the name of the command sender.@NotNull ObjectgetOriginalSender()Gets the command sender that the instance is wrapped in.@NotNull UUIDgetUUID()Gets theUUIDof the command sender.booleanhasPermission(@NotNull String perm)Checks if theSenderhas the requested permission.default booleanisConsole()Checks if the sender is console.booleanisOnline()Checks if the sender is online.
-
-
-
Method Detail
-
getUUID
@NotNull @NotNull UUID getUUID()
Gets theUUIDof the command sender.If it is internal sender, returns
ConsoleSender.CONSOLE_UUID.- Returns:
- sender's
UUID.
-
getName
@NotNull @NotNull String getName()
Gets the name of the command sender.If it is internal sender, returns
ConsoleSender.CONSOLE_NAME.- Returns:
- sender's name.
-
hasPermission
boolean hasPermission(@NotNull @NotNull String perm)
Checks if theSenderhas the requested permission.- Parameters:
perm- a permission.- Returns:
trueif the sender have permission,falseotherwise
-
isOnline
boolean isOnline()
Checks if the sender is online.- Returns:
trueif the sender is online,falseotherwise.
-
isConsole
default boolean isConsole()
Checks if the sender is console.- Returns:
trueif the sender is console,falseotherwise.
-
getOriginalSender
@NotNull @NotNull Object getOriginalSender()
Gets the command sender that the instance is wrapped in.- Returns:
- the original command sender
-
-