Package com.minecolonies.core.research
Class LocalResearch
java.lang.Object
com.minecolonies.core.research.LocalResearch
- All Implemented Interfaces:
ILocalResearch
The implementation of the ILocalResearch interface which represents one type of research, stored in each colony.
-
Constructor Summary
ConstructorsConstructorDescriptionLocalResearch(net.minecraft.resources.ResourceLocation id, net.minecraft.resources.ResourceLocation branch, int depth) Create the new research. -
Method Summary
Modifier and TypeMethodDescriptionnet.minecraft.resources.ResourceLocationGet the identifier of the branch.intgetDepth()Getter for the research depth.net.minecraft.resources.ResourceLocationgetId()Getter of the id of the research.intGetter for the progress of the research.getState()Get the ResearchState of the research.booleanresearch(IResearchEffectManager effects, ILocalResearchTree tree) Tick the research to execute it.voidsetProgress(int progress) Set the research progress.voidsetState(ResearchState value) Set the current research state.
-
Constructor Details
-
LocalResearch
public LocalResearch(net.minecraft.resources.ResourceLocation id, net.minecraft.resources.ResourceLocation branch, int depth) Create the new research.- Parameters:
id- it's id.depth- the depth in the tree.branch- the branch it is on.
-
-
Method Details
-
research
Description copied from interface:ILocalResearchTick the research to execute it.- Specified by:
researchin interfaceILocalResearch- Parameters:
effects- the research effects class which holds the information of the colony.tree- the research tree which holds the currently explored tree.- Returns:
- true if effective.
-
getProgress
public int getProgress()Description copied from interface:ILocalResearchGetter for the progress of the research.- Specified by:
getProgressin interfaceILocalResearch- Returns:
- the progress in ticks.
-
getId
public net.minecraft.resources.ResourceLocation getId()Description copied from interface:ILocalResearchGetter of the id of the research.- Specified by:
getIdin interfaceILocalResearch- Returns:
- the research id, as a ResourceLocation
-
getState
Description copied from interface:ILocalResearchGet the ResearchState of the research.- Specified by:
getStatein interfaceILocalResearch- Returns:
- the current state.
-
getBranch
public net.minecraft.resources.ResourceLocation getBranch()Description copied from interface:ILocalResearchGet the identifier of the branch.- Specified by:
getBranchin interfaceILocalResearch- Returns:
- the branch id, as a ResourceLocation.
-
getDepth
public int getDepth()Description copied from interface:ILocalResearchGetter for the research depth.- Specified by:
getDepthin interfaceILocalResearch- Returns:
- the depth.
-
setState
Description copied from interface:ILocalResearchSet the current research state.- Specified by:
setStatein interfaceILocalResearch- Parameters:
value- the state to set.
-
setProgress
public void setProgress(int progress) Description copied from interface:ILocalResearchSet the research progress.- Specified by:
setProgressin interfaceILocalResearch- Parameters:
progress- the progress to set.
-