Class PixelmonPlayerResearch
java.lang.Object
com.pixelmonmod.pixelmon.api.storage.research.impl.PixelmonPlayerResearch
- All Implemented Interfaces:
PlayerResearch,ServerPlayerResearch
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionPixelmonPlayerResearch(UUID player) PixelmonPlayerResearch(net.minecraft.world.entity.player.Player player, Research 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.booleanboolean@Nullable ResearchStagenet.minecraft.server.level.ServerPlayerowner()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()uuid()Gets the UUID of this research instance.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.pixelmonmod.pixelmon.api.storage.research.PlayerResearch
isAssignment, isCollection, update, update, write
-
Field Details
-
UUID_TAG
- See Also:
-
RESEARCH_TAG
- See Also:
-
CURRENT_STAGE_TAG
- See Also:
-
STAGE_TAG
- See Also:
-
COMPLETE_TAG
- See Also:
-
-
Constructor Details
-
PixelmonPlayerResearch
-
PixelmonPlayerResearch
-
-
Method Details
-
uuid
Description copied from interface:PlayerResearchGets the UUID of this research instance.- Specified by:
uuidin interfacePlayerResearch- Returns:
- The UUID of this.
-
type
- Specified by:
typein interfacePlayerResearch- Returns:
- The
Researchthat this player research is for.
-
owner
public net.minecraft.server.level.ServerPlayer owner()Description copied from interface:PlayerResearchGets the player which this research is for.- Specified by:
ownerin interfacePlayerResearch- Specified by:
ownerin interfaceServerPlayerResearch- Returns:
- The player which this is for.
-
storage
Description copied from interface:PlayerResearchGets the storage which this research is for.- Specified by:
storagein interfacePlayerResearch- Returns:
- The storage which this is for.
-
currentStage
- Specified by:
currentStagein interfacePlayerResearch- Returns:
- The current
PlayerResearchStagethat the player is on.
-
nextStage
- Specified by:
nextStagein interfacePlayerResearch- Returns:
- The next
ResearchStagethat the player will progress to.
-
isFavorite
public boolean isFavorite()- Specified by:
isFavoritein interfacePlayerResearch- Returns:
- Whether this research is marked as a favorite.
-
toggleFavorite
public void toggleFavorite()Description copied from interface:PlayerResearchToggles the favorite state of this research.- Specified by:
toggleFavoritein interfacePlayerResearch
-
isComplete
public boolean isComplete()- Specified by:
isCompletein interfacePlayerResearch- Returns:
- Whether the player has completed the research.
-
handleInteractionEvent
Description copied from interface:PlayerResearchHandles anInteractionEventthat the player has triggered.- Specified by:
handleInteractionEventin interfacePlayerResearch- 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:PlayerResearchCompletes the research.- Specified by:
completein interfacePlayerResearch
-
completeStage
public void completeStage()Description copied from interface:PlayerResearchCompletes the currentPlayerResearchStageand progresses to the next stage.
This will also callPlayerResearch.complete()if the player has completed the research.- Specified by:
completeStagein interfacePlayerResearch
-
abandon
public boolean abandon()Description copied from interface:PlayerResearchAbandons the research, if able to.- Specified by:
abandonin interfacePlayerResearch- Returns:
- Whether this research was abandoned or not.
-
serialize
public net.minecraft.nbt.CompoundTag serialize()Description copied from interface:PlayerResearchSerializes the player research to aCompoundTag.- Specified by:
serializein interfacePlayerResearch- Returns:
- The serialized player research.
-
deserialize
public void deserialize(net.minecraft.nbt.CompoundTag tag) Description copied from interface:PlayerResearchDeserializes the player research from aCompoundTag.- Specified by:
deserializein interfacePlayerResearch- Parameters:
tag- The tag to deserialize from.
-