Class PixelmonResearchStorage
java.lang.Object
com.pixelmonmod.pixelmon.api.storage.research.impl.PixelmonResearchStorage
- All Implemented Interfaces:
ResearchStorage
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
clear()
Clears all research data.void
deserialize
(net.minecraft.nbt.CompoundTag tag) Deserializes the research storage from aCompoundTag
.boolean
discardResearch
(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.ServerPlayer
getOwner()
void
handleInteractionEvent
(InteractionEvent event, InteractionContext context) Handles anInteractionEvent
that the player has triggered.void
markComplete
(PlayerResearch research) Marks the research as complete.void
removeResearch
(PlayerResearch research) Removes the research from the storage bypassing the check for if theResearch
isResearch.abandonable()
.net.minecraft.nbt.CompoundTag
Serializes the research storage.boolean
startResearch
(Research research) Starts a new research for the player.void
Updates all research data.
-
Field Details
-
ACTIVE_RESEARCH_TAG
- See Also:
-
COMPLETE_RESEARCH_TAG
- See Also:
-
-
Constructor Details
-
PixelmonResearchStorage
-
-
Method Details
-
getUniqueId
- Specified by:
getUniqueId
in interfaceResearchStorage
- Returns:
- The unique identifier of the player.
-
getOwner
@Nullable public @Nullable net.minecraft.server.level.ServerPlayer getOwner()- Specified by:
getOwner
in interfaceResearchStorage
- Returns:
- The owner of the research storage.
-
handleInteractionEvent
Description copied from interface:ResearchStorage
Handles anInteractionEvent
that the player has triggered.- Specified by:
handleInteractionEvent
in interfaceResearchStorage
- Parameters:
event
- The event that the player has triggered.context
- The context of the interaction.
-
activeResearch
- Specified by:
activeResearch
in interfaceResearchStorage
- Returns:
- The collection of active research that the player is currently researching.
-
findResearch
Description copied from interface:ResearchStorage
Finds all active research the player has of that type.- Specified by:
findResearch
in interfaceResearchStorage
- Parameters:
research
- The research to find.- Returns:
- The list of research that the player has found.
-
findResearch
Description copied from interface:ResearchStorage
Finds the active research the player has with the given UUID, or null if not present.- Specified by:
findResearch
in interfaceResearchStorage
- Parameters:
uuid
- The UUID to find.- Returns:
- The research with the given UUID, or null if not present.
-
startResearch
Description copied from interface:ResearchStorage
Starts a new research for the player.- Specified by:
startResearch
in interfaceResearchStorage
- Parameters:
research
- The research to start.
-
markComplete
Description copied from interface:ResearchStorage
Marks the research as complete.- Specified by:
markComplete
in interfaceResearchStorage
- Parameters:
research
- The research to mark as complete.
-
discardResearch
Description copied from interface:ResearchStorage
Discards the research.- Specified by:
discardResearch
in interfaceResearchStorage
- Parameters:
research
- The research to discard.- Returns:
- Whether this research was discarded or not.
-
removeResearch
Description copied from interface:ResearchStorage
Removes the research from the storage bypassing the check for if theResearch
isResearch.abandonable()
.- Specified by:
removeResearch
in interfaceResearchStorage
- Parameters:
research
- The research to remove.
-
clear
public void clear()Description copied from interface:ResearchStorage
Clears all research data.- Specified by:
clear
in interfaceResearchStorage
-
updateAll
public void updateAll()Description copied from interface:ResearchStorage
Updates all research data.- Specified by:
updateAll
in interfaceResearchStorage
-
serialize
public net.minecraft.nbt.CompoundTag serialize()Description copied from interface:ResearchStorage
Serializes the research storage.- Specified by:
serialize
in interfaceResearchStorage
- Returns:
- The serialized form of the research storage.
-
deserialize
public void deserialize(net.minecraft.nbt.CompoundTag tag) Description copied from interface:ResearchStorage
Deserializes the research storage from aCompoundTag
.- Specified by:
deserialize
in interfaceResearchStorage
- Parameters:
tag
- The tag to deserialize.
-