Package me.hackware.api
Class RotationManager
java.lang.Object
me.hackware.api.RotationManager
Single-slot rotation manager.
Modules submit a rotation each tick they want to be active. Higher
priority replaces a lower-priority active request. The active
request lives for one tick — the owner must re-submit each tick
to keep it active. There is no queue, no suppliers, no instant flag.
Three submission entry points:
requestRotation(String, double, float, float)— uses the global mode from theRotationssettings module.requestMotionRotation(String, double, float, float)— forces MOTION (rotation piggy-backs on the next vanillasendPositionpacket so movement physics see the spoofed yaw).requestSilentRotation(String, double, float, float)— forces SILENT: an extraServerboundMovePlayerPacket.PosRotis sent immediately so the server validates following action packets against the spoofed angles. The next vanillasendPositionnaturally restores the real client rotation.
-
Method Summary
Modifier and TypeMethodDescriptionstatic RotationManagerget()The id of the active request, ornull.doubleThe priority of the active request, orDouble.NEGATIVE_INFINITY.booleanfloatdoubledoublefloatdoublefloatgetPitch()Current rotation target pitch — clamped to [-90, 90].floatThe player's real (un-spoofed) pitch at the start of this tick.floatThe player's real (un-spoofed) yaw at the start of this tick.floatThe pitch the server most recently saw.floatThe yaw the server most recently saw.floatgetYaw()Current rotation target yaw — the angle that gets sent in the next packet.voidinit()booleanWhether the active request is in MOTION mode.booleanWhether any rotation request is currently active.booleanWhether the active request is in SILENT mode.booleanjustTeleported(int withinTicks) True withinwithinTicksclient ticks of the last server teleport.voidExplicitly release the active request if it is owned byid.booleanrequestMotionRotation(String id, double priority, float yaw, float pitch) Force MOTION mode — rotation is applied via vanillasendPosition.booleanrequestMotionRotationCameraAnchored(String id, double priority, float yaw, float pitch) Force MOTION mode, anchoring the sent yaw to the real CAMERA yaw instead of the last-sent yaw.booleanrequestRotation(String id, double priority, float yaw, float pitch) Submit a rotation using the global mode from theRotationssettings module (defaults to MOTION if the module is missing).booleanrequestSilentRotation(String id, double priority, float yaw, float pitch) Force SILENT mode — an extraPosRotpacket is sent immediately so following action packets validate against the spoofed angles.
-
Method Details
-
get
-
init
public void init() -
justTeleported
public boolean justTeleported(int withinTicks) True withinwithinTicksclient ticks of the last server teleport. Used by ClientInputMixin to suppress a frame-perfect jump on the ack tick: Grim resets its sim to the teleport position and doesn't know the client's ground state there yet, so a jump (or a KB verified) on that exact tick is unpredictable — the one-offSimulation .42(unpredicted jump) andAntiKB .078 / A: 0.0(airborne-vs-grounded phase mismatch) flags while jump-spamming through pearl teleports. No human times a jump onto the ack tick, so a one-tick suppression is vanilla-invisible. -
requestRotation
Submit a rotation using the global mode from theRotationssettings module (defaults to MOTION if the module is missing).- Returns:
trueif accepted (took the active slot),falseif a higher-priority request already owns the slot this tick.
-
requestMotionRotation
Force MOTION mode — rotation is applied via vanillasendPosition. -
requestMotionRotationCameraAnchored
public boolean requestMotionRotationCameraAnchored(String id, double priority, float yaw, float pitch) Force MOTION mode, anchoring the sent yaw to the real CAMERA yaw instead of the last-sent yaw. For movement rotations (Sprint) whose target oscillates ~180° via WASD flips: serverYaw-anchoring resolves every 180° flip the same way (−180) and spirals the sent yaw unbounded (−298→−478→−658…). Camera-anchoring keeps it oscillating around the stable camera yaw. Do NOT use for combat aim — an aim target hovering exactly 180° from the camera would flip 360° on tiny changes (AimModulo360). -
requestSilentRotation
Force SILENT mode — an extraPosRotpacket is sent immediately so following action packets validate against the spoofed angles. The next vanillasendPositionrestores the real yaw. -
release
Explicitly release the active request if it is owned byid. Modules normally don't need this — just stop re-submitting. -
isRotating
public boolean isRotating()Whether any rotation request is currently active. -
isMotionActive
public boolean isMotionActive()Whether the active request is in MOTION mode. -
isSilentActive
public boolean isSilentActive()Whether the active request is in SILENT mode. -
getActiveId
The id of the active request, ornull. -
getActivePriority
public double getActivePriority()The priority of the active request, orDouble.NEGATIVE_INFINITY. -
getYaw
public float getYaw()Current rotation target yaw — the angle that gets sent in the next packet. Returns the real client yaw when no request is active. -
getPitch
public float getPitch()Current rotation target pitch — clamped to [-90, 90]. Returns the real client pitch when no request is active. -
getRealYaw
public float getRealYaw()The player's real (un-spoofed) yaw at the start of this tick. -
getRealPitch
public float getRealPitch()The player's real (un-spoofed) pitch at the start of this tick. -
getServerYaw
public float getServerYaw()The yaw the server most recently saw. -
getServerPitch
public float getServerPitch()The pitch the server most recently saw. -
getLastSentX
public double getLastSentX() -
getLastSentY
public double getLastSentY() -
getLastSentZ
public double getLastSentZ() -
getLastSentYaw
public float getLastSentYaw() -
getLastSentPitch
public float getLastSentPitch() -
getLastSentOnGround
public boolean getLastSentOnGround()
-