Class SpigotBootCommand

java.lang.Object
org.bukkit.command.Command
tech.guilhermekaua.spigotboot.commands.spigot.SpigotBootCommand

public class SpigotBootCommand extends org.bukkit.command.Command
  • Field Summary

    Fields inherited from class org.bukkit.command.Command

    description, timings, usageMessage
  • Constructor Summary

    Constructors
    Constructor
    Description
    SpigotBootCommand(tech.guilhermekaua.spigotboot.core.context.Context context, CompiledRootCommand rootCommand, CommandDispatcher dispatcher, CommandPlatformSupport commandPlatformSupport)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    execute(@NotNull org.bukkit.command.CommandSender sender, @NotNull String commandLabel, @NotNull String[] args)
     
    @Nullable String
    Returns null so Bukkit carries no static permission for this command; visibility is computed per-sender in testPermissionSilent(CommandSender) instead.
     
    boolean
    isOwnedBy(tech.guilhermekaua.spigotboot.core.plugin.BootPlugin bootPlugin)
     
    @NotNull List<String>
    tabComplete(@NotNull org.bukkit.command.CommandSender sender, @NotNull String alias, @NotNull String[] args)
     
    boolean
    testPermissionSilent(@NotNull org.bukkit.command.CommandSender target)
    Reports whether target can use at least one route of this command.

    Methods inherited from class org.bukkit.command.Command

    broadcastCommandMessage, broadcastCommandMessage, broadcastCommandMessage, broadcastCommandMessage, getAliases, getDescription, getLabel, getName, getPermissionMessage, getTimingName, getUsage, isRegistered, permissionMessage, permissionMessage, register, setAliases, setDescription, setLabel, setName, setPermission, setPermissionMessage, setUsage, tabComplete, testPermission, toString, unregister

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

  • Method Details

    • execute

      public boolean execute(@NotNull @NotNull org.bukkit.command.CommandSender sender, @NotNull @NotNull String commandLabel, @NotNull @NotNull String[] args)
      Specified by:
      execute in class org.bukkit.command.Command
    • tabComplete

      @NotNull public @NotNull List<String> tabComplete(@NotNull @NotNull org.bukkit.command.CommandSender sender, @NotNull @NotNull String alias, @NotNull @NotNull String[] args) throws IllegalArgumentException
      Overrides:
      tabComplete in class org.bukkit.command.Command
      Throws:
      IllegalArgumentException
    • isOwnedBy

      public boolean isOwnedBy(tech.guilhermekaua.spigotboot.core.plugin.BootPlugin bootPlugin)
    • getRootCommand

      public CompiledRootCommand getRootCommand()
    • getPermission

      @Nullable public @Nullable String getPermission()
      Returns null so Bukkit carries no static permission for this command; visibility is computed per-sender in testPermissionSilent(CommandSender) instead. Per-route permissions (@Permission) are enforced by CommandDispatcher during both dispatch and tab-completion.
      Overrides:
      getPermission in class org.bukkit.command.Command
    • testPermissionSilent

      public boolean testPermissionSilent(@NotNull @NotNull org.bukkit.command.CommandSender target)
      Reports whether target can use at least one route of this command. CraftBukkit builds each command's client-side command-tree node with a requires(...) predicate backed by this method, so returning the route-aware result hides the command in tab completion from senders who can run none of its subcommands (nor its default handler). Execution is unaffected — Bukkit's command dispatch does not consult permissions — so CommandDispatcher still enforces per-route @Permission during execute(org.bukkit.command.CommandSender, java.lang.String, java.lang.String[]) and tabComplete(org.bukkit.command.CommandSender, java.lang.String, java.lang.String[]) for senders who pass this gate.
      Overrides:
      testPermissionSilent in class org.bukkit.command.Command
      Parameters:
      target - the sender being tested
      Returns:
      true if target can use at least one of this command's routes