Class SyncCommandHandler

java.lang.Object
dev.satyrn.papermc.api.commands.v1.CommandHandler
All Implemented Interfaces:
org.bukkit.command.CommandExecutor, org.bukkit.command.TabCompleter

public final class SyncCommandHandler extends AccountCommandHandler
Implements a command which can be used to sync a user's account balance to their current XP balance.
Author:
Isabel Maskrey (saturniidae)
  • Constructor Summary

    Constructors
    Constructor
    Description
    SyncCommandHandler(@NotNull org.bukkit.plugin.Plugin plugin, @NotNull net.milkbowl.vault.permission.Permission permission, @NotNull AccountManager accountManager, @NotNull Configuration configuration)
    Creates a new instance of the remove command handler.
  • Method Summary

    Modifier and Type
    Method
    Description
    protected @NotNull String
    getUsage(@NotNull org.bukkit.command.CommandSender sender, @NotNull org.bukkit.command.Command command)
    Gets the command usage hint.
    boolean
    onCommand(@NotNull org.bukkit.command.CommandSender sender, @NotNull org.bukkit.command.Command command, @NotNull String label, @NotNull String[] args)
    Executes the given command, returning its success.
    @NotNull List<String>
    onTabComplete(@NotNull org.bukkit.command.CommandSender sender, @NotNull org.bukkit.command.Command command, @NotNull String alias, @NotNull String[] args)
    Requests a list of possible completions for a command argument.

    Methods inherited from class dev.satyrn.xpeconomy.api.commands.AccountCommandHandler

    getAccountManager, getConfiguration, getEconomyMethod

    Methods inherited from class dev.satyrn.xpeconomy.api.commands.VaultCommandHandler

    getPermission

    Methods inherited from class dev.satyrn.papermc.api.commands.v1.CommandHandler

    getPlugin, setupCommand, setupCommand, setUsage

    Methods inherited from class java.lang.Object

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

    • SyncCommandHandler

      public SyncCommandHandler(@NotNull @NotNull org.bukkit.plugin.Plugin plugin, @NotNull @NotNull net.milkbowl.vault.permission.Permission permission, @NotNull @NotNull AccountManager accountManager, @NotNull @NotNull Configuration configuration)
      Creates a new instance of the remove command handler.
      Parameters:
      plugin - The plugin instance
      permission - The permission instance
      accountManager - The account manager
      configuration - The configuration manager
  • Method Details

    • onCommand

      public boolean onCommand(@NotNull @NotNull org.bukkit.command.CommandSender sender, @NotNull @NotNull org.bukkit.command.Command command, @NotNull @NotNull String label, @NotNull @NotNull String[] args)
      Executes the given command, returning its success.
      If false is returned, then the "usage" plugin.yml entry for this command (if defined) will be sent to the player.
      Parameters:
      sender - Source of the command
      command - Command which was executed
      label - Alias of the command which was used
      args - Passed command arguments
      Returns:
      true if a valid command, otherwise false
    • onTabComplete

      @NotNull public @NotNull 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)
      Requests a list of possible completions for a command argument.
      Parameters:
      sender - Source of the command. For players tab-completing a command inside a command block, this will be the player, not the command block.
      command - Command which was executed
      alias - The alias used
      args - The arguments passed to the command, including final partial argument to be completed and command label
      Returns:
      A List of possible completions for the final argument, or null to default to the command executor
    • getUsage

      @NotNull protected @NotNull String getUsage(@NotNull @NotNull org.bukkit.command.CommandSender sender, @NotNull @NotNull org.bukkit.command.Command command)
      Gets the command usage hint.
      Overrides:
      getUsage in class dev.satyrn.papermc.api.commands.v1.CommandHandler
      Parameters:
      sender - Source of the command.
      command - The command to default to if the usage is not set on the handler.
      Returns:
      The command usage hint.