replace crab_nbt with fastnbt
This commit is contained in:
1 parent
d574553113
commit
2479019443
4 files changed
+30
-38
No files matched your search
+1
-2
@@ -29,6 +29,5 @@ mio = { version = "1.0.1", features = ["os-poll", "net"]}
|
||||
crossbeam-channel = "0.5.13"
|
||||
uuid = "1.10"
|
||||
toml = "0.8.17"
|
||||
crab_nbt = "0.1.2"
|
||||
|
||||
fastnbt = "2.5.0"
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
use core::str;
|
||||
use std::io::{self, Error, ErrorKind, Read};
|
||||
use std::io::{self, Error, ErrorKind, Read, Write};
|
||||
|
||||
use bytes::{Buf, BufMut, BytesMut};
|
||||
|
||||
@@ -180,13 +180,17 @@ impl ByteBuffer {
|
||||
self.put_list(v, |p, &v| p.put_var_int(v))
|
||||
}
|
||||
|
||||
pub fn get_nbt(&mut self) -> Option<crab_nbt::NbtTag> {
|
||||
/* pub fn get_nbt(&mut self) -> Option<crab_nbt::NbtTag> {
|
||||
match crab_nbt::NbtTag::deserialize(self.buf()) {
|
||||
Ok(v) => Some(v),
|
||||
Err(err) => None,
|
||||
}
|
||||
}
|
||||
|
||||
pub fn put_nbt(&mut self, nbt: NbtTag) {
|
||||
self.buffer.put_slice(&nbt.serialize());
|
||||
} */
|
||||
|
||||
pub fn buf(&mut self) -> &mut BytesMut {
|
||||
&mut self.buffer
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@ struct CodecItem<T> {
|
||||
|
||||
pub fn write_single_dimension(out: &mut ByteBuffer, world_min_y: i32, world_height: u32) {
|
||||
let dimension = dimensions::overworld(world_min_y, world_height);
|
||||
// out.put_slice(&crab_nbt::nbt!("", &dimension).unwrap().serialize());
|
||||
// out.put_nbt(nbt!(dimension))
|
||||
}
|
||||
|
||||
pub fn write_codec(out: &mut ByteBuffer, world_min_y: i32, world_height: u32) {
|
||||
|
||||
Reference in new issue
Block a user