Interface IGlobalResearch

All Known Implementing Classes:
GlobalResearch

public interface IGlobalResearch
Interface defining how a research globally is defined.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Add a child to a research.
    void
    addChild(net.minecraft.resources.ResourceLocation child)
    Add a child to a research, without setting parentage.
    void
    Add an individual cost.
    void
    Add an individual effect.
    void
    Add an individual requirement
    boolean
    canDisplay(int uni_level)
    Check if this research can be displayed in the GUI.
    boolean
    canResearch(@NotNull IBuilding building, @NotNull ILocalResearchTree localTree)
    Check if this research can be executed at this moment.
    net.minecraft.resources.ResourceLocation
    Get the id of the branch.
    List<net.minecraft.resources.ResourceLocation>
    Get the list of children of the research.
    Get the cost list from the research.
    int
    Get the depth in the research tree.
    Get the effect of the research.
    net.minecraft.resources.ResourceLocation
    Getter of the id of the research.
    net.minecraft.network.chat.contents.TranslatableContents
    Human-readable description of research, in human-readable text or as a translation key.
    @Nullable net.minecraft.resources.ResourceLocation
    Get the id of the parent IResearch.
    Getter for the research requirement.
    int
    Get the sort order for relative display position.
    net.minecraft.network.chat.contents.TranslatableContents
    Subtitle description of research, in human-readable text or as a translation key.
    boolean
    hasEnoughResources(@NotNull net.minecraft.world.entity.player.Player player, @NotNull net.minecraft.core.BlockPos universityPos)
    Check whether all resources are available to execute the research.
    boolean
    Check if this research is an only child research.
    boolean
    Check if this research has other children and if one of these children has been research already.
    boolean
    Check if this research should automatically start when requirements are complete.
    boolean
    Check if this research is a hidden research.
    boolean
    Check if this research is an immutable research.
    boolean
    Check if this research is an instant research.
    static boolean
    isPlayerResearchMatch(net.minecraft.world.item.ItemStack stack, net.minecraft.world.item.Item cost)
    A stack "matches" a research ingredient if: - It has the same Item - It does NOT carry enchantments, custom names, etc.
    static boolean
    isUniversityResearchMatch(net.minecraft.world.item.ItemStack stack, net.minecraft.world.item.Item cost)
    A stack "matches" a research ingredient if: - It has the same Item (even if they are enchanted or have a custom name)
    void
    startResearch(@NotNull ILocalResearchTree localResearchTree)
    Start the research.
  • Method Details

    • canResearch

      boolean canResearch(@NotNull @NotNull IBuilding building, @NotNull @NotNull ILocalResearchTree localTree)
      Check if this research can be executed at this moment.
      Parameters:
      building - the university building trying to do the research.
      localTree - the local tree of the colony.
      Returns:
      true if so.
    • canDisplay

      boolean canDisplay(int uni_level)
      Check if this research can be displayed in the GUI.
      Parameters:
      uni_level - the level of the university.
      Returns:
      true if so.
    • hasEnoughResources

      boolean hasEnoughResources(@NotNull @NotNull net.minecraft.world.entity.player.Player player, @NotNull @NotNull net.minecraft.core.BlockPos universityPos)
      Check whether all resources are available to execute the research.
      Parameters:
      inventory - the inventory to check in.
      Returns:
      true if so
    • getCostList

      List<IResearchCost> getCostList()
      Get the cost list from the research.
      Returns:
      the list.
    • startResearch

      void startResearch(@NotNull @NotNull ILocalResearchTree localResearchTree)
      Start the research.
      Parameters:
      localResearchTree - the local research tree to store in the colony.
    • getName

      net.minecraft.network.chat.contents.TranslatableContents getName()
      Human-readable description of research, in human-readable text or as a translation key.
      Returns:
      the description.
    • getSubtitle

      net.minecraft.network.chat.contents.TranslatableContents getSubtitle()
      Subtitle description of research, in human-readable text or as a translation key.
      Returns:
      the optional subtitle name.
    • getId

      net.minecraft.resources.ResourceLocation getId()
      Getter of the id of the research.
      Returns:
      the research id, as a ResourceLocation
    • getParent

      @Nullable @Nullable net.minecraft.resources.ResourceLocation getParent()
      Get the id of the parent IResearch.
      Returns:
      the parent id, as a ResourceLocation
    • getBranch

      net.minecraft.resources.ResourceLocation getBranch()
      Get the id of the branch.
      Returns:
      the branch id, as a ResourceLocation
    • getDepth

      int getDepth()
      Get the depth in the research tree.
      Returns:
      the depth.
    • getSortOrder

      int getSortOrder()
      Get the sort order for relative display position.
      Returns:
      the depth.
    • isInstant

      boolean isInstant()
      Check if this research is an instant research. If so, it will attempt to start when its requirements are complete, and prompt the player.
      Returns:
      true if so.
    • isAutostart

      boolean isAutostart()
      Check if this research should automatically start when requirements are complete. This can temporarily exceed normal limits of the max number of concurrent researches.
      Returns:
      true if so.
    • isHidden

      boolean isHidden()
      Check if this research is a hidden research. If so, it (and its children) should only be visible if all requirements are met.
      Returns:
      true if so.
    • isImmutable

      boolean isImmutable()
      Check if this research is an immutable research. If so, it (and ancestor research unlocking it) can not be reset once completed.
      Returns:
      true if so.
    • hasOnlyChild

      boolean hasOnlyChild()
      Check if this research is an only child research. This means, after researching one child no other children can be researched.
      Returns:
      true if so.
    • hasResearchedChild

      boolean hasResearchedChild(@NotNull @NotNull ILocalResearchTree localTree)
      Check if this research has other children and if one of these children has been research already.
      Parameters:
      localTree - the local tree of the colony.
      Returns:
      true if so.
    • addChild

      void addChild(IGlobalResearch child)
      Add a child to a research.
      Parameters:
      child - the child to add.
    • addChild

      void addChild(net.minecraft.resources.ResourceLocation child)
      Add a child to a research, without setting parentage.
      Parameters:
      child - the child to add
    • addCost

      void addCost(IResearchCost cost)
      Add an individual cost.
      Parameters:
      cost - the individual item to add to the cost list, as a reseach cost instance.
    • addEffect

      void addEffect(IResearchEffect effect)
      Add an individual effect.
      Parameters:
      effect - the individual effect to add to the research, as a IResearchEffect.
    • addRequirement

      void addRequirement(IResearchRequirement requirement)
      Add an individual requirement
      Parameters:
      requirement - the individual requirement to add to the research, as an IResearchRequirement.
    • getChildren

      List<net.minecraft.resources.ResourceLocation> getChildren()
      Get the list of children of the research.
      Returns:
      a copy of the list of child identifiers.
    • getResearchRequirements

      List<IResearchRequirement> getResearchRequirements()
      Getter for the research requirement.
      Returns:
      the requirement.
    • getEffects

      List<IResearchEffect> getEffects()
      Get the effect of the research.
      Returns:
      the effect.
    • isPlayerResearchMatch

      static boolean isPlayerResearchMatch(net.minecraft.world.item.ItemStack stack, net.minecraft.world.item.Item cost)
      A stack "matches" a research ingredient if: - It has the same Item - It does NOT carry enchantments, custom names, etc.
    • isUniversityResearchMatch

      static boolean isUniversityResearchMatch(net.minecraft.world.item.ItemStack stack, net.minecraft.world.item.Item cost)
      A stack "matches" a research ingredient if: - It has the same Item (even if they are enchanted or have a custom name)