Remove unused deps
to mention is the take_mut dep i removed. Its heavily outdated and uses unsafe combined with pointer magic.
This commit is contained in:
parent
dad4798844
commit
91d190c212
21
Cargo.lock
generated
21
Cargo.lock
generated
@ -534,15 +534,6 @@ dependencies = [
|
|||||||
"cfg-if",
|
"cfg-if",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "crossbeam-channel"
|
|
||||||
version = "0.5.13"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "33480d6946193aa8033910124896ca395333cae7e2d1113d1fef6c3272217df2"
|
|
||||||
dependencies = [
|
|
||||||
"crossbeam-utils",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "crossbeam-deque"
|
name = "crossbeam-deque"
|
||||||
version = "0.8.5"
|
version = "0.8.5"
|
||||||
@ -1856,7 +1847,6 @@ version = "0.1.0-dev"
|
|||||||
dependencies = [
|
dependencies = [
|
||||||
"base64 0.22.1",
|
"base64 0.22.1",
|
||||||
"bytes",
|
"bytes",
|
||||||
"crossbeam-channel",
|
|
||||||
"ctrlc",
|
"ctrlc",
|
||||||
"digest 0.11.0-pre.9",
|
"digest 0.11.0-pre.9",
|
||||||
"hmac",
|
"hmac",
|
||||||
@ -1886,7 +1876,6 @@ dependencies = [
|
|||||||
"simple_logger",
|
"simple_logger",
|
||||||
"thiserror",
|
"thiserror",
|
||||||
"tokio",
|
"tokio",
|
||||||
"toml",
|
|
||||||
"uuid",
|
"uuid",
|
||||||
]
|
]
|
||||||
|
|
||||||
@ -1917,8 +1906,6 @@ dependencies = [
|
|||||||
name = "pumpkin-entity"
|
name = "pumpkin-entity"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"num-derive",
|
|
||||||
"num-traits",
|
|
||||||
"pumpkin-core",
|
"pumpkin-core",
|
||||||
]
|
]
|
||||||
|
|
||||||
@ -1966,8 +1953,6 @@ dependencies = [
|
|||||||
"pumpkin-macros",
|
"pumpkin-macros",
|
||||||
"pumpkin-world",
|
"pumpkin-world",
|
||||||
"serde",
|
"serde",
|
||||||
"serde_json",
|
|
||||||
"take_mut",
|
|
||||||
"thiserror",
|
"thiserror",
|
||||||
"uuid",
|
"uuid",
|
||||||
]
|
]
|
||||||
@ -2657,12 +2642,6 @@ dependencies = [
|
|||||||
"winx",
|
"winx",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "take_mut"
|
|
||||||
version = "0.2.2"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "f764005d11ee5f36500a149ace24e00e3da98b0158b3e2d53a7495660d3f4d60"
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "target-lexicon"
|
name = "target-lexicon"
|
||||||
version = "0.12.16"
|
version = "0.12.16"
|
||||||
|
|||||||
@ -5,6 +5,3 @@ edition.workspace = true
|
|||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
pumpkin-core = { path = "../pumpkin-core"}
|
pumpkin-core = { path = "../pumpkin-core"}
|
||||||
|
|
||||||
num-traits = "0.2"
|
|
||||||
num-derive = "0.4"
|
|
||||||
@ -13,8 +13,6 @@ bytes = "1.7"
|
|||||||
uuid.workspace = true
|
uuid.workspace = true
|
||||||
|
|
||||||
serde.workspace = true
|
serde.workspace = true
|
||||||
# to parse strings to json responses
|
|
||||||
serde_json = "1.0"
|
|
||||||
|
|
||||||
flate2 = "1.0.33"
|
flate2 = "1.0.33"
|
||||||
|
|
||||||
@ -26,6 +24,6 @@ num-derive = "0.4"
|
|||||||
# encryption
|
# encryption
|
||||||
aes = "0.8.4"
|
aes = "0.8.4"
|
||||||
cfb8 = "0.8.1"
|
cfb8 = "0.8.1"
|
||||||
take_mut = "0.2.2"
|
|
||||||
itertools = "0.13.0"
|
itertools = "0.13.0"
|
||||||
fastnbt = { git = "https://github.com/owengage/fastnbt.git" }
|
fastnbt = { git = "https://github.com/owengage/fastnbt.git" }
|
||||||
|
|||||||
@ -83,12 +83,13 @@ where
|
|||||||
P: Packet + Serialize,
|
P: Packet + Serialize,
|
||||||
{
|
{
|
||||||
fn write(&self, bytebuf: &mut ByteBuffer) {
|
fn write(&self, bytebuf: &mut ByteBuffer) {
|
||||||
take_mut::take(bytebuf, |bytebuf| {
|
let mut serializer = serializer::Serializer::new(ByteBuffer::empty());
|
||||||
let mut serializer = serializer::Serializer::new(bytebuf);
|
self.serialize(&mut serializer)
|
||||||
self.serialize(&mut serializer)
|
.expect("Could not serialize packet");
|
||||||
.expect("Could not serialize packet");
|
// We write the packet in an empty bytebuffer and then put it into our current one.
|
||||||
serializer.into()
|
// In the future we may do packet batching thats the reason i don't let every packet create a new bytebuffer and use
|
||||||
});
|
// an existing instead
|
||||||
|
bytebuf.put(serializer.output.buf());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -9,7 +9,7 @@ use thiserror::Error;
|
|||||||
use super::ByteBuffer;
|
use super::ByteBuffer;
|
||||||
|
|
||||||
pub struct Serializer {
|
pub struct Serializer {
|
||||||
output: ByteBuffer,
|
pub output: ByteBuffer,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Serializer {
|
impl Serializer {
|
||||||
|
|||||||
@ -33,12 +33,12 @@ impl Registry {
|
|||||||
registry_id: "minecraft:worldgen/biome".to_string(),
|
registry_id: "minecraft:worldgen/biome".to_string(),
|
||||||
registry_entries: vec![
|
registry_entries: vec![
|
||||||
RegistryEntry {
|
RegistryEntry {
|
||||||
entry_id: "minecraft:snowy_taiga",
|
entry_id: "minecraft:plains",
|
||||||
data: fastnbt::to_bytes_with_opts(&Biome::default(), SerOpts::network_nbt())
|
data: fastnbt::to_bytes_with_opts(&Biome::default(), SerOpts::network_nbt())
|
||||||
.unwrap(),
|
.unwrap(),
|
||||||
},
|
},
|
||||||
RegistryEntry {
|
RegistryEntry {
|
||||||
entry_id: "minecraft:plains",
|
entry_id: "minecraft:snowy_taiga",
|
||||||
data: fastnbt::to_bytes_with_opts(&Biome::default(), SerOpts::network_nbt())
|
data: fastnbt::to_bytes_with_opts(&Biome::default(), SerOpts::network_nbt())
|
||||||
.unwrap(),
|
.unwrap(),
|
||||||
},
|
},
|
||||||
|
|||||||
@ -1,9 +1,11 @@
|
|||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
|
|
||||||
// TODO make this work with the protocol
|
// TODO make this work with the protocol
|
||||||
|
// Send by the registry
|
||||||
#[derive(Serialize, Deserialize, Clone, Copy)]
|
#[derive(Serialize, Deserialize, Clone, Copy)]
|
||||||
#[non_exhaustive]
|
#[non_exhaustive]
|
||||||
pub enum Biome {
|
pub enum Biome {
|
||||||
Plains,
|
Plains,
|
||||||
|
SnowyTiga,
|
||||||
// TODO list all Biomes
|
// TODO list all Biomes
|
||||||
}
|
}
|
||||||
|
|||||||
@ -277,7 +277,7 @@ impl Level {
|
|||||||
match compression {
|
match compression {
|
||||||
Compression::Gzip => {
|
Compression::Gzip => {
|
||||||
let mut z = GzDecoder::new(&compressed_data[..]);
|
let mut z = GzDecoder::new(&compressed_data[..]);
|
||||||
let mut chunk_data = Vec::new();
|
let mut chunk_data = Vec::with_capacity(compressed_data.len());
|
||||||
match z.read_to_end(&mut chunk_data) {
|
match z.read_to_end(&mut chunk_data) {
|
||||||
Ok(_) => {}
|
Ok(_) => {}
|
||||||
Err(e) => {
|
Err(e) => {
|
||||||
@ -288,7 +288,7 @@ impl Level {
|
|||||||
}
|
}
|
||||||
Compression::Zlib => {
|
Compression::Zlib => {
|
||||||
let mut z = ZlibDecoder::new(&compressed_data[..]);
|
let mut z = ZlibDecoder::new(&compressed_data[..]);
|
||||||
let mut chunk_data = Vec::new();
|
let mut chunk_data = Vec::with_capacity(compressed_data.len());
|
||||||
match z.read_to_end(&mut chunk_data) {
|
match z.read_to_end(&mut chunk_data) {
|
||||||
Ok(_) => {}
|
Ok(_) => {}
|
||||||
Err(e) => {
|
Err(e) => {
|
||||||
|
|||||||
@ -21,7 +21,6 @@ pumpkin-registry = { path = "../pumpkin-registry"}
|
|||||||
# config
|
# config
|
||||||
serde.workspace = true
|
serde.workspace = true
|
||||||
serde_json = "1.0"
|
serde_json = "1.0"
|
||||||
toml = "0.8"
|
|
||||||
|
|
||||||
bytes = "1.7"
|
bytes = "1.7"
|
||||||
|
|
||||||
@ -59,7 +58,6 @@ log.workspace = true
|
|||||||
|
|
||||||
# networking
|
# networking
|
||||||
mio = { version = "1.0.2", features = ["os-poll", "net"]}
|
mio = { version = "1.0.2", features = ["os-poll", "net"]}
|
||||||
crossbeam-channel = "0.5.13"
|
|
||||||
|
|
||||||
uuid.workspace = true
|
uuid.workspace = true
|
||||||
tokio.workspace = true
|
tokio.workspace = true
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user