aboutsummaryrefslogtreecommitdiff
path: root/azalea-protocol/src/packets
diff options
context:
space:
mode:
authorEightFactorial <29801334+EightFactorial@users.noreply.github.com>2023-09-07 10:40:53 -0700
committerGitHub <noreply@github.com>2023-09-07 12:40:53 -0500
commite6a787f77752da4593964eba775e82f8c6d282b4 (patch)
tree3588bd4ea0a549da61df4cd9d39e9445c25b95bd /azalea-protocol/src/packets
parentbf8f533d9f75dc6a1e218b5c576fe9a1275b17ec (diff)
downloadazalea-drasl-e6a787f77752da4593964eba775e82f8c6d282b4.tar.xz
Don't crash when missing extra registries (#108)
* Fix decoding on missing Nbt structures * Fix default and renaming
Diffstat (limited to 'azalea-protocol/src/packets')
-rwxr-xr-xazalea-protocol/src/packets/game/clientbound_login_packet.rs10
1 files changed, 5 insertions, 5 deletions
diff --git a/azalea-protocol/src/packets/game/clientbound_login_packet.rs b/azalea-protocol/src/packets/game/clientbound_login_packet.rs
index b57fe66f..3b8ae03d 100755
--- a/azalea-protocol/src/packets/game/clientbound_login_packet.rs
+++ b/azalea-protocol/src/packets/game/clientbound_login_packet.rs
@@ -101,14 +101,14 @@ pub mod registry {
#[serde(rename = "minecraft:trim_material")]
pub trim_material: RegistryType<TrimMaterialElement>,
#[cfg(not(feature = "strict_registry"))]
- #[serde(rename = "minecraft:trim_material")]
+ #[serde(default, rename = "minecraft:trim_material")]
pub trim_material: Nbt,
#[cfg(feature = "strict_registry")]
#[serde(rename = "minecraft:chat_type")]
pub chat_type: RegistryType<ChatTypeElement>,
#[cfg(not(feature = "strict_registry"))]
- #[serde(rename = "minecraft:chat_type")]
+ #[serde(default, rename = "minecraft:chat_type")]
pub chat_type: Nbt,
#[serde(rename = "minecraft:dimension_type")]
@@ -118,21 +118,21 @@ pub mod registry {
#[serde(rename = "minecraft:worldgen/biome")]
pub world_type: RegistryType<WorldTypeElement>,
#[cfg(not(feature = "strict_registry"))]
- #[serde(rename = "minecraft:worldgen/biome")]
+ #[serde(default, rename = "minecraft:worldgen/biome")]
pub world_type: Nbt,
#[cfg(feature = "strict_registry")]
#[serde(rename = "minecraft:trim_pattern")]
pub trim_pattern: RegistryType<TrimPatternElement>,
#[cfg(not(feature = "strict_registry"))]
- #[serde(rename = "minecraft:trim_pattern")]
+ #[serde(default, rename = "minecraft:trim_pattern")]
pub trim_pattern: Nbt,
#[cfg(feature = "strict_registry")]
#[serde(rename = "minecraft:damage_type")]
pub damage_type: RegistryType<DamageTypeElement>,
#[cfg(not(feature = "strict_registry"))]
- #[serde(rename = "minecraft:damage_type")]
+ #[serde(default, rename = "minecraft:damage_type")]
pub damage_type: Nbt,
}