aboutsummaryrefslogtreecommitdiff
path: root/minecraft-protocol/src/packets
diff options
context:
space:
mode:
Diffstat (limited to 'minecraft-protocol/src/packets')
-rw-r--r--minecraft-protocol/src/packets/login/clientbound_hello_packet.rs8
-rw-r--r--minecraft-protocol/src/packets/status/clientbound_status_response_packet.rs4
2 files changed, 6 insertions, 6 deletions
diff --git a/minecraft-protocol/src/packets/login/clientbound_hello_packet.rs b/minecraft-protocol/src/packets/login/clientbound_hello_packet.rs
index 2041497a..36a48706 100644
--- a/minecraft-protocol/src/packets/login/clientbound_hello_packet.rs
+++ b/minecraft-protocol/src/packets/login/clientbound_hello_packet.rs
@@ -1,7 +1,7 @@
use std::hash::Hash;
use tokio::io::BufReader;
-use crate::mc_buf;
+use crate::mc_buf::Readable;
use super::LoginPacket;
@@ -24,9 +24,9 @@ impl ClientboundHelloPacket {
pub async fn read<T: tokio::io::AsyncRead + std::marker::Unpin + std::marker::Send>(
buf: &mut BufReader<T>,
) -> Result<LoginPacket, String> {
- let server_id = mc_buf::read_utf_with_len(buf, 20).await?;
- let public_key = mc_buf::read_byte_array(buf).await?;
- let nonce = mc_buf::read_byte_array(buf).await?;
+ let server_id = buf.read_utf_with_len(20).await?;
+ let public_key = buf.read_byte_array().await?;
+ let nonce = buf.read_byte_array().await?;
Ok(ClientboundHelloPacket {
server_id,
diff --git a/minecraft-protocol/src/packets/status/clientbound_status_response_packet.rs b/minecraft-protocol/src/packets/status/clientbound_status_response_packet.rs
index fc5d8a2a..920e3484 100644
--- a/minecraft-protocol/src/packets/status/clientbound_status_response_packet.rs
+++ b/minecraft-protocol/src/packets/status/clientbound_status_response_packet.rs
@@ -3,7 +3,7 @@ use serde::Deserialize;
use serde_json::Value;
use tokio::io::BufReader;
-use crate::mc_buf;
+use crate::mc_buf::Readable;
use super::StatusPacket;
@@ -45,7 +45,7 @@ impl ClientboundStatusResponsePacket {
pub async fn read<T: tokio::io::AsyncRead + std::marker::Unpin + std::marker::Send>(
buf: &mut BufReader<T>,
) -> Result<StatusPacket, String> {
- let status_string = mc_buf::read_utf(buf).await?;
+ let status_string = buf.read_utf().await?;
let status_json: Value =
serde_json::from_str(status_string.as_str()).expect("Server status isn't valid JSON");