Class QuestManager

java.lang.Object
com.minecolonies.core.quests.QuestManager
All Implemented Interfaces:
IQuestManager, net.neoforged.neoforge.common.util.INBTSerializable<net.minecraft.nbt.CompoundTag>

public class QuestManager extends Object implements IQuestManager
Quest manager of each colony.
  • Constructor Details

    • QuestManager

      public QuestManager(IColony colony)
  • Method Details

    • attemptAcceptQuest

      public boolean attemptAcceptQuest(net.minecraft.resources.ResourceLocation questID, net.minecraft.world.entity.player.Player player)
      Description copied from interface: IQuestManager
      Have player attempt to accept a colony quest.
      Specified by:
      attemptAcceptQuest in interface IQuestManager
      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: IQuestManager
      Alter the quest reputation.
      Specified by:
      alterReputation in interface IQuestManager
      Parameters:
      difference - the alteration.
    • getReputation

      public double getReputation()
      Description copied from interface: IQuestManager
      Get the reputation of the colony.
      Specified by:
      getReputation in interface IQuestManager
      Returns:
      the reputation.
    • completeQuest

      public void completeQuest(net.minecraft.resources.ResourceLocation questId)
      Description copied from interface: IQuestManager
      Conclude a given quest. This is called FROM the quest, to the colony.
      Specified by:
      completeQuest in interface IQuestManager
      Parameters:
      questId - the unique id of the quest.
    • onColonyTick

      public void onColonyTick()
      Description copied from interface: IQuestManager
      On each colony tick.
      Specified by:
      onColonyTick in interface IQuestManager
    • deleteQuest

      public void deleteQuest(net.minecraft.resources.ResourceLocation questID)
      Description copied from interface: IQuestManager
      Deactivate a given quest.
      Specified by:
      deleteQuest in interface IQuestManager
      Parameters:
      questID - the id of the quest.
    • getAvailableOrInProgressQuest

      public IQuestInstance getAvailableOrInProgressQuest(net.minecraft.resources.ResourceLocation questId)
      Description copied from interface: IQuestManager
      Get the currently available or in progress quest with a given id.
      Specified by:
      getAvailableOrInProgressQuest in interface IQuestManager
      Parameters:
      questId - the id.
      Returns:
      the quest.
    • onWorldLoad

      public void onWorldLoad()
      Description copied from interface: IQuestManager
      On world load handling.
      Specified by:
      onWorldLoad in interface IQuestManager
    • unlockQuest

      public void unlockQuest(net.minecraft.resources.ResourceLocation questId)
      Description copied from interface: IQuestManager
      Unlock a quest with a given id.
      Specified by:
      unlockQuest in interface IQuestManager
      Parameters:
      questId - the quest to unlock.
    • isUnlocked

      public boolean isUnlocked(net.minecraft.resources.ResourceLocation questId)
      Description copied from interface: IQuestManager
      Check if a quest is unlocked.
      Specified by:
      isUnlocked in interface IQuestManager
      Parameters:
      questId - the id of the quest.
      Returns:
      true if so.
    • serializeNBT

      public net.minecraft.nbt.CompoundTag serializeNBT(@NotNull net.minecraft.core.HolderLookup.Provider provider)
      Specified by:
      serializeNBT in interface net.neoforged.neoforge.common.util.INBTSerializable<net.minecraft.nbt.CompoundTag>
    • deserializeNBT

      public void deserializeNBT(@NotNull net.minecraft.core.HolderLookup.Provider provider, net.minecraft.nbt.CompoundTag nbt)
      Specified by:
      deserializeNBT in interface net.neoforged.neoforge.common.util.INBTSerializable<net.minecraft.nbt.CompoundTag>
    • serialize

      public void serialize(net.minecraft.network.RegistryFriendlyByteBuf buf, boolean hasNewSubscribers)
      Description copied from interface: IQuestManager
      Serialize to network data
      Specified by:
      serialize in interface IQuestManager
      Parameters:
      buf -
      hasNewSubscribers -
    • deserialize

      public void deserialize(net.minecraft.network.RegistryFriendlyByteBuf buf)
      Description copied from interface: IQuestManager
      Deserialize network data
      Specified by:
      deserialize in interface IQuestManager
      Parameters:
      buf -
    • markDirty

      public void markDirty()
      Specified by:
      markDirty in interface IQuestManager
    • getAvailableQuests

      public List<IQuestInstance> getAvailableQuests()
      Description copied from interface: IQuestManager
      Get the list of available quests in the colony.
      Specified by:
      getAvailableQuests in interface IQuestManager
      Returns:
      the list of quest instances.
    • getInProgressQuests

      public List<IQuestInstance> getInProgressQuests()
      Description copied from interface: IQuestManager
      Get the list of in progress quests in the colony.
      Specified by:
      getInProgressQuests in interface IQuestManager
      Returns:
      the list of quest instances.
    • getFinishedQuests

      public List<FinishedQuest> getFinishedQuests()
      Description copied from interface: IQuestManager
      Get the list of completed quests in the colony.
      Specified by:
      getFinishedQuests in interface IQuestManager
      Returns:
      the list of quest templates, and how often they've been completed.
    • injectAvailableQuest

      public void injectAvailableQuest(IQuestInstance questInstance)
      Description copied from interface: IQuestManager
      Inject an available quest manually.
      Specified by:
      injectAvailableQuest in interface IQuestManager
      Parameters:
      questInstance - the quest instance to inject.