Class PixelmonResearchStorage

java.lang.Object
com.pixelmonmod.pixelmon.api.storage.research.impl.PixelmonResearchStorage
All Implemented Interfaces:
ResearchStorage

public class PixelmonResearchStorage extends Object implements ResearchStorage
  • Field Details

  • Constructor Details

    • PixelmonResearchStorage

      public PixelmonResearchStorage(UUID uuid)
  • Method Details

    • getUniqueId

      public UUID getUniqueId()
      Specified by:
      getUniqueId in interface ResearchStorage
      Returns:
      The unique identifier of the player.
    • getOwner

      @Nullable public @Nullable net.minecraft.server.level.ServerPlayer getOwner()
      Specified by:
      getOwner in interface ResearchStorage
      Returns:
      The owner of the research storage.
    • handleInteractionEvent

      public void handleInteractionEvent(net.minecraft.core.Holder<InteractionEvent> event, StoredContext context)
      Description copied from interface: ResearchStorage
      Handles an InteractionEvent that the player has triggered.
      Specified by:
      handleInteractionEvent in interface ResearchStorage
      Parameters:
      event - The event that the player has triggered.
      context - The context of the interaction.
    • activeResearch

      public Collection<PlayerResearch> activeResearch()
      Specified by:
      activeResearch in interface ResearchStorage
      Returns:
      The collection of active research that the player is currently researching.
    • findResearch

      public List<PlayerResearch> findResearch(Research research)
      Description copied from interface: ResearchStorage
      Finds all active research the player has of that type.
      Specified by:
      findResearch in interface ResearchStorage
      Parameters:
      research - The research to find.
      Returns:
      The list of research that the player has found.
    • findResearch

      public PlayerResearch findResearch(UUID uuid)
      Description copied from interface: ResearchStorage
      Finds the active research the player has with the given UUID, or null if not present.
      Specified by:
      findResearch in interface ResearchStorage
      Parameters:
      uuid - The UUID to find.
      Returns:
      The research with the given UUID, or null if not present.
    • startResearch

      public boolean startResearch(Research research)
      Description copied from interface: ResearchStorage
      Starts a new research for the player.
      Specified by:
      startResearch in interface ResearchStorage
      Parameters:
      research - The research to start.
    • markComplete

      public void markComplete(PlayerResearch research)
      Description copied from interface: ResearchStorage
      Marks the research as complete.
      Specified by:
      markComplete in interface ResearchStorage
      Parameters:
      research - The research to mark as complete.
    • discardResearch

      public boolean discardResearch(PlayerResearch research)
      Description copied from interface: ResearchStorage
      Discards the research.
      Specified by:
      discardResearch in interface ResearchStorage
      Parameters:
      research - The research to discard.
      Returns:
      Whether this research was discarded or not.
    • removeResearch

      public void removeResearch(PlayerResearch research)
      Description copied from interface: ResearchStorage
      Removes the research from the storage bypassing the check for if the Research is Research.abandonable().
      Specified by:
      removeResearch in interface ResearchStorage
      Parameters:
      research - The research to remove.
    • clear

      public void clear()
      Description copied from interface: ResearchStorage
      Clears all research data.
      Specified by:
      clear in interface ResearchStorage
    • updateAll

      public void updateAll()
      Description copied from interface: ResearchStorage
      Updates all research data.
      Specified by:
      updateAll in interface ResearchStorage
    • serialize

      public net.minecraft.nbt.CompoundTag serialize()
      Description copied from interface: ResearchStorage
      Serializes the research storage.
      Specified by:
      serialize in interface ResearchStorage
      Returns:
      The serialized form of the research storage.
    • deserialize

      public void deserialize(net.minecraft.nbt.CompoundTag tag)
      Description copied from interface: ResearchStorage
      Deserializes the research storage from a CompoundTag.
      Specified by:
      deserialize in interface ResearchStorage
      Parameters:
      tag - The tag to deserialize.