Class PixelmonPlayerResearch
java.lang.Object
com.pixelmonmod.pixelmon.api.storage.research.impl.PixelmonPlayerResearch
- All Implemented Interfaces:
PlayerResearch
,ServerPlayerResearch
-
Field Summary
-
Constructor Summary
ConstructorDescriptionPixelmonPlayerResearch
(UUID player) PixelmonPlayerResearch
(net.minecraft.world.entity.player.Player player, Research research) -
Method Summary
Modifier and TypeMethodDescriptionboolean
abandon()
Abandons the research, if able to.void
complete()
Completes the research.void
Completes the currentPlayerResearchStage
and progresses to the next stage.void
deserialize
(net.minecraft.nbt.CompoundTag tag) Deserializes the player research from aCompoundTag
.boolean
handleInteractionEvent
(InteractionEvent event, InteractionContext context) Handles anInteractionEvent
that the player has triggered.boolean
boolean
@Nullable ResearchStage
net.minecraft.server.level.ServerPlayer
owner()
Gets the player which this research is for.net.minecraft.nbt.CompoundTag
Serializes the player research to aCompoundTag
.storage()
Gets the storage which this research is for.void
Toggles 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, wait
Methods 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:PlayerResearch
Gets the UUID of this research instance.- Specified by:
uuid
in interfacePlayerResearch
- Returns:
- The UUID of this.
-
type
- Specified by:
type
in interfacePlayerResearch
- Returns:
- The
Research
that this player research is for.
-
owner
public net.minecraft.server.level.ServerPlayer owner()Description copied from interface:PlayerResearch
Gets the player which this research is for.- Specified by:
owner
in interfacePlayerResearch
- Specified by:
owner
in interfaceServerPlayerResearch
- Returns:
- The player which this is for.
-
storage
Description copied from interface:PlayerResearch
Gets the storage which this research is for.- Specified by:
storage
in interfacePlayerResearch
- Returns:
- The storage which this is for.
-
currentStage
- Specified by:
currentStage
in interfacePlayerResearch
- Returns:
- The current
PlayerResearchStage
that the player is on.
-
nextStage
- Specified by:
nextStage
in interfacePlayerResearch
- Returns:
- The next
ResearchStage
that the player will progress to.
-
isFavorite
public boolean isFavorite()- Specified by:
isFavorite
in interfacePlayerResearch
- Returns:
- Whether this research is marked as a favorite.
-
toggleFavorite
public void toggleFavorite()Description copied from interface:PlayerResearch
Toggles the favorite state of this research.- Specified by:
toggleFavorite
in interfacePlayerResearch
-
isComplete
public boolean isComplete()- Specified by:
isComplete
in interfacePlayerResearch
- Returns:
- Whether the player has completed the research.
-
handleInteractionEvent
Description copied from interface:PlayerResearch
Handles anInteractionEvent
that the player has triggered.- Specified by:
handleInteractionEvent
in 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:PlayerResearch
Completes the research.- Specified by:
complete
in interfacePlayerResearch
-
completeStage
public void completeStage()Description copied from interface:PlayerResearch
Completes the currentPlayerResearchStage
and progresses to the next stage.
This will also callPlayerResearch.complete()
if the player has completed the research.- Specified by:
completeStage
in interfacePlayerResearch
-
abandon
public boolean abandon()Description copied from interface:PlayerResearch
Abandons the research, if able to.- Specified by:
abandon
in interfacePlayerResearch
- Returns:
- Whether this research was abandoned or not.
-
serialize
public net.minecraft.nbt.CompoundTag serialize()Description copied from interface:PlayerResearch
Serializes the player research to aCompoundTag
.- Specified by:
serialize
in interfacePlayerResearch
- Returns:
- The serialized player research.
-
deserialize
public void deserialize(net.minecraft.nbt.CompoundTag tag) Description copied from interface:PlayerResearch
Deserializes the player research from aCompoundTag
.- Specified by:
deserialize
in interfacePlayerResearch
- Parameters:
tag
- The tag to deserialize from.
-