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 String
getName()
Gets the name of the command sender.@NotNull Object
getOriginalSender()
Gets the command sender that the instance is wrapped in.@NotNull UUID
getUUID()
Gets theUUID
of the command sender.boolean
hasPermission(@NotNull String perm)
Checks if theSender
has the requested permission.default boolean
isConsole()
Checks if the sender is console.boolean
isOnline()
Checks if the sender is online.
-
-
-
Method Detail
-
getUUID
@NotNull @NotNull UUID getUUID()
Gets theUUID
of 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 theSender
has the requested permission.- Parameters:
perm
- a permission.- Returns:
true
if the sender have permission,false
otherwise
-
isOnline
boolean isOnline()
Checks if the sender is online.- Returns:
true
if the sender is online,false
otherwise.
-
isConsole
default boolean isConsole()
Checks if the sender is console.- Returns:
true
if the sender is console,false
otherwise.
-
getOriginalSender
@NotNull @NotNull Object getOriginalSender()
Gets the command sender that the instance is wrapped in.- Returns:
- the original command sender
-
-