diff --git a/src/world/chunk.rs b/src/world/chunk.rs index 9285a16..77a543c 100644 --- a/src/world/chunk.rs +++ b/src/world/chunk.rs @@ -93,10 +93,10 @@ impl<'a> Chunk<'a> { let data_version = data.data_version.unwrap_or_default(); match &data.chunk { - de::ChunkVariants::V1_18 { sections } => { + de::ChunkVariant::V1_18 { sections } => { Self::new_v1_18(data_version, sections, block_types, biome_types) } - de::ChunkVariants::V0 { level } => { + de::ChunkVariant::V0 { level } => { Self::new_v0(data_version, level, block_types, biome_types) } } @@ -113,7 +113,7 @@ impl<'a> Chunk<'a> { for section in sections { match §ion.section { - de::SectionV1_18Variants::V1_18 { + de::SectionV1_18Variant::V1_18 { block_states, biomes, block_light, @@ -140,7 +140,7 @@ impl<'a> Chunk<'a> { ), ); } - de::SectionV1_18Variants::Empty {} => {} + de::SectionV1_18Variant::Empty {} => {} }; } @@ -163,7 +163,7 @@ impl<'a> Chunk<'a> { format!("Failed to load section block light at Y={}", section.y) })?; match §ion.section { - de::SectionV0Variants::V1_13 { + de::SectionV0Variant::V1_13 { block_states, palette, } => { @@ -183,7 +183,7 @@ impl<'a> Chunk<'a> { ), ); } - de::SectionV0Variants::V0 { blocks, data } => { + de::SectionV0Variant::V0 { blocks, data } => { section_map_v0.insert( SectionY(section.y.into()), ( @@ -194,7 +194,7 @@ impl<'a> Chunk<'a> { ), ); } - de::SectionV0Variants::Empty {} => {} + de::SectionV0Variant::Empty {} => {} } } diff --git a/src/world/de.rs b/src/world/de.rs index 5c8f84f..cf1b6b5 100644 --- a/src/world/de.rs +++ b/src/world/de.rs @@ -31,7 +31,7 @@ pub struct BiomesV1_18 { /// Variable part of a [SectionV1_18] #[derive(Debug, Deserialize)] #[serde(untagged)] -pub enum SectionV1_18Variants { +pub enum SectionV1_18Variant { /// Populated 1.18+ section V1_18 { /// Block type data @@ -54,13 +54,13 @@ pub struct SectionV1_18 { pub y: i32, /// Variable part of section #[serde(flatten)] - pub section: SectionV1_18Variants, + pub section: SectionV1_18Variant, } /// Version-specific part of a pre-1.18 [Section](SectionV0) #[derive(Debug, Deserialize)] #[serde(untagged)] -pub enum SectionV0Variants { +pub enum SectionV0Variant { /// v1.13+ data #[serde(rename_all = "PascalCase")] V1_13 { @@ -91,7 +91,7 @@ pub struct SectionV0 { pub block_light: Option, /// Version-specific data #[serde(flatten)] - pub section: SectionV0Variants, + pub section: SectionV0Variant, } /// Pre-1.18 biome fields found in the [Level](LevelV0) compound @@ -118,7 +118,7 @@ pub struct LevelV0 { /// Version-specific part of a [Chunk] compound #[derive(Debug, Deserialize)] #[serde(untagged)] -pub enum ChunkVariants { +pub enum ChunkVariant { /// 1.18+ chunk data V1_18 { /// List of chunk sections @@ -140,7 +140,7 @@ pub struct Chunk { pub data_version: Option, /// Version-specific chunk data #[serde(flatten)] - pub chunk: ChunkVariants, + pub chunk: ChunkVariant, } /// `Data` compound element of level.dat