ViaFabricPlus icon indicating copy to clipboard operation
ViaFabricPlus copied to clipboard

In 1.8.x compatibility, crouching near the side of a 1-block gap lets you fall

Open yukijoou opened this issue 1 year ago • 2 comments

General Information

ViaVersion dump

Bug Description

When using 1.8.x compatibility, crouching near the side of a 1-block gap lets you fall down, when it should prevent you from doing so.

Testing on servers that support 1.8.x and later versions, the issue doesn't occur on later versions.

Steps to Reproduce

  1. Join mc.hypixel.net
  2. Go to the Bedwars lobby (/lobby bedwars)
  3. Try crouching off one of the slightly raised areas left or right of the spawnpoint

Expected Behavior

Crouching should not make you fall off >1 block gaps (I don't know the exact cutoff point)

yukijoou avatar Apr 29 '24 08:04 yukijoou

Hi, thanks for reporting! Can you make a video of the issue? I don't really understand it.

FlorianMichael avatar May 17 '24 21:05 FlorianMichael

Hi!

When crouching, I'm able to fall off one block high ledges, as you can see here:

https://github.com/ViaVersion/ViaFabricPlus/assets/139722374/f3a5f985-8332-4ca1-b3bf-4709d59a794a

I believe this would be the related function, which is probably missing a case for 1.8 and possibly other versions:

    @Redirect(method = "adjustMovementForSneaking", at = @At(value = "INVOKE", target = "Lnet/minecraft/entity/player/PlayerEntity;getStepHeight()F"))
    private float modifyStepHeight1_10(PlayerEntity instance) {
        if (ProtocolTranslator.getTargetVersion().olderThanOrEqualTo(ProtocolVersion.v1_10)) {
            return 1.0F;
        } else {
            return instance.getStepHeight();
        }
    }

@ src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/entity/MixinPlayerEntity.java:159-166

yukijoou avatar May 18 '24 00:05 yukijoou

Thanks for reporting, should be fixed in the latest dev build: https://ci.viaversion.com/view/Platforms/job/ViaFabricPlus/

RaphiMC avatar May 18 '24 09:05 RaphiMC