Class SpherePosition

java.lang.Object
com.hypixel.hytale.math.iterator.SpherePosition

public final class SpherePosition extends Object
Mutable position holder returned by SphereSpiralIterator.position().

A single instance is reused across SphereSpiralIterator.advance() calls to avoid per-step allocation. Read the fields immediately after advance() returns true; the values are invalidated by the next advance().

Not thread-safe. The iterator and its position are intended for single-threaded use.

  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    int
    3D Euclidean distance² from the iterator's center.
    int
    World-space chunk X coordinate (center + dx).
    int
    World-space chunk Y coordinate (center + dy).
    int
    World-space chunk Z coordinate (center + dz).
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Methods inherited from class Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • x

      public int x
      World-space chunk X coordinate (center + dx).
    • y

      public int y
      World-space chunk Y coordinate (center + dy).
    • z

      public int z
      World-space chunk Z coordinate (center + dz).
    • distSq

      public int distSq
      3D Euclidean distance² from the iterator's center. Useful for advancing the tracker's "sent up to this distance" cursor between ticks.
  • Constructor Details

    • SpherePosition

      public SpherePosition()