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-entity/src/attributes.rs | 16 ++++++++-------- azalea-entity/src/lib.rs | 4 ++-- 2 files changed, 10 insertions(+), 10 deletions(-) (limited to 'azalea-entity/src') diff --git a/azalea-entity/src/attributes.rs b/azalea-entity/src/attributes.rs index 75423746..ca02e639 100644 --- a/azalea-entity/src/attributes.rs +++ b/azalea-entity/src/attributes.rs @@ -3,7 +3,7 @@ use std::collections::{HashMap, hash_map}; use azalea_buf::AzBuf; -use azalea_core::resource_location::ResourceLocation; +use azalea_core::identifier::Identifier; use bevy_ecs::component::Component; use thiserror::Error; @@ -23,7 +23,7 @@ pub struct Attributes { #[derive(Clone, Debug)] pub struct AttributeInstance { pub base: f64, - modifiers_by_id: HashMap, + modifiers_by_id: HashMap, // TODO: add cache } @@ -73,14 +73,14 @@ impl AttributeInstance { /// Remove the modifier with the given ID from this attribute, returning /// the previous modifier is present. - pub fn remove(&mut self, id: &ResourceLocation) -> Option { + pub fn remove(&mut self, id: &Identifier) -> Option { self.modifiers_by_id.remove(id) } } #[derive(Clone, Debug, AzBuf, PartialEq)] pub struct AttributeModifier { - pub id: ResourceLocation, + pub id: Identifier, pub amount: f64, pub operation: AttributeModifierOperation, } @@ -94,21 +94,21 @@ pub enum AttributeModifierOperation { pub fn sprinting_modifier() -> AttributeModifier { AttributeModifier { - id: ResourceLocation::new("sprinting"), + id: Identifier::new("sprinting"), amount: 0.3f32 as f64, operation: AttributeModifierOperation::AddMultipliedTotal, } } pub fn base_attack_speed_modifier(amount: f64) -> AttributeModifier { AttributeModifier { - id: ResourceLocation::new("base_attack_speed"), + id: Identifier::new("base_attack_speed"), amount, operation: AttributeModifierOperation::AddValue, } } pub fn creative_block_interaction_range_modifier() -> AttributeModifier { AttributeModifier { - id: ResourceLocation::new("creative_mode_block_range"), + id: Identifier::new("creative_mode_block_range"), amount: 0.5, operation: AttributeModifierOperation::AddValue, } @@ -116,7 +116,7 @@ pub fn creative_block_interaction_range_modifier() -> AttributeModifier { pub fn creative_entity_interaction_range_modifier() -> AttributeModifier { AttributeModifier { - id: ResourceLocation::new("creative_mode_entity_range"), + id: Identifier::new("creative_mode_entity_range"), amount: 2.0, operation: AttributeModifierOperation::AddValue, } diff --git a/azalea-entity/src/lib.rs b/azalea-entity/src/lib.rs index 1f9e426e..927b4637 100644 --- a/azalea-entity/src/lib.rs +++ b/azalea-entity/src/lib.rs @@ -22,9 +22,9 @@ use azalea_block::{BlockState, fluid_state::FluidKind}; use azalea_buf::AzBuf; use azalea_core::{ aabb::Aabb, + identifier::Identifier, math, position::{BlockPos, ChunkPos, Vec3}, - resource_location::ResourceLocation, }; use azalea_registry::EntityKind; use azalea_world::{ChunkStorage, InstanceName}; @@ -496,7 +496,7 @@ impl EntityBundle { uuid: Uuid, pos: Vec3, kind: azalea_registry::EntityKind, - world_name: ResourceLocation, + world_name: Identifier, ) -> Self { let dimensions = EntityDimensions::from(kind); -- cgit v1.2.3