Class PreferenceCommand

java.lang.Object
org.bukkit.command.Command
org.bukkit.command.defaults.BukkitCommand
tk.airshipcraft.commonlib.commands.CommandManager
tk.airshipcraft.commonlib.commands.PreferenceCommand

public class PreferenceCommand extends CommandManager
PreferenceCommand class extends CommandManager to provide custom command handling specifically for managing player preferences in the game. This class handles the 'preference' command and its sub-commands to allow players to set and view their preferences.
Since:
2023-11-20
Version:
1.0.0
Author:
notzune
  • Field Summary

    Fields inherited from class org.bukkit.command.Command

    description, timings, usageMessage
  • Constructor Summary

    Constructors
    Constructor
    Description
    Constructs a new PreferenceCommand.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    execute(org.bukkit.command.CommandSender sender, String[] args)
    Executes the 'preference' command when invoked by a player or console.
    onTabComplete(org.bukkit.command.CommandSender sender, String[] args)
    Provides tab completion options for the 'preference' command.

    Methods inherited from class tk.airshipcraft.commonlib.commands.CommandManager

    execute, tabComplete

    Methods inherited from class org.bukkit.command.Command

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

    Methods inherited from class java.lang.Object

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

    • PreferenceCommand

      public PreferenceCommand()
      Constructs a new PreferenceCommand. Sets up the command with the name 'preference', a description, required permission, and command aliases.
  • Method Details

    • execute

      public void execute(org.bukkit.command.CommandSender sender, String[] args) throws SQLException
      Executes the 'preference' command when invoked by a player or console. Supports sub-commands for setting and viewing player preferences.
      Specified by:
      execute in class CommandManager
      Parameters:
      sender - The entity that issued the command.
      args - Arguments provided with the command.
      Throws:
      SQLException - If a database access error occurs.
    • onTabComplete

      public List<String> onTabComplete(org.bukkit.command.CommandSender sender, String[] args)
      Provides tab completion options for the 'preference' command. Customizes the tab completion behavior based on the current argument level.
      Specified by:
      onTabComplete in class CommandManager
      Parameters:
      sender - The entity that sent the command.
      args - Command arguments passed to the command.
      Returns:
      A list of strings containing potential tab completion options.