Class CosmeticsMenuCommand
java.lang.Object
com.storytimeproductions.stweaks.commands.CosmeticsMenuCommand
- All Implemented Interfaces:
org.bukkit.command.CommandExecutor
,org.bukkit.event.Listener
public class CosmeticsMenuCommand
extends Object
implements org.bukkit.command.CommandExecutor, org.bukkit.event.Listener
Command executor and menu handler for the Cosmetics GUI. Handles opening the cosmetics menu,
pagination, and reloading cosmetics.
-
Constructor Summary
ConstructorsConstructorDescriptionCosmeticsMenuCommand
(CosmeticsManager cosmeticsManager) Constructs a new CosmeticsMenuCommand. -
Method Summary
Modifier and TypeMethodDescriptionboolean
onCommand
(org.bukkit.command.CommandSender sender, org.bukkit.command.Command command, String label, String[] args) Handles the /cosmetics command, opening the menu or reloading cosmetics.static void
openCosmeticView
(org.bukkit.entity.Player player, Cosmetic cosmetic, int returnPage) Opens a detailed view of a specific cosmetic for the player.static void
openMainMenu
(org.bukkit.entity.Player player, int page) Opens the main cosmetics menu for the player at the specified page.
-
Constructor Details
-
CosmeticsMenuCommand
Constructs a new CosmeticsMenuCommand.- Parameters:
cosmeticsManager
- the CosmeticsManager instance
-
-
Method Details
-
openMainMenu
public static void openMainMenu(org.bukkit.entity.Player player, int page) Opens the main cosmetics menu for the player at the specified page.- Parameters:
player
- the player to open the menu forpage
- the page number (0-based)
-
openCosmeticView
public static void openCosmeticView(org.bukkit.entity.Player player, Cosmetic cosmetic, int returnPage) Opens a detailed view of a specific cosmetic for the player.- Parameters:
player
- the player to open the view forcosmetic
- the cosmetic to view
-
onCommand
public boolean onCommand(org.bukkit.command.CommandSender sender, org.bukkit.command.Command command, String label, String[] args) Handles the /cosmetics command, opening the menu or reloading cosmetics.- Specified by:
onCommand
in interfaceorg.bukkit.command.CommandExecutor
- Parameters:
sender
- the command sendercommand
- the commandlabel
- the command labelargs
- the command arguments- Returns:
- true if the command was handled, false otherwise
-