Skip to content

Handle held item change packet#361

Merged
caelunshun merged 8 commits into
feather-rs:mainfrom
devmattrick:feat/held-item-change
Mar 5, 2021
Merged

Handle held item change packet#361
caelunshun merged 8 commits into
feather-rs:mainfrom
devmattrick:feat/held-item-change

Conversation

@devmattrick

Copy link
Copy Markdown
Contributor

This adds basic handling to held item change packets. Fixes #355.

This can be used in the future to add "get item in hand" support but I think this needs to wait on a more complete player struct api?

Comment thread crates/common/src/entities/player.rs Outdated

/// The hotbar slot a player's cursor is currently on
#[derive(Debug, Clone, Copy, Eq, PartialEq)]
pub struct HotbarSlot(pub usize);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Could we encapsulate the usize to enforce that it's always in the range 0..9? In other words, make the field private and add a setter method that returns a Result.

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.

Done with d2a0eda

@caelunshun caelunshun left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks!

@caelunshun caelunshun merged commit bb33f00 into feather-rs:main Mar 5, 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.

Handle Held Item Change

2 participants