Class CommandSettings
java.lang.Object
com.github.cyberryan1.cybercore.spigot.command.settings.CommandSettings
- Direct Known Subclasses:
BaseCommand
Contains all the settings for a command. Contains constructors,
getters, setters, and checkers (but no chess (please laugh)) for the settings.
-
Constructor Summary
ConstructorsConstructorDescriptionCommandSettings
(String name, String usage) CommandSettings
(String name, String permission, String usage) CommandSettings
(String name, String permission, String permissionMsg, String usage) -
Method Summary
Modifier and TypeMethodDescriptionfinal void
demandConsole
(boolean demandConsole) Alias for the setDemandConsole() methodfinal void
demandPermission
(boolean demandPermission) Alias for the setDemandPermission() methodfinal void
demandPlayer
(boolean demandPlayer) Alias for the setDemandPlayer() methodfinal String
final String
final String
final String
getName()
final String
final String
final String
getUsage()
final boolean
final boolean
final boolean
final boolean
boolean
permissionsAllowed
(org.bukkit.command.CommandSender sender) Whether the sender has permissions or not for the commandboolean
permsAllowed
(org.bukkit.command.CommandSender sender) Whether the sender has permissions or not for the commandfinal boolean
runAsync()
final void
setDemandConsole
(boolean demandConsole) final void
setDemandPermission
(boolean demandPermission) final void
setDemandPlayer
(boolean demandPlayer) final void
Sets the message that's sent to the player when they provide an invalid double.final void
Sets the message that's sent to the player when they provide an invalid integer.final void
Sets the message that's sent to the player when they provide an invalid player.final void
setRunAsync
(boolean async) final void
setTabCompleteEnabled
(boolean tabCompleteEnabled)
-
Constructor Details
-
CommandSettings
-
CommandSettings
-
CommandSettings
-
-
Method Details
-
permissionsAllowed
public boolean permissionsAllowed(org.bukkit.command.CommandSender sender) Whether the sender has permissions or not for the command- Parameters:
sender
- the sender of the command- Returns:
- true if the sender has permissions or if the permission variable is null, false otherwise
-
permsAllowed
public boolean permsAllowed(org.bukkit.command.CommandSender sender) Whether the sender has permissions or not for the command- Parameters:
sender
- the sender of the command- Returns:
- true if the sender has permissions or if the permission variable is null, false otherwise
-
getName
- Returns:
- The name of the command
-
getPermission
- Returns:
- The permission of the command
-
getPermissionMsg
- Returns:
- The permission message for the command. If not set,
CyberCommandUtils.getDefaultPermissionMsg()
is returned instead.
-
getUsage
- Returns:
- The usage for the command
-
getInvalidPlayerMsg
- Returns:
- The invalid player message for the command. If not set,
CyberCommandUtils.getInvalidPlayerMsg()
is returned instead. Note that %s is where the attempted name should be inserted.
-
getInvalidIntegerMsg
- Returns:
- The invalid integer message for the command. If not set,
CyberCommandUtils.getInvalidIntegerMsg()
is returned instead. Note that %s is where the invalid integer should be inserted.
-
getInvalidDoubleMsg
- Returns:
- The invalid double message for the command. If not set,
CyberCommandUtils.getInvalidDoubleMsg()
is returned instead. Note that %s is where the invalid double should be inserted.
-
isDemandPlayer
public final boolean isDemandPlayer()- Returns:
- True if the command is only executable by players, false otherwise
-
isDemandConsole
public final boolean isDemandConsole()- Returns:
- True if the command is only executable by the console, false otherwise
-
isDemandPermission
public final boolean isDemandPermission()- Returns:
- True if the command is only executable by players with the permission, false otherwise
-
runAsync
public final boolean runAsync()- Returns:
- True if the command is asynchronous, false otherwise
-
isTabCompleteEnabled
public final boolean isTabCompleteEnabled()- Returns:
- True if the command has tab completion enabled, false otherwise
-
setInvalidPlayerMsg
Sets the message that's sent to the player when they provide an invalid player. Use %s to mark where the invalid player name should be inserted.- Parameters:
msg
- The message
-
setInvalidIntegerMsg
Sets the message that's sent to the player when they provide an invalid integer. Use %s to mark where the invalid integer should be inserted.- Parameters:
msg
- The message
-
setInvalidDoubleMsg
Sets the message that's sent to the player when they provide an invalid double. Use %s to mark where the invalid double should be inserted.- Parameters:
msg
- The message
-
setDemandPlayer
public final void setDemandPlayer(boolean demandPlayer) - Parameters:
demandPlayer
- Whether the command is only executable by players (true) or not (false)
-
demandPlayer
public final void demandPlayer(boolean demandPlayer) Alias for the setDemandPlayer() method- Parameters:
demandPlayer
- Whether the command is only executable by players (true) or not (false)
-
setDemandConsole
public final void setDemandConsole(boolean demandConsole) - Parameters:
demandConsole
- Whether the command is only executable by the console (true) or not (false)
-
demandConsole
public final void demandConsole(boolean demandConsole) Alias for the setDemandConsole() method- Parameters:
demandConsole
- Whether the command is only executable by the console (true) or not (false)
-
setDemandPermission
public final void setDemandPermission(boolean demandPermission) - Parameters:
demandPermission
- Whether the command is only executable by players with the permission (true) or not (false)
-
demandPermission
public final void demandPermission(boolean demandPermission) Alias for the setDemandPermission() method- Parameters:
demandPermission
- Whether the command is only executable by players with the permission (true) or not (false)
-
setRunAsync
public final void setRunAsync(boolean async) - Parameters:
async
- Whether the command is asynchronous (true) or not (false)
-
setTabCompleteEnabled
public final void setTabCompleteEnabled(boolean tabCompleteEnabled) - Parameters:
tabCompleteEnabled
- Whether the command has tab completion enabled (true) or not (false)
-