Package com.minecolonies.core.quests
Class QuestManager
java.lang.Object
com.minecolonies.core.quests.QuestManager
- All Implemented Interfaces:
IQuestManager,net.minecraftforge.common.util.INBTSerializable<net.minecraft.nbt.CompoundTag>
Quest manager of each colony.
-
Field Summary
Fields inherited from interface com.minecolonies.api.quests.IQuestManager
GLOBAL_SERVER_QUESTS -
Constructor Summary
Constructors -
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.FriendlyByteBuf buf) Deserialize network datavoiddeserializeNBT(net.minecraft.nbt.CompoundTag nbt) getAvailableOrInProgressQuest(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.FriendlyByteBuf buf, boolean hasNewSubscribers) Serialize to network datanet.minecraft.nbt.CompoundTagvoidunlockQuest(net.minecraft.resources.ResourceLocation questId) Unlock a quest with a given id.
-
Constructor Details
-
QuestManager
-
-
Method Details
-
attemptAcceptQuest
public boolean attemptAcceptQuest(net.minecraft.resources.ResourceLocation questID, net.minecraft.world.entity.player.Player player) Description copied from interface:IQuestManagerHave player attempt to accept a colony quest.- Specified by:
attemptAcceptQuestin interfaceIQuestManager- Parameters:
questID- the unique id of the quest.player- the player trying to accept it.- Returns:
- true if successful.
-
alterReputation
public void alterReputation(double difference) Description copied from interface:IQuestManagerAlter the quest reputation.- Specified by:
alterReputationin interfaceIQuestManager- Parameters:
difference- the alteration.
-
getReputation
public double getReputation()Description copied from interface:IQuestManagerGet the reputation of the colony.- Specified by:
getReputationin interfaceIQuestManager- Returns:
- the reputation.
-
completeQuest
public void completeQuest(net.minecraft.resources.ResourceLocation questId) Description copied from interface:IQuestManagerConclude a given quest. This is called FROM the quest, to the colony.- Specified by:
completeQuestin interfaceIQuestManager- Parameters:
questId- the unique id of the quest.
-
onColonyTick
public void onColonyTick()Description copied from interface:IQuestManagerOn each colony tick.- Specified by:
onColonyTickin interfaceIQuestManager
-
deleteQuest
public void deleteQuest(net.minecraft.resources.ResourceLocation questID) Description copied from interface:IQuestManagerDeactivate a given quest.- Specified by:
deleteQuestin interfaceIQuestManager- Parameters:
questID- the id of the quest.
-
getAvailableOrInProgressQuest
public IQuestInstance getAvailableOrInProgressQuest(net.minecraft.resources.ResourceLocation questId) Description copied from interface:IQuestManagerGet the currently available or in progress quest with a given id.- Specified by:
getAvailableOrInProgressQuestin interfaceIQuestManager- Parameters:
questId- the id.- Returns:
- the quest.
-
onWorldLoad
public void onWorldLoad()Description copied from interface:IQuestManagerOn world load handling.- Specified by:
onWorldLoadin interfaceIQuestManager
-
unlockQuest
public void unlockQuest(net.minecraft.resources.ResourceLocation questId) Description copied from interface:IQuestManagerUnlock a quest with a given id.- Specified by:
unlockQuestin interfaceIQuestManager- Parameters:
questId- the quest to unlock.
-
isUnlocked
public boolean isUnlocked(net.minecraft.resources.ResourceLocation questId) Description copied from interface:IQuestManagerCheck if a quest is unlocked.- Specified by:
isUnlockedin interfaceIQuestManager- Parameters:
questId- the id of the quest.- Returns:
- true if so.
-
serializeNBT
public net.minecraft.nbt.CompoundTag serializeNBT()- Specified by:
serializeNBTin interfacenet.minecraftforge.common.util.INBTSerializable<net.minecraft.nbt.CompoundTag>
-
deserializeNBT
public void deserializeNBT(net.minecraft.nbt.CompoundTag nbt) - Specified by:
deserializeNBTin interfacenet.minecraftforge.common.util.INBTSerializable<net.minecraft.nbt.CompoundTag>
-
serialize
public void serialize(net.minecraft.network.FriendlyByteBuf buf, boolean hasNewSubscribers) Description copied from interface:IQuestManagerSerialize to network data- Specified by:
serializein interfaceIQuestManager
-
deserialize
public void deserialize(net.minecraft.network.FriendlyByteBuf buf) Description copied from interface:IQuestManagerDeserialize network data- Specified by:
deserializein interfaceIQuestManager
-
markDirty
public void markDirty()- Specified by:
markDirtyin interfaceIQuestManager
-
getAvailableQuests
Description copied from interface:IQuestManagerGet the list of available quests in the colony.- Specified by:
getAvailableQuestsin interfaceIQuestManager- Returns:
- the list of quest instances.
-
getInProgressQuests
Description copied from interface:IQuestManagerGet the list of in progress quests in the colony.- Specified by:
getInProgressQuestsin interfaceIQuestManager- Returns:
- the list of quest instances.
-
getFinishedQuests
Description copied from interface:IQuestManagerGet the list of completed quests in the colony.- Specified by:
getFinishedQuestsin interfaceIQuestManager- Returns:
- the list of quest templates, and how often they've been completed.
-
injectAvailableQuest
Description copied from interface:IQuestManagerInject an available quest manually.- Specified by:
injectAvailableQuestin interfaceIQuestManager- Parameters:
questInstance- the quest instance to inject.
-