Class GlobalResearchBranch

java.lang.Object
com.minecolonies.core.research.GlobalResearchBranch
All Implemented Interfaces:
IGlobalResearchBranch

public class GlobalResearchBranch extends Object implements IGlobalResearchBranch
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    The property name for branch's research time modifier.
    static final String
    The property name for research branch name keys.
    static final String
    The property name for the branch type tag.
  • Constructor Summary

    Constructors
    Constructor
    Description
    GlobalResearchBranch(net.minecraft.nbt.CompoundTag nbt)
    Reassembles a GlobalResearchBranch from its NBT transmission.
    GlobalResearchBranch(net.minecraft.resources.ResourceLocation id)
    Creates a GlobalResearchBranch containing default values for a given BranchID.
    GlobalResearchBranch(net.minecraft.resources.ResourceLocation id, com.google.gson.JsonObject researchJson)
    Creates a GlobalResearchBranch from a jsonObject.
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    getBaseTime(int depth)
    Get the base progress requirements for non-instant research on the branch.
    boolean
    Get if the branch should be hidden, even from the selection list, until at least one research is eligible to begin.
    double
    getHoursTime(int depth)
    Get the base progress time requirements for non-instant research on the branch.
    net.minecraft.network.chat.contents.TranslatableContents
    Get the human-readable name or translation key for the Research Branch
    int
    Get the sort order numeral for the branch's placement on the University Hut GUI.
    net.minecraft.network.chat.contents.TranslatableContents
    Get the optional human-readable subtitle or its translation key for the Research Branch
    Get the branch style type identifier.
    net.minecraft.nbt.CompoundTag
    Write the Branch characteristics to an NBT for serialization.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • RESEARCH_BRANCH_NAME_PROP

      public static final String RESEARCH_BRANCH_NAME_PROP
      The property name for research branch name keys. Only applies at the level of branch settings. May be a human-readable text, or a translation key.
      See Also:
    • RESEARCH_BRANCH_TYPE_PROP

      public static final String RESEARCH_BRANCH_TYPE_PROP
      The property name for the branch type tag.
      See Also:
    • RESEARCH_BASE_TIME_PROP

      public static final String RESEARCH_BASE_TIME_PROP
      The property name for branch's research time modifier. Only applies at the level of branch settings.
      See Also:
  • Constructor Details

    • GlobalResearchBranch

      public GlobalResearchBranch(net.minecraft.resources.ResourceLocation id)
      Creates a GlobalResearchBranch containing default values for a given BranchID.
      Parameters:
      id - The Branch's ResourceID.
    • GlobalResearchBranch

      public GlobalResearchBranch(net.minecraft.resources.ResourceLocation id, com.google.gson.JsonObject researchJson)
      Creates a GlobalResearchBranch from a jsonObject.
      Parameters:
      id - The Branch's ResourceID.
      researchJson - the Json containing research branch data.
    • GlobalResearchBranch

      public GlobalResearchBranch(net.minecraft.nbt.CompoundTag nbt)
      Reassembles a GlobalResearchBranch from its NBT transmission.
      Parameters:
      nbt - The nbt containing the Research Branch data.
  • Method Details

    • getName

      public net.minecraft.network.chat.contents.TranslatableContents getName()
      Description copied from interface: IGlobalResearchBranch
      Get the human-readable name or translation key for the Research Branch
      Specified by:
      getName in interface IGlobalResearchBranch
      Returns:
      Human-readable name or translation key.
    • getSubtitle

      public net.minecraft.network.chat.contents.TranslatableContents getSubtitle()
      Description copied from interface: IGlobalResearchBranch
      Get the optional human-readable subtitle or its translation key for the Research Branch
      Specified by:
      getSubtitle in interface IGlobalResearchBranch
      Returns:
      Human-readable subtitle or translation key.
    • getBaseTime

      public int getBaseTime(int depth)
      Description copied from interface: IGlobalResearchBranch
      Get the base progress requirements for non-instant research on the branch.
      Specified by:
      getBaseTime in interface IGlobalResearchBranch
      Parameters:
      depth - The university level for the research.
      Returns:
      The number of progress 'ticks' required to complete the research for the included depth. Each tick is (on average) 25 seconds, but this depends on researcher availability and may be reduced by stored researcher time.
    • getHoursTime

      public double getHoursTime(int depth)
      Description copied from interface: IGlobalResearchBranch
      Get the base progress time requirements for non-instant research on the branch. Use only for direct display purposes, as it is likely to be inaccurate. Favor getBaseTime for any mathematical use.
      Specified by:
      getHoursTime in interface IGlobalResearchBranch
      Parameters:
      depth - The university level for the research.
      Returns:
      The number of hours required to complete a research for the included depth, to a rough estimate.
    • getSortOrder

      public int getSortOrder()
      Description copied from interface: IGlobalResearchBranch
      Get the sort order numeral for the branch's placement on the University Hut GUI.
      Specified by:
      getSortOrder in interface IGlobalResearchBranch
      Returns:
      The sort order.
    • getType

      public ResearchBranchType getType()
      Description copied from interface: IGlobalResearchBranch
      Get the branch style type identifier.
      Specified by:
      getType in interface IGlobalResearchBranch
      Returns:
      the branch's style, used for logic and presentation.
    • getHidden

      public boolean getHidden()
      Description copied from interface: IGlobalResearchBranch
      Get if the branch should be hidden, even from the selection list, until at least one research is eligible to begin.
      Specified by:
      getHidden in interface IGlobalResearchBranch
      Returns:
      True if the branch shouldn't be visible until at least one research may begin.
    • writeToNBT

      public net.minecraft.nbt.CompoundTag writeToNBT()
      Description copied from interface: IGlobalResearchBranch
      Write the Branch characteristics to an NBT for serialization.
      Specified by:
      writeToNBT in interface IGlobalResearchBranch
      Returns:
      a compoundNBT containing the necessary traits to make the branch data on a client.