Package com.minecolonies.core.research
Class GlobalResearchEffect
java.lang.Object
com.minecolonies.core.research.GlobalResearchEffect
- All Implemented Interfaces:
IResearchEffect
An instance of a Research Effect at a specific strength, to be applied to a specific colony.
-
Constructor Summary
ConstructorsConstructorDescriptionGlobalResearchEffect(net.minecraft.nbt.CompoundTag nbt) The constructor to build a new global research effect from an NBT.GlobalResearchEffect(net.minecraft.resources.ResourceLocation id, String name, String subtitle, double effect, double displayEffect) The constructor to create a new global research effect, with a statically assigned description. -
Method Summary
Modifier and TypeMethodDescriptiondoubleGet the absolute effect of the research.net.minecraft.resources.ResourceLocationgetId()Getter for the ID of the effect.net.minecraft.network.chat.contents.TranslatableContentsgetName()Human-readable effect description, or a translation key.Get theModResearchEffects.ResearchEffectEntryfor this Research Effect.net.minecraft.network.chat.contents.TranslatableContentsHuman-readable effect subtitle description, or a translation key.booleanoverrides(@NotNull IResearchEffect other) Does this effect override another effect with the same id?net.minecraft.nbt.CompoundTagWrite the ResearchEffect's traits to NBT, to simplify serialization for client-viewable data.
-
Constructor Details
-
GlobalResearchEffect
public GlobalResearchEffect(net.minecraft.resources.ResourceLocation id, String name, String subtitle, double effect, double displayEffect) The constructor to create a new global research effect, with a statically assigned description.- Parameters:
id- the id to unlock.name- the effect's description, for display.subtitle- the effect's subtitle description.effect- the effect's absolute strength.displayEffect- the effect's relative strength, for display purposes.
-
GlobalResearchEffect
public GlobalResearchEffect(net.minecraft.nbt.CompoundTag nbt) The constructor to build a new global research effect from an NBT.- Parameters:
nbt- the nbt containing the traits for the global research.
-
-
Method Details
-
getRegistryEntry
Description copied from interface:IResearchEffectGet theModResearchEffects.ResearchEffectEntryfor this Research Effect.- Specified by:
getRegistryEntryin interfaceIResearchEffect- Returns:
- a registry entry.
-
getId
public net.minecraft.resources.ResourceLocation getId()Description copied from interface:IResearchEffectGetter for the ID of the effect.- Specified by:
getIdin interfaceIResearchEffect- Returns:
- the effect id as a ResourceLocation.
-
getName
public net.minecraft.network.chat.contents.TranslatableContents getName()Description copied from interface:IResearchEffectHuman-readable effect description, or a translation key.- Specified by:
getNamein interfaceIResearchEffect- Returns:
- the desc.
-
getSubtitle
public net.minecraft.network.chat.contents.TranslatableContents getSubtitle()Description copied from interface:IResearchEffectHuman-readable effect subtitle description, or a translation key.- Specified by:
getSubtitlein interfaceIResearchEffect- Returns:
- the Subtitle desc.
-
getEffect
public double getEffect()Description copied from interface:IResearchEffectGet the absolute effect of the research.- Specified by:
getEffectin interfaceIResearchEffect- Returns:
- the effect.
-
overrides
Description copied from interface:IResearchEffectDoes this effect override another effect with the same id?- Specified by:
overridesin interfaceIResearchEffect- Parameters:
other- the effect to check.- Returns:
- true if so, generally meaning a higher magnitude effect.
-
writeToNBT
public net.minecraft.nbt.CompoundTag writeToNBT()Description copied from interface:IResearchEffectWrite the ResearchEffect's traits to NBT, to simplify serialization for client-viewable data.- Specified by:
writeToNBTin interfaceIResearchEffect- Returns:
- an NBT file containing at least the necessary traits to reassemble user-visible traits of the effect.
-