Class ClientResearch
java.lang.Object
com.pixelmonmod.pixelmon.api.storage.research.impl.client.ClientResearch
- All Implemented Interfaces:
PlayerResearch
-
Constructor Summary
-
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.int
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
boolean
boolean
@Nullable ResearchStage
net.minecraft.client.player.LocalPlayer
owner()
Gets the player which this research is for.net.minecraft.nbt.CompoundTag
Serializes the player research to aCompoundTag
.int
stages()
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.void
write
(net.minecraft.network.FriendlyByteBuf buffer) Writes the player research into a buffer, for reading byClientResearch
later.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
update, update
-
Constructor Details
-
ClientResearch
public ClientResearch(net.minecraft.network.FriendlyByteBuf buffer)
-
-
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.client.player.LocalPlayer owner()Description copied from interface:PlayerResearch
Gets the player which this research is for.- Specified by:
owner
in interfacePlayerResearch
- 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.
-
currentStageClient
-
currentStageIndex
public int currentStageIndex() -
stages
public int stages() -
isAssignment
public boolean isAssignment()- Specified by:
isAssignment
in interfacePlayerResearch
- Returns:
- Whether this research is an assignment.
-
isCollection
public boolean isCollection()- Specified by:
isCollection
in interfacePlayerResearch
- Returns:
- Whether this research is a collection.
-
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.
-
write
public void write(net.minecraft.network.FriendlyByteBuf buffer) Description copied from interface:PlayerResearch
Writes the player research into a buffer, for reading byClientResearch
later.- Specified by:
write
in interfacePlayerResearch
- Parameters:
buffer
- The buffer to write to.
-