Interface ILocalResearchTree

All Known Implementing Classes:
LocalResearchTree

public interface ILocalResearchTree
The class which contains all research.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    addResearch(net.minecraft.resources.ResourceLocation branch, ILocalResearch research)
    Add a research to the tree.
    void
    attemptBeginResearch(net.minecraft.world.entity.player.Player player, IColony colony, BuildingUniversity building, IGlobalResearch research)
    Attempt to begin a research.
    void
    attemptResetResearch(net.minecraft.world.entity.player.Player player, @Nullable IColony colony, ILocalResearch research)
    Reset a research, and optionally undo its effects.
    boolean
    branchFinishedHighestLevel(net.minecraft.resources.ResourceLocation branch)
    Check if a branch already researched a level 6 research.
    void
    finishResearch(net.minecraft.resources.ResourceLocation id)
    Finish a research and remove it from the inProgress list.
    List<net.minecraft.resources.ResourceLocation>
    Get the list of all finished researches
    getResearch(net.minecraft.resources.ResourceLocation branch, net.minecraft.resources.ResourceLocation id)
    Get a research by id.
    Get a list of all research in progress.
    boolean
    hasCompletedResearch(net.minecraft.resources.ResourceLocation researchId)
    Checks if a given research is complete.
    boolean
    isComplete(net.minecraft.resources.ResourceLocation location)
    Check if a given research is complete.
    void
    readFromNBT(net.minecraft.nbt.CompoundTag compound, IResearchEffectManager effects)
    Read the research tree from NBT.
    void
    writeToNBT(net.minecraft.nbt.CompoundTag compound)
    Write the research tree to NBT.
  • Method Details

    • getResearch

      ILocalResearch getResearch(net.minecraft.resources.ResourceLocation branch, net.minecraft.resources.ResourceLocation id)
      Get a research by id.
      Parameters:
      id - the id of the research.
      branch - the branch of the research.
      Returns:
      the IResearch object.
    • addResearch

      void addResearch(net.minecraft.resources.ResourceLocation branch, ILocalResearch research)
      Add a research to the tree.
      Parameters:
      research - the research to add.
      branch - the branch of the research.
    • branchFinishedHighestLevel

      boolean branchFinishedHighestLevel(net.minecraft.resources.ResourceLocation branch)
      Check if a branch already researched a level 6 research. This is important since only 1 of these can be researched for each branch.
      Parameters:
      branch - the branch to check.
      Returns:
      true if so.
    • getResearchInProgress

      List<ILocalResearch> getResearchInProgress()
      Get a list of all research in progress.
      Returns:
      the list.
    • hasCompletedResearch

      boolean hasCompletedResearch(net.minecraft.resources.ResourceLocation researchId)
      Checks if a given research is complete.
      Returns:
      true if complete or if no such research is loaded, false if not completed.
    • finishResearch

      void finishResearch(net.minecraft.resources.ResourceLocation id)
      Finish a research and remove it from the inProgress list.
      Parameters:
      id - the id of the research to finish.
    • attemptBeginResearch

      void attemptBeginResearch(net.minecraft.world.entity.player.Player player, IColony colony, BuildingUniversity building, IGlobalResearch research)
      Attempt to begin a research.
      Parameters:
      player - the player(s) making the request (and to apply costs toward)
      colony - the colony doing the research
      research - the research.
    • attemptResetResearch

      void attemptResetResearch(net.minecraft.world.entity.player.Player player, @Nullable @Nullable IColony colony, ILocalResearch research)
      Reset a research, and optionally undo its effects. If the research is begun but incomplete, cancel it.
      Parameters:
      player - the player to notify of research cancellation results.
      colony - the colony to remove effects from, or null if no effect reset is desired.
      research - the local research descriptor.
    • writeToNBT

      void writeToNBT(net.minecraft.nbt.CompoundTag compound)
      Write the research tree to NBT.
      Parameters:
      compound - the compound.
    • readFromNBT

      void readFromNBT(net.minecraft.nbt.CompoundTag compound, IResearchEffectManager effects)
      Read the research tree from NBT.
      Parameters:
      compound - the compound to read it from.
      effects - the effects.
    • getCompletedList

      List<net.minecraft.resources.ResourceLocation> getCompletedList()
      Get the list of all finished researches
      Returns:
      a copy of the completed list.
    • isComplete

      boolean isComplete(net.minecraft.resources.ResourceLocation location)
      Check if a given research is complete.
      Parameters:
      location - the unique id.
      Returns:
      true if so.