diff options
| author | mat <git@matdoes.dev> | 2025-11-13 12:34:47 +0930 |
|---|---|---|
| committer | mat <git@matdoes.dev> | 2025-11-13 07:04:52 +0400 |
| commit | fbaae39cdf9c5a7a34005a51a37b85f7cdd5ea00 (patch) | |
| tree | 3126fb34a4e0ac979a1103a8227a2b9a136c1553 /azalea-protocol/src/common | |
| parent | a4312599f7c04709a92b7be238dcf577bafbb14f (diff) | |
| download | azalea-drasl-fbaae39cdf9c5a7a34005a51a37b85f7cdd5ea00.tar.xz | |
rename ResourceLocation to Identifier ahead of mojmap changes
Diffstat (limited to 'azalea-protocol/src/common')
| -rw-r--r-- | azalea-protocol/src/common/recipe.rs | 6 | ||||
| -rw-r--r-- | azalea-protocol/src/common/tags.rs | 12 |
2 files changed, 9 insertions, 9 deletions
diff --git a/azalea-protocol/src/common/recipe.rs b/azalea-protocol/src/common/recipe.rs index 8ab2d5ba..709679f1 100644 --- a/azalea-protocol/src/common/recipe.rs +++ b/azalea-protocol/src/common/recipe.rs @@ -1,5 +1,5 @@ use azalea_buf::AzBuf; -use azalea_core::resource_location::ResourceLocation; +use azalea_core::identifier::Identifier; use azalea_inventory::ItemStack; use azalea_registry::HolderSet; @@ -56,7 +56,7 @@ pub struct SmithingRecipeDisplay { #[derive(Clone, Debug, PartialEq, AzBuf)] pub struct Ingredient { - pub allowed: HolderSet<azalea_registry::Item, ResourceLocation>, + pub allowed: HolderSet<azalea_registry::Item, Identifier>, } /// [`azalea_registry::SlotDisplay`] @@ -66,7 +66,7 @@ pub enum SlotDisplayData { AnyFuel, Item(ItemStackDisplay), ItemStack(ItemStackSlotDisplay), - Tag(ResourceLocation), + Tag(Identifier), SmithingTrim(Box<SmithingTrimDemoSlotDisplay>), WithRemainder(Box<WithRemainderSlotDisplay>), Composite(CompositeSlotDisplay), diff --git a/azalea-protocol/src/common/tags.rs b/azalea-protocol/src/common/tags.rs index 0b798519..f8ddfc81 100644 --- a/azalea-protocol/src/common/tags.rs +++ b/azalea-protocol/src/common/tags.rs @@ -4,15 +4,15 @@ use std::{ }; use azalea_buf::{AzaleaRead, AzaleaReadVar, AzaleaWrite, AzaleaWriteVar, BufReadError}; -use azalea_core::resource_location::ResourceLocation; +use azalea_core::identifier::Identifier; use indexmap::IndexMap; #[derive(Clone, Debug, PartialEq)] -pub struct TagMap(pub IndexMap<ResourceLocation, Vec<Tags>>); +pub struct TagMap(pub IndexMap<Identifier, Vec<Tags>>); #[derive(Clone, Debug, PartialEq)] pub struct Tags { - pub name: ResourceLocation, + pub name: Identifier, pub elements: Vec<i32>, } @@ -21,7 +21,7 @@ impl AzaleaRead for TagMap { let length = u32::azalea_read_var(buf)? as usize; let mut data = IndexMap::with_capacity(length); for _ in 0..length { - let tag_type = ResourceLocation::azalea_read(buf)?; + let tag_type = Identifier::azalea_read(buf)?; let tags_count = i32::azalea_read_var(buf)? as usize; let mut tags_vec = Vec::with_capacity(tags_count); for _ in 0..tags_count { @@ -46,7 +46,7 @@ impl AzaleaWrite for TagMap { } impl AzaleaRead for Tags { fn azalea_read(buf: &mut Cursor<&[u8]>) -> Result<Self, BufReadError> { - let name = ResourceLocation::azalea_read(buf)?; + let name = Identifier::azalea_read(buf)?; let elements = Vec::<i32>::azalea_read_var(buf)?; Ok(Tags { name, elements }) } @@ -61,7 +61,7 @@ impl AzaleaWrite for Tags { } impl Deref for TagMap { - type Target = IndexMap<ResourceLocation, Vec<Tags>>; + type Target = IndexMap<Identifier, Vec<Tags>>; fn deref(&self) -> &Self::Target { &self.0 |
