Package com.minecolonies.api.research
Class AbstractResearchProvider.ResearchEffect
java.lang.Object
com.minecolonies.api.research.AbstractResearchProvider.ResearchEffect
- Enclosing class:
AbstractResearchProvider
A Builder-like class for producing Research Effects.
-
Field Summary
FieldsModifier and TypeFieldDescriptionfinal net.minecraft.resources.ResourceLocationfinal com.google.gson.JsonObjectA Translated Name to add to the output language file.A Translated Subtitle to add to the output language file. -
Constructor Summary
ConstructorsConstructorDescriptionResearchEffect(AbstractColonyBlock<?> buildingBlock) Creates a new instances of a ResearchEffect that locks and unlocks a Building See ModBuildings for a list of supported buildings.ResearchEffect(net.minecraft.resources.ResourceLocation id) Creates a new instances of a ResearchEffect.ResearchEffect(net.minecraft.resources.ResourceLocation id, String type) Create a new instance of a ResearchEffect with an effectType. -
Method Summary
Modifier and TypeMethodDescriptionsetLevels(double[] strengths) Set the levels of the research effect, starting at level 1.Set the research name as a human-readable string.setSubtitle(String subtitle) Adds a human-readable subtitle to the Research Effect json.setTranslatedName(String name) Set the research name, using an auto-generated translation key, and add a matching translation text to the language output file.setTranslatedSubtitle(String subtitle) Adds a translated subtitle to the language file, and the translation key to the ResearchEffect json.
-
Field Details
-
json
public final com.google.gson.JsonObject json -
id
public final net.minecraft.resources.ResourceLocation id -
translatedName
A Translated Name to add to the output language file. -
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
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
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
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
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
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
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
-