Class GlobalResearchEffect

java.lang.Object
com.minecolonies.core.research.GlobalResearchEffect
All Implemented Interfaces:
IResearchEffect

public class GlobalResearchEffect extends Object implements IResearchEffect
An instance of a Research Effect at a specific strength, to be applied to a specific colony.
  • Constructor Summary

    Constructors
    Constructor
    Description
    GlobalResearchEffect(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 Type
    Method
    Description
    double
    Get the absolute effect of the research.
    net.minecraft.resources.ResourceLocation
    Getter for the ID of the effect.
    net.minecraft.network.chat.contents.TranslatableContents
    Human-readable effect description, or a translation key.
    Get the ModResearchEffects.ResearchEffectEntry for this Research Effect.
    net.minecraft.network.chat.contents.TranslatableContents
    Human-readable effect subtitle description, or a translation key.
    boolean
    overrides(@NotNull IResearchEffect other)
    Does this effect override another effect with the same id?
    net.minecraft.nbt.CompoundTag
    Write the ResearchEffect's traits to NBT, to simplify serialization for client-viewable data.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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

      public ModResearchEffects.ResearchEffectEntry getRegistryEntry()
      Description copied from interface: IResearchEffect
      Get the ModResearchEffects.ResearchEffectEntry for this Research Effect.
      Specified by:
      getRegistryEntry in interface IResearchEffect
      Returns:
      a registry entry.
    • getId

      public net.minecraft.resources.ResourceLocation getId()
      Description copied from interface: IResearchEffect
      Getter for the ID of the effect.
      Specified by:
      getId in interface IResearchEffect
      Returns:
      the effect id as a ResourceLocation.
    • getName

      public net.minecraft.network.chat.contents.TranslatableContents getName()
      Description copied from interface: IResearchEffect
      Human-readable effect description, or a translation key.
      Specified by:
      getName in interface IResearchEffect
      Returns:
      the desc.
    • getSubtitle

      public net.minecraft.network.chat.contents.TranslatableContents getSubtitle()
      Description copied from interface: IResearchEffect
      Human-readable effect subtitle description, or a translation key.
      Specified by:
      getSubtitle in interface IResearchEffect
      Returns:
      the Subtitle desc.
    • getEffect

      public double getEffect()
      Description copied from interface: IResearchEffect
      Get the absolute effect of the research.
      Specified by:
      getEffect in interface IResearchEffect
      Returns:
      the effect.
    • overrides

      public boolean overrides(@NotNull @NotNull IResearchEffect other)
      Description copied from interface: IResearchEffect
      Does this effect override another effect with the same id?
      Specified by:
      overrides in interface IResearchEffect
      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: IResearchEffect
      Write the ResearchEffect's traits to NBT, to simplify serialization for client-viewable data.
      Specified by:
      writeToNBT in interface IResearchEffect
      Returns:
      an NBT file containing at least the necessary traits to reassemble user-visible traits of the effect.