Class AbstractResearchProvider.ResearchBranch

java.lang.Object
com.minecolonies.api.research.AbstractResearchProvider.ResearchBranch
Enclosing class:
AbstractResearchProvider

public static class AbstractResearchProvider.ResearchBranch extends Object
A Builder-like class for producing Research Branches
  • Field Details

    • json

      public final com.google.gson.JsonObject json
    • id

      public final net.minecraft.resources.ResourceLocation id
    • translatedName

      public String translatedName
      A Translated Name to add to the output language file.
    • translatedSubtitle

      public String translatedSubtitle
      A Translated Subtitle to add to the output language file.
  • Constructor Details

    • ResearchBranch

      public ResearchBranch(net.minecraft.resources.ResourceLocation id)
      Creates a Research Branch.
      Parameters:
      id - A unique identifier. Suggested path format is name.json.
  • Method Details

    • setBranchName

      public AbstractResearchProvider.ResearchBranch setBranchName(String branchName)
      Sets the Branch name. This may be a human-readable string. For translation keys, use setTranslatedBranchName instead.
      Parameters:
      branchName - The human-readable string.
      Returns:
      this
    • setTranslatedBranchName

      public AbstractResearchProvider.ResearchBranch setTranslatedBranchName(String translatedBranchName)
      Sets the Branch Translated name for later recording to the language file, and assigns an auto-generated translation key.
      Parameters:
      translatedBranchName - The human-readable string.
      Returns:
      this
    • setSubtitle

      public AbstractResearchProvider.ResearchBranch setSubtitle(String subtitle)
      Set the subtitle, as a human-readable name. If using a translation key, use setTranslatedSubtitle.
      Parameters:
      subtitle - The research's human-readable subtitle.
      Returns:
      this
    • setTranslatedSubtitle

      public AbstractResearchProvider.ResearchBranch setTranslatedSubtitle(String translatedSubtitle)
      Sets a subtitle translation key. This will use an auto-generated key, and add a matching translation text to the language output file.
      Parameters:
      translatedSubtitle - The research's human-readable subtitle.
      Returns:
      this
    • setBranchTimeMultiplier

      public AbstractResearchProvider.ResearchBranch setBranchTimeMultiplier(double branchTimeMultiplier)
      Sets the Branch Time Multiplier. This increases or decreases the worker time required to complete all research on this branch. Larger numbers go slower, while lower numbers go faster. Very low values may have unpredictable results. Defaults to 1.0
      Parameters:
      branchTimeMultiplier - The multiplier to set.
      Returns:
      this
    • setBranchType

      Sets a research branch type. This styles presentation of the branch at the university, and can have logic or colony ramifications. See ResearchBranchType for details. Branches with no branch-type will default to ResearchBranchTyupe.DEFAULT
      Parameters:
      type - The style of the research branch.
      Returns:
      this
    • setBranchSortOrder

      public AbstractResearchProvider.ResearchBranch setBranchSortOrder(int sortOrder)
      The sorting order of the research branches within the Minecolonies University Window. Higher numbers will appear lower on the list. Defaults to 0, accepts negative numbers. Builtin branches should be separated by large ranges, to allow possible inserts by third parties.
      Parameters:
      sortOrder - The sorting order of the branches.
      Returns:
      this
    • setHidden

      public AbstractResearchProvider.ResearchBranch setHidden(boolean hidden)
      If true, hides a research branch within the University BOWindow until at least one research has at least one research that isn't hidden, or with requirements met, or complete. This is mostly intended to avoid spoilers, or to prevent branches with many primary researches from showing a giant and useless tooltip. Only applies to branches where all primary researches are hidden. Defaults to false.
      Parameters:
      hidden - If true, hides the branch until at least one research is available.
      Returns:
      this
    • setRemove

      Sets the Research Branch JSON to remove all researches attached to its branch. Avoid use where stacking data packs are possible, as only last JSON for a ResourceLocation wins. Not compatible with other variants of setRemove.
      Returns:
      this
    • setRemove

      public AbstractResearchProvider.ResearchBranch setRemove(net.minecraft.resources.ResourceLocation branchId)
      Sets the Research Branch JSON to remove a different branch and all dependent researches, by ResourceLocation. Not compatible with other variants of setRemove.
      Parameters:
      branchId - The target research branch.
      Returns:
      this
    • setRemove

      public AbstractResearchProvider.ResearchBranch setRemove(Collection<net.minecraft.resources.ResourceLocation> branchIds)
      Sets the Research JSON to remove different branches and all dependent researches, by ResourceLocation. Not compatible with other variants of setRemove.
      Parameters:
      branchIds - The target research branch.
      Returns:
      this