public class AnnoyingSender
extends java.lang.Object
AnnoyingCommand| Constructor and Description |
|---|
AnnoyingSender(@NotNull AnnoyingPlugin plugin,
@NotNull org.bukkit.command.CommandSender cmdSender)
Constructs a new
AnnoyingSender without a Command |
AnnoyingSender(@NotNull AnnoyingPlugin plugin,
@NotNull org.bukkit.command.CommandSender cmdSender,
@NotNull org.bukkit.command.Command cmd,
@NotNull java.lang.String label,
@NotNull java.lang.String[] args)
Constructs a new
AnnoyingSender |
| Modifier and Type | Method and Description |
|---|---|
boolean |
argEquals(int index,
java.lang.String... strings)
Returns if the specified
args index is equal to any of the specified strings (case-insensitive) |
boolean |
checkPermission(@NotNull java.lang.String permission)
Checks if the
CommandSender has the specified permission. |
boolean |
checkPlayer()
Checks if the
CommandSender is a Player. |
@Nullable java.lang.String[] |
getArgs()
Returns the
Command's arguments that were used |
@Nullable org.bukkit.command.Command |
getCmd()
Returns the
Command that was used |
@NotNull org.bukkit.command.CommandSender |
getCmdSender()
Returns the
CommandSender that was used |
@Nullable java.lang.String |
getLabel()
Returns the
Command's label that was used |
@NotNull org.bukkit.entity.Player |
getPlayer()
Casts the
CommandSender to a Player |
@Contract(pure=true)
public AnnoyingSender(@NotNull
@NotNull AnnoyingPlugin plugin,
@NotNull
@NotNull org.bukkit.command.CommandSender cmdSender,
@NotNull
@NotNull org.bukkit.command.Command cmd,
@NotNull
@NotNull java.lang.String label,
@NotNull
@NotNull java.lang.String[] args)
AnnoyingSenderplugin - the AnnoyingPlugin instancecmdSender - the CommandSender to be usedcmd - the Command that was usedlabel - the Command's label that was usedargs - the Command's arguments that were used@Contract(pure=true)
public AnnoyingSender(@NotNull
@NotNull AnnoyingPlugin plugin,
@NotNull
@NotNull org.bukkit.command.CommandSender cmdSender)
AnnoyingSender without a Commandplugin - the AnnoyingPlugin instancecmdSender - the CommandSender to be used@NotNull public @NotNull org.bukkit.command.CommandSender getCmdSender()
CommandSender that was usedCommandSender used@Nullable public @Nullable org.bukkit.command.Command getCmd()
Command that was usedCommand that was used@Nullable public @Nullable java.lang.String getLabel()
Command's label that was usedCommand's label that was used@Nullable public @Nullable java.lang.String[] getArgs()
Command's arguments that were usedCommand's arguments that were used@NotNull public @NotNull org.bukkit.entity.Player getPlayer()
CommandSender to a Player
Only use this if you know that the CommandSender is a Player
Player that was usedpublic boolean argEquals(int index,
@Nullable
java.lang.String... strings)
args index is equal to any of the specified strings (case-insensitive)index - the argument indexstrings - the strings to compare totrue if the specified args index is equal to any of the specified strings (case-insensitive)public boolean checkPlayer()
CommandSender is a Player. If they aren't, it sends the AnnoyingOptions.playerOnly messageCommandSender is a Playerpublic boolean checkPermission(@NotNull
@NotNull java.lang.String permission)
CommandSender has the specified permission. If they don't, it sends the AnnoyingOptions.noPermission messagepermission - the permission to checkCommandSender has the specified permission