Fix movement while riding boats and other entities

This commit is contained in:
Martin Prokoph
2024-12-11 18:08:40 +01:00
parent 7d791fac89
commit 78900ac83e

View File

@@ -15,6 +15,7 @@ import eu.midnightdust.midnightcontrols.client.util.MathUtil;
import net.minecraft.client.MinecraftClient; import net.minecraft.client.MinecraftClient;
import net.minecraft.client.network.ClientPlayerEntity; import net.minecraft.client.network.ClientPlayerEntity;
import net.minecraft.entity.attribute.EntityAttributes; import net.minecraft.entity.attribute.EntityAttributes;
import net.minecraft.util.PlayerInput;
import net.minecraft.util.math.MathHelper; import net.minecraft.util.math.MathHelper;
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.NotNull;
@@ -48,11 +49,8 @@ public final class MovementHandler implements PressAction {
public void applyMovement(@NotNull ClientPlayerEntity player) { public void applyMovement(@NotNull ClientPlayerEntity player) {
if (!this.shouldOverrideMovement) if (!this.shouldOverrideMovement)
return; return;
// TODO player.input.playerInput = new PlayerInput(this.pressingForward, this.pressingBack, this.pressingLeft, this.pressingRight,
// player.input.playerInput.pressingForward = this.pressingForward; player.input.playerInput.jump(), player.input.playerInput.sneak(), player.input.playerInput.sprint());
// player.input.pressingBack = this.pressingBack;
// player.input.pressingLeft = this.pressingLeft;
// player.input.pressingRight = this.pressingRight;
polarUtil.calculate(this.movementSideways, this.movementForward, this.slowdownFactor); polarUtil.calculate(this.movementSideways, this.movementForward, this.slowdownFactor);
player.input.movementForward = polarUtil.polarY; player.input.movementForward = polarUtil.polarY;