Interface IPlayerAbilityData


  • public interface IPlayerAbilityData
    Interface for managing player abilities. Players reference abilities by key (built-in names or custom UUIDs).

    Access via IPlayerData.getAbilityData()

    • Method Detail

      • getUnlockedAbilities

        String[] getUnlockedAbilities()
        Get all unlocked ability keys.
        Returns:
        array of ability keys
      • unlockAbility

        void unlockAbility​(String key)
        Unlock an ability for this player.
        Parameters:
        key - The ability key (built-in name or custom UUID)
      • lockAbility

        void lockAbility​(String key)
        Lock (remove) an ability from this player.
        Parameters:
        key - the ability key
      • hasUnlockedAbility

        boolean hasUnlockedAbility​(String key)
        Check if the player has unlocked a specific ability.
        Parameters:
        key - the ability key
        Returns:
        true if unlocked
      • getSelectedIndex

        int getSelectedIndex()
        Get the currently selected ability index.
        Returns:
        the selected index
      • setSelectedIndex

        void setSelectedIndex​(int index)
        Set the selected ability index.
        Parameters:
        index - the ability index
      • getSelectedAbilityKey

        String getSelectedAbilityKey()
        Get the key of the currently selected ability.
        Returns:
        the selected ability key
      • selectNext

        void selectNext()
        Select the next ability in the list.
      • selectPrevious

        void selectPrevious()
        Select the previous ability in the list.
      • isExecutingAbility

        boolean isExecutingAbility()
        Check if the player is currently executing an ability.
        Returns:
        true if executing
      • getCurrentAbility

        IAbility getCurrentAbility()
        Get the currently executing ability.
        Returns:
        the current ability, or null
      • interruptCurrentAbility

        void interruptCurrentAbility()
        Interrupt the currently executing ability.
      • completeCurrentAbility

        void completeCurrentAbility()
        Signal the current ability to complete immediately.
      • isOnCooldown

        boolean isOnCooldown()
        Check if the player is on universal cooldown.
        Returns:
        true if on cooldown
      • isOnCooldown

        boolean isOnCooldown​(String key)
        Check if a specific ability is on cooldown.
        Parameters:
        key - The ability key
        Returns:
        true if on cooldown
      • resetCooldown

        void resetCooldown()
        Reset the universal cooldown.
      • resetCooldown

        void resetCooldown​(String key)
        Reset cooldown for a specific ability key.
        Parameters:
        key - The ability key
      • resetAllCooldowns

        void resetAllCooldowns()
        Reset all cooldowns.
      • activateAbility

        boolean activateAbility()
        Activate the currently selected ability.
        Returns:
        true if activated
      • activateAbility

        boolean activateAbility​(String key)
        Activate a specific ability by key.
        Parameters:
        key - the ability key
        Returns:
        true if activated
      • toggleAbility

        int toggleAbility​(String key)
        Cycle a toggle ability to its next state. Off -> State 1 -> State 2 -> ... -> State N -> Off
        Parameters:
        key - the ability key
        Returns:
        The new state (0 = off, 1+ = active state number)
      • getToggleState

        int getToggleState​(String key)
        Get the current toggle state for an ability.
        Parameters:
        key - the ability key
        Returns:
        0 if not active, 1+ for active state
      • setToggleState

        void setToggleState​(String key,
                            int state)
        Set a toggle to a specific state. 0 = deactivate, 1+ = specific state.
        Parameters:
        key - the ability key
        state - the toggle state
      • isAbilityToggled

        boolean isAbilityToggled​(String key)
        Check if a toggle ability is currently active (any state > 0).
        Parameters:
        key - the ability key
        Returns:
        true if toggled on