Class LocalResearch

java.lang.Object
com.minecolonies.core.research.LocalResearch
All Implemented Interfaces:
ILocalResearch

public class LocalResearch extends Object implements ILocalResearch
The implementation of the ILocalResearch interface which represents one type of research, stored in each colony.
  • 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

      public boolean research(IResearchEffectManager effects, ILocalResearchTree tree)
      Description copied from interface: ILocalResearch
      Tick the research to execute it.
      Specified by:
      research in interface ILocalResearch
      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: ILocalResearch
      Getter for the progress of the research.
      Specified by:
      getProgress in interface ILocalResearch
      Returns:
      the progress in ticks.
    • getId

      public net.minecraft.resources.ResourceLocation getId()
      Description copied from interface: ILocalResearch
      Getter of the id of the research.
      Specified by:
      getId in interface ILocalResearch
      Returns:
      the research id, as a ResourceLocation
    • getState

      public ResearchState getState()
      Description copied from interface: ILocalResearch
      Get the ResearchState of the research.
      Specified by:
      getState in interface ILocalResearch
      Returns:
      the current state.
    • getBranch

      public net.minecraft.resources.ResourceLocation getBranch()
      Description copied from interface: ILocalResearch
      Get the identifier of the branch.
      Specified by:
      getBranch in interface ILocalResearch
      Returns:
      the branch id, as a ResourceLocation.
    • getDepth

      public int getDepth()
      Description copied from interface: ILocalResearch
      Getter for the research depth.
      Specified by:
      getDepth in interface ILocalResearch
      Returns:
      the depth.
    • setState

      public void setState(ResearchState value)
      Description copied from interface: ILocalResearch
      Set the current research state.
      Specified by:
      setState in interface ILocalResearch
      Parameters:
      value - the state to set.
    • setProgress

      public void setProgress(int progress)
      Description copied from interface: ILocalResearch
      Set the research progress.
      Specified by:
      setProgress in interface ILocalResearch
      Parameters:
      progress - the progress to set.