aboutsummaryrefslogtreecommitdiff
path: root/azalea-protocol/src/packets/game/clientbound_login_packet.rs
diff options
context:
space:
mode:
authormat <27899617+mat-1@users.noreply.github.com>2023-03-14 16:33:03 -0500
committerGitHub <noreply@github.com>2023-03-14 16:33:03 -0500
commit12a9c8ce65b58f0c600fd7b9fc5d454ce228b420 (patch)
tree9bada4164ea12fa533d413c0c7090f4779b519f1 /azalea-protocol/src/packets/game/clientbound_login_packet.rs
parentb792e21d1c2b7dba04d88dba479ed451104a6514 (diff)
downloadazalea-drasl-12a9c8ce65b58f0c600fd7b9fc5d454ce228b420.tar.xz
1.19.4 (#57)
* 23w03a * 23w04a * 23w05a * 23w06a * fix * 23w07a mojang broke their json data generator so some stuff is missing * didn't mean to commit that file here * 1.19.4-pre2 * fix * 1.19.4-pre3 * fix * how did these packets get here * 1.19.4-pre4 * 1.19.4-rc1 * 1.19.4-rc2 * 1.19.4-rc3 * merge main * remove debugging code * 1.19.4
Diffstat (limited to 'azalea-protocol/src/packets/game/clientbound_login_packet.rs')
-rwxr-xr-xazalea-protocol/src/packets/game/clientbound_login_packet.rs77
1 files changed, 63 insertions, 14 deletions
diff --git a/azalea-protocol/src/packets/game/clientbound_login_packet.rs b/azalea-protocol/src/packets/game/clientbound_login_packet.rs
index a79e0f5e..37273b03 100755
--- a/azalea-protocol/src/packets/game/clientbound_login_packet.rs
+++ b/azalea-protocol/src/packets/game/clientbound_login_packet.rs
@@ -96,9 +96,15 @@ pub mod registry {
#[cfg_attr(feature = "strict_registry", serde(deny_unknown_fields))]
pub struct RegistryRoot {
#[cfg(feature = "strict_registry")]
+ #[serde(rename = "minecraft:trim_material")]
+ pub trim_material: RegistryType<TrimMaterialElement>,
+ #[cfg(not(feature = "strict_registry"))]
+ #[serde(rename = "minecraft:trim_material")]
+ pub trim_material: Tag,
+
+ #[cfg(feature = "strict_registry")]
#[serde(rename = "minecraft:chat_type")]
pub chat_type: RegistryType<ChatTypeElement>,
-
#[cfg(not(feature = "strict_registry"))]
#[serde(rename = "minecraft:chat_type")]
pub chat_type: Tag,
@@ -109,10 +115,23 @@ pub mod registry {
#[cfg(feature = "strict_registry")]
#[serde(rename = "minecraft:worldgen/biome")]
pub world_type: RegistryType<WorldTypeElement>,
-
#[cfg(not(feature = "strict_registry"))]
#[serde(rename = "minecraft:worldgen/biome")]
pub world_type: Tag,
+
+ #[cfg(feature = "strict_registry")]
+ #[serde(rename = "minecraft:trim_pattern")]
+ pub trim_pattern: RegistryType<TrimPatternElement>,
+ #[cfg(not(feature = "strict_registry"))]
+ #[serde(rename = "minecraft:trim_pattern")]
+ pub trim_pattern: Tag,
+
+ #[cfg(feature = "strict_registry")]
+ #[serde(rename = "minecraft:damage_type")]
+ pub damage_type: RegistryType<DamageTypeElement>,
+ #[cfg(not(feature = "strict_registry"))]
+ #[serde(rename = "minecraft:damage_type")]
+ pub damage_type: Tag,
}
/// A collection of values for a certain type of registry data.
@@ -133,6 +152,18 @@ pub mod registry {
pub element: T,
}
+ #[derive(Debug, Clone, Serialize, Deserialize)]
+ #[cfg_attr(feature = "strict_registry", serde(deny_unknown_fields))]
+ pub struct TrimMaterialElement {
+ pub asset_name: String,
+ pub ingredient: ResourceLocation,
+ pub item_model_index: f32,
+ pub override_armor_materials: HashMap<String, String>,
+ #[serde(default)]
+ #[serde(skip_serializing_if = "Option::is_none")]
+ pub description: Option<String>,
+ }
+
/// Data about a kind of chat message
#[derive(Debug, Clone, Serialize, Deserialize)]
#[cfg_attr(feature = "strict_registry", serde(deny_unknown_fields))]
@@ -259,12 +290,13 @@ pub mod registry {
#[derive(Debug, Clone, Serialize, Deserialize)]
#[cfg_attr(feature = "strict_registry", serde(deny_unknown_fields))]
pub struct WorldTypeElement {
+ #[serde(with = "Convert")]
+ pub has_precipitation: bool,
pub temperature: f32,
#[serde(default)]
#[serde(skip_serializing_if = "Option::is_none")]
pub temperature_modifier: Option<String>,
pub downfall: f32,
- pub precipitation: BiomePrecipitation,
pub effects: BiomeEffects,
}
@@ -309,7 +341,7 @@ pub mod registry {
pub additions_sound: Option<AdditionsSound>,
#[serde(default)]
#[serde(skip_serializing_if = "Option::is_none")]
- pub ambient_sound: Option<SoundId>,
+ pub ambient_sound: Option<ResourceLocation>,
#[serde(default)]
#[serde(skip_serializing_if = "Option::is_none")]
pub particle: Option<BiomeParticle>,
@@ -325,7 +357,7 @@ pub mod registry {
pub replace_current_music: bool,
pub max_delay: u32,
pub min_delay: u32,
- pub sound: SoundId,
+ pub sound: azalea_registry::SoundEvent,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
@@ -334,21 +366,14 @@ pub mod registry {
pub tick_delay: u32,
pub block_search_extent: u32,
pub offset: f32,
- pub sound: SoundId,
+ pub sound: azalea_registry::SoundEvent,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[cfg_attr(feature = "strict_registry", serde(deny_unknown_fields))]
pub struct AdditionsSound {
pub tick_chance: f32,
- pub sound: SoundId,
- }
-
- /// The ID of a sound.
- #[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
- #[cfg_attr(feature = "strict_registry", serde(deny_unknown_fields))]
- pub struct SoundId {
- pub sound_id: azalea_registry::SoundEvent,
+ pub sound: azalea_registry::SoundEvent,
}
/// Biome particles.
@@ -361,6 +386,27 @@ pub mod registry {
pub options: HashMap<String, String>,
}
+ #[derive(Debug, Clone, Serialize, Deserialize)]
+ #[cfg_attr(feature = "strict_registry", serde(deny_unknown_fields))]
+ pub struct TrimPatternElement {
+ #[serde(flatten)]
+ pub pattern: HashMap<String, String>,
+ }
+
+ #[derive(Debug, Clone, Serialize, Deserialize)]
+ #[cfg_attr(feature = "strict_registry", serde(deny_unknown_fields))]
+ pub struct DamageTypeElement {
+ pub message_id: String,
+ pub scaling: String,
+ pub exhaustion: f32,
+ #[serde(default)]
+ #[serde(skip_serializing_if = "Option::is_none")]
+ pub effects: Option<String>,
+ #[serde(default)]
+ #[serde(skip_serializing_if = "Option::is_none")]
+ pub death_message_type: Option<String>,
+ }
+
// Using a trait because you can't implement methods for
// types you don't own, in this case Option<bool> and bool.
trait Convert: Sized {
@@ -443,12 +489,15 @@ mod tests {
// This is just for testing.
let registry = RegistryHolder {
root: RegistryRoot {
+ trim_material: Tag::End,
chat_type: Tag::End,
dimension_type: RegistryType::<DimensionTypeElement> {
kind: ResourceLocation::new("minecraft:dimension_type"),
value: Vec::new(),
},
world_type: Tag::End,
+ trim_pattern: Tag::End,
+ damage_type: Tag::End,
},
};