Class QuestTemplate

java.lang.Object
com.minecolonies.core.quests.QuestTemplate
All Implemented Interfaces:
IQuestTemplate

public class QuestTemplate extends Object implements IQuestTemplate
Instance of a specific quest type
  • Constructor Details

    • QuestTemplate

      public QuestTemplate(net.minecraft.resources.ResourceLocation questID, net.minecraft.network.chat.Component name, List<net.minecraft.resources.ResourceLocation> parents, int maxOccurrence, Function<IColony,List<ITriggerReturnData<?>>> questTriggerList, List<IQuestObjectiveTemplate> questObjectives, int questTimeout, List<IQuestRewardTemplate> questRewards)
      Create new quest data.
      Parameters:
      questID - the id of the quest.
      name - the name of the quest.
      parents - the parent quests.
      maxOccurrence - the max num of occurrences.
      questTriggerList - the list of triggers.
      questObjectives - the quest objectives.
      questTimeout - the time until it times out.
      questRewards - its rewards
  • Method Details

    • attemptStart

      public IQuestInstance attemptStart(IColony colony)
      Description copied from interface: IQuestTemplate
      This is where we actually check if the colony fulfills the quest requirements.
      Specified by:
      attemptStart in interface IQuestTemplate
      Parameters:
      colony - the colony to check.
      Returns:
      the colony quest instance if successful.
    • getQuestTimeout

      public int getQuestTimeout()
      Description copied from interface: IQuestTemplate
      Timeout in ingame days until an available quest or in progress quest gets deleted.
      Specified by:
      getQuestTimeout in interface IQuestTemplate
      Returns:
      the timeout.
    • getMaxOccurrence

      public int getMaxOccurrence()
      Description copied from interface: IQuestTemplate
      How often we can redo this quest.
      Specified by:
      getMaxOccurrence in interface IQuestTemplate
      Returns:
      the number.
    • unlockQuestRewards

      public void unlockQuestRewards(IColony colony, net.minecraft.world.entity.player.Player player, IQuestInstance colonyQuest, List<Integer> unlockedRewards)
      Description copied from interface: IQuestTemplate
      Unlock the quest rewards.
      Specified by:
      unlockQuestRewards in interface IQuestTemplate
      Parameters:
      colony - the colony.
      player - the player.
      colonyQuest - the quest.
      unlockedRewards - the applicable rewards.
    • getObjective

      public IQuestObjectiveTemplate getObjective(int index)
      Description copied from interface: IQuestTemplate
      Get the objective at a given index.
      Specified by:
      getObjective in interface IQuestTemplate
      Parameters:
      index - the index of the objective.
      Returns:
      the current objective.
    • getObjectiveCount

      public int getObjectiveCount()
      Description copied from interface: IQuestTemplate
      Get the objective count of this quest.
      Specified by:
      getObjectiveCount in interface IQuestTemplate
      Returns:
      the count.
    • getName

      public net.minecraft.network.chat.Component getName()
      Description copied from interface: IQuestTemplate
      The name of the quest.
      Specified by:
      getName in interface IQuestTemplate
      Returns:
      the name of the quest.
    • getParents

      public List<net.minecraft.resources.ResourceLocation> getParents()
      Description copied from interface: IQuestTemplate
      Get the list of parent quests.
      Specified by:
      getParents in interface IQuestTemplate
      Returns:
      the list of parent quests.