Interface IBeeEffect

All Superinterfaces:
IEffect

public interface IBeeEffect extends IEffect
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final com.mojang.serialization.Codec<IBeeEffect>
    Dispatch codec for datapack effect definitions (data/<namespace>/forestry/bee_effect/<name>.json).
  • Method Summary

    Modifier and Type
    Method
    Description
    default com.mojang.serialization.MapCodec<? extends IBeeEffect>
     
    default IEffectData
    doEffect(IGenome genome, IEffectData storedData, IBeeHousing housing)
    Called by apiaries to cause an effect in the world.
    default IEffectData
    doFX(IGenome genome, IEffectData storedData, IBeeHousing housing)
    Called on the client side to produce visual bee effects.
    default boolean
     
    boolean
     
    default IEffectData
    Returns the passed data storage if it is valid for this effect or a new one if the passed storage object was invalid for this effect.
  • Field Details

    • CODEC

      static final com.mojang.serialization.Codec<IBeeEffect> CODEC
      Dispatch codec for datapack effect definitions (data/<namespace>/forestry/bee_effect/<name>.json). The "type" field is resolved against ForestryRegistries.BEE_EFFECT_TYPE to a parameterized primitive (apply_potion, transform_block, …). Effects are always type-keyed, so there is no plain fallback (mirrors IMutationCondition#CODEC). The reloadable BeeEffectManager decodes each entry with this codec and, via GeneticsReloadHandler, feeds the results into the bee species type's effect map before species are (re)built, so a species genome can reference a datapack effect allele by its entry key.
  • Method Details

    • codec

      default com.mojang.serialization.MapCodec<? extends IBeeEffect> codec()
      Returns:
      The serializer used to (de)serialize this effect in a datapack effect definition. Only primitives that are meant to be datapack-configurable override this; code-only base effects never pass through the datapack registry, so they inherit the throwing default.
    • isDominant

      boolean isDominant()
      Returns:
      Whether the allele for this value is dominant or recessive.
    • validateStorage

      default IEffectData validateStorage(IEffectData storedData)
      Description copied from interface: IEffect
      Returns the passed data storage if it is valid for this effect or a new one if the passed storage object was invalid for this effect.
      Specified by:
      validateStorage in interface IEffect
      Returns:
      IEffectData for the next cycle.
    • isCombinable

      default boolean isCombinable()
      Specified by:
      isCombinable in interface IEffect
      Returns:
      Whether this effect can work with another combinable effect on the same chromosome pair.
    • doEffect

      default IEffectData doEffect(IGenome genome, IEffectData storedData, IBeeHousing housing)
      Called by apiaries to cause an effect in the world. (server)
      Parameters:
      genome - Genome of the bee queen causing this effect
      storedData - Object containing the stored effect data for the apiary/hive the bee is in.
      housing - IBeeHousing the bee currently resides in.
      Returns:
      storedData, may have been manipulated.
    • doFX

      default IEffectData doFX(IGenome genome, IEffectData storedData, IBeeHousing housing)
      Called on the client side to produce visual bee effects.
      Parameters:
      genome - Genome of the bee queen causing this effect
      storedData - Object containing the stored effect data for the apiary/hive the bee is in.
      housing - IBeeHousing the bee currently resides in.
      Returns:
      storedData, may have been manipulated.