Package com.minecolonies.api.research
Interface IResearchEffectManager
- All Known Implementing Classes:
ResearchEffectManager
public interface IResearchEffectManager
The manager of unlocked research effects of a given colony.
-
Method Summary
Modifier and TypeMethodDescriptionvoidapplyEffect(IResearchEffect effect) Apply the effect to the research effects class.doublegetEffectStrength(net.minecraft.resources.ResourceLocation id) Get the research effect strength for a given ResearchEffect type, or zero, if no matching effect is present.voidClear all effects from the effect manager.
-
Method Details
-
getEffectStrength
double getEffectStrength(net.minecraft.resources.ResourceLocation id) Get the research effect strength for a given ResearchEffect type, or zero, if no matching effect is present.- Parameters:
id- the id of the effect.- Returns:
- the strength of the effect, 1 by default for researches effects which do not have values configured, or zero if it isn't present.
-
applyEffect
Apply the effect to the research effects class.- Parameters:
effect- the effect to apply.
-
removeAllEffects
void removeAllEffects()Clear all effects from the effect manager. This should be called on modifications to the effects inside the GlobalResearchTree, or on removal or disable of any effects inside a colony's LocalResearchTree. Because ResearchEffect strengths may not have constantly increasingly impact, and Researches themselves may not necessarily require all (or any) previous levels of an Effect be unlocked, modifications to a ResearchEffect's behavior can not rely on simply rolling a single research effect level or reduce effect strength. After the modifications are complete, the modifying class can then reapply the full cases of local research.
-