package net.rustnotmc.client; import net.minecraft.client.settings.GameSettings; import net.minecraft.util.MovementInputFromOptions; /** * The movement input with our crouch. * * The vanilla already slows the movement down by a third while the crouch key * is down. We undo that and apply our own factor, so the crouch is a little * faster than the vanilla one and the number itself lives in * {@link RsxPlayerTuning}. */ public class RsxMovementInput extends MovementInputFromOptions { public RsxMovementInput(GameSettings settings) { super(settings); } @Override public void updatePlayerMoveState() { super.updatePlayerMoveState(); if (!this.sneak) { return; } float correction = RsxPlayerTuning.sneakCorrection(); this.moveStrafe = (float) ((double) this.moveStrafe * (double) correction); this.moveForward = (float) ((double) this.moveForward * (double) correction); } }