Record Class SpatialSnapshot

java.lang.Object
java.lang.Record
com.hypixel.hytale.builtin.triggervolumes.manager.SpatialSnapshot

public record SpatialSnapshot(@Nonnull org.joml.Vector3d position, @Nonnull TriggerVolumeShape shape) extends Record
Pre-edit position and shape of a VolumeEntry, captured the instant before a spatial mutation. The spatial index recomputes the volume's old footprint from a snapshot so it can unstamp the cells the volume used to occupy without persisting per-entry bounds across ticks.

The shape is a defensive copy taken at snapshot time; callers must never hand in a live shape reference that could change before the snapshot is consumed.

  • Constructor Details

    • SpatialSnapshot

      public SpatialSnapshot(@Nonnull org.joml.Vector3d position, @Nonnull TriggerVolumeShape shape)
      Creates an instance of a SpatialSnapshot record class.
      Parameters:
      position - the value for the position record component
      shape - the value for the shape record component
  • Method Details

    • of

      @Nonnull public static SpatialSnapshot of(@Nonnull VolumeEntry entry)
    • 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.
    • position

      @Nonnull public org.joml.Vector3d position()
      Returns the value of the position record component.
      Returns:
      the value of the position record component
    • shape

      @Nonnull public TriggerVolumeShape shape()
      Returns the value of the shape record component.
      Returns:
      the value of the shape record component