Record Class BurstBlockVisualEffect

java.lang.Object
java.lang.Record
johnsmith.enchantmentcore.api.enchantment.spellfield.effect.visual.BurstBlockVisualEffect
Record Components:
particle - The ParticleOptions defining the particle type to emit.
count - The LevelBasedValue base number of particles emitted per block before topological scaling.
speed - The LevelBasedValue base particle speed before topological scaling.
evaluator - The TopologyEvaluator governing deterministic threshold or probabilistic activation.
All Implemented Interfaces:
SpellFieldBlockEffect, SpellFieldEffect

public record BurstBlockVisualEffect(net.minecraft.core.particles.ParticleOptions particle, net.minecraft.world.item.enchantment.LevelBasedValue count, net.minecraft.world.item.enchantment.LevelBasedValue speed, TopologyEvaluator evaluator) extends Record implements SpellFieldBlockEffect
A visual SpellFieldBlockEffect that emits a localized burst of particles centered at each evaluated block coordinate that passes its TopologyEvaluator, scaling both particle count and speed by the block's topological multiplier.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final com.mojang.serialization.MapCodec<BurstBlockVisualEffect>
    MapCodec for serializing and deserializing BurstBlockVisualEffect instances from JSON.
    static final String
    JSON field key for the base particle count.
    static final String
    JSON field key for the topological threshold/probability evaluator.
    static final String
    Registry path identifier for this spell field block effect.
    Supplies the JSON property keys holding LevelBasedValue definitions for data transformation.
    static final String
    JSON field key for the particle options definition.
    static final String
    JSON field key for the base particle speed.
  • Constructor Summary

    Constructors
    Constructor
    Description
    BurstBlockVisualEffect(net.minecraft.core.particles.ParticleOptions particle, net.minecraft.world.item.enchantment.LevelBasedValue count, net.minecraft.world.item.enchantment.LevelBasedValue speed)
    Constructs a BurstBlockVisualEffect using the default TopologyEvaluator.PROBABILISTIC evaluator.
    BurstBlockVisualEffect(net.minecraft.core.particles.ParticleOptions particle, net.minecraft.world.item.enchantment.LevelBasedValue count, net.minecraft.world.item.enchantment.LevelBasedValue speed, TopologyEvaluator evaluator)
    Creates an instance of a BurstBlockVisualEffect record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    apply(net.minecraft.server.level.ServerLevel level, int enchantmentLevel, net.minecraft.world.item.enchantment.EnchantedItemInUse context, net.minecraft.world.entity.Entity spatialReference, net.minecraft.world.phys.Vec3 epicenter, net.minecraft.core.BlockPos pos, float scalar, Set<net.minecraft.core.BlockPos> modifiedBlocks)
    Broadcasts a particle burst around the center of pos with a $0.5$ block spread along each axis when permitted by evaluator().
    com.mojang.serialization.MapCodec<? extends SpellFieldBlockEffect>
    Retrieves the MapCodec responsible for serializing and deserializing this effect.
    net.minecraft.world.item.enchantment.LevelBasedValue
    Returns the value of the count record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    Returns the value of the evaluator record component.
    float
    getPriority(int enchantmentLevel)
    Returns the execution priority of this block effect derived from the evaluator's threshold.
    final int
    Returns a hash code value for this object.
    net.minecraft.core.particles.ParticleOptions
    Returns the value of the particle record component.
    net.minecraft.world.item.enchantment.LevelBasedValue
    Returns the value of the speed record component.
    final String
    Returns a string representation of this record class.

    Methods inherited from class Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Field Details

  • Constructor Details

    • BurstBlockVisualEffect

      public BurstBlockVisualEffect(net.minecraft.core.particles.ParticleOptions particle, net.minecraft.world.item.enchantment.LevelBasedValue count, net.minecraft.world.item.enchantment.LevelBasedValue speed)
      Constructs a BurstBlockVisualEffect using the default TopologyEvaluator.PROBABILISTIC evaluator.
      Parameters:
      particle - The particle options to emit.
      count - The LevelBasedValue base particle count.
      speed - The LevelBasedValue base particle speed.
    • BurstBlockVisualEffect

      public BurstBlockVisualEffect(net.minecraft.core.particles.ParticleOptions particle, net.minecraft.world.item.enchantment.LevelBasedValue count, net.minecraft.world.item.enchantment.LevelBasedValue speed, TopologyEvaluator evaluator)
      Creates an instance of a BurstBlockVisualEffect record class.
      Parameters:
      particle - the value for the particle record component
      count - the value for the count record component
      speed - the value for the speed record component
      evaluator - the value for the evaluator record component
  • Method Details

    • getPriority

      public float getPriority(int enchantmentLevel)
      Returns the execution priority of this block effect derived from the evaluator's threshold.
      Specified by:
      getPriority in interface SpellFieldBlockEffect
      Parameters:
      enchantmentLevel - The active level of the spell field enchantment.
      Returns:
      The priority scalar.
    • apply

      public void apply(net.minecraft.server.level.ServerLevel level, int enchantmentLevel, net.minecraft.world.item.enchantment.EnchantedItemInUse context, net.minecraft.world.entity.Entity spatialReference, net.minecraft.world.phys.Vec3 epicenter, net.minecraft.core.BlockPos pos, float scalar, Set<net.minecraft.core.BlockPos> modifiedBlocks)
      Broadcasts a particle burst around the center of pos with a $0.5$ block spread along each axis when permitted by evaluator().
      Specified by:
      apply in interface SpellFieldBlockEffect
      Parameters:
      level - The executing server level.
      enchantmentLevel - The active level of the spell field enchantment.
      context - The item usage context triggering the spell field.
      spatialReference - The anchor entity or focal point of the spell field.
      epicenter - The exact spatial origin vector of the spell field.
      pos - The target block coordinate.
      scalar - The active topological multiplier at pos.
      modifiedBlocks - A mutable set tracking block coordinates modified during this evaluation cycle.
    • codec

      public com.mojang.serialization.MapCodec<? extends SpellFieldBlockEffect> codec()
      Description copied from interface: SpellFieldEffect
      Retrieves the MapCodec responsible for serializing and deserializing this effect.
      Specified by:
      codec in interface SpellFieldEffect
      Returns:
      The registered MapCodec instance.
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • particle

      public net.minecraft.core.particles.ParticleOptions particle()
      Returns the value of the particle record component.
      Returns:
      the value of the particle record component
    • count

      public net.minecraft.world.item.enchantment.LevelBasedValue count()
      Returns the value of the count record component.
      Returns:
      the value of the count record component
    • speed

      public net.minecraft.world.item.enchantment.LevelBasedValue speed()
      Returns the value of the speed record component.
      Returns:
      the value of the speed record component
    • evaluator

      public TopologyEvaluator evaluator()
      Returns the value of the evaluator record component.
      Returns:
      the value of the evaluator record component