From f9c25665c203d6377ace62f1e95381d037d8fd9e Mon Sep 17 00:00:00 2001 From: mat <27899617+mat-1@users.noreply.github.com> Date: Fri, 12 Dec 2025 00:56:02 -0600 Subject: Refactor azalea-registry (#294) * move registries in azalea-registry into separate modules * rename Item and Block to ItemKind and BlockKind * remove 'extra' registries from azalea-registry * hide deprecated items from docs * use DamageKindKey instead of Identifier when parsing registries * store tag entries as a Vec instead of a HashSet * sort tag values by protocol id * update changelog --- azalea-protocol/src/common/debug_subscription.rs | 4 ++-- azalea-protocol/src/common/recipe.rs | 11 +++++------ azalea-protocol/src/common/tags.rs | 2 +- 3 files changed, 8 insertions(+), 9 deletions(-) (limited to 'azalea-protocol/src/common') diff --git a/azalea-protocol/src/common/debug_subscription.rs b/azalea-protocol/src/common/debug_subscription.rs index 221cd98c..0be792e1 100644 --- a/azalea-protocol/src/common/debug_subscription.rs +++ b/azalea-protocol/src/common/debug_subscription.rs @@ -2,7 +2,7 @@ use std::fmt::Debug; use azalea_buf::AzBuf; use azalea_core::position::{BlockPos, Vec3}; -use azalea_registry::{Block, DebugSubscription, GameEvent, PointOfInterestKind}; +use azalea_registry::builtin::{BlockKind, DebugSubscription, GameEvent, PointOfInterestKind}; // see DebugSubscriptions.java @@ -119,7 +119,7 @@ pub enum DebugEntityBlockIntersection { #[derive(Clone, Debug, AzBuf, PartialEq)] pub struct DebugHiveInfo { - pub kind: Block, + pub kind: BlockKind, #[var] pub occupant_count: i32, #[var] diff --git a/azalea-protocol/src/common/recipe.rs b/azalea-protocol/src/common/recipe.rs index 709679f1..43a64469 100644 --- a/azalea-protocol/src/common/recipe.rs +++ b/azalea-protocol/src/common/recipe.rs @@ -1,7 +1,6 @@ use azalea_buf::AzBuf; -use azalea_core::identifier::Identifier; use azalea_inventory::ItemStack; -use azalea_registry::HolderSet; +use azalea_registry::{HolderSet, builtin::ItemKind, identifier::Identifier}; /// [`azalea_registry::RecipeDisplay`] #[derive(Clone, Debug, AzBuf, PartialEq)] @@ -56,7 +55,7 @@ pub struct SmithingRecipeDisplay { #[derive(Clone, Debug, PartialEq, AzBuf)] pub struct Ingredient { - pub allowed: HolderSet, + pub allowed: HolderSet, } /// [`azalea_registry::SlotDisplay`] @@ -64,7 +63,7 @@ pub struct Ingredient { pub enum SlotDisplayData { Empty, AnyFuel, - Item(ItemStackDisplay), + ItemKind(ItemStackDisplay), ItemStack(ItemStackSlotDisplay), Tag(Identifier), SmithingTrim(Box), @@ -74,7 +73,7 @@ pub enum SlotDisplayData { #[derive(Clone, Debug, PartialEq, AzBuf)] pub struct ItemStackDisplay { - pub item: azalea_registry::Item, + pub item: ItemKind, } #[derive(Clone, Debug, PartialEq, AzBuf)] pub struct ItemStackSlotDisplay { @@ -82,7 +81,7 @@ pub struct ItemStackSlotDisplay { } #[derive(Clone, Debug, PartialEq, AzBuf)] pub struct TagSlotDisplay { - pub tag: azalea_registry::Item, + pub tag: ItemKind, } #[derive(Clone, Debug, PartialEq, AzBuf)] pub struct SmithingTrimDemoSlotDisplay { diff --git a/azalea-protocol/src/common/tags.rs b/azalea-protocol/src/common/tags.rs index f8ddfc81..f22175ee 100644 --- a/azalea-protocol/src/common/tags.rs +++ b/azalea-protocol/src/common/tags.rs @@ -4,7 +4,7 @@ use std::{ }; use azalea_buf::{AzaleaRead, AzaleaReadVar, AzaleaWrite, AzaleaWriteVar, BufReadError}; -use azalea_core::identifier::Identifier; +use azalea_registry::identifier::Identifier; use indexmap::IndexMap; #[derive(Clone, Debug, PartialEq)] -- cgit v1.2.3