Skip to content

Conversation

@oryxel1
Copy link
Contributor

@oryxel1 oryxel1 commented Oct 22, 2025

Nowhere near perfect, but well, feel free to play around as much as you'd like to...

Copy link
Member

@FlorianMichael FlorianMichael left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Going to leave the functionality review to @RaphiMC , this is just styling things


@Redirect(method = {"shouldStopSprinting", "canStartSprinting"}, at = @At(value = "INVOKE", target = "Lnet/minecraft/client/network/ClientPlayerEntity;canSprint(Z)Z"))
private boolean allowNonSwimWaterSprinting(ClientPlayerEntity instance, boolean allowTouchingWater) {
return this.canSprint(allowTouchingWater || ProtocolTranslator.getTargetVersion().equals(BedrockProtocolVersion.bedrockLatest) && (instance.isSwimming() || instance.isOnGround()));
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note to self: This part is wrong.... The condition for this is not swimming or on ground, it's depending on the water height maybe... however the player will sprint when swimming.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

However if the water height can't be figure out then we can avoid sending raw sprinting value to the server in certain cases, since BDS use the raw value to determine if we're sprinting or not instead of START/STOP.

@FlorianMichael FlorianMichael merged commit ffaec08 into ViaVersion:main Nov 3, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants