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 Summary
Modifier and TypeMethodDescriptionbooleanabandon()Abandons the research, if able to.voidcomplete()Completes the research.voidCompletes the currentPlayerResearchStageand progresses to the next stage.voiddeserialize(net.minecraft.nbt.CompoundTag tag) Deserializes the player research from aCompoundTag.booleanhandleInteractionEvent(InteractionEvent event, InteractionContext context) Handles anInteractionEventthat the player has triggered.default booleandefault booleanbooleanboolean@Nullable ResearchStagenet.minecraft.world.entity.player.Playerowner()Gets the player which this research is for.net.minecraft.nbt.CompoundTagSerializes the player research to aCompoundTag.storage()Gets the storage which this research is for.voidToggles the favorite state of this research.type()default voidupdate()Sends this research to the player which it is for.default voidupdate(boolean remove) Sends this research to the player which it is for.uuid()Gets the UUID of this research instance.default voidwrite(net.minecraft.network.FriendlyByteBuf buffer) Writes the player research into a buffer, for reading byClientResearchlater.
-
Method Details
-
uuid
UUID uuid()Gets the UUID of this research instance.- Returns:
- The UUID of this.
-
type
Research type()- Returns:
- The
Researchthat 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
PlayerResearchStagethat the player is on.
-
nextStage
- Returns:
- The next
ResearchStagethat 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
Handles anInteractionEventthat 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 currentPlayerResearchStageand progresses to the next stage.
This will also callcomplete()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 aCompoundTag.- Returns:
- The serialized player research.
-
deserialize
void deserialize(net.minecraft.nbt.CompoundTag tag) Deserializes the player research from aCompoundTag.- 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 byClientResearchlater.- Parameters:
buffer- The buffer to write to.
-