Package io.github.simplexdevelopment.cl
Class CommandBase
java.lang.Object
io.github.simplexdevelopment.cl.Permissible
io.github.simplexdevelopment.cl.CommandBase
- All Implemented Interfaces:
ICommand,org.bukkit.command.CommandExecutor,org.bukkit.command.TabCompleter
- Direct Known Subclasses:
ExampleCommand
-
Constructor Summary
ConstructorsConstructorDescriptionCommandBase(@NotNull String permission) CommandBase(@NotNull String permission, boolean allowConsole) CommandBase(@NotNull String permission, String permissionMessage) CommandBase(@NotNull String permission, String permissionMessage, boolean allowConsole) -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidbroadcast(String text, AdvancedColors color) voidbroadcast(String text, BasicColors color) voiddisablePlugin(org.bukkit.plugin.Plugin plugin) voidenablePlugin(org.bukkit.plugin.Plugin plugin) List<? extends org.bukkit.entity.Player>@Nullable org.bukkit.entity.Player@Nullable org.bukkit.entity.Player@NotNull net.kyori.adventure.text.TextComponentReturns a text component for Kyori friendly messaging.@NotNull net.kyori.adventure.text.TextComponentmsg(@NotNull String text, @NotNull AdvancedColors color) Returns a text component for Kyori friendly messaging.@NotNull net.kyori.adventure.text.TextComponentmsg(@NotNull String text, @NotNull BasicColors color) Returns a text component for Kyori friendly messaging.booleanonCommand(@NotNull org.bukkit.command.CommandSender sender, @NotNull org.bukkit.command.Command command, @NotNull String lbl, String[] args) onTabComplete(@NotNull org.bukkit.command.CommandSender sender, @NotNull org.bukkit.command.Command command, @NotNull String alias, @NotNull String[] args) booleansubCommand(@NotNull String name, @NotNull org.bukkit.command.CommandSender sender, @NotNull String permission, String @NotNull [] args, @NotNull SubCommand command) Runs a subcommand provided that the user has the required permission.Methods inherited from class io.github.simplexdevelopment.cl.Permissible
allowConsole, getPermission, getPermissionMessage, hasPermission
-
Constructor Details
-
CommandBase
public CommandBase(@NotNull @NotNull String permission, String permissionMessage, boolean allowConsole) - Parameters:
permission- The permission the user should have to run the commandpermissionMessage- The message to send when the user does not have the permission to run the command.allowConsole- Whether to allow the command to be run anywhere, or only in game.
-
CommandBase
- Parameters:
permission- The permission the user should have to run the commandpermissionMessage- The message to send when the user does not have the permission to run the command.
-
CommandBase
- Parameters:
permission- The permission the user should have to run the commandallowConsole- Whether to allow the command to be run anywhere, or only in game.
-
CommandBase
- Parameters:
permission- The permission the user should have to run the command
-
-
Method Details
-
onCommand
public boolean onCommand(@NotNull @NotNull org.bukkit.command.CommandSender sender, @NotNull @NotNull org.bukkit.command.Command command, @NotNull @NotNull String lbl, String[] args) - Specified by:
onCommandin interfaceorg.bukkit.command.CommandExecutor
-
onTabComplete
@Nullable public @Nullable List<String> onTabComplete(@NotNull @NotNull org.bukkit.command.CommandSender sender, @NotNull @NotNull org.bukkit.command.Command command, @NotNull @NotNull String alias, @NotNull @NotNull String[] args) - Specified by:
onTabCompletein interfaceorg.bukkit.command.TabCompleter
-
msg
Returns a text component for Kyori friendly messaging.- Parameters:
text- The text to convert to a component- Returns:
- A
TextComponentcontaining the message provided in
-
msg
@NotNull public @NotNull net.kyori.adventure.text.TextComponent msg(@NotNull @NotNull String text, @NotNull @NotNull BasicColors color) Returns a text component for Kyori friendly messaging.- Parameters:
text- The text to convert to a Componentcolor- The color you'd like the text. These colors are basic and the majority of which are provided by Minecraft's native color system.- Returns:
- A
TextComponentcontaining the message provided in with the provided
-
msg
@NotNull public @NotNull net.kyori.adventure.text.TextComponent msg(@NotNull @NotNull String text, @NotNull @NotNull AdvancedColors color) Returns a text component for Kyori friendly messaging.- Parameters:
text- The text to convert to a Componentcolor- The color you'd like the text. These colors are much more diverse for viewing pleasure.- Returns:
- A
TextComponentcontaining the message provided in with the provided
-
subCommand
public boolean subCommand(@NotNull @NotNull String name, @NotNull @NotNull org.bukkit.command.CommandSender sender, @NotNull @NotNull String permission, String @NotNull [] args, @NotNull @NotNull SubCommand command) Runs a subcommand provided that the user has the required permission.- Parameters:
name- The name of the subcommand.sender- The user who executed the command. (Provided by Paper)permission- The permission required to run the subcommand.args- The arguments the user input to run the subcommand. (Provided by Paper)command- The SubCommand to run. This is a functional interface to provide easy implementation of the command's details.
-
getPlayer
-
getPlayer
-
getOnlinePlayers
-
broadcast
-
broadcast
-
broadcast
-
enablePlugin
public void enablePlugin(org.bukkit.plugin.Plugin plugin) -
disablePlugin
public void disablePlugin(org.bukkit.plugin.Plugin plugin)
-