Skip to content
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

Added Sprint Tracking #434

Merged
merged 11 commits into from
Sep 6, 2021
Merged

Added Sprint Tracking #434

merged 11 commits into from
Sep 6, 2021

Conversation

ThisNekoGuy
Copy link
Contributor

Added Sprint Tracking

Status

  • Ready
  • Development
  • Hold

Description

Did the same as #428 just for sprinting instead.

Related issues

#423

Checklist

Note: Could not test plugin because of a potential compiler bug in Rust version 1.52.1

  • Ran cargo fmt, cargo clippy, cargo build --release and cargo test and fixed any generated errors!
  • Removed unnecessary commented out code
  • Used specific traces (if you trace actions please specify the cause i.e. the player)

@ambeeeeee
Copy link
Contributor

Provided CI passes of course

ThisNekoGuy added 3 commits June 8, 2021 21:14
Refactored the sprint detection to reduce code duplication with the assistance of Defman
The desired refactor didn't work because the method attempted couldn't receive the sprint state from the player
Copy link
Contributor Author

@ThisNekoGuy ThisNekoGuy left a comment

Choose a reason for hiding this comment

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

@Defman The macro doesn't approve of packet.action_id because:

  1. It doesn't want/expect . ("unexpected token")
  2. and using the == operator isn't permitted for EntityActionKind

@Defman
Copy link
Member

Defman commented Jun 10, 2021

Sorry, I swaped the parameters of matches. It should be matches!(packet.action_id, EntityActionKind::StartSprinting).

Turned out the macro actually expected the packet id and the `EntityActionKind` to be reversed
@ThisNekoGuy
Copy link
Contributor Author

Sorry, I swaped the parameters of matches. It should be matches!(packet.action_id, EntityActionKind::StartSprinting).

This works; thanks for clarifying

@ambeeeeee
Copy link
Contributor

If it passes CI I'll merge it

Copy link
Contributor

@ambeeeeee ambeeeeee left a comment

Choose a reason for hiding this comment

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

Sorry, I actually think this is a prime location for a quick unit test. Please write one.

@Defman
Copy link
Member

Defman commented Sep 6, 2021

BUMP

@Defman Defman merged commit 9008090 into feather-rs:main Sep 6, 2021
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