java.lang.Object
com.pixelmonmod.pixelmon.api.storage.research.impl.client.ClientResearch
All Implemented Interfaces:
PlayerResearch

public class ClientResearch extends Object implements PlayerResearch
  • Constructor Details

    • ClientResearch

      public ClientResearch(net.minecraft.network.FriendlyByteBuf buffer)
  • Method Details

    • uuid

      public UUID uuid()
      Description copied from interface: PlayerResearch
      Gets the UUID of this research instance.
      Specified by:
      uuid in interface PlayerResearch
      Returns:
      The UUID of this.
    • type

      public Research type()
      Specified by:
      type in interface PlayerResearch
      Returns:
      The Research that this player research is for.
    • owner

      public net.minecraft.client.player.LocalPlayer owner()
      Description copied from interface: PlayerResearch
      Gets the player which this research is for.
      Specified by:
      owner in interface PlayerResearch
      Returns:
      The player which this is for.
    • storage

      public ResearchStorage storage()
      Description copied from interface: PlayerResearch
      Gets the storage which this research is for.
      Specified by:
      storage in interface PlayerResearch
      Returns:
      The storage which this is for.
    • currentStage

      public PlayerResearchStage currentStage()
      Specified by:
      currentStage in interface PlayerResearch
      Returns:
      The current PlayerResearchStage that the player is on.
    • currentStageClient

      public ClientResearchStage currentStageClient()
    • currentStageIndex

      public int currentStageIndex()
    • stages

      public int stages()
    • isAssignment

      public boolean isAssignment()
      Specified by:
      isAssignment in interface PlayerResearch
      Returns:
      Whether this research is an assignment.
    • isCollection

      public boolean isCollection()
      Specified by:
      isCollection in interface PlayerResearch
      Returns:
      Whether this research is a collection.
    • nextStage

      @Nullable public @Nullable ResearchStage nextStage()
      Specified by:
      nextStage in interface PlayerResearch
      Returns:
      The next ResearchStage that the player will progress to.
    • isFavorite

      public boolean isFavorite()
      Specified by:
      isFavorite in interface PlayerResearch
      Returns:
      Whether this research is marked as a favorite.
    • toggleFavorite

      public void toggleFavorite()
      Description copied from interface: PlayerResearch
      Toggles the favorite state of this research.
      Specified by:
      toggleFavorite in interface PlayerResearch
    • isComplete

      public boolean isComplete()
      Specified by:
      isComplete in interface PlayerResearch
      Returns:
      Whether the player has completed the research.
    • handleInteractionEvent

      public boolean handleInteractionEvent(InteractionEvent event, InteractionContext context)
      Description copied from interface: PlayerResearch
      Handles an InteractionEvent that the player has triggered.
      Specified by:
      handleInteractionEvent in interface PlayerResearch
      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

      public void complete()
      Description copied from interface: PlayerResearch
      Completes the research.
      Specified by:
      complete in interface PlayerResearch
    • completeStage

      public void completeStage()
      Description copied from interface: PlayerResearch
      Completes the current PlayerResearchStage and progresses to the next stage.
      This will also call PlayerResearch.complete() if the player has completed the research.
      Specified by:
      completeStage in interface PlayerResearch
    • abandon

      public boolean abandon()
      Description copied from interface: PlayerResearch
      Abandons the research, if able to.
      Specified by:
      abandon in interface PlayerResearch
      Returns:
      Whether this research was abandoned or not.
    • serialize

      public net.minecraft.nbt.CompoundTag serialize()
      Description copied from interface: PlayerResearch
      Serializes the player research to a CompoundTag.
      Specified by:
      serialize in interface PlayerResearch
      Returns:
      The serialized player research.
    • deserialize

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

      public void write(net.minecraft.network.FriendlyByteBuf buffer)
      Description copied from interface: PlayerResearch
      Writes the player research into a buffer, for reading by ClientResearch later.
      Specified by:
      write in interface PlayerResearch
      Parameters:
      buffer - The buffer to write to.