Record Class AttachedBeam

java.lang.Object
java.lang.Record
com.hypixel.hytale.builtin.beam.AttachedBeam
Record Components:
beamIndex - the runtime index of the Beam asset that gives the appearance
sourceScale - how wide the beam is at the source end
sourceNode - the model node on the owner to start from, or null for the owner's origin
sourceOffset - offset from the source attachment point, in the node's space
targetScale - how wide the beam is at the target end
targetEntity - the entity to end at, or null when targetPosition is set
targetNode - the model node on the target to end at, or null for the target's origin
targetOffset - offset from the target attachment point, in the node's space
targetPosition - the world position to end at, or null when targetEntity is set

public record AttachedBeam(int beamIndex, float sourceScale, @Nullable String sourceNode, @Nonnull org.joml.Vector3fc sourceOffset, float targetScale, @Nullable Ref<EntityStore> targetEntity, @Nullable String targetNode, @Nonnull org.joml.Vector3fc targetOffset, @Nullable org.joml.Vector3dc targetPosition) extends Record
One beam owned by an entity. It runs from an attachment point on the owner to a target, which is either another entity or a fixed world position.
  • Constructor Details

    • AttachedBeam

      public AttachedBeam(int beamIndex, float sourceScale, @Nullable String sourceNode, @Nonnull org.joml.Vector3fc sourceOffset, float targetScale, @Nullable Ref<EntityStore> targetEntity, @Nullable String targetNode, @Nonnull org.joml.Vector3fc targetOffset, @Nullable org.joml.Vector3dc targetPosition)
      Creates an instance of a AttachedBeam record class.
      Parameters:
      beamIndex - the value for the beamIndex record component
      sourceScale - the value for the sourceScale record component
      sourceNode - the value for the sourceNode record component
      sourceOffset - the value for the sourceOffset record component
      targetScale - the value for the targetScale record component
      targetEntity - the value for the targetEntity record component
      targetNode - the value for the targetNode record component
      targetOffset - the value for the targetOffset record component
      targetPosition - the value for the targetPosition record component
  • Method Details

    • toEntity

      @Nonnull public static AttachedBeam toEntity(int beamIndex, float scale, @Nullable String sourceNode, @Nonnull Ref<EntityStore> target, @Nullable String targetNode)
    • toEntity

      @Nonnull public static AttachedBeam toEntity(int beamIndex, float sourceScale, float targetScale, @Nullable String sourceNode, @Nonnull Ref<EntityStore> target, @Nullable String targetNode)
    • toEntity

      @Nonnull public static AttachedBeam toEntity(int beamIndex, float scale, @Nullable String sourceNode, @Nonnull org.joml.Vector3fc sourceOffset, @Nonnull Ref<EntityStore> target, @Nullable String targetNode, @Nonnull org.joml.Vector3fc targetOffset)
    • toEntity

      @Nonnull public static AttachedBeam toEntity(int beamIndex, float sourceScale, float targetScale, @Nullable String sourceNode, @Nonnull org.joml.Vector3fc sourceOffset, @Nonnull Ref<EntityStore> target, @Nullable String targetNode, @Nonnull org.joml.Vector3fc targetOffset)
    • toPosition

      @Nonnull public static AttachedBeam toPosition(int beamIndex, float scale, @Nullable String sourceNode, @Nonnull org.joml.Vector3dc target)
    • toPosition

      @Nonnull public static AttachedBeam toPosition(int beamIndex, float sourceScale, float targetScale, @Nullable String sourceNode, @Nonnull org.joml.Vector3dc target)
    • toPosition

      @Nonnull public static AttachedBeam toPosition(int beamIndex, float scale, @Nullable String sourceNode, @Nonnull org.joml.Vector3fc sourceOffset, @Nonnull org.joml.Vector3dc target)
      A target position is absolute, so only the source takes an offset.
    • toPosition

      @Nonnull public static AttachedBeam toPosition(int beamIndex, float sourceScale, float targetScale, @Nullable String sourceNode, @Nonnull org.joml.Vector3fc sourceOffset, @Nonnull org.joml.Vector3dc target)
      A target position is absolute, so only the source takes an offset.
    • toBlock

      @Nonnull public static AttachedBeam toBlock(int beamIndex, float scale, @Nullable String sourceNode, int x, int y, int z)
      Returns a beam that ends at the centre of the given block.
    • toBlock

      @Nonnull public static AttachedBeam toBlock(int beamIndex, float sourceScale, float targetScale, @Nullable String sourceNode, int x, int y, int z)
      Returns a beam that ends at the centre of the given block.
    • isValid

      public boolean isValid()
      Returns whether this beam still has something to attach to.
    • 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. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with the compare method from their corresponding wrapper classes.
      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.
    • beamIndex

      public int beamIndex()
      Returns the value of the beamIndex record component.
      Returns:
      the value of the beamIndex record component
    • sourceScale

      public float sourceScale()
      Returns the value of the sourceScale record component.
      Returns:
      the value of the sourceScale record component
    • sourceNode

      @Nullable public String sourceNode()
      Returns the value of the sourceNode record component.
      Returns:
      the value of the sourceNode record component
    • sourceOffset

      @Nonnull public org.joml.Vector3fc sourceOffset()
      Returns the value of the sourceOffset record component.
      Returns:
      the value of the sourceOffset record component
    • targetScale

      public float targetScale()
      Returns the value of the targetScale record component.
      Returns:
      the value of the targetScale record component
    • targetEntity

      @Nullable public Ref<EntityStore> targetEntity()
      Returns the value of the targetEntity record component.
      Returns:
      the value of the targetEntity record component
    • targetNode

      @Nullable public String targetNode()
      Returns the value of the targetNode record component.
      Returns:
      the value of the targetNode record component
    • targetOffset

      @Nonnull public org.joml.Vector3fc targetOffset()
      Returns the value of the targetOffset record component.
      Returns:
      the value of the targetOffset record component
    • targetPosition

      @Nullable public org.joml.Vector3dc targetPosition()
      Returns the value of the targetPosition record component.
      Returns:
      the value of the targetPosition record component