Record Class BurstBlockVisualEffect
java.lang.Object
java.lang.Record
johnsmith.enchantmentcore.api.enchantment.spellfield.effect.visual.BurstBlockVisualEffect
- Record Components:
particle- TheParticleOptionsdefining the particle type to emit.count- TheLevelBasedValuebase number of particles emitted per block before topological scaling.speed- TheLevelBasedValuebase particle speed before topological scaling.evaluator- TheTopologyEvaluatorgoverning 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
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.MapCodec<BurstBlockVisualEffect> MapCodec for serializing and deserializingBurstBlockVisualEffectinstances from JSON.static final StringJSON field key for the base particle count.static final StringJSON field key for the topological threshold/probability evaluator.static final StringRegistry path identifier for this spell field block effect.static final LevelBasedKeyProviderSupplies the JSON property keys holdingLevelBasedValuedefinitions for data transformation.static final StringJSON field key for the particle options definition.static final StringJSON field key for the base particle speed. -
Constructor Summary
ConstructorsConstructorDescriptionBurstBlockVisualEffect(net.minecraft.core.particles.ParticleOptions particle, net.minecraft.world.item.enchantment.LevelBasedValue count, net.minecraft.world.item.enchantment.LevelBasedValue speed) Constructs aBurstBlockVisualEffectusing the defaultTopologyEvaluator.PROBABILISTICevaluator.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 aBurstBlockVisualEffectrecord class. -
Method Summary
Modifier and TypeMethodDescriptionvoidapply(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 ofposwith a $0.5$ block spread along each axis when permitted byevaluator().com.mojang.serialization.MapCodec<? extends SpellFieldBlockEffect> codec()Retrieves theMapCodecresponsible for serializing and deserializing this effect.net.minecraft.world.item.enchantment.LevelBasedValuecount()Returns the value of thecountrecord component.final booleanIndicates whether some other object is "equal to" this one.Returns the value of theevaluatorrecord component.floatgetPriority(int enchantmentLevel) Returns the execution priority of this block effect derived from the evaluator's threshold.final inthashCode()Returns a hash code value for this object.net.minecraft.core.particles.ParticleOptionsparticle()Returns the value of theparticlerecord component.net.minecraft.world.item.enchantment.LevelBasedValuespeed()Returns the value of thespeedrecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
PARTICLE
JSON field key for the particle options definition.- See Also:
-
COUNT
JSON field key for the base particle count.- See Also:
-
SPEED
JSON field key for the base particle speed.- See Also:
-
EVALUATOR
JSON field key for the topological threshold/probability evaluator.- See Also:
-
KEY
Registry path identifier for this spell field block effect.- See Also:
-
KEY_PROVIDER
Supplies the JSON property keys holdingLevelBasedValuedefinitions for data transformation. -
CODEC
MapCodec for serializing and deserializingBurstBlockVisualEffectinstances from JSON.
-
-
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 aBurstBlockVisualEffectusing the defaultTopologyEvaluator.PROBABILISTICevaluator.- Parameters:
particle- The particle options to emit.count- TheLevelBasedValuebase particle count.speed- TheLevelBasedValuebase 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 aBurstBlockVisualEffectrecord class.
-
-
Method Details
-
getPriority
public float getPriority(int enchantmentLevel) Returns the execution priority of this block effect derived from the evaluator's threshold.- Specified by:
getPriorityin interfaceSpellFieldBlockEffect- 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 ofposwith a $0.5$ block spread along each axis when permitted byevaluator().- Specified by:
applyin interfaceSpellFieldBlockEffect- 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 atpos.modifiedBlocks- A mutable set tracking block coordinates modified during this evaluation cycle.
-
codec
Description copied from interface:SpellFieldEffectRetrieves theMapCodecresponsible for serializing and deserializing this effect.- Specified by:
codecin interfaceSpellFieldEffect- Returns:
- The registered
MapCodecinstance.
-
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. -
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. -
equals
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 withObjects::equals(Object,Object). -
particle
public net.minecraft.core.particles.ParticleOptions particle()Returns the value of theparticlerecord component.- Returns:
- the value of the
particlerecord component
-
count
public net.minecraft.world.item.enchantment.LevelBasedValue count()Returns the value of thecountrecord component.- Returns:
- the value of the
countrecord component
-
speed
public net.minecraft.world.item.enchantment.LevelBasedValue speed()Returns the value of thespeedrecord component.- Returns:
- the value of the
speedrecord component
-
evaluator
Returns the value of theevaluatorrecord component.- Returns:
- the value of the
evaluatorrecord component
-