Class AbstractResearchProvider.ResearchEffect

java.lang.Object
com.minecolonies.api.research.AbstractResearchProvider.ResearchEffect
Enclosing class:
AbstractResearchProvider

public static class AbstractResearchProvider.ResearchEffect extends Object
A Builder-like class for producing Research Effects.
  • Field Details

    • json

      public final com.google.gson.JsonObject json
    • id

      public final net.minecraft.resources.ResourceLocation id
    • translatedName

      public String translatedName
      A Translated Name to add to the output language file.
    • translatedSubtitle

      public String translatedSubtitle
      A Translated Subtitle to add to the output language file.
  • Constructor Details

    • ResearchEffect

      public ResearchEffect(net.minecraft.resources.ResourceLocation id)
      Creates a new instances of a ResearchEffect.
      Parameters:
      id - A unique identifier. Suggested path format is effects/name.json.
    • ResearchEffect

      public ResearchEffect(AbstractColonyBlock<?> buildingBlock)
      Creates a new instances of a ResearchEffect that locks and unlocks a Building See ModBuildings for a list of supported buildings.
      Parameters:
      buildingBlock - A Building hut block. This will auto-generate an unlock effect ID of effects/blockhutname.json.
    • ResearchEffect

      public ResearchEffect(net.minecraft.resources.ResourceLocation id, String type)
      Create a new instance of a ResearchEffect with an effectType.
      Parameters:
      id - A unique identifier. Suggested path format is effects/name.json.
      type - The type of the research effect.
  • Method Details

    • setLevels

      public AbstractResearchProvider.ResearchEffect setLevels(double[] strengths)
      Set the levels of the research effect, starting at level 1. Level 0 will be automatically populated during JsonLoad on the server, and set to a value of zero.
      Parameters:
      strengths - The strengths of the research effect.
      Returns:
      this
    • setName

      Set the research name as a human-readable string. For translation keys, use setTranslatedName instead.
      Parameters:
      name - The human-readable name.
      Returns:
      this
    • setTranslatedName

      public AbstractResearchProvider.ResearchEffect setTranslatedName(String name)
      Set the research name, using an auto-generated translation key, and add a matching translation text to the language output file.
      Parameters:
      name - The human-readable name.
      Returns:
      this
    • setSubtitle

      public AbstractResearchProvider.ResearchEffect setSubtitle(String subtitle)
      Adds a human-readable subtitle to the Research Effect json.
      Parameters:
      subtitle - A human-readable subtitle. This will only show on tooltips.
      Returns:
      this
    • setTranslatedSubtitle

      public AbstractResearchProvider.ResearchEffect setTranslatedSubtitle(String subtitle)
      Adds a translated subtitle to the language file, and the translation key to the ResearchEffect json.
      Parameters:
      subtitle - A human-readable subtitle. This will only show on tooltips.
      Returns:
      this