aboutsummaryrefslogtreecommitdiff
path: root/Minecraft.Client
diff options
context:
space:
mode:
authorqwasdrizzel <145519042+qwasdrizzel@users.noreply.github.com>2026-03-05 18:22:54 -0600
committerGitHub <noreply@github.com>2026-03-06 07:22:54 +0700
commit5d544bcb837531bb31dd517a0ff3a4a55a646f8e (patch)
tree338e4a626a82164d05627a7dad33e34f2a4c70ee /Minecraft.Client
parent75c4f51218cbaad4565cf042f8ad6ea38ae4355f (diff)
Fix for flying angle snapping (#641)
* Modify dispense behavior to set outcome as LEFT_ITEM * Fix the angle problem with flying Removed checks that limit flying to a 90 degree angle, which caused the problem.
Diffstat (limited to 'Minecraft.Client')
-rw-r--r--Minecraft.Client/LocalPlayer.cpp35
1 files changed, 2 insertions, 33 deletions
diff --git a/Minecraft.Client/LocalPlayer.cpp b/Minecraft.Client/LocalPlayer.cpp
index 77306621..cfcf85ac 100644
--- a/Minecraft.Client/LocalPlayer.cpp
+++ b/Minecraft.Client/LocalPlayer.cpp
@@ -143,39 +143,8 @@ void LocalPlayer::serverAiStep()
{
Player::serverAiStep();
- if( abilities.flying && abilities.mayfly )
- {
- // snap y rotation for flying to nearest 90 degrees in world space
- float fMag = sqrtf(input->xa * input->xa + input->ya * input->ya);
- // Don't bother for tiny inputs
- if( fMag >= 0.1f )
- {
- // Get angle (in player rotated space) of input controls
- float yRotInput = atan2f(input->ya, input->xa) * (180.0f / PI);
- // Now get in world space
- float yRotFinal = yRotInput + yRot;
- // Snap this to nearest 90 degrees
- float yRotSnapped = floorf((yRotFinal / 45.0f) + 0.5f) * 45.0f;
- // Find out how much we had to move to do this snap
- float yRotDiff = yRotSnapped - yRotFinal;
- // Apply the same difference to the player rotated space angle
- float yRotInputAdjust = yRotInput + yRotDiff;
-
- // Calculate final x/y player-space movement required
- this->xxa = cos(yRotInputAdjust * ( PI / 180.0f) ) * fMag;
- this->yya = sin(yRotInputAdjust * ( PI / 180.0f) ) * fMag;
- }
- else
- {
- this->xxa = input->xa;
- this->yya = input->ya;
- }
- }
- else
- {
- this->xxa = input->xa;
- this->yya = input->ya;
- }
+ this->xxa = input->xa;
+ this->yya = input->ya;
this->jumping = input->jumping;
yBobO = yBob;