Skip to content

Commit 8afe0f5

Browse files
committed
fix: slow sneak movement (closes #349)
1 parent ba50be2 commit 8afe0f5

1 file changed

Lines changed: 2 additions & 7 deletions

File tree

src/main/java/eu/midnightdust/midnightcontrols/client/controller/MovementHandler.java

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@
1515
import eu.midnightdust.midnightcontrols.client.util.MathUtil;
1616
import net.minecraft.client.Minecraft;
1717
import net.minecraft.client.player.LocalPlayer;
18-
import net.minecraft.util.Mth;
19-
import net.minecraft.world.entity.ai.attributes.Attributes;
2018
import net.minecraft.world.entity.player.Input;
2119
import net.minecraft.world.phys.Vec2;
2220
import org.jetbrains.annotations.NotNull;
@@ -81,11 +79,8 @@ else if (button == ButtonBinding.BACK || button == ButtonBinding.RIGHT)
8179
value = 1.f;
8280
}
8381

84-
this.slowdownFactor = client.player.isMovingSlowly() ? (Mth.clamp(
85-
0.3F + (float) client.player.getAttributeValue(Attributes.SNEAKING_SPEED),
86-
0.0F,
87-
1.0F
88-
)) : 1.f;
82+
this.slowdownFactor = 1.f; // TODO: Remove this entirely in case it also isn't needed in backports for older versions
83+
// LocalPlayer#modifyInput already applies the slowdown for us now. (1.21.11)
8984

9085
if (button == ButtonBinding.FORWARD || button == ButtonBinding.BACK) {
9186
// Handle forward movement.

0 commit comments

Comments
 (0)