Class GuiButtonData
java.lang.Object
github.nighter.smartspawner.api.gui.GuiButtonData
Immutable data transfer object representing a GUI button configuration.
This class is part of the SmartSpawner Developer API and can be used
to programmatically define GUI layouts via
GuiButtonBuilder.-
Constructor Summary
ConstructorsConstructorDescriptionGuiButtonData(String buttonType, int slot, org.bukkit.Material material, boolean enabled, String condition, Map<String, String> actions, boolean infoButton, String customTexture) Creates button data using the same 1-based slot numbering as GUI layout YAML files.GuiButtonData(String buttonType, int slot, org.bukkit.Material material, boolean enabled, String condition, Map<String, String> actions, boolean infoButton, String customTexture, long cooldownTicks, GuiButtonSoundData clickSound) Creates button data with optional cooldown and click sound settings.GuiButtonData(String buttonType, int slot, org.bukkit.Material material, boolean enabled, String condition, Map<String, String> actions, boolean infoButton, String customTexture, long cooldownTicks, GuiButtonSoundData clickSound, GuiButtonSoundData successSound, GuiButtonSoundData failSound) GuiButtonData(String buttonType, int slot, org.bukkit.Material material, boolean enabled, String condition, Map<String, String> actions, boolean infoButton, String customTexture, long cooldownTicks, Map<String, List<GuiButtonSoundData>> clickSounds, Map<String, List<GuiButtonSoundData>> successSounds, Map<String, List<GuiButtonSoundData>> failSounds) -
Method Summary
Modifier and TypeMethodDescriptionGets the action for a specific click type.Gets the default action (checks "click" first, then "default").booleanReturns whether this button has a configured click sound.booleanbooleanReturns whether this button has an enabled cooldown.booleanboolean
-
Constructor Details
-
GuiButtonData
-
GuiButtonData
public GuiButtonData(String buttonType, int slot, org.bukkit.Material material, boolean enabled, String condition, Map<String, String> actions, boolean infoButton, String customTexture, long cooldownTicks, GuiButtonSoundData clickSound) Creates button data with optional cooldown and click sound settings.- Parameters:
cooldownTicks- cooldown in server ticks; zero disables cooldownclickSound- click sound configuration, or null for no sound
-
GuiButtonData
public GuiButtonData(String buttonType, int slot, org.bukkit.Material material, boolean enabled, String condition, Map<String, String> actions, boolean infoButton, String customTexture, long cooldownTicks, GuiButtonSoundData clickSound, GuiButtonSoundData successSound, GuiButtonSoundData failSound) -
GuiButtonData
public GuiButtonData(String buttonType, int slot, org.bukkit.Material material, boolean enabled, String condition, Map<String, String> actions, boolean infoButton, String customTexture, long cooldownTicks, Map<String, List<GuiButtonSoundData>> clickSounds, Map<String, List<GuiButtonSoundData>> successSounds, Map<String, List<GuiButtonSoundData>> failSounds)
-
-
Method Details
-
getAction
-
getDefaultAction
Gets the default action (checks "click" first, then "default").- Returns:
- the default action string, or null if not found
-
hasCondition
public boolean hasCondition() -
hasCooldown
public boolean hasCooldown()Returns whether this button has an enabled cooldown. -
hasClickSound
public boolean hasClickSound()Returns whether this button has a configured click sound. -
hasSuccessSound
public boolean hasSuccessSound() -
hasFailSound
public boolean hasFailSound()
-