java.lang.Object
java.lang.Enum<FieldAxis>
johnsmith.enchantmentcore.api.enchantment.spellfield.math.FieldAxis
All Implemented Interfaces:
Serializable, Comparable<FieldAxis>, Constable, net.minecraft.util.StringRepresentable

public enum FieldAxis extends Enum<FieldAxis> implements net.minecraft.util.StringRepresentable
Defines local and topological spatial reference axes and their corresponding kinetic impulse unit vectors relative to a reference entity's orientation and an evaluation epicenter.
  • Nested Class Summary

    Nested classes/interfaces inherited from class java.lang.Enum

    Enum.EnumDesc<E extends Enum<E>>

    Nested classes/interfaces inherited from interface net.minecraft.util.StringRepresentable

    net.minecraft.util.StringRepresentable.EnumCodec<E extends Enum<E> & net.minecraft.util.StringRepresentable>, net.minecraft.util.StringRepresentable.StringRepresentableCodec<S extends net.minecraft.util.StringRepresentable>
  • Enum Constant Summary

    Enum Constants
    Enum Constant
    Description
    Points tangentially around the VERTICAL axis ($\vec{r} \times \hat{u}_{\text{vertical}}$), producing horizontal yaw-plane orbital motion.
    Aligns with the reference entity's horizontal right vector ($\text{forward} \times \text{up}$, or $+X$ if no entity is present).
    Aligns with the reference entity's direct line of sight (forward view vector, or $+Z$ if no entity is present).
    Points tangentially around the LATERAL axis ($\vec{r} \times \hat{u}_{\text{lateral}}$), producing longitudinal pitching orbital motion.
    Points radially outward from offsetEpicenter toward targetPos.
    Points tangentially around the LONGITUDINAL axis ($\vec{r} \times \hat{u}_{\text{longitudinal}}$), producing lateral rolling orbital motion.
    Aligns with the reference entity's local up vector (or the global $+Y$ axis if no entity is present).
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final com.mojang.serialization.Codec<FieldAxis>
    Codec for serializing and deserializing FieldAxis constants by their lowercase identifier.

    Fields inherited from interface net.minecraft.util.StringRepresentable

    PRE_BUILT_MAP_THRESHOLD
  • Method Summary

    Modifier and Type
    Method
    Description
    abstract net.minecraft.world.phys.Vec3
    getImpulseVector(net.minecraft.world.entity.Entity spatialReference, net.minecraft.world.phys.Vec3 offsetEpicenter, net.minecraft.world.phys.Vec3 targetPos)
    Computes the normalized kinetic impulse vector at targetPos relative to offsetEpicenter.
    abstract net.minecraft.world.phys.Vec3
    getReferenceAxis(net.minecraft.world.entity.Entity spatialReference)
    Retrieves the normalized primary reference axis vector based on the entity's orientation.
    @NotNull String
     
    static FieldAxis
    Returns the enum constant of this class with the specified name.
    static FieldAxis[]
    Returns an array containing the constants of this enum class, in the order they are declared.

    Methods inherited from class java.lang.Object

    getClass, notify, notifyAll, wait, wait, wait
  • Enum Constant Details

    • VERTICAL

      public static final FieldAxis VERTICAL
      Aligns with the reference entity's local up vector (or the global $+Y$ axis if no entity is present).
    • LONGITUDINAL

      public static final FieldAxis LONGITUDINAL
      Aligns with the reference entity's direct line of sight (forward view vector, or $+Z$ if no entity is present).
    • LATERAL

      public static final FieldAxis LATERAL
      Aligns with the reference entity's horizontal right vector ($\text{forward} \times \text{up}$, or $+X$ if no entity is present).
    • RADIAL

      public static final FieldAxis RADIAL
      Points radially outward from offsetEpicenter toward targetPos.
    • AZIMUTHAL

      public static final FieldAxis AZIMUTHAL
      Points tangentially around the VERTICAL axis ($\vec{r} \times \hat{u}_{\text{vertical}}$), producing horizontal yaw-plane orbital motion.
    • NUTATIONAL

      public static final FieldAxis NUTATIONAL
      Points tangentially around the LATERAL axis ($\vec{r} \times \hat{u}_{\text{lateral}}$), producing longitudinal pitching orbital motion.
    • TORSIONAL

      public static final FieldAxis TORSIONAL
      Points tangentially around the LONGITUDINAL axis ($\vec{r} \times \hat{u}_{\text{longitudinal}}$), producing lateral rolling orbital motion.
  • Field Details

    • CODEC

      public static final com.mojang.serialization.Codec<FieldAxis> CODEC
      Codec for serializing and deserializing FieldAxis constants by their lowercase identifier.
  • Method Details

    • values

      public static FieldAxis[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static FieldAxis valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • getReferenceAxis

      public abstract net.minecraft.world.phys.Vec3 getReferenceAxis(net.minecraft.world.entity.Entity spatialReference)
      Retrieves the normalized primary reference axis vector based on the entity's orientation.
      Parameters:
      spatialReference - The entity defining the local coordinate frame, or null for world-axis defaults.
      Returns:
      The normalized direction vector.
    • getImpulseVector

      public abstract net.minecraft.world.phys.Vec3 getImpulseVector(net.minecraft.world.entity.Entity spatialReference, net.minecraft.world.phys.Vec3 offsetEpicenter, net.minecraft.world.phys.Vec3 targetPos)
      Computes the normalized kinetic impulse vector at targetPos relative to offsetEpicenter.
      Parameters:
      spatialReference - The entity defining the local coordinate frame, or null.
      offsetEpicenter - The world-space origin point of the impulse field.
      targetPos - The world-space position of the target being evaluated.
      Returns:
      The normalized impulse direction vector, or Vec3.ZERO if degenerate.
    • getSerializedName

      @NotNull public @NotNull String getSerializedName()
      Specified by:
      getSerializedName in interface net.minecraft.util.StringRepresentable