diff options
| author | Sculas <contact@sculas.xyz> | 2022-10-19 17:42:38 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-10-19 10:42:38 -0500 |
| commit | 41606fdd14904ba9e80e2ee992bea0b02ec76348 (patch) | |
| tree | d10b00214f71c8ab4d292045d9f7577f53337de4 | |
| parent | c0338cac35db6849a0a82a451db0e62d1fc24a0f (diff) | |
| download | azalea-drasl-41606fdd14904ba9e80e2ee992bea0b02ec76348.tar.xz | |
fix: make fields in PlayerInfo::Action public (#32)
This PR makes the fields in the PlayerInfo packet public.
I encountered this issue when writing my own bot which needs a list of UUID > String of all currently logged-in players, and while writing my handler for `Action::RemovePlayer` I found out that the `uuid` field is private. This PR fixes that.
| -rw-r--r-- | azalea-protocol/src/packets/game/clientbound_player_info_packet.rs | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/azalea-protocol/src/packets/game/clientbound_player_info_packet.rs b/azalea-protocol/src/packets/game/clientbound_player_info_packet.rs index 845eed30..885148a5 100644 --- a/azalea-protocol/src/packets/game/clientbound_player_info_packet.rs +++ b/azalea-protocol/src/packets/game/clientbound_player_info_packet.rs @@ -22,9 +22,9 @@ pub enum Action { #[derive(Clone, Debug, McBuf)] pub struct PlayerProperty { - name: String, - value: String, - signature: Option<String>, + pub name: String, + pub value: String, + pub signature: Option<String>, } #[derive(Clone, Debug, McBuf)] @@ -42,26 +42,26 @@ pub struct AddPlayer { #[derive(Clone, Debug, McBuf)] pub struct UpdateGameMode { - uuid: Uuid, + pub uuid: Uuid, #[var] - gamemode: u32, + pub gamemode: u32, } #[derive(Clone, Debug, McBuf)] pub struct UpdateLatency { - uuid: Uuid, + pub uuid: Uuid, #[var] - ping: i32, + pub ping: i32, } #[derive(Clone, Debug, McBuf)] pub struct UpdateDisplayName { - uuid: Uuid, - display_name: Option<Component>, + pub uuid: Uuid, + pub display_name: Option<Component>, } #[derive(Clone, Debug, McBuf)] pub struct RemovePlayer { - uuid: Uuid, + pub uuid: Uuid, } impl McBufReadable for Action { |
