Package com.minecolonies.core.research
Class ResearchEffectManager
java.lang.Object
com.minecolonies.core.research.ResearchEffectManager
- All Implemented Interfaces:
IResearchEffectManager
The map of unlocked research effects of a given colony.
-
Constructor Summary
Constructors -
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.
-
Constructor Details
-
ResearchEffectManager
public ResearchEffectManager()
-
-
Method Details
-
getEffectStrength
public double getEffectStrength(net.minecraft.resources.ResourceLocation id) Description copied from interface:IResearchEffectManagerGet the research effect strength for a given ResearchEffect type, or zero, if no matching effect is present.- Specified by:
getEffectStrengthin interfaceIResearchEffectManager- 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
Description copied from interface:IResearchEffectManagerApply the effect to the research effects class.- Specified by:
applyEffectin interfaceIResearchEffectManager- Parameters:
effect- the effect to apply.
-
removeAllEffects
public void removeAllEffects()Description copied from interface:IResearchEffectManagerClear 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.- Specified by:
removeAllEffectsin interfaceIResearchEffectManager
-