整个好活

This commit is contained in:
shenjack 2023-08-05 11:33:29 +08:00
parent dcee738c9a
commit f7aeb60bfa
Signed by: shenjack
GPG Key ID: 7B1134A979775551

View File

@ -1,8 +1,6 @@
use crate::data::{NbtItem, NbtLength, NbtList, NbtValue, Reader}; use crate::data::{NbtItem, NbtLength, NbtList, NbtValue, Reader};
use std::cell::RefCell; use std::convert::From;
use std::convert::{From, Into};
use std::io::{Cursor, Read}; use std::io::{Cursor, Read};
use std::rc::Rc;
/// 输出类型标识符 /// 输出类型标识符
/// 类型标识符 /// 类型标识符
@ -110,7 +108,7 @@ pub mod read {
[0x07] => { [0x07] => {
// ByteArray // ByteArray
for _ in 0..len { for _ in 0..len {
vec.push(NbtItem::Array(NbtList::from(from_bool_array(value)))); vec.push(NbtItem::from(from_bool_array(value)));
} }
} }
[0x08] => { [0x08] => {
@ -124,26 +122,26 @@ pub mod read {
// 要命 (虽说没 Compound 那么麻烦) // 要命 (虽说没 Compound 那么麻烦)
// 直接递归就行 // 直接递归就行
for _ in 0..len { for _ in 0..len {
vec.push(NbtItem::Array(NbtList::from(read_nbt_list(value)))); vec.push(NbtItem::from(read_nbt_list(value)));
} }
} }
[0x0A] => { [0x0A] => {
// Compound // Compound
// 他甚至不告诉你有多少个元素,要命 // 他甚至不告诉你有多少个元素,要命
for _ in 0..len { for _ in 0..len {
vec.push(NbtItem::Array(NbtList::from(from_compound(value)))); vec.push(NbtItem::from(from_compound(value)));
} }
} }
[0x0B] => { [0x0B] => {
// IntArray // IntArray
for _ in 0..len { for _ in 0..len {
vec.push(NbtItem::Array(NbtList::from(from_i32_array(value)))); vec.push(NbtItem::from(from_i32_array(value)));
} }
} }
[0x0C] => { [0x0C] => {
// LongArray // LongArray
for _ in 0..len { for _ in 0..len {
vec.push(NbtItem::Array(NbtList::from(from_i64_array(value)))); vec.push(NbtItem::from(from_i64_array(value)));
} }
} }
_ => { _ => {