Class ResearchEffectManager

java.lang.Object
com.minecolonies.core.research.ResearchEffectManager
All Implemented Interfaces:
IResearchEffectManager

public class ResearchEffectManager extends Object implements IResearchEffectManager
The map of unlocked research effects of a given colony.
  • Constructor Details

    • ResearchEffectManager

      public ResearchEffectManager()
  • Method Details

    • getEffectStrength

      public double getEffectStrength(net.minecraft.resources.ResourceLocation id)
      Description copied from interface: IResearchEffectManager
      Get the research effect strength for a given ResearchEffect type, or zero, if no matching effect is present.
      Specified by:
      getEffectStrength in interface IResearchEffectManager
      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

      public void applyEffect(IResearchEffect effect)
      Description copied from interface: IResearchEffectManager
      Apply the effect to the research effects class.
      Specified by:
      applyEffect in interface IResearchEffectManager
      Parameters:
      effect - the effect to apply.
    • removeAllEffects

      public void removeAllEffects()
      Description copied from interface: IResearchEffectManager
      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.
      Specified by:
      removeAllEffects in interface IResearchEffectManager