Skip to content

Commit

Permalink
Fix strider off ground speed
Browse files Browse the repository at this point in the history
  • Loading branch information
SamB440 committed Sep 5, 2024
1 parent 3890d12 commit 7f0dbdb
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@ public static float getFrictionInfluencedSpeed(float f, GrimPlayer player) {
}

if (player.compensatedEntities.getSelf().getRiding() instanceof PacketEntityStrider) {
// Unsure which version the speed changed in
if (player.getClientVersion().isNewerThanOrEquals(ClientVersion.V_1_20)) {
return (float) player.speed * 0.1f;
}

PacketEntityStrider strider = (PacketEntityStrider) player.compensatedEntities.getSelf().getRiding();
// Vanilla multiplies by 0.1 to calculate speed
return (float) strider.getAttributeValue(Attributes.GENERIC_MOVEMENT_SPEED) * (strider.isShaking ? 0.66F : 1.0F) * 0.1f;
Expand Down

0 comments on commit 7f0dbdb

Please sign in to comment.