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-protocol/src/common/recipe.rs | 6 +++--- azalea-protocol/src/common/tags.rs | 12 +++++------ azalea-protocol/src/packets/common.rs | 6 +++--- .../src/packets/config/c_cookie_request.rs | 4 ++-- .../src/packets/config/c_custom_payload.rs | 4 ++-- .../src/packets/config/c_registry_data.rs | 6 +++--- .../src/packets/config/c_store_cookie.rs | 4 ++-- .../packets/config/c_update_enabled_features.rs | 4 ++-- .../src/packets/config/s_cookie_response.rs | 4 ++-- .../src/packets/config/s_custom_click_action.rs | 4 ++-- .../src/packets/config/s_custom_payload.rs | 4 ++-- azalea-protocol/src/packets/game/c_add_entity.rs | 4 ++-- azalea-protocol/src/packets/game/c_commands.rs | 20 +++++++++--------- .../src/packets/game/c_cookie_request.rs | 4 ++-- .../src/packets/game/c_custom_payload.rs | 7 +++---- azalea-protocol/src/packets/game/c_login.rs | 4 ++-- .../src/packets/game/c_select_advancements_tab.rs | 4 ++-- azalea-protocol/src/packets/game/c_stop_sound.rs | 6 +++--- azalea-protocol/src/packets/game/c_store_cookie.rs | 4 ++-- .../src/packets/game/c_update_advancements.rs | 24 +++++++++++----------- .../src/packets/game/c_update_recipes.rs | 4 ++-- azalea-protocol/src/packets/game/c_waypoint.rs | 6 +++--- .../src/packets/game/s_cookie_response.rs | 4 ++-- .../src/packets/game/s_custom_click_action.rs | 4 ++-- .../src/packets/game/s_custom_payload.rs | 7 +++---- azalea-protocol/src/packets/game/s_place_recipe.rs | 4 ++-- .../src/packets/game/s_recipe_book_seen_recipe.rs | 4 ++-- .../src/packets/game/s_seen_advancements.rs | 6 +++--- .../src/packets/game/s_set_jigsaw_block.rs | 8 ++++---- .../src/packets/login/c_cookie_request.rs | 4 ++-- .../src/packets/login/c_custom_query.rs | 4 ++-- .../src/packets/login/s_cookie_response.rs | 4 ++-- 32 files changed, 96 insertions(+), 98 deletions(-) (limited to 'azalea-protocol') 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, + pub allowed: HolderSet, } /// [`azalea_registry::SlotDisplay`] @@ -66,7 +66,7 @@ pub enum SlotDisplayData { AnyFuel, Item(ItemStackDisplay), ItemStack(ItemStackSlotDisplay), - Tag(ResourceLocation), + Tag(Identifier), SmithingTrim(Box), WithRemainder(Box), 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>); +pub struct TagMap(pub IndexMap>); #[derive(Clone, Debug, PartialEq)] pub struct Tags { - pub name: ResourceLocation, + pub name: Identifier, pub elements: Vec, } @@ -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 { - let name = ResourceLocation::azalea_read(buf)?; + let name = Identifier::azalea_read(buf)?; let elements = Vec::::azalea_read_var(buf)?; Ok(Tags { name, elements }) } @@ -61,7 +61,7 @@ impl AzaleaWrite for Tags { } impl Deref for TagMap { - type Target = IndexMap>; + type Target = IndexMap>; fn deref(&self) -> &Self::Target { &self.0 diff --git a/azalea-protocol/src/packets/common.rs b/azalea-protocol/src/packets/common.rs index ad87fa8d..fcbf0b05 100644 --- a/azalea-protocol/src/packets/common.rs +++ b/azalea-protocol/src/packets/common.rs @@ -2,16 +2,16 @@ use azalea_buf::AzBuf; use azalea_core::{ data_registry::ResolvableDataRegistry, game_type::{GameMode, OptionalGameType}, + identifier::Identifier, position::GlobalPos, registry_holder::{DimensionTypeElement, RegistryHolder}, - resource_location::ResourceLocation, }; use tracing::error; #[derive(Clone, Debug, AzBuf, PartialEq)] pub struct CommonPlayerSpawnInfo { pub dimension_type: azalea_registry::DimensionType, - pub dimension: ResourceLocation, + pub dimension: Identifier, pub seed: i64, pub game_type: GameMode, pub previous_game_type: OptionalGameType, @@ -27,7 +27,7 @@ impl CommonPlayerSpawnInfo { pub fn dimension_type( &self, registry_holder: &RegistryHolder, - ) -> Option<(ResourceLocation, DimensionTypeElement)> { + ) -> Option<(Identifier, DimensionTypeElement)> { let dimension_res = self .dimension_type .resolve_and_deserialize::(registry_holder); diff --git a/azalea-protocol/src/packets/config/c_cookie_request.rs b/azalea-protocol/src/packets/config/c_cookie_request.rs index c1a42cac..ff368b63 100644 --- a/azalea-protocol/src/packets/config/c_cookie_request.rs +++ b/azalea-protocol/src/packets/config/c_cookie_request.rs @@ -1,8 +1,8 @@ use azalea_buf::AzBuf; -use azalea_core::resource_location::ResourceLocation; +use azalea_core::identifier::Identifier; use azalea_protocol_macros::ClientboundConfigPacket; #[derive(Clone, Debug, AzBuf, PartialEq, ClientboundConfigPacket)] pub struct ClientboundCookieRequest { - pub key: ResourceLocation, + pub key: Identifier, } diff --git a/azalea-protocol/src/packets/config/c_custom_payload.rs b/azalea-protocol/src/packets/config/c_custom_payload.rs index 19335264..03776bf9 100644 --- a/azalea-protocol/src/packets/config/c_custom_payload.rs +++ b/azalea-protocol/src/packets/config/c_custom_payload.rs @@ -1,9 +1,9 @@ use azalea_buf::{AzBuf, UnsizedByteArray}; -use azalea_core::resource_location::ResourceLocation; +use azalea_core::identifier::Identifier; use azalea_protocol_macros::ClientboundConfigPacket; #[derive(Clone, Debug, AzBuf, PartialEq, ClientboundConfigPacket)] pub struct ClientboundCustomPayload { - pub identifier: ResourceLocation, + pub identifier: Identifier, pub data: UnsizedByteArray, } diff --git a/azalea-protocol/src/packets/config/c_registry_data.rs b/azalea-protocol/src/packets/config/c_registry_data.rs index 18d2e73b..16a86a9f 100644 --- a/azalea-protocol/src/packets/config/c_registry_data.rs +++ b/azalea-protocol/src/packets/config/c_registry_data.rs @@ -1,10 +1,10 @@ use azalea_buf::AzBuf; -use azalea_core::resource_location::ResourceLocation; +use azalea_core::identifier::Identifier; use azalea_protocol_macros::ClientboundConfigPacket; use simdnbt::owned::NbtCompound; #[derive(Clone, Debug, AzBuf, PartialEq, ClientboundConfigPacket)] pub struct ClientboundRegistryData { - pub registry_id: ResourceLocation, - pub entries: Vec<(ResourceLocation, Option)>, + pub registry_id: Identifier, + pub entries: Vec<(Identifier, Option)>, } diff --git a/azalea-protocol/src/packets/config/c_store_cookie.rs b/azalea-protocol/src/packets/config/c_store_cookie.rs index 5fa03729..3d797d18 100644 --- a/azalea-protocol/src/packets/config/c_store_cookie.rs +++ b/azalea-protocol/src/packets/config/c_store_cookie.rs @@ -1,9 +1,9 @@ use azalea_buf::AzBuf; -use azalea_core::resource_location::ResourceLocation; +use azalea_core::identifier::Identifier; use azalea_protocol_macros::ClientboundConfigPacket; #[derive(Clone, Debug, AzBuf, PartialEq, ClientboundConfigPacket)] pub struct ClientboundStoreCookie { - pub key: ResourceLocation, + pub key: Identifier, pub payload: Vec, } diff --git a/azalea-protocol/src/packets/config/c_update_enabled_features.rs b/azalea-protocol/src/packets/config/c_update_enabled_features.rs index 7d86ceb4..b4e0e9c1 100644 --- a/azalea-protocol/src/packets/config/c_update_enabled_features.rs +++ b/azalea-protocol/src/packets/config/c_update_enabled_features.rs @@ -1,8 +1,8 @@ use azalea_buf::AzBuf; -use azalea_core::resource_location::ResourceLocation; +use azalea_core::identifier::Identifier; use azalea_protocol_macros::ClientboundConfigPacket; #[derive(Clone, Debug, AzBuf, PartialEq, ClientboundConfigPacket)] pub struct ClientboundUpdateEnabledFeatures { - pub features: Vec, + pub features: Vec, } diff --git a/azalea-protocol/src/packets/config/s_cookie_response.rs b/azalea-protocol/src/packets/config/s_cookie_response.rs index 590a651e..ae44953e 100644 --- a/azalea-protocol/src/packets/config/s_cookie_response.rs +++ b/azalea-protocol/src/packets/config/s_cookie_response.rs @@ -1,9 +1,9 @@ use azalea_buf::AzBuf; -use azalea_core::resource_location::ResourceLocation; +use azalea_core::identifier::Identifier; use azalea_protocol_macros::ServerboundConfigPacket; #[derive(Clone, Debug, AzBuf, PartialEq, ServerboundConfigPacket)] pub struct ServerboundCookieResponse { - pub key: ResourceLocation, + pub key: Identifier, pub payload: Option>, } diff --git a/azalea-protocol/src/packets/config/s_custom_click_action.rs b/azalea-protocol/src/packets/config/s_custom_click_action.rs index 0c33d635..21b5cfbb 100644 --- a/azalea-protocol/src/packets/config/s_custom_click_action.rs +++ b/azalea-protocol/src/packets/config/s_custom_click_action.rs @@ -1,10 +1,10 @@ use azalea_buf::AzBuf; -use azalea_core::resource_location::ResourceLocation; +use azalea_core::identifier::Identifier; use azalea_protocol_macros::ServerboundConfigPacket; use simdnbt::owned::Nbt; #[derive(Clone, Debug, AzBuf, PartialEq, ServerboundConfigPacket)] pub struct ServerboundCustomClickAction { - pub id: ResourceLocation, + pub id: Identifier, pub payload: Nbt, } diff --git a/azalea-protocol/src/packets/config/s_custom_payload.rs b/azalea-protocol/src/packets/config/s_custom_payload.rs index fec04fb5..1bdc85af 100644 --- a/azalea-protocol/src/packets/config/s_custom_payload.rs +++ b/azalea-protocol/src/packets/config/s_custom_payload.rs @@ -1,9 +1,9 @@ use azalea_buf::{AzBuf, UnsizedByteArray}; -use azalea_core::resource_location::ResourceLocation; +use azalea_core::identifier::Identifier; use azalea_protocol_macros::ServerboundConfigPacket; #[derive(Clone, Debug, AzBuf, PartialEq, ServerboundConfigPacket)] pub struct ServerboundCustomPayload { - pub identifier: ResourceLocation, + pub identifier: Identifier, pub data: UnsizedByteArray, } diff --git a/azalea-protocol/src/packets/game/c_add_entity.rs b/azalea-protocol/src/packets/game/c_add_entity.rs index fe473289..fbd2cb8a 100644 --- a/azalea-protocol/src/packets/game/c_add_entity.rs +++ b/azalea-protocol/src/packets/game/c_add_entity.rs @@ -1,5 +1,5 @@ use azalea_buf::AzBuf; -use azalea_core::{delta::LpVec3, position::Vec3, resource_location::ResourceLocation}; +use azalea_core::{delta::LpVec3, identifier::Identifier, position::Vec3}; use azalea_entity::{EntityBundle, metadata::apply_default_metadata}; use azalea_protocol_macros::ClientboundGamePacket; use azalea_world::MinecraftEntityId; @@ -34,7 +34,7 @@ impl ClientboundAddEntity { /// /// You must apply the metadata after inserting the bundle with /// [`Self::apply_metadata`]. - pub fn as_entity_bundle(&self, world_name: ResourceLocation) -> EntityBundle { + pub fn as_entity_bundle(&self, world_name: Identifier) -> EntityBundle { EntityBundle::new(self.uuid, self.position, self.entity_type, world_name) } diff --git a/azalea-protocol/src/packets/game/c_commands.rs b/azalea-protocol/src/packets/game/c_commands.rs index 303f8481..46be5613 100644 --- a/azalea-protocol/src/packets/game/c_commands.rs +++ b/azalea-protocol/src/packets/game/c_commands.rs @@ -1,7 +1,7 @@ use std::io::{self, Cursor, Write}; use azalea_buf::{AzBuf, AzaleaRead, AzaleaReadVar, AzaleaWrite, AzaleaWriteVar, BufReadError}; -use azalea_core::{bitset::FixedBitSet, resource_location::ResourceLocation}; +use azalea_core::{bitset::FixedBitSet, identifier::Identifier}; use azalea_protocol_macros::ClientboundGamePacket; use tracing::warn; @@ -131,7 +131,7 @@ pub enum BrigadierParser { Team, ItemSlot, ItemSlots, - ResourceLocation, + Identifier, Function, EntityAnchor, IntRange, @@ -139,11 +139,11 @@ pub enum BrigadierParser { Dimension, GameMode, Time { min: i32 }, - ResourceOrTag { registry_key: ResourceLocation }, - ResourceOrTagKey { registry_key: ResourceLocation }, - Resource { registry_key: ResourceLocation }, - ResourceKey { registry_key: ResourceLocation }, - ResourceSelector { registry_key: ResourceLocation }, + ResourceOrTag { registry_key: Identifier }, + ResourceOrTagKey { registry_key: Identifier }, + Resource { registry_key: Identifier }, + ResourceKey { registry_key: Identifier }, + ResourceSelector { registry_key: Identifier }, TemplateMirror, TemplateRotation, Heightmap, @@ -210,7 +210,7 @@ impl AzaleaRead for BrigadierNodeStub { let name = String::azalea_read(buf)?; let parser = BrigadierParser::azalea_read(buf)?; let suggestions_type = if has_suggestions_type { - Some(ResourceLocation::azalea_read(buf)?) + Some(Identifier::azalea_read(buf)?) } else { None }; @@ -318,7 +318,7 @@ pub enum NodeType { Argument { name: String, parser: BrigadierParser, - suggestions_type: Option, + suggestions_type: Option, }, } @@ -379,7 +379,7 @@ mod tests { node_type: NodeType::Argument { name: "position".to_string(), parser: BrigadierParser::Vec3, - suggestions_type: Some(ResourceLocation::new("minecraft:test_suggestion")), + suggestions_type: Some(Identifier::new("minecraft:test_suggestion")), }, is_restricted: false, }; diff --git a/azalea-protocol/src/packets/game/c_cookie_request.rs b/azalea-protocol/src/packets/game/c_cookie_request.rs index 06828aec..7b1e8e30 100644 --- a/azalea-protocol/src/packets/game/c_cookie_request.rs +++ b/azalea-protocol/src/packets/game/c_cookie_request.rs @@ -1,8 +1,8 @@ use azalea_buf::AzBuf; -use azalea_core::resource_location::ResourceLocation; +use azalea_core::identifier::Identifier; use azalea_protocol_macros::ClientboundGamePacket; #[derive(Clone, Debug, AzBuf, PartialEq, ClientboundGamePacket)] pub struct ClientboundCookieRequest { - pub key: ResourceLocation, + pub key: Identifier, } diff --git a/azalea-protocol/src/packets/game/c_custom_payload.rs b/azalea-protocol/src/packets/game/c_custom_payload.rs index 33c446c2..e76967a6 100644 --- a/azalea-protocol/src/packets/game/c_custom_payload.rs +++ b/azalea-protocol/src/packets/game/c_custom_payload.rs @@ -1,10 +1,9 @@ -use azalea_buf::AzBuf; -use azalea_buf::UnsizedByteArray; -use azalea_core::resource_location::ResourceLocation; +use azalea_buf::{AzBuf, UnsizedByteArray}; +use azalea_core::identifier::Identifier; use azalea_protocol_macros::ClientboundGamePacket; #[derive(Clone, Debug, AzBuf, PartialEq, ClientboundGamePacket)] pub struct ClientboundCustomPayload { - pub identifier: ResourceLocation, + pub identifier: Identifier, pub data: UnsizedByteArray, } diff --git a/azalea-protocol/src/packets/game/c_login.rs b/azalea-protocol/src/packets/game/c_login.rs index 61f553e3..1c89dbac 100644 --- a/azalea-protocol/src/packets/game/c_login.rs +++ b/azalea-protocol/src/packets/game/c_login.rs @@ -1,5 +1,5 @@ use azalea_buf::AzBuf; -use azalea_core::resource_location::ResourceLocation; +use azalea_core::identifier::Identifier; use azalea_protocol_macros::ClientboundGamePacket; use azalea_world::MinecraftEntityId; @@ -13,7 +13,7 @@ use crate::packets::common::CommonPlayerSpawnInfo; pub struct ClientboundLogin { pub player_id: MinecraftEntityId, pub hardcore: bool, - pub levels: Vec, + pub levels: Vec, #[var] pub max_players: i32, #[var] diff --git a/azalea-protocol/src/packets/game/c_select_advancements_tab.rs b/azalea-protocol/src/packets/game/c_select_advancements_tab.rs index ec390ce5..0eee09de 100644 --- a/azalea-protocol/src/packets/game/c_select_advancements_tab.rs +++ b/azalea-protocol/src/packets/game/c_select_advancements_tab.rs @@ -1,8 +1,8 @@ use azalea_buf::AzBuf; -use azalea_core::resource_location::ResourceLocation; +use azalea_core::identifier::Identifier; use azalea_protocol_macros::ClientboundGamePacket; #[derive(Clone, Debug, AzBuf, PartialEq, ClientboundGamePacket)] pub struct ClientboundSelectAdvancementsTab { - pub tab: Option, + pub tab: Option, } diff --git a/azalea-protocol/src/packets/game/c_stop_sound.rs b/azalea-protocol/src/packets/game/c_stop_sound.rs index 70f3c424..f6b42325 100644 --- a/azalea-protocol/src/packets/game/c_stop_sound.rs +++ b/azalea-protocol/src/packets/game/c_stop_sound.rs @@ -1,7 +1,7 @@ use std::io::{self, Cursor, Write}; use azalea_buf::{AzaleaRead, AzaleaWrite, BufReadError}; -use azalea_core::{bitset::FixedBitSet, resource_location::ResourceLocation}; +use azalea_core::{bitset::FixedBitSet, identifier::Identifier}; use azalea_protocol_macros::ClientboundGamePacket; use super::c_sound::SoundSource; @@ -9,7 +9,7 @@ use super::c_sound::SoundSource; #[derive(Clone, Debug, PartialEq, ClientboundGamePacket)] pub struct ClientboundStopSound { pub source: Option, - pub name: Option, + pub name: Option, } impl AzaleaRead for ClientboundStopSound { @@ -21,7 +21,7 @@ impl AzaleaRead for ClientboundStopSound { None }; let name = if set.index(1) { - Some(ResourceLocation::azalea_read(buf)?) + Some(Identifier::azalea_read(buf)?) } else { None }; diff --git a/azalea-protocol/src/packets/game/c_store_cookie.rs b/azalea-protocol/src/packets/game/c_store_cookie.rs index 0b48ed0e..9646c3b9 100644 --- a/azalea-protocol/src/packets/game/c_store_cookie.rs +++ b/azalea-protocol/src/packets/game/c_store_cookie.rs @@ -1,9 +1,9 @@ use azalea_buf::AzBuf; -use azalea_core::resource_location::ResourceLocation; +use azalea_core::identifier::Identifier; use azalea_protocol_macros::ClientboundGamePacket; #[derive(Clone, Debug, AzBuf, PartialEq, ClientboundGamePacket)] pub struct ClientboundStoreCookie { - pub key: ResourceLocation, + pub key: Identifier, pub payload: Vec, } diff --git a/azalea-protocol/src/packets/game/c_update_advancements.rs b/azalea-protocol/src/packets/game/c_update_advancements.rs index d1b1fa80..7296d916 100644 --- a/azalea-protocol/src/packets/game/c_update_advancements.rs +++ b/azalea-protocol/src/packets/game/c_update_advancements.rs @@ -5,7 +5,7 @@ use std::{ use azalea_buf::AzBuf; use azalea_chat::FormattedText; -use azalea_core::resource_location::ResourceLocation; +use azalea_core::identifier::Identifier; use azalea_inventory::ItemStack; use azalea_protocol_macros::ClientboundGamePacket; use indexmap::IndexMap; @@ -14,14 +14,14 @@ use indexmap::IndexMap; pub struct ClientboundUpdateAdvancements { pub reset: bool, pub added: Vec, - pub removed: Vec, - pub progress: IndexMap, + pub removed: Vec, + pub progress: IndexMap, pub show_advancements: bool, } #[derive(Clone, Debug, AzBuf, PartialEq)] pub struct Advancement { - pub parent_id: Option, + pub parent_id: Option, pub display: Option, pub requirements: Vec>, pub sends_telemetry_event: bool, @@ -35,7 +35,7 @@ pub struct DisplayInfo { pub frame: FrameType, pub show_toast: bool, pub hidden: bool, - pub background: Option, + pub background: Option, pub x: f32, pub y: f32, } @@ -80,7 +80,7 @@ impl azalea_buf::AzaleaRead for DisplayInfo { let hidden = (data & 0b100) != 0; let background = if has_background { - Some(ResourceLocation::azalea_read(buf)?) + Some(Identifier::azalea_read(buf)?) } else { None }; @@ -116,7 +116,7 @@ pub struct CriterionProgress { #[derive(Clone, Debug, AzBuf, PartialEq)] pub struct AdvancementHolder { - pub id: ResourceLocation, + pub id: Identifier, pub value: Advancement, } @@ -131,7 +131,7 @@ mod tests { let packet = ClientboundUpdateAdvancements { reset: true, added: [AdvancementHolder { - id: ResourceLocation::new("minecraft:test"), + id: Identifier::new("minecraft:test"), value: Advancement { parent_id: None, display: Some(DisplayInfo { @@ -151,9 +151,9 @@ mod tests { }] .into_iter() .collect(), - removed: vec![ResourceLocation::new("minecraft:test2")], + removed: vec![Identifier::new("minecraft:test2")], progress: [( - ResourceLocation::new("minecraft:test3"), + Identifier::new("minecraft:test3"), [( "minecraft:test4".to_string(), CriterionProgress { @@ -180,7 +180,7 @@ mod tests { .added .into_iter() .find_map(|a| { - if a.id == ResourceLocation::new("minecraft:test") { + if a.id == Identifier::new("minecraft:test") { Some(a.value) } else { None @@ -192,7 +192,7 @@ mod tests { .added .into_iter() .find_map(|a| { - if a.id == ResourceLocation::new("minecraft:test") { + if a.id == Identifier::new("minecraft:test") { Some(a.value) } else { None diff --git a/azalea-protocol/src/packets/game/c_update_recipes.rs b/azalea-protocol/src/packets/game/c_update_recipes.rs index c425622e..e05708a3 100644 --- a/azalea-protocol/src/packets/game/c_update_recipes.rs +++ b/azalea-protocol/src/packets/game/c_update_recipes.rs @@ -1,14 +1,14 @@ use std::collections::HashMap; use azalea_buf::AzBuf; -use azalea_core::resource_location::ResourceLocation; +use azalea_core::identifier::Identifier; use azalea_protocol_macros::ClientboundGamePacket; use crate::common::recipe::{Ingredient, SlotDisplayData}; #[derive(Clone, Debug, AzBuf, PartialEq, ClientboundGamePacket)] pub struct ClientboundUpdateRecipes { - pub item_sets: HashMap, + pub item_sets: HashMap, pub stonecutter_recipes: Vec, } diff --git a/azalea-protocol/src/packets/game/c_waypoint.rs b/azalea-protocol/src/packets/game/c_waypoint.rs index d7c6ad91..0debb0d0 100644 --- a/azalea-protocol/src/packets/game/c_waypoint.rs +++ b/azalea-protocol/src/packets/game/c_waypoint.rs @@ -1,7 +1,7 @@ use std::io::{self, Cursor, Write}; use azalea_buf::{AzBuf, AzaleaRead, AzaleaWrite, BufReadError}; -use azalea_core::{color::RgbColor, position::Vec3i, resource_location::ResourceLocation}; +use azalea_core::{color::RgbColor, identifier::Identifier, position::Vec3i}; use azalea_protocol_macros::ClientboundGamePacket; use uuid::Uuid; @@ -33,7 +33,7 @@ pub enum WaypointIdentifier { #[derive(Clone, Debug, PartialEq)] pub struct WaypointIcon { - pub style: ResourceLocation, + pub style: Identifier, pub color: Option, } impl AzaleaWrite for WaypointIcon { @@ -50,7 +50,7 @@ impl AzaleaWrite for WaypointIcon { } impl AzaleaRead for WaypointIcon { fn azalea_read(buf: &mut Cursor<&[u8]>) -> Result { - let style = ResourceLocation::azalea_read(buf)?; + let style = Identifier::azalea_read(buf)?; let color = Option::::azalea_read(buf)?; let color = color.map(|c| RgbColor::new(c.r, c.g, c.b)); diff --git a/azalea-protocol/src/packets/game/s_cookie_response.rs b/azalea-protocol/src/packets/game/s_cookie_response.rs index fd6b8a51..a6a99cf7 100644 --- a/azalea-protocol/src/packets/game/s_cookie_response.rs +++ b/azalea-protocol/src/packets/game/s_cookie_response.rs @@ -1,9 +1,9 @@ use azalea_buf::AzBuf; -use azalea_core::resource_location::ResourceLocation; +use azalea_core::identifier::Identifier; use azalea_protocol_macros::ServerboundGamePacket; #[derive(Clone, Debug, AzBuf, PartialEq, ServerboundGamePacket)] pub struct ServerboundCookieResponse { - pub key: ResourceLocation, + pub key: Identifier, pub payload: Option>, } diff --git a/azalea-protocol/src/packets/game/s_custom_click_action.rs b/azalea-protocol/src/packets/game/s_custom_click_action.rs index 338137c4..193405df 100644 --- a/azalea-protocol/src/packets/game/s_custom_click_action.rs +++ b/azalea-protocol/src/packets/game/s_custom_click_action.rs @@ -1,10 +1,10 @@ use azalea_buf::AzBuf; -use azalea_core::resource_location::ResourceLocation; +use azalea_core::identifier::Identifier; use azalea_protocol_macros::ServerboundGamePacket; use simdnbt::owned::Nbt; #[derive(Clone, Debug, AzBuf, PartialEq, ServerboundGamePacket)] pub struct ServerboundCustomClickAction { - pub id: ResourceLocation, + pub id: Identifier, pub payload: Nbt, } diff --git a/azalea-protocol/src/packets/game/s_custom_payload.rs b/azalea-protocol/src/packets/game/s_custom_payload.rs index 1f2897e2..8753c7f7 100644 --- a/azalea-protocol/src/packets/game/s_custom_payload.rs +++ b/azalea-protocol/src/packets/game/s_custom_payload.rs @@ -1,10 +1,9 @@ -use azalea_buf::AzBuf; -use azalea_buf::UnsizedByteArray; -use azalea_core::resource_location::ResourceLocation; +use azalea_buf::{AzBuf, UnsizedByteArray}; +use azalea_core::identifier::Identifier; use azalea_protocol_macros::ServerboundGamePacket; #[derive(Clone, Debug, AzBuf, PartialEq, ServerboundGamePacket)] pub struct ServerboundCustomPayload { - pub identifier: ResourceLocation, + pub identifier: Identifier, pub data: UnsizedByteArray, } diff --git a/azalea-protocol/src/packets/game/s_place_recipe.rs b/azalea-protocol/src/packets/game/s_place_recipe.rs index fe56cd96..a1f007a0 100644 --- a/azalea-protocol/src/packets/game/s_place_recipe.rs +++ b/azalea-protocol/src/packets/game/s_place_recipe.rs @@ -1,11 +1,11 @@ use azalea_buf::AzBuf; -use azalea_core::resource_location::ResourceLocation; +use azalea_core::identifier::Identifier; use azalea_protocol_macros::ServerboundGamePacket; #[derive(Clone, Debug, AzBuf, PartialEq, ServerboundGamePacket)] pub struct ServerboundPlaceRecipe { #[var] pub container_id: i32, - pub recipe: ResourceLocation, + pub recipe: Identifier, pub shift_down: bool, } diff --git a/azalea-protocol/src/packets/game/s_recipe_book_seen_recipe.rs b/azalea-protocol/src/packets/game/s_recipe_book_seen_recipe.rs index 7fa1da45..350c7290 100644 --- a/azalea-protocol/src/packets/game/s_recipe_book_seen_recipe.rs +++ b/azalea-protocol/src/packets/game/s_recipe_book_seen_recipe.rs @@ -1,8 +1,8 @@ use azalea_buf::AzBuf; -use azalea_core::resource_location::ResourceLocation; +use azalea_core::identifier::Identifier; use azalea_protocol_macros::ServerboundGamePacket; #[derive(Clone, Debug, AzBuf, PartialEq, ServerboundGamePacket)] pub struct ServerboundRecipeBookSeenRecipe { - pub recipe: ResourceLocation, + pub recipe: Identifier, } diff --git a/azalea-protocol/src/packets/game/s_seen_advancements.rs b/azalea-protocol/src/packets/game/s_seen_advancements.rs index 1c502568..7d9e552b 100644 --- a/azalea-protocol/src/packets/game/s_seen_advancements.rs +++ b/azalea-protocol/src/packets/game/s_seen_advancements.rs @@ -1,7 +1,7 @@ use std::io::{self, Cursor, Write}; use azalea_buf::{AzBuf, AzaleaRead, AzaleaWrite}; -use azalea_core::resource_location::ResourceLocation; +use azalea_core::identifier::Identifier; use azalea_protocol_macros::ServerboundGamePacket; use crate::packets::BufReadError; @@ -9,7 +9,7 @@ use crate::packets::BufReadError; #[derive(Clone, Debug, PartialEq, ServerboundGamePacket)] pub struct ServerboundSeenAdvancements { pub action: Action, - pub tab: Option, + pub tab: Option, } #[derive(AzBuf, Clone, Copy, Debug, Eq, PartialEq)] @@ -22,7 +22,7 @@ impl AzaleaRead for ServerboundSeenAdvancements { fn azalea_read(buf: &mut Cursor<&[u8]>) -> Result { let action = Action::azalea_read(buf)?; let tab = if action == Action::OpenedTab { - Some(ResourceLocation::azalea_read(buf)?) + Some(Identifier::azalea_read(buf)?) } else { None }; diff --git a/azalea-protocol/src/packets/game/s_set_jigsaw_block.rs b/azalea-protocol/src/packets/game/s_set_jigsaw_block.rs index 8999faf4..ac942d88 100644 --- a/azalea-protocol/src/packets/game/s_set_jigsaw_block.rs +++ b/azalea-protocol/src/packets/game/s_set_jigsaw_block.rs @@ -4,7 +4,7 @@ use std::{ }; use azalea_buf::{AzBuf, AzaleaRead}; -use azalea_core::{position::BlockPos, resource_location::ResourceLocation}; +use azalea_core::{identifier::Identifier, position::BlockPos}; use azalea_protocol_macros::ServerboundGamePacket; use crate::packets::{AzaleaWrite, BufReadError}; @@ -12,9 +12,9 @@ use crate::packets::{AzaleaWrite, BufReadError}; #[derive(Clone, Debug, AzBuf, PartialEq, ServerboundGamePacket)] pub struct ServerboundSetJigsawBlock { pub pos: BlockPos, - pub name: ResourceLocation, - pub target: ResourceLocation, - pub pool: ResourceLocation, + pub name: Identifier, + pub target: Identifier, + pub pool: Identifier, pub final_state: String, pub joint: String, #[var] diff --git a/azalea-protocol/src/packets/login/c_cookie_request.rs b/azalea-protocol/src/packets/login/c_cookie_request.rs index 2574d718..fbe72c6a 100644 --- a/azalea-protocol/src/packets/login/c_cookie_request.rs +++ b/azalea-protocol/src/packets/login/c_cookie_request.rs @@ -1,8 +1,8 @@ use azalea_buf::AzBuf; -use azalea_core::resource_location::ResourceLocation; +use azalea_core::identifier::Identifier; use azalea_protocol_macros::ClientboundLoginPacket; #[derive(Clone, Debug, AzBuf, PartialEq, ClientboundLoginPacket)] pub struct ClientboundCookieRequest { - pub key: ResourceLocation, + pub key: Identifier, } diff --git a/azalea-protocol/src/packets/login/c_custom_query.rs b/azalea-protocol/src/packets/login/c_custom_query.rs index c74d6e21..9c7ee50a 100644 --- a/azalea-protocol/src/packets/login/c_custom_query.rs +++ b/azalea-protocol/src/packets/login/c_custom_query.rs @@ -1,13 +1,13 @@ use std::hash::Hash; use azalea_buf::{AzBuf, UnsizedByteArray}; -use azalea_core::resource_location::ResourceLocation; +use azalea_core::identifier::Identifier; use azalea_protocol_macros::ClientboundLoginPacket; #[derive(Hash, Clone, Debug, AzBuf, PartialEq, ClientboundLoginPacket)] pub struct ClientboundCustomQuery { #[var] pub transaction_id: u32, - pub identifier: ResourceLocation, + pub identifier: Identifier, pub data: UnsizedByteArray, } diff --git a/azalea-protocol/src/packets/login/s_cookie_response.rs b/azalea-protocol/src/packets/login/s_cookie_response.rs index 8a7af784..c9e7ced9 100644 --- a/azalea-protocol/src/packets/login/s_cookie_response.rs +++ b/azalea-protocol/src/packets/login/s_cookie_response.rs @@ -1,9 +1,9 @@ use azalea_buf::AzBuf; -use azalea_core::resource_location::ResourceLocation; +use azalea_core::identifier::Identifier; use azalea_protocol_macros::ServerboundLoginPacket; #[derive(Clone, Debug, AzBuf, PartialEq, ServerboundLoginPacket)] pub struct ServerboundCookieResponse { - pub key: ResourceLocation, + pub key: Identifier, pub payload: Option>, } -- cgit v1.2.3