Interface IPlayerPreference

All Known Implementing Classes:
PlayerPreference

public interface IPlayerPreference
IPlayerPreference is an interface that defines the contract for managing player-specific preferences in a Minecraft server environment. Implementations of this interface should handle the loading, saving, and resetting of preferences for individual players. This interface is essential for ensuring consistent behavior across different implementations of player preference management.
Since:
2023-11-20
Version:
1.0.0
Author:
notzune
  • Method Summary

    Modifier and Type
    Method
    Description
    describe(org.bukkit.entity.Player player)
    Provides a string representation of the player's current preferences.
    void
    load(org.bukkit.entity.Player player)
    Loads the player's preferences from a persistent data store.
    void
    reset(org.bukkit.entity.Player player)
    Resets the player's preferences to their default values.
    void
    save(org.bukkit.entity.Player player)
    Saves the current state of the player's preferences to a persistent data store.
  • Method Details

    • load

      void load(org.bukkit.entity.Player player)
      Loads the player's preferences from a persistent data store. This method should be implemented to retrieve the stored preferences of a player and apply them. It's typically called when a player joins the server or a reload of preferences is needed.
      Parameters:
      player - The player whose preferences are to be loaded.
    • save

      void save(org.bukkit.entity.Player player)
      Saves the current state of the player's preferences to a persistent data store. Implementations should ensure that any changes made to the preferences are persisted. This method is usually called when a player leaves the server or when preferences are changed.
      Parameters:
      player - The player whose preferences are to be saved.
    • reset

      void reset(org.bukkit.entity.Player player)
      Resets the player's preferences to their default values. This method is useful for situations where a player's preferences need to be cleared or reverted. Implementations should ensure that all preferences are set to their initial state.
      Parameters:
      player - The player whose preferences are to be reset.
    • describe

      String describe(org.bukkit.entity.Player player)
      Provides a string representation of the player's current preferences. This can be used to display the preferences to the player, for logging, or for administrative purposes. The format and detail level of the description can vary depending on the implementation.
      Parameters:
      player - The player whose preference summary is to be retrieved.
      Returns:
      A string describing the player's current preferences. The format of this string is implementation-specific.