Class PreferenceCommand
java.lang.Object
org.bukkit.command.Command
org.bukkit.command.defaults.BukkitCommand
tk.airshipcraft.commonlib.commands.CommandManager
tk.airshipcraft.commonlib.commands.PreferenceCommand
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 -
Method Summary
Modifier and TypeMethodDescriptionvoid
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
-
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
Executes the 'preference' command when invoked by a player or console. Supports sub-commands for setting and viewing player preferences.- Specified by:
execute
in classCommandManager
- Parameters:
sender
- The entity that issued the command.args
- Arguments provided with the command.- Throws:
SQLException
- If a database access error occurs.
-
onTabComplete
Provides tab completion options for the 'preference' command. Customizes the tab completion behavior based on the current argument level.- Specified by:
onTabComplete
in classCommandManager
- 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.
-