Class ClientResearch
java.lang.Object
com.pixelmonmod.pixelmon.api.storage.research.impl.client.ClientResearch
- All Implemented Interfaces:
PlayerResearch
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanabandon()Abandons the research, if able to.voidcomplete()Completes the research.voidCompletes the currentPlayerResearchStageand progresses to the next stage.intvoiddeserialize(net.minecraft.nbt.CompoundTag tag) Deserializes the player research from aCompoundTag.booleanhandleInteractionEvent(net.minecraft.core.Holder<InteractionEvent> event, StoredContext context) Handles anInteractionEventthat the player has triggered.booleanbooleanbooleanbooleannet.minecraft.network.chat.Componentname()@Nullable ResearchStagenet.minecraft.client.player.LocalPlayerowner()Gets the player which this research is for.net.minecraft.nbt.CompoundTagSerializes the player research to aCompoundTag.intstages()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.voidwrite(net.minecraft.network.FriendlyByteBuf buffer) Writes the player research into a buffer, for reading byClientResearchlater.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
is, update, update
-
Constructor Details
-
ClientResearch
public ClientResearch(net.minecraft.network.FriendlyByteBuf buffer)
-
-
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.client.player.LocalPlayer owner()Description copied from interface:PlayerResearchGets the player which this research is for.- Specified by:
ownerin interfacePlayerResearch- 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.
-
currentStageClient
-
currentStageIndex
public int currentStageIndex() -
stages
public int stages() -
isAssignment
public boolean isAssignment()- Specified by:
isAssignmentin interfacePlayerResearch- Returns:
- Whether this research is an assignment.
-
isCollection
public boolean isCollection()- Specified by:
isCollectionin interfacePlayerResearch- Returns:
- Whether this research is a collection.
-
name
public net.minecraft.network.chat.Component name() -
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
public boolean handleInteractionEvent(net.minecraft.core.Holder<InteractionEvent> event, StoredContext context) 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.
-
write
public void write(net.minecraft.network.FriendlyByteBuf buffer) Description copied from interface:PlayerResearchWrites the player research into a buffer, for reading byClientResearchlater.- Specified by:
writein interfacePlayerResearch- Parameters:
buffer- The buffer to write to.
-