Interface PlayerResearch

All Known Subinterfaces:
ServerPlayerResearch
All Known Implementing Classes:
ClientResearch, PixelmonPlayerResearch

public interface PlayerResearch
This interface represents data stored about the player's progress on the Research.
  • Method Details

    • uuid

      UUID uuid()
      Gets the UUID of this research instance.
      Returns:
      The UUID of this.
    • type

      Research type()
      Returns:
      The Research that this player research is for.
    • owner

      net.minecraft.world.entity.player.Player owner()
      Gets the player which this research is for.
      Returns:
      The player which this is for.
    • storage

      ResearchStorage storage()
      Gets the storage which this research is for.
      Returns:
      The storage which this is for.
    • currentStage

      PlayerResearchStage currentStage()
      Returns:
      The current PlayerResearchStage that the player is on.
    • nextStage

      @Nullable @Nullable ResearchStage nextStage()
      Returns:
      The next ResearchStage that the player will progress to.
    • isFavorite

      boolean isFavorite()
      Returns:
      Whether this research is marked as a favorite.
    • toggleFavorite

      void toggleFavorite()
      Toggles the favorite state of this research.
    • isComplete

      boolean isComplete()
      Returns:
      Whether the player has completed the research.
    • handleInteractionEvent

      boolean 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.
      Returns:
      If the event caused the research to progress (not complete).
    • complete

      void complete()
      Completes the research.
    • completeStage

      void completeStage()
      Completes the current PlayerResearchStage and progresses to the next stage.
      This will also call complete() if the player has completed the research.
    • abandon

      boolean abandon()
      Abandons the research, if able to.
      Returns:
      Whether this research was abandoned or not.
    • serialize

      net.minecraft.nbt.CompoundTag serialize()
      Serializes the player research to a CompoundTag.
      Returns:
      The serialized player research.
    • deserialize

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

      default boolean isAssignment()
      Returns:
      Whether this research is an assignment.
    • isCollection

      default boolean isCollection()
      Returns:
      Whether this research is a collection.
    • update

      default void update()
      Sends this research to the player which it is for.
    • update

      default void update(boolean remove)
      Sends this research to the player which it is for.
      Parameters:
      remove - Whether to mark this research for removal on the client.
    • write

      default void write(net.minecraft.network.FriendlyByteBuf buffer)
      Writes the player research into a buffer, for reading by ClientResearch later.
      Parameters:
      buffer - The buffer to write to.