feat: implement player ability state management with rotation and position locking

This commit is contained in:
Kam committed 2026-02-14 04:02:01 -05:00
1 parent befebdb9f7
commit 85db3df355
8 files changed
+427 -21

No files matched your search

@@ -56,6 +56,7 @@ public class ClientTickHandler {
if ((this.prevWorld == null || mc.theWorld == null) && this.prevWorld != mc.theWorld) {
if (mc.theWorld == null) {
ClientCacheHandler.clearCache();
ClientAbilityState.reset();
}
this.prevWorld = mc.theWorld;
}
@@ -72,6 +73,19 @@ public class ClientTickHandler {
lastSpecialKeyDown = specialKeyDown;
}
// Suppress player input during ability-controlled phases
if (ClientAbilityState.shouldSuppressMovementInput()) {
mc.thePlayer.movementInput.moveForward = 0;
mc.thePlayer.movementInput.moveStrafe = 0;
mc.thePlayer.movementInput.jump = false;
}
if (ClientAbilityState.shouldLockRotation()) {
mc.thePlayer.rotationYaw = ClientAbilityState.lockedYaw;
mc.thePlayer.rotationPitch = ClientAbilityState.lockedPitch;
mc.thePlayer.prevRotationYaw = ClientAbilityState.lockedYaw;
mc.thePlayer.prevRotationPitch = ClientAbilityState.lockedPitch;
}
if (player.ridingEntity instanceof EntityNPCInterface) {
EntityNPCInterface mount = (EntityNPCInterface) player.ridingEntity;
if (mount.advanced.role == EnumRoleType.Mount && mount.roleInterface instanceof RoleMount) {