Package com.minecolonies.core.research
Class GlobalResearchBranch
java.lang.Object
com.minecolonies.core.research.GlobalResearchBranch
- All Implemented Interfaces:
IGlobalResearchBranch
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionGlobalResearchBranch(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 TypeMethodDescriptionintgetBaseTime(int depth) Get the base progress requirements for non-instant research on the branch.booleanGet if the branch should be hidden, even from the selection list, until at least one research is eligible to begin.doublegetHoursTime(int depth) Get the base progress time requirements for non-instant research on the branch.net.minecraft.network.chat.contents.TranslatableContentsgetName()Get the human-readable name or translation key for the Research BranchintGet the sort order numeral for the branch's placement on the University Hut GUI.net.minecraft.network.chat.contents.TranslatableContentsGet the optional human-readable subtitle or its translation key for the Research BranchgetType()Get the branch style type identifier.net.minecraft.nbt.CompoundTagWrite the Branch characteristics to an NBT for serialization.
-
Field Details
-
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
The property name for the branch type tag.- See Also:
-
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:IGlobalResearchBranchGet the human-readable name or translation key for the Research Branch- Specified by:
getNamein interfaceIGlobalResearchBranch- Returns:
- Human-readable name or translation key.
-
getSubtitle
public net.minecraft.network.chat.contents.TranslatableContents getSubtitle()Description copied from interface:IGlobalResearchBranchGet the optional human-readable subtitle or its translation key for the Research Branch- Specified by:
getSubtitlein interfaceIGlobalResearchBranch- Returns:
- Human-readable subtitle or translation key.
-
getBaseTime
public int getBaseTime(int depth) Description copied from interface:IGlobalResearchBranchGet the base progress requirements for non-instant research on the branch.- Specified by:
getBaseTimein interfaceIGlobalResearchBranch- 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:IGlobalResearchBranchGet 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:
getHoursTimein interfaceIGlobalResearchBranch- 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:IGlobalResearchBranchGet the sort order numeral for the branch's placement on the University Hut GUI.- Specified by:
getSortOrderin interfaceIGlobalResearchBranch- Returns:
- The sort order.
-
getType
Description copied from interface:IGlobalResearchBranchGet the branch style type identifier.- Specified by:
getTypein interfaceIGlobalResearchBranch- Returns:
- the branch's style, used for logic and presentation.
-
getHidden
public boolean getHidden()Description copied from interface:IGlobalResearchBranchGet if the branch should be hidden, even from the selection list, until at least one research is eligible to begin.- Specified by:
getHiddenin interfaceIGlobalResearchBranch- 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:IGlobalResearchBranchWrite the Branch characteristics to an NBT for serialization.- Specified by:
writeToNBTin interfaceIGlobalResearchBranch- Returns:
- a compoundNBT containing the necessary traits to make the branch data on a client.
-