Interface IDataHandler

All Known Implementing Classes:
JSONDataHandler

public interface IDataHandler
  • Method Details

    • startUp

      boolean startUp()
      Called when the plugin is enabled and the data handler is selected.
      Returns:
      true if the data handler started up successfully, false otherwise.
    • shutDown

      boolean shutDown()
      Called when the plugin is disabled and the data handler is selected.
      Returns:
      true if the data handler shut down successfully, false otherwise.
    • getHandlerName

      String getHandlerName()
      Called when the data handlers name is needed.
      Returns:
      The name of the data handler.
    • loadPlayerData

      PlayerData loadPlayerData(String uuid)
      Called when the user data needs to be loaded.
      Parameters:
      uuid - The UUID of the player to load data for.
      Returns:
      The player data for the specified UUID.
    • savePlayerData

      boolean savePlayerData(PlayerData data)
      Called when the user data needs to be saved.
      Parameters:
      data - The player data to save.
      Returns:
      true if the data was saved successfully, false otherwise.
    • getJobData

      Job getJobData(String uuid)
      Retrieves job data for a given name. The data is serialized and deserialized by the selected Data Handler.
      Parameters:
      uuid - The uuid of the job to retrieve data for.
      Returns:
      The job data for the specified name.
    • saveJobData

      boolean saveJobData(String uuid, Job data)
      Saves the job data for a given name. The data is serialized and deserialized by the selected Data Handler.
      Parameters:
      uuid - The name of the job to save data for.
      data - The job data to save.
      Returns:
      true if the data was saved successfully, false otherwise.
    • saveConsumables

      boolean saveConsumables(BasicNeedsHandler handler)
      Saves the consumables for the BasicNeedsHandler. The data is serialized and deserialized by the selected Data Handler.
      Parameters:
      handler - The BasicNeedsHandler to save consumables for.
      Returns:
      true if the data was saved successfully, false otherwise.
    • loadConsumables

      HashMap<org.bukkit.inventory.ItemStack,​ConsumableItem> loadConsumables()
      Loads the consumables for the BasicNeedsHandler. The data is serialized and deserialized by the selected Data Handler.
      Returns:
      A HashMap containing all consumables.
    • getAllJobData

      Job[] getAllJobData()
      Retrieves all job data stored by the selected Data Handler.
      Returns:
      An array containing all job data.
    • removeJobData

      boolean removeJobData(String uuid)
      Removes the job data with the specified name.
      Parameters:
      uuid - The uuid of the job to remove data for.
      Returns:
      true if the data was removed successfully, false otherwise.
    • getQueueSaveTime

      int getQueueSaveTime()
      Called at the start of the plugin, this is used to determine how often the save task should run.
      Returns:
      The time in ticks between each save task run.
    • saveLockData

      boolean saveLockData(Lock lock)
      Saves lock
      Returns:
      Status if the lock has been saved.
    • getAllLockData

      Lock[] getAllLockData()
      Gets all the saved lock data.
      Returns:
      An array of all the saved lock data.
    • removeLockData

      void removeLockData(Lock lock)
      Removes the lock data from the data handler.
      Parameters:
      lock - The lock to remove.