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 booleanvoidClaims the reward for the objective.voidcomplete()Completes the objective.voiddeserialize(net.minecraft.nbt.CompoundTag tag) Deserializes the objective from aCompoundTag.intintbooleanhandleInteractionEvent(InteractionEvent event, InteractionContext context) Handles an interaction event for the objective.booleanbooleanGets the objective that this player research objective is for.net.minecraft.nbt.CompoundTagSerializes the objective to aCompoundTag.default voidwrite(net.minecraft.network.FriendlyByteBuf buffer) Writes the player research objective into a buffer, for reading byClientResearchObjectivelater.
-
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 byClientResearchObjectivelater.- Parameters:
buffer- The buffer to write to.
-