Interface PlayerResearchObjective

All Known Implementing Classes:
ClientResearchObjective, PixelmonPlayerResearchObjective

public interface PlayerResearchObjective
Represents the player's data for a specific research objective.
This is used to track the progress of a player's research.
  • Method Details

    • objective

      ResearchObjective objective()
      Gets the objective that this player research objective is for.
      Returns:
      The objective.
    • isComplete

      boolean isComplete()
      Returns:
      If the objective has been completed.
    • hasClaimedReward

      boolean hasClaimedReward()
      Returns:
      If the reward for the objective has been claimed.
    • canClaimReward

      default boolean canClaimReward()
      Returns:
      If the player can claim the reward for the objective.
    • getProgress

      int getProgress()
      Returns:
      The progress of the objective.
    • getTarget

      int getTarget()
      Returns:
      The target of the objective.
    • handleInteractionEvent

      boolean handleInteractionEvent(InteractionEvent event, InteractionContext context)
      Handles an interaction event for the objective.
      Parameters:
      event - The event.
      context - The context.
      Returns:
      If the event was handled.
    • claimReward

      void claimReward()
      Claims the reward for the objective.
    • complete

      void complete()
      Completes the objective.
    • serialize

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

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

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