Interface ITreeEffect

All Superinterfaces:
IEffect, IRegistryAlleleValue

public interface ITreeEffect extends IEffect, IRegistryAlleleValue
Defines random tick and animation tick logic for leaves. In Forestry, this is only used by Cherry Blossom trees to spawn petal particles.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    doAnimationEffect(IGenome genome, net.minecraft.world.level.Level level, net.minecraft.core.BlockPos pos, net.minecraft.util.RandomSource rand)
    Called whenever this leaf block is randomly animation ticked, like in Block.animateTick(net.minecraft.world.level.block.state.BlockState, net.minecraft.world.level.Level, net.minecraft.core.BlockPos, net.minecraft.util.RandomSource).
    doEffect(IGenome genome, IEffectData storedData, net.minecraft.world.level.Level level, net.minecraft.core.BlockPos pos)
    Called whenever this leaf block is randomly ticked, like in BlockBehaviour.randomTick(net.minecraft.world.level.block.state.BlockState, net.minecraft.server.level.ServerLevel, net.minecraft.core.BlockPos, net.minecraft.util.RandomSource).

    Methods inherited from interface forestry.api.apiculture.genetics.IEffect

    isCombinable, validateStorage

    Methods inherited from interface forestry.api.genetics.alleles.IRegistryAlleleValue

    isDominant
  • Method Details

    • doEffect

      IEffectData doEffect(IGenome genome, IEffectData storedData, net.minecraft.world.level.Level level, net.minecraft.core.BlockPos pos)
      Called whenever this leaf block is randomly ticked, like in BlockBehaviour.randomTick(net.minecraft.world.level.block.state.BlockState, net.minecraft.server.level.ServerLevel, net.minecraft.core.BlockPos, net.minecraft.util.RandomSource).
      Parameters:
      genome - The genome of the tree.
      storedData - Effect data stored between invocations. Not persisted to disk.
      level - The world of the tree.
      pos - The position of the leaf block.
      Returns:
      The effect data to use in the next invocation of this method.
    • doAnimationEffect

      void doAnimationEffect(IGenome genome, net.minecraft.world.level.Level level, net.minecraft.core.BlockPos pos, net.minecraft.util.RandomSource rand)
      Called whenever this leaf block is randomly animation ticked, like in Block.animateTick(net.minecraft.world.level.block.state.BlockState, net.minecraft.world.level.Level, net.minecraft.core.BlockPos, net.minecraft.util.RandomSource). Only called on the logical client.
      Parameters:
      genome - The genome of the tree.
      level - The world of the tree. Always clientside.
      pos - The position of the leaf block.
      rand - A random source to use for random number generation.