Skip to content

Added Sprint Tracking#434

Merged
Defman merged 11 commits into
feather-rs:mainfrom
ThisNekoGuy:main
Sep 6, 2021
Merged

Added Sprint Tracking#434
Defman merged 11 commits into
feather-rs:mainfrom
ThisNekoGuy:main

Conversation

@ThisNekoGuy

Copy link
Copy Markdown
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
Copy Markdown
Contributor

Provided CI passes of course

Comment thread feather/server/src/packet_handlers/entity_action.rs
Comment thread quill/common/src/components.rs
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

@ThisNekoGuy ThisNekoGuy left a comment

Copy link
Copy Markdown
Contributor Author

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

Comment thread feather/server/src/packet_handlers/entity_action.rs
@Defman

Defman commented Jun 10, 2021

Copy link
Copy Markdown
Member

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
Copy Markdown
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
Copy Markdown
Contributor

If it passes CI I'll merge it

@ambeeeeee ambeeeeee left a comment

Copy link
Copy Markdown
Contributor

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

Defman commented Sep 6, 2021

Copy link
Copy Markdown
Member

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