From 833f306e8b8faddd232b5c736b2134ed08adcb6c Mon Sep 17 00:00:00 2001 From: mat <27899617+mat-1@users.noreply.github.com> Date: Fri, 21 Feb 2025 13:43:56 -0600 Subject: Fix errors on switching dimensions (#204) * Fix errors on switching dimensions * fix other tests * clippy * fix log feature in test_simulation * fix chunks oops --- azalea-registry/src/data.rs | 17 +++++++++++++++++ azalea-registry/src/extra.rs | 9 --------- 2 files changed, 17 insertions(+), 9 deletions(-) (limited to 'azalea-registry/src') diff --git a/azalea-registry/src/data.rs b/azalea-registry/src/data.rs index c80889d6..17338c8f 100644 --- a/azalea-registry/src/data.rs +++ b/azalea-registry/src/data.rs @@ -22,3 +22,20 @@ impl DataRegistry for Enchantment { self.id } } + +#[derive(Debug, Clone, Copy, AzBuf, PartialEq, Eq, Hash)] +pub struct DimensionType { + #[var] + id: u32, +} +impl DimensionType { + pub fn new_raw(id: u32) -> Self { + Self { id } + } +} +impl DataRegistry for DimensionType { + const NAME: &'static str = "dimension_type"; + fn protocol_id(&self) -> u32 { + self.id + } +} diff --git a/azalea-registry/src/extra.rs b/azalea-registry/src/extra.rs index ba5d8559..1ba1f0a9 100644 --- a/azalea-registry/src/extra.rs +++ b/azalea-registry/src/extra.rs @@ -27,15 +27,6 @@ impl Default for WolfVariant { } } -registry! { -enum DimensionType { - Overworld => "minecraft:overworld", - Nether => "minecraft:the_nether", - End => "minecraft:the_end", - OverworldCaves => "minecraft:overworld_caves", -} -} - registry! { enum TrimMaterial { Quartz => "minecraft:quartz", -- cgit v1.2.3