Class RailStepResult

java.lang.Object
com.hypixel.hytale.server.npc.movement.controllers.RailStepResult

public final class RailStepResult extends Object
Per-tick result carrier for MotionController.applyRailStep(Ref, Role, Vector3dc, RailStepConfig, RailStepResult, ComponentAccessor).

Allocated once by the BodyMotion and reused across ticks. reset() clears the scalar fields and resets the hit counts to 0 without releasing the underlying storage; hit entries are pooled and reused on subsequent ticks. The backing arrays only grow when a tick reports more hits than any previous tick did.

Typical access pattern for callers:

result.reset();
// ... motionController.applyRailStep(..., result, ...);
for (int i = 0; i < result.getPassThroughCount(); i++) {
    var hit = result.getPassThrough(i);
    // read hit.blockX, hit.collisionPoint, ...
}
  • Field Details

    • obstructed

      public boolean obstructed
      true when the step was clamped short of the requested delta by a non-ignored block collision.
    • hitEntity

      public boolean hitEntity
      true when the step was clamped short of the requested delta by an entity collision while RailStepConfig.stopOnEntityHit was true.
    • appliedFraction

      public double appliedFraction
      Fraction of the requested delta actually applied to the entity's position, in [0, 1].
  • Constructor Details

    • RailStepResult

      public RailStepResult()
  • Method Details