Package com.minecolonies.api.quests
Interface IQuestManager
- All Superinterfaces:
net.neoforged.neoforge.common.util.INBTSerializable<net.minecraft.nbt.CompoundTag>
- All Known Implementing Classes:
QuestManager
public interface IQuestManager
extends net.neoforged.neoforge.common.util.INBTSerializable<net.minecraft.nbt.CompoundTag>
Interface of the Quest manager of each colony.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Map<net.minecraft.resources.ResourceLocation, IQuestTemplate> All quests that exist. -
Method Summary
Modifier and TypeMethodDescriptionvoidalterReputation(double difference) Alter the quest reputation.booleanattemptAcceptQuest(net.minecraft.resources.ResourceLocation questID, net.minecraft.world.entity.player.Player player) Have player attempt to accept a colony quest.voidcompleteQuest(net.minecraft.resources.ResourceLocation questId) Conclude a given quest.voiddeleteQuest(net.minecraft.resources.ResourceLocation questID) Deactivate a given quest.voiddeserialize(net.minecraft.network.RegistryFriendlyByteBuf buf) Deserialize network data@Nullable IQuestInstancegetAvailableOrInProgressQuest(net.minecraft.resources.ResourceLocation questId) Get the currently available or in progress quest with a given id.Get the list of available quests in the colony.Get the list of completed quests in the colony.Get the list of in progress quests in the colony.doubleGet the reputation of the colony.voidinjectAvailableQuest(IQuestInstance questInstance) Inject an available quest manually.booleanisUnlocked(net.minecraft.resources.ResourceLocation questId) Check if a quest is unlocked.voidvoidOn each colony tick.voidOn world load handling.voidserialize(net.minecraft.network.RegistryFriendlyByteBuf buf, boolean hasNewSubscribers) Serialize to network datavoidunlockQuest(net.minecraft.resources.ResourceLocation questId) Unlock a quest with a given id.Methods inherited from interface net.neoforged.neoforge.common.util.INBTSerializable
deserializeNBT, serializeNBT
-
Field Details
-
GLOBAL_SERVER_QUESTS
All quests that exist.
-
-
Method Details
-
attemptAcceptQuest
boolean attemptAcceptQuest(net.minecraft.resources.ResourceLocation questID, net.minecraft.world.entity.player.Player player) Have player attempt to accept a colony quest.- Parameters:
questID- the unique id of the quest.player- the player trying to accept it.- Returns:
- true if successful.
-
completeQuest
void completeQuest(net.minecraft.resources.ResourceLocation questId) Conclude a given quest. This is called FROM the quest, to the colony.- Parameters:
questId- the unique id of the quest.
-
onColonyTick
void onColonyTick()On each colony tick. -
deleteQuest
void deleteQuest(net.minecraft.resources.ResourceLocation questID) Deactivate a given quest.- Parameters:
questID- the id of the quest.
-
getAvailableOrInProgressQuest
@Nullable @Nullable IQuestInstance getAvailableOrInProgressQuest(net.minecraft.resources.ResourceLocation questId) Get the currently available or in progress quest with a given id.- Parameters:
questId- the id.- Returns:
- the quest.
-
onWorldLoad
void onWorldLoad()On world load handling. -
unlockQuest
void unlockQuest(net.minecraft.resources.ResourceLocation questId) Unlock a quest with a given id.- Parameters:
questId- the quest to unlock.
-
isUnlocked
boolean isUnlocked(net.minecraft.resources.ResourceLocation questId) Check if a quest is unlocked.- Parameters:
questId- the id of the quest.- Returns:
- true if so.
-
alterReputation
void alterReputation(double difference) Alter the quest reputation.- Parameters:
difference- the alteration.
-
getReputation
double getReputation()Get the reputation of the colony.- Returns:
- the reputation.
-
markDirty
void markDirty() -
getAvailableQuests
List<IQuestInstance> getAvailableQuests()Get the list of available quests in the colony.- Returns:
- the list of quest instances.
-
getInProgressQuests
List<IQuestInstance> getInProgressQuests()Get the list of in progress quests in the colony.- Returns:
- the list of quest instances.
-
getFinishedQuests
List<FinishedQuest> getFinishedQuests()Get the list of completed quests in the colony.- Returns:
- the list of quest templates, and how often they've been completed.
-
injectAvailableQuest
Inject an available quest manually.- Parameters:
questInstance- the quest instance to inject.
-
serialize
void serialize(net.minecraft.network.RegistryFriendlyByteBuf buf, boolean hasNewSubscribers) Serialize to network data- Parameters:
buf-hasNewSubscribers-
-
deserialize
void deserialize(net.minecraft.network.RegistryFriendlyByteBuf buf) Deserialize network data- Parameters:
buf-
-