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.
This is used to track the progress of a player's research.
-
Method Summary
Modifier and TypeMethodDescriptiondefault boolean
void
Claims the reward for the objective.void
complete()
Completes the objective.void
deserialize
(net.minecraft.nbt.CompoundTag tag) Deserializes the objective from aCompoundTag
.int
int
boolean
handleInteractionEvent
(InteractionEvent event, InteractionContext context) Handles an interaction event for the objective.boolean
boolean
Gets the objective that this player research objective is for.net.minecraft.nbt.CompoundTag
Serializes the objective to aCompoundTag
.default void
write
(net.minecraft.network.FriendlyByteBuf buffer) Writes the player research objective into a buffer, for reading byClientResearchObjective
later.
-
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
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 aCompoundTag
.- Returns:
- The serialized objective.
-
deserialize
void deserialize(net.minecraft.nbt.CompoundTag tag) Deserializes the objective from aCompoundTag
.- 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 byClientResearchObjective
later.- Parameters:
buffer
- The buffer to write to.
-