Class StateDeclarationMixin
java.lang.Object
johnsmith.enchantmentcore.mixin.enchantment.effect.entity.projectile.StateDeclarationMixin
- All Implemented Interfaces:
EntityStateAccessor,ProjectileStateAccessor
Mixin injecting ProjectileStateAccessor state fields into the base Projectile class.
Allocates memory footprint for custom projectile physics and behavioral parameters.
Allows independent, isolated state tracking for every instantiated projectile.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintRetrieves the number of remaining ricochet bounces.doubleRetrieves the active aerodynamic drag multiplier.doubleRetrieves the arming distance required before homing activates.doubleRetrieves the field-of-view cone angle for homing target acquisition.doubleRetrieves the maximum frustum distance threshold for homing target acquisition.doubleRetrieves the minimum frustum distance threshold for homing target acquisition.booleanRetrieves whether homing prioritizes the target's head/eye position.doubleRetrieves the homing tracking strength.doubleRetrieves the maximum angular turn rate per tick for homing tracking.doubleRetrieves the arming distance required before the magnetic effect activates.booleanRetrieves whether magnetic pull prioritizes the target's head/eye position.doubleRetrieves the radial target search radius for the magnetic effect.doubleRetrieves the magnetic trajectory pull strength.doubleRetrieves the velocity retention multiplier applied after each ricochet bounce.intRetrieves the number of child shrapnel projectiles spawned per impact.doubleRetrieves the base damage retention multiplier for spawned shrapnel arrows.intRetrieves the number of recursive shrapnel split generations remaining.doubleRetrieves the inaccuracy spread angle of spawned shrapnel projectiles.booleanRetrieves whether shrapnel generation triggers upon block impact.booleanRetrieves whether shrapnel generation triggers upon entity impact.doubleRetrieves the velocity retention multiplier for spawned shrapnel projectiles.booleanRetrieves whether weapon enchantment modifiers have been evaluated and cached on this projectile.voidenchantment_core$setBouncesRemaining(int bounces) Sets the number of block-surface ricochet bounces remaining for the projectile.voidenchantment_core$setCalculated(boolean calculated) Sets the state lock flag indicating whether weapon enchantment modifiers have been evaluated and cached on this projectile.voidenchantment_core$setDragMultiplier(double multiplier) Sets the multiplier applied to the projectile's base aerodynamic/fluid velocity retention factor.voidenchantment_core$setHomingArmingDistance(double distance) Sets the minimum distance (in blocks) the projectile must travel from its spawn point before homing activates.voidenchantment_core$setHomingFov(double fov) Sets the field-of-view cone angle (in degrees) restricting homing target acquisition.voidenchantment_core$setHomingMaxDistance(double distance) Sets the far-clipping plane distance (in blocks) of the homing target acquisition frustum.voidenchantment_core$setHomingMinDistance(double distance) Sets the near-clipping plane distance (in blocks) of the homing target acquisition frustum.voidenchantment_core$setHomingPrioritizesHead(boolean head) Sets whether homing steering aims for the target's eye height instead of its bounding box center.voidenchantment_core$setHomingStrength(double strength) Sets the steering interpolation strength applied when tracking a homing target.voidenchantment_core$setHomingTurnRate(double turnRate) Sets the maximum angular rotation (in degrees per tick) the projectile can turn during homing.voidenchantment_core$setMagneticArmingDistance(double distance) Sets the minimum distance (in blocks) the projectile must travel before magnetic attraction activates.voidenchantment_core$setMagneticPrioritizesHead(boolean head) Sets whether magnetic trajectory attraction aims for the target's eye height.voidenchantment_core$setMagneticSearchRadius(double radius) Sets the radial search distance (in blocks) within which candidate targets are evaluated for magnetism.voidenchantment_core$setMagneticStrength(double strength) Sets the attractive pull strength steering the projectile toward nearby magnetic targets.voidenchantment_core$setRicochetRetention(double retention) Sets the fraction of velocity magnitude retained after a ricochet bounce.voidenchantment_core$setShrapnelAmount(int amount) Sets the number of child shrapnel projectiles spawned per fracture event.voidenchantment_core$setShrapnelDamageRetention(double retention) Sets the fraction of the parent arrow's base damage inherited by spawned shrapnel arrows.voidenchantment_core$setShrapnelGenerations(int gens) Sets the number of recursive shrapnel split generations remaining upon impact.voidenchantment_core$setShrapnelSpread(double spread) Sets the inaccuracy cone spread angle (in degrees) applied to spawned shrapnel projectiles.voidenchantment_core$setShrapnelTriggerBlock(boolean trigger) Sets whether impacting a block triggers shrapnel fracturing.voidenchantment_core$setShrapnelTriggerEntity(boolean trigger) Sets whether impacting an entity triggers shrapnel fracturing.voidenchantment_core$setShrapnelVelocityRetention(double retention) Sets the fraction of the parent projectile's speed inherited by spawned shrapnel projectiles.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface johnsmith.enchantmentcore.api.entity.accessor.EntityStateAccessor
enchantment_core$getGravityMultiplier, enchantment_core$setGravityMultiplier
-
Constructor Details
-
StateDeclarationMixin
public StateDeclarationMixin()
-
-
Method Details
-
enchantment_core$setDragMultiplier
public void enchantment_core$setDragMultiplier(double multiplier) Description copied from interface:ProjectileStateAccessorSets the multiplier applied to the projectile's base aerodynamic/fluid velocity retention factor.- Specified by:
enchantment_core$setDragMultiplierin interfaceProjectileStateAccessor- Parameters:
multiplier- The drag multiplier.
-
enchantment_core$setHomingStrength
public void enchantment_core$setHomingStrength(double strength) Description copied from interface:ProjectileStateAccessorSets the steering interpolation strength applied when tracking a homing target.- Specified by:
enchantment_core$setHomingStrengthin interfaceProjectileStateAccessor- Parameters:
strength- The homing tracking strength.
-
enchantment_core$setHomingPrioritizesHead
public void enchantment_core$setHomingPrioritizesHead(boolean head) Description copied from interface:ProjectileStateAccessorSets whether homing steering aims for the target's eye height instead of its bounding box center.- Specified by:
enchantment_core$setHomingPrioritizesHeadin interfaceProjectileStateAccessor- Parameters:
head-trueto prioritize the head/eyes,falsefor center of mass.
-
enchantment_core$setHomingArmingDistance
public void enchantment_core$setHomingArmingDistance(double distance) Description copied from interface:ProjectileStateAccessorSets the minimum distance (in blocks) the projectile must travel from its spawn point before homing activates.- Specified by:
enchantment_core$setHomingArmingDistancein interfaceProjectileStateAccessor- Parameters:
distance- The arming distance in blocks.
-
enchantment_core$setHomingMinDistance
public void enchantment_core$setHomingMinDistance(double distance) Description copied from interface:ProjectileStateAccessorSets the near-clipping plane distance (in blocks) of the homing target acquisition frustum.- Specified by:
enchantment_core$setHomingMinDistancein interfaceProjectileStateAccessor- Parameters:
distance- The minimum tracking distance in blocks.
-
enchantment_core$setHomingMaxDistance
public void enchantment_core$setHomingMaxDistance(double distance) Description copied from interface:ProjectileStateAccessorSets the far-clipping plane distance (in blocks) of the homing target acquisition frustum.- Specified by:
enchantment_core$setHomingMaxDistancein interfaceProjectileStateAccessor- Parameters:
distance- The maximum tracking distance in blocks.
-
enchantment_core$setHomingFov
public void enchantment_core$setHomingFov(double fov) Description copied from interface:ProjectileStateAccessorSets the field-of-view cone angle (in degrees) restricting homing target acquisition.- Specified by:
enchantment_core$setHomingFovin interfaceProjectileStateAccessor- Parameters:
fov- The field-of-view angle in degrees.
-
enchantment_core$setHomingTurnRate
public void enchantment_core$setHomingTurnRate(double turnRate) Description copied from interface:ProjectileStateAccessorSets the maximum angular rotation (in degrees per tick) the projectile can turn during homing.- Specified by:
enchantment_core$setHomingTurnRatein interfaceProjectileStateAccessor- Parameters:
turnRate- The turn rate limit in degrees per tick.
-
enchantment_core$setBouncesRemaining
public void enchantment_core$setBouncesRemaining(int bounces) Description copied from interface:ProjectileStateAccessorSets the number of block-surface ricochet bounces remaining for the projectile.- Specified by:
enchantment_core$setBouncesRemainingin interfaceProjectileStateAccessor- Parameters:
bounces- The number of bounces remaining.
-
enchantment_core$setRicochetRetention
public void enchantment_core$setRicochetRetention(double retention) Description copied from interface:ProjectileStateAccessorSets the fraction of velocity magnitude retained after a ricochet bounce.- Specified by:
enchantment_core$setRicochetRetentionin interfaceProjectileStateAccessor- Parameters:
retention- The velocity retention multiplier.
-
enchantment_core$setMagneticStrength
public void enchantment_core$setMagneticStrength(double strength) Description copied from interface:ProjectileStateAccessorSets the attractive pull strength steering the projectile toward nearby magnetic targets.- Specified by:
enchantment_core$setMagneticStrengthin interfaceProjectileStateAccessor- Parameters:
strength- The magnetic pull strength.
-
enchantment_core$setMagneticPrioritizesHead
public void enchantment_core$setMagneticPrioritizesHead(boolean head) Description copied from interface:ProjectileStateAccessorSets whether magnetic trajectory attraction aims for the target's eye height.- Specified by:
enchantment_core$setMagneticPrioritizesHeadin interfaceProjectileStateAccessor- Parameters:
head-trueto target the head/eyes,falsefor center of mass.
-
enchantment_core$setMagneticArmingDistance
public void enchantment_core$setMagneticArmingDistance(double distance) Description copied from interface:ProjectileStateAccessorSets the minimum distance (in blocks) the projectile must travel before magnetic attraction activates.- Specified by:
enchantment_core$setMagneticArmingDistancein interfaceProjectileStateAccessor- Parameters:
distance- The arming distance in blocks.
-
enchantment_core$setMagneticSearchRadius
public void enchantment_core$setMagneticSearchRadius(double radius) Description copied from interface:ProjectileStateAccessorSets the radial search distance (in blocks) within which candidate targets are evaluated for magnetism.- Specified by:
enchantment_core$setMagneticSearchRadiusin interfaceProjectileStateAccessor- Parameters:
radius- The search radius in blocks.
-
enchantment_core$setShrapnelGenerations
public void enchantment_core$setShrapnelGenerations(int gens) Description copied from interface:ProjectileStateAccessorSets the number of recursive shrapnel split generations remaining upon impact.- Specified by:
enchantment_core$setShrapnelGenerationsin interfaceProjectileStateAccessor- Parameters:
gens- The number of shrapnel generations.
-
enchantment_core$setShrapnelAmount
public void enchantment_core$setShrapnelAmount(int amount) Description copied from interface:ProjectileStateAccessorSets the number of child shrapnel projectiles spawned per fracture event.- Specified by:
enchantment_core$setShrapnelAmountin interfaceProjectileStateAccessor- Parameters:
amount- The child projectile count per split.
-
enchantment_core$setShrapnelSpread
public void enchantment_core$setShrapnelSpread(double spread) Description copied from interface:ProjectileStateAccessorSets the inaccuracy cone spread angle (in degrees) applied to spawned shrapnel projectiles.- Specified by:
enchantment_core$setShrapnelSpreadin interfaceProjectileStateAccessor- Parameters:
spread- The spread angle in degrees.
-
enchantment_core$setShrapnelVelocityRetention
public void enchantment_core$setShrapnelVelocityRetention(double retention) Description copied from interface:ProjectileStateAccessorSets the fraction of the parent projectile's speed inherited by spawned shrapnel projectiles.- Specified by:
enchantment_core$setShrapnelVelocityRetentionin interfaceProjectileStateAccessor- Parameters:
retention- The velocity retention multiplier.
-
enchantment_core$setShrapnelDamageRetention
public void enchantment_core$setShrapnelDamageRetention(double retention) Description copied from interface:ProjectileStateAccessorSets the fraction of the parent arrow's base damage inherited by spawned shrapnel arrows.- Specified by:
enchantment_core$setShrapnelDamageRetentionin interfaceProjectileStateAccessor- Parameters:
retention- The damage retention multiplier.
-
enchantment_core$setShrapnelTriggerBlock
public void enchantment_core$setShrapnelTriggerBlock(boolean trigger) Description copied from interface:ProjectileStateAccessorSets whether impacting a block triggers shrapnel fracturing.- Specified by:
enchantment_core$setShrapnelTriggerBlockin interfaceProjectileStateAccessor- Parameters:
trigger-trueto trigger on block impact,falseotherwise.
-
enchantment_core$setShrapnelTriggerEntity
public void enchantment_core$setShrapnelTriggerEntity(boolean trigger) Description copied from interface:ProjectileStateAccessorSets whether impacting an entity triggers shrapnel fracturing.- Specified by:
enchantment_core$setShrapnelTriggerEntityin interfaceProjectileStateAccessor- Parameters:
trigger-trueto trigger on entity impact,falseotherwise.
-
enchantment_core$setCalculated
public void enchantment_core$setCalculated(boolean calculated) Description copied from interface:ProjectileStateAccessorSets the state lock flag indicating whether weapon enchantment modifiers have been evaluated and cached on this projectile.- Specified by:
enchantment_core$setCalculatedin interfaceProjectileStateAccessor- Parameters:
calculated-trueonce initial evaluation is complete,falseotherwise.
-
enchantment_core$getDragMultiplier
public double enchantment_core$getDragMultiplier()Description copied from interface:ProjectileStateAccessorRetrieves the active aerodynamic drag multiplier.- Specified by:
enchantment_core$getDragMultiplierin interfaceProjectileStateAccessor- Returns:
- The drag multiplier (defaults to
1.0).
-
enchantment_core$getHomingStrength
public double enchantment_core$getHomingStrength()Description copied from interface:ProjectileStateAccessorRetrieves the homing tracking strength.- Specified by:
enchantment_core$getHomingStrengthin interfaceProjectileStateAccessor- Returns:
- The homing strength (defaults to
0.0).
-
enchantment_core$getHomingPrioritizesHead
public boolean enchantment_core$getHomingPrioritizesHead()Description copied from interface:ProjectileStateAccessorRetrieves whether homing prioritizes the target's head/eye position.- Specified by:
enchantment_core$getHomingPrioritizesHeadin interfaceProjectileStateAccessor- Returns:
trueif prioritizing head,falseotherwise.
-
enchantment_core$getHomingArmingDistance
public double enchantment_core$getHomingArmingDistance()Description copied from interface:ProjectileStateAccessorRetrieves the arming distance required before homing activates.- Specified by:
enchantment_core$getHomingArmingDistancein interfaceProjectileStateAccessor- Returns:
- The arming distance in blocks.
-
enchantment_core$getHomingMinDistance
public double enchantment_core$getHomingMinDistance()Description copied from interface:ProjectileStateAccessorRetrieves the minimum frustum distance threshold for homing target acquisition.- Specified by:
enchantment_core$getHomingMinDistancein interfaceProjectileStateAccessor- Returns:
- The minimum distance in blocks.
-
enchantment_core$getHomingMaxDistance
public double enchantment_core$getHomingMaxDistance()Description copied from interface:ProjectileStateAccessorRetrieves the maximum frustum distance threshold for homing target acquisition.- Specified by:
enchantment_core$getHomingMaxDistancein interfaceProjectileStateAccessor- Returns:
- The maximum distance in blocks (defaults to
64.0).
-
enchantment_core$getHomingFov
public double enchantment_core$getHomingFov()Description copied from interface:ProjectileStateAccessorRetrieves the field-of-view cone angle for homing target acquisition.- Specified by:
enchantment_core$getHomingFovin interfaceProjectileStateAccessor- Returns:
- The FOV angle in degrees (defaults to
360.0).
-
enchantment_core$getHomingTurnRate
public double enchantment_core$getHomingTurnRate()Description copied from interface:ProjectileStateAccessorRetrieves the maximum angular turn rate per tick for homing tracking.- Specified by:
enchantment_core$getHomingTurnRatein interfaceProjectileStateAccessor- Returns:
- The turn rate in degrees per tick (defaults to
360.0).
-
enchantment_core$getBouncesRemaining
public int enchantment_core$getBouncesRemaining()Description copied from interface:ProjectileStateAccessorRetrieves the number of remaining ricochet bounces.- Specified by:
enchantment_core$getBouncesRemainingin interfaceProjectileStateAccessor- Returns:
- The remaining bounce count.
-
enchantment_core$getRicochetRetention
public double enchantment_core$getRicochetRetention()Description copied from interface:ProjectileStateAccessorRetrieves the velocity retention multiplier applied after each ricochet bounce.- Specified by:
enchantment_core$getRicochetRetentionin interfaceProjectileStateAccessor- Returns:
- The velocity retention multiplier (defaults to
0.8).
-
enchantment_core$getMagneticStrength
public double enchantment_core$getMagneticStrength()Description copied from interface:ProjectileStateAccessorRetrieves the magnetic trajectory pull strength.- Specified by:
enchantment_core$getMagneticStrengthin interfaceProjectileStateAccessor- Returns:
- The magnetic pull strength (defaults to
0.0).
-
enchantment_core$getMagneticPrioritizesHead
public boolean enchantment_core$getMagneticPrioritizesHead()Description copied from interface:ProjectileStateAccessorRetrieves whether magnetic pull prioritizes the target's head/eye position.- Specified by:
enchantment_core$getMagneticPrioritizesHeadin interfaceProjectileStateAccessor- Returns:
trueif prioritizing head,falseotherwise.
-
enchantment_core$getMagneticArmingDistance
public double enchantment_core$getMagneticArmingDistance()Description copied from interface:ProjectileStateAccessorRetrieves the arming distance required before the magnetic effect activates.- Specified by:
enchantment_core$getMagneticArmingDistancein interfaceProjectileStateAccessor- Returns:
- The arming distance in blocks.
-
enchantment_core$getMagneticSearchRadius
public double enchantment_core$getMagneticSearchRadius()Description copied from interface:ProjectileStateAccessorRetrieves the radial target search radius for the magnetic effect.- Specified by:
enchantment_core$getMagneticSearchRadiusin interfaceProjectileStateAccessor- Returns:
- The search radius in blocks (defaults to
16.0).
-
enchantment_core$getShrapnelGenerations
public int enchantment_core$getShrapnelGenerations()Description copied from interface:ProjectileStateAccessorRetrieves the number of recursive shrapnel split generations remaining.- Specified by:
enchantment_core$getShrapnelGenerationsin interfaceProjectileStateAccessor- Returns:
- The remaining generation count.
-
enchantment_core$getShrapnelAmount
public int enchantment_core$getShrapnelAmount()Description copied from interface:ProjectileStateAccessorRetrieves the number of child shrapnel projectiles spawned per impact.- Specified by:
enchantment_core$getShrapnelAmountin interfaceProjectileStateAccessor- Returns:
- The shrapnel projectile count.
-
enchantment_core$getShrapnelSpread
public double enchantment_core$getShrapnelSpread()Description copied from interface:ProjectileStateAccessorRetrieves the inaccuracy spread angle of spawned shrapnel projectiles.- Specified by:
enchantment_core$getShrapnelSpreadin interfaceProjectileStateAccessor- Returns:
- The spread angle in degrees.
-
enchantment_core$getShrapnelVelocityRetention
public double enchantment_core$getShrapnelVelocityRetention()Description copied from interface:ProjectileStateAccessorRetrieves the velocity retention multiplier for spawned shrapnel projectiles.- Specified by:
enchantment_core$getShrapnelVelocityRetentionin interfaceProjectileStateAccessor- Returns:
- The velocity retention multiplier.
-
enchantment_core$getShrapnelDamageRetention
public double enchantment_core$getShrapnelDamageRetention()Description copied from interface:ProjectileStateAccessorRetrieves the base damage retention multiplier for spawned shrapnel arrows.- Specified by:
enchantment_core$getShrapnelDamageRetentionin interfaceProjectileStateAccessor- Returns:
- The damage retention multiplier.
-
enchantment_core$getShrapnelTriggerBlock
public boolean enchantment_core$getShrapnelTriggerBlock()Description copied from interface:ProjectileStateAccessorRetrieves whether shrapnel generation triggers upon block impact.- Specified by:
enchantment_core$getShrapnelTriggerBlockin interfaceProjectileStateAccessor- Returns:
trueif triggered on block impact,falseotherwise.
-
enchantment_core$getShrapnelTriggerEntity
public boolean enchantment_core$getShrapnelTriggerEntity()Description copied from interface:ProjectileStateAccessorRetrieves whether shrapnel generation triggers upon entity impact.- Specified by:
enchantment_core$getShrapnelTriggerEntityin interfaceProjectileStateAccessor- Returns:
trueif triggered on entity impact,falseotherwise.
-
enchantment_core$isCalculated
public boolean enchantment_core$isCalculated()Description copied from interface:ProjectileStateAccessorRetrieves whether weapon enchantment modifiers have been evaluated and cached on this projectile.- Specified by:
enchantment_core$isCalculatedin interfaceProjectileStateAccessor- Returns:
trueif calculated,falseotherwise.
-