1
2
Fork 0
mirror of https://github.com/mat-1/azalea.git synced 2025-08-02 14:26:04 +00:00

read Tool blocks as HolderSet

fixes an error with viaversion servers
This commit is contained in:
mat 2024-05-22 10:13:22 +00:00
parent 892869ad12
commit 729d211406
4 changed files with 4 additions and 1 deletions

View file

@ -468,6 +468,7 @@ impl simdnbt::FromNbtTag for FormattedText {
}
#[cfg(feature = "azalea-buf")]
#[cfg(feature = "simdnbt")]
impl McBufReadable for FormattedText {
fn read_from(buf: &mut std::io::Cursor<&[u8]>) -> Result<Self, BufReadError> {
let nbt = simdnbt::borrow::read_optional_tag(buf)?;

View file

@ -49,6 +49,7 @@ pub fn send_packet_events(
Ok(packet) => packet,
Err(err) => {
error!("failed to read packet: {:?}", err);
debug!("packet bytes: {:?}", raw_packet);
continue;
}
};

View file

@ -164,6 +164,7 @@ pub fn send_packet_events(
Ok(packet) => packet,
Err(err) => {
error!("failed to read packet: {:?}", err);
debug!("packet bytes: {:?}", raw_packet);
continue;
}
};

View file

@ -359,7 +359,7 @@ impl DataComponent for FireResistant {}
#[derive(Clone, PartialEq, McBuf)]
pub struct ToolRule {
pub blocks: Vec<Block>,
pub blocks: HolderSet<Block, ResourceLocation>,
pub speed: Option<f32>,
pub correct_for_drops: Option<bool>,
}