-
-
Notifications
You must be signed in to change notification settings - Fork 67
A lot of fixes related to swimming and water movement on Bedrock. #922
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this 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
...n/java/com/viaversion/viafabricplus/injection/mixin/features/movement/water/MixinEntity.java
Outdated
Show resolved
Hide resolved
.../com/viaversion/viafabricplus/injection/mixin/features/movement/water/MixinLivingEntity.java
Outdated
Show resolved
Hide resolved
.../com/viaversion/viafabricplus/injection/mixin/features/movement/water/MixinPlayerEntity.java
Outdated
Show resolved
Hide resolved
...om/viaversion/viafabricplus/injection/mixin/features/bedrock/movement/MixinPlayerEntity.java
Show resolved
Hide resolved
...om/viaversion/viafabricplus/injection/mixin/features/bedrock/movement/MixinPlayerEntity.java
Show resolved
Hide resolved
...om/viaversion/viafabricplus/injection/mixin/features/bedrock/movement/MixinPlayerEntity.java
Show resolved
Hide resolved
|
|
||
| @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())); |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
Nowhere near perfect, but well, feel free to play around as much as you'd like to...