Class FollowerHistory
java.lang.Object
ac.boar.anticheat.prediction.vehicle.FollowerHistory
Boar's best guess of where the client shows a vehicle the server moves: one pose, not a set.
It copies the client's interpolation (PredictedMovementComponent, HistoryCache::addHistory, tickNextPosition, Actor::lerpTo),
with one guessed stamp per packet (from LatencyUtil).
Used for the seat of a rider the server moves (FollowVehicleTicker), the box of a boat someone else drives (CompensatedWorldImpl), and the start pose when the player takes control of a boat (EntityCache). Checks that need a limit use FollowerEnvelope (envelope()).
Timing copies: when a stamp has two likely values, the history splits into copies that use the other value. Only the stationary death-exit check (admitsStationaryExitPose) reads them. They never change the main history.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordstatic final classHow uneven input arrivals are (jitter).static final record -
Constructor Summary
ConstructorsConstructorDescriptionFollowerHistory(long nowNs, float x, float y, float z, float pitch, float yaw, FollowerHistory.ArrivalClock arrivalClock) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddMotion(long handleNs, long earlyHandleNs, long group, long sentNs, long replyNs, boolean onGround) voidaddMove(long handleNs, long earlyHandleNs, long group, long sentNs, long replyNs, float x, float y, float z, float pitch, float yaw, boolean onGround, boolean addedActor) booleanadmitsStationaryExitPose(float x, float y, float z, float yaw) True if one timing copy that is still alive (or this history, when there are no copies) shows the vehicle resting exactly at this pose.advanceForControl(float headYaw, boolean onGround) longcurrentPose(float headYaw, boolean onGround) floatdistanceSquared(float x, float y, float z) envelope()booleanfloat[]booleanbooleanbooleanfloatlatestMoveDistanceSquared(float x, float y, float z) floatrenderX()floatrenderY()floatfloatrenderZ()voidresetForLocalControl(long nowNs, long nowLowerNs, long tick, float x, float y, float z, float pitch, float yaw) voidresumeRemoteTick(long nowNs, long nowLowerNs, long tick, FollowerHistory.ActorPose before, FollowerHistory.ActorPose after, FollowerHistory.ActorPose pendingTarget, int pendingSteps) voidresync(long nowNs, long nowLowerNs) static floatstepAngle(float current, float target, int steps) One interpolation step of an angle in degrees, with steps the steps left (at least 1).voidtick(long nowNs, long nowLowerNs, long tick) booleantickedAt(long tick) booleantickedLast(long tick)
-
Constructor Details
-
FollowerHistory
public FollowerHistory(long nowNs, float x, float y, float z, float pitch, float yaw, FollowerHistory.ArrivalClock arrivalClock)
-
-
Method Details
-
envelope
-
envelopeControlSet
-
envelopeControlYawOffsets
public float[] envelopeControlYawOffsets() -
envelopeControlTrusted
public boolean envelopeControlTrusted() -
controlEndTick
public long controlEndTick() -
addMove
public void addMove(long handleNs, long earlyHandleNs, long group, long sentNs, long replyNs, float x, float y, float z, float pitch, float yaw, boolean onGround, boolean addedActor) -
addMotion
public void addMotion(long handleNs, long earlyHandleNs, long group, long sentNs, long replyNs, boolean onGround) -
isLocallyPredicted
public boolean isLocallyPredicted() -
resetForLocalControl
public void resetForLocalControl(long nowNs, long nowLowerNs, long tick, float x, float y, float z, float pitch, float yaw) -
currentPose
-
hasPositionStep
public boolean hasPositionStep() -
advanceForControl
-
resumeRemoteTick
public void resumeRemoteTick(long nowNs, long nowLowerNs, long tick, FollowerHistory.ActorPose before, FollowerHistory.ActorPose after, FollowerHistory.ActorPose pendingTarget, int pendingSteps) -
tick
public void tick(long nowNs, long nowLowerNs, long tick) -
tickedLast
public boolean tickedLast(long tick) -
hasTicked
public boolean hasTicked() -
tickedAt
public boolean tickedAt(long tick) -
resync
public void resync(long nowNs, long nowLowerNs) -
distanceSquared
public float distanceSquared(float x, float y, float z) -
latestMoveDistanceSquared
public float latestMoveDistanceSquared(float x, float y, float z) -
stepAngle
public static float stepAngle(float current, float target, int steps) One interpolation step of an angle in degrees, with steps the steps left (at least 1). The last step lands on the target. Otherwise the angle turns the short way by 1/steps of the gap (the client multiplies, it does not divide). The result is wrapped to -180..180. Also used for the rotation of an actor the reach interpolator moves (EntityCache.tickFollowerExternalRotation). -
renderX
public float renderX() -
renderY
public float renderY() -
renderZ
public float renderZ() -
renderYaw
public float renderYaw() -
admitsStationaryExitPose
public boolean admitsStationaryExitPose(float x, float y, float z, float yaw) True if one timing copy that is still alive (or this history, when there are no copies) shows the vehicle resting exactly at this pose. -
untrustedClockReason
-