From fbaae39cdf9c5a7a34005a51a37b85f7cdd5ea00 Mon Sep 17 00:00:00 2001 From: mat Date: Thu, 13 Nov 2025 12:34:47 +0930 Subject: rename ResourceLocation to Identifier ahead of mojmap changes --- azalea-registry/src/lib.rs | 36 ++++++++++++++---------------------- 1 file changed, 14 insertions(+), 22 deletions(-) (limited to 'azalea-registry/src') diff --git a/azalea-registry/src/lib.rs b/azalea-registry/src/lib.rs index 88b154a2..a3145b15 100644 --- a/azalea-registry/src/lib.rs +++ b/azalea-registry/src/lib.rs @@ -88,22 +88,20 @@ impl AzaleaWrite for CustomRegistry { +pub enum HolderSet { Direct { contents: Vec, }, Named { - key: ResourceLocation, - contents: Vec, + key: Identifier, + contents: Vec, }, } -impl AzaleaRead - for HolderSet -{ +impl AzaleaRead for HolderSet { fn azalea_read(buf: &mut Cursor<&[u8]>) -> Result { let size = i32::azalea_read_var(buf)? - 1; if size == -1 { - let key = ResourceLocation::azalea_read(buf)?; + let key = Identifier::azalea_read(buf)?; Ok(Self::Named { key, contents: Vec::new(), @@ -117,9 +115,7 @@ impl AzaleaRead } } } -impl AzaleaWrite - for HolderSet -{ +impl AzaleaWrite for HolderSet { fn azalea_write(&self, buf: &mut impl Write) -> io::Result<()> { match self { Self::Direct { contents } => { @@ -136,8 +132,8 @@ impl AzaleaWrite Ok(()) } } -impl Debug - for HolderSet +impl Debug + for HolderSet { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { match self { @@ -150,16 +146,14 @@ impl De } } } -impl From> - for HolderSet -{ +impl From> for HolderSet { fn from(contents: Vec) -> Self { Self::Direct { contents } } } #[cfg(feature = "serde")] -impl Serialize - for HolderSet +impl Serialize + for HolderSet { fn serialize(&self, serializer: S) -> Result where @@ -177,9 +171,7 @@ impl Default - for HolderSet -{ +impl Default for HolderSet { fn default() -> Self { Self::Direct { contents: Vec::new(), @@ -188,7 +180,7 @@ impl Default } /// A reference to either a registry or a custom value (usually something with a -/// ResourceLocation). +/// Identifier). pub enum Holder { Reference(R), Direct(Direct), @@ -1646,7 +1638,7 @@ enum CommandArgumentKind { Team => "minecraft:team", ItemSlot => "minecraft:item_slot", ItemSlots => "minecraft:item_slots", - ResourceLocation => "minecraft:resource_location", + Identifier => "minecraft:resource_location", Function => "minecraft:function", EntityAnchor => "minecraft:entity_anchor", IntRange => "minecraft:int_range", -- cgit v1.2.3