Contents
Class RailStepResult
java.lang.Object
com.hypixel.hytale.server.npc.movement.controllers.RailStepResult
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 Summary
FieldsModifier and TypeFieldDescriptiondoubleFraction of the requested delta actually applied to the entity's position, in [0, 1].booleantruewhen the step was clamped short of the requested delta by an entity collision whileRailStepConfig.stopOnEntityHitwastrue.booleantruewhen the step was clamped short of the requested delta by a non-ignored block collision. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetEntityHit(int i) intgetPassThrough(int i) intReturn a pooledEntityHitslot and bump the count.Return a pooledBlockHitslot and bump the count.voidreset()Clear the previous tick's data.
-
Field Details
-
obstructed
public boolean obstructedtruewhen the step was clamped short of the requested delta by a non-ignored block collision. -
hitEntity
public boolean hitEntitytruewhen the step was clamped short of the requested delta by an entity collision whileRailStepConfig.stopOnEntityHitwastrue. -
appliedFraction
public double appliedFractionFraction of the requested delta actually applied to the entity's position, in [0, 1].
-
-
Constructor Details
-
RailStepResult
public RailStepResult()
-
-
Method Details
-
reset
public void reset()Clear the previous tick's data. Resets scalar fields and hit counts; the pooled hit instances and their backing arrays are retained. -
getPassThroughCount
public int getPassThroughCount() -
getPassThrough
-
nextPassThrough
Return a pooledBlockHitslot and bump the count. The caller is expected to overwrite the returned instance viaBlockHit.assign(int, int, int, int, Vector3dc, Vector3dc, double). -
getEntityHitCount
public int getEntityHitCount() -
getEntityHit
-
nextEntityHit
Return a pooledEntityHitslot and bump the count. The caller is expected to overwrite the returned instance viaEntityHit.assign(Ref, boolean, Vector3dc, Vector3dc, double).
-