Interface ResearchStorage

All Known Implementing Classes:
PixelmonResearchStorage

public interface ResearchStorage
This interface represents the storage of research data for a player.
  • Method Details

    • getUniqueId

      UUID getUniqueId()
      Returns:
      The unique identifier of the player.
    • getOwner

      @Nullable @Nullable net.minecraft.server.level.ServerPlayer getOwner()
      Returns:
      The owner of the research storage.
    • handleInteractionEvent

      void handleInteractionEvent(InteractionEvent event, InteractionContext context)
      Handles an InteractionEvent that the player has triggered.
      Parameters:
      event - The event that the player has triggered.
      context - The context of the interaction.
    • activeResearch

      Collection<PlayerResearch> activeResearch()
      Returns:
      The collection of active research that the player is currently researching.
    • findResearch

      List<PlayerResearch> findResearch(Research research)
      Finds all active research the player has of that type.
      Parameters:
      research - The research to find.
      Returns:
      The list of research that the player has found.
    • findResearch

      PlayerResearch findResearch(UUID uuid)
      Finds the active research the player has with the given UUID, or null if not present.
      Parameters:
      uuid - The UUID to find.
      Returns:
      The research with the given UUID, or null if not present.
    • startResearch

      boolean startResearch(Research research)
      Starts a new research for the player.
      Parameters:
      research - The research to start.
    • markComplete

      void markComplete(PlayerResearch research)
      Marks the research as complete.
      Parameters:
      research - The research to mark as complete.
    • discardResearch

      boolean discardResearch(PlayerResearch research)
      Discards the research.
      Parameters:
      research - The research to discard.
      Returns:
      Whether this research was discarded or not.
    • removeResearch

      void removeResearch(PlayerResearch research)
      Removes the research from the storage bypassing the check for if the Research is Research.abandonable().
      Parameters:
      research - The research to remove.
    • clear

      void clear()
      Clears all research data.
    • updateAll

      void updateAll()
      Updates all research data.
    • serialize

      net.minecraft.nbt.CompoundTag serialize()
      Serializes the research storage.
      Returns:
      The serialized form of the research storage.
    • deserialize

      void deserialize(net.minecraft.nbt.CompoundTag tag)
      Deserializes the research storage from a CompoundTag.
      Parameters:
      tag - The tag to deserialize.