Class DefaultResearchProvider
java.lang.Object
com.minecolonies.api.research.AbstractResearchProvider
com.minecolonies.core.generation.defaults.DefaultResearchProvider
- All Implemented Interfaces:
net.minecraft.data.DataProvider
A class for creating the Research-related JSONs, including Research, ResearchEffects, and (optional) Branches.
Note that this does not validate that the resulting research tree is coherent:
programmers should make sure that research parents and effects exist, that depth is 1 or one level above the parent depth,
and that cost and requirement identifiers match real items.
Avoid changing research resource locations here unless necessary. If such a change is required, add the old and new ResearchIds to ResearchCompatMap. ResearchIDs are stored to disk, and if not present on a GlobalResearchTree during colony load, will be lost. Effect and Branch ResourceLocations are not stored to disk, but changing them may cause confusion with outside data packs.
-
Nested Class Summary
Nested classes/interfaces inherited from class com.minecolonies.api.research.AbstractResearchProvider
AbstractResearchProvider.Research, AbstractResearchProvider.ResearchBranch, AbstractResearchProvider.ResearchEffectNested classes/interfaces inherited from interface net.minecraft.data.DataProvider
net.minecraft.data.DataProvider.Factory<T extends net.minecraft.data.DataProvider> -
Field Summary
Fields inherited from class com.minecolonies.api.research.AbstractResearchProvider
packOutputFields inherited from interface net.minecraft.data.DataProvider
FIXED_ORDER_FIELDS, KEY_COMPARATOR, LOGGER -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGet a list of all research branches.Get a list of all researches.Get a list of all research effects.Methods inherited from class com.minecolonies.api.research.AbstractResearchProvider
generateAll, getName, run
-
Constructor Details
-
DefaultResearchProvider
public DefaultResearchProvider(@NotNull @NotNull net.minecraft.data.PackOutput packOutput)
-
-
Method Details
-
getResearchBranchCollection
Get a list of all research branches. Conventions: these are not mandatory, and their inclusion simply fixes capitalization and sorting. MineColonies should fully populate new branches for clarity; other data pack makers may not want to do so. Branch Sort Order should be separated by large values, to allow possible third-party inserts between existing branches. Only use setBranchType for non-default styled branches, and useResearchBranchTypeto do so.- Specified by:
getResearchBranchCollectionin classAbstractResearchProvider- Returns:
- a complete list of all research branches.
-
getResearchEffectCollection
Get a list of all research effects. Conventions: group effects by type (unlock-building, ability, or strength-based), and then by subject (citizen, building, colony). Unlock-building effect ids are automatically generated from hut block ids; all other effect IDs should useResearchConstants- Specified by:
getResearchEffectCollectionin classAbstractResearchProvider- Returns:
- a complete list of all research effects.
-
getResearchCollection
Get a list of all researches. Conventions: group research by branch first. Inside each branch, follow conventional English reading order: from left-to-right from a primary research until its first descendants are complete, then to any splits from that subbranch, by sortOrder, then to the next primary research. Set local (final) variables for any research with descendants, and reference that variable for parent and parent research level.- Specified by:
getResearchCollectionin classAbstractResearchProvider- Returns:
- a complete list of all research.
-
getCivilResearch
public Collection<AbstractResearchProvider.Research> getCivilResearch(Collection<AbstractResearchProvider.Research> r) -
getCombatResearch
public Collection<AbstractResearchProvider.Research> getCombatResearch(Collection<AbstractResearchProvider.Research> r) -
getTechnologyResearch
public Collection<AbstractResearchProvider.Research> getTechnologyResearch(Collection<AbstractResearchProvider.Research> r) -
getAchievementResearch
public Collection<AbstractResearchProvider.Research> getAchievementResearch(Collection<AbstractResearchProvider.Research> r)
-