Interface IProfileHandler


  • public interface IProfileHandler
    Manages player profiles, which allow players to have multiple save slots for their CNPC+ data.
    • Method Detail

      • getProfile

        IProfile getProfile​(IPlayer player)
        Returns the profile for the given player.
        Parameters:
        player - the player.
        Returns:
        the player's profile.
      • changeSlot

        boolean changeSlot​(IPlayer player,
                           int slotID)
        Switches the player to a different profile slot.
        Parameters:
        player - the player.
        slotID - the slot ID to switch to.
        Returns:
        true if the switch was successful.
      • hasSlot

        boolean hasSlot​(IPlayer player,
                        int slotID)
        Checks whether a profile slot exists for the player.
        Parameters:
        player - the player.
        slotID - the slot ID.
        Returns:
        true if the slot exists.
      • removeSlot

        boolean removeSlot​(IPlayer player,
                           int slotID)
        Removes a profile slot from the player.
        Parameters:
        player - the player.
        slotID - the slot ID to remove.
        Returns:
        true if the slot was removed.
      • getSlotPlayerData

        IPlayerData getSlotPlayerData​(IPlayer player,
                                      int slotID)
        Returns the player data for a specific profile slot without switching to it.
        Parameters:
        player - the player.
        slotID - the slot ID.
        Returns:
        the player data for the slot.
      • saveSlotData

        void saveSlotData​(IPlayer player)
        Saves the current slot data for the player.
        Parameters:
        player - the player.