Class PixelmonResearchStorage
java.lang.Object
com.pixelmonmod.pixelmon.api.storage.research.impl.PixelmonResearchStorage
- All Implemented Interfaces:
ResearchStorage
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()Clears all research data.voiddeserialize(net.minecraft.nbt.CompoundTag tag) Deserializes the research storage from aCompoundTag.booleandiscardResearch(PlayerResearch research) Discards the research.findResearch(Research research) Finds all active research the player has of that type.findResearch(UUID uuid) Finds the active research the player has with the given UUID, or null if not present.@Nullable net.minecraft.server.level.ServerPlayergetOwner()voidhandleInteractionEvent(net.minecraft.core.Holder<InteractionEvent> event, StoredContext context) Handles anInteractionEventthat the player has triggered.voidmarkComplete(PlayerResearch research) Marks the research as complete.voidremoveResearch(PlayerResearch research) Removes the research from the storage bypassing the check for if theResearchisResearch.abandonable().net.minecraft.nbt.CompoundTagSerializes the research storage.booleanstartResearch(Research research) Starts a new research for the player.voidUpdates all research data.
-
Field Details
-
ACTIVE_RESEARCH_TAG
- See Also:
-
COMPLETE_RESEARCH_TAG
- See Also:
-
-
Constructor Details
-
PixelmonResearchStorage
-
-
Method Details
-
getUniqueId
- Specified by:
getUniqueIdin interfaceResearchStorage- Returns:
- The unique identifier of the player.
-
getOwner
@Nullable public @Nullable net.minecraft.server.level.ServerPlayer getOwner()- Specified by:
getOwnerin interfaceResearchStorage- Returns:
- The owner of the research storage.
-
handleInteractionEvent
public void handleInteractionEvent(net.minecraft.core.Holder<InteractionEvent> event, StoredContext context) Description copied from interface:ResearchStorageHandles anInteractionEventthat the player has triggered.- Specified by:
handleInteractionEventin interfaceResearchStorage- Parameters:
event- The event that the player has triggered.context- The context of the interaction.
-
activeResearch
- Specified by:
activeResearchin interfaceResearchStorage- Returns:
- The collection of active research that the player is currently researching.
-
findResearch
Description copied from interface:ResearchStorageFinds all active research the player has of that type.- Specified by:
findResearchin interfaceResearchStorage- Parameters:
research- The research to find.- Returns:
- The list of research that the player has found.
-
findResearch
Description copied from interface:ResearchStorageFinds the active research the player has with the given UUID, or null if not present.- Specified by:
findResearchin interfaceResearchStorage- Parameters:
uuid- The UUID to find.- Returns:
- The research with the given UUID, or null if not present.
-
startResearch
Description copied from interface:ResearchStorageStarts a new research for the player.- Specified by:
startResearchin interfaceResearchStorage- Parameters:
research- The research to start.
-
markComplete
Description copied from interface:ResearchStorageMarks the research as complete.- Specified by:
markCompletein interfaceResearchStorage- Parameters:
research- The research to mark as complete.
-
discardResearch
Description copied from interface:ResearchStorageDiscards the research.- Specified by:
discardResearchin interfaceResearchStorage- Parameters:
research- The research to discard.- Returns:
- Whether this research was discarded or not.
-
removeResearch
Description copied from interface:ResearchStorageRemoves the research from the storage bypassing the check for if theResearchisResearch.abandonable().- Specified by:
removeResearchin interfaceResearchStorage- Parameters:
research- The research to remove.
-
clear
public void clear()Description copied from interface:ResearchStorageClears all research data.- Specified by:
clearin interfaceResearchStorage
-
updateAll
public void updateAll()Description copied from interface:ResearchStorageUpdates all research data.- Specified by:
updateAllin interfaceResearchStorage
-
serialize
public net.minecraft.nbt.CompoundTag serialize()Description copied from interface:ResearchStorageSerializes the research storage.- Specified by:
serializein interfaceResearchStorage- Returns:
- The serialized form of the research storage.
-
deserialize
public void deserialize(net.minecraft.nbt.CompoundTag tag) Description copied from interface:ResearchStorageDeserializes the research storage from aCompoundTag.- Specified by:
deserializein interfaceResearchStorage- Parameters:
tag- The tag to deserialize.
-