Skip to content

Commit

Permalink
adapt to new nbtx lib #2
Browse files Browse the repository at this point in the history
  • Loading branch information
theaddonn committed Sep 15, 2024
1 parent a1a44bc commit cd1eef8
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions crates/paletted_storage/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
use std::io::Cursor;

use bedrockrs_core::int::LE;
use bedrockrs_nbt as nbt;
use byteorder::ReadBytesExt;

#[derive(Debug, Clone)]
pub struct PalettedStorage {
pub blocks: [u32; 4096],
pub palette: Vec<nbt::Value>,
pub palette: Vec<nbtx::Value>,
}

impl PalettedStorage {
Expand Down Expand Up @@ -100,9 +99,9 @@ impl PalettedStorage {

for nbt in &self.palette {
if network {
nbt::to_var_bytes_in(&mut out, &nbt).unwrap()
nbtx::to_net_bytes_in(&mut out, &nbt).unwrap()
} else {
nbt::to_le_bytes_in(&mut out, &nbt).unwrap()
nbtx::to_le_bytes_in(&mut out, &nbt).unwrap()
}
}

Expand Down

0 comments on commit cd1eef8

Please sign in to comment.