aboutsummaryrefslogtreecommitdiff
path: root/azalea/src/entity_ref
diff options
context:
space:
mode:
authormat <27899617+mat-1@users.noreply.github.com>2026-01-13 10:51:30 -0600
committerGitHub <noreply@github.com>2026-01-13 10:51:30 -0600
commitd5fa5e32b37754b3b5c136e58821e48cd3b7c2ff (patch)
treeea04702f96ad170fb1d90e5ed2dc875ae8166495 /azalea/src/entity_ref
parentefb36d5fc0fe56a98f5795c53dfa109887cd5aae (diff)
downloadazalea-drasl-d5fa5e32b37754b3b5c136e58821e48cd3b7c2ff.tar.xz
Rename Instance to World (#304)
Diffstat (limited to 'azalea/src/entity_ref')
-rw-r--r--azalea/src/entity_ref/mod.rs4
-rw-r--r--azalea/src/entity_ref/shared_impls.rs24
2 files changed, 18 insertions, 10 deletions
diff --git a/azalea/src/entity_ref/mod.rs b/azalea/src/entity_ref/mod.rs
index d604fe00..e09852c1 100644
--- a/azalea/src/entity_ref/mod.rs
+++ b/azalea/src/entity_ref/mod.rs
@@ -57,9 +57,9 @@ impl EntityRef {
/// # Examples
///
/// ```
- /// # use azalea_world::InstanceName;
+ /// # use azalea_world::WorldName;
/// # fn example(client: &azalea::Client) {
- /// let world_name = client.component::<InstanceName>();
+ /// let world_name = client.component::<WorldName>();
/// # }
pub fn component<T: Component>(&self) -> MappedRwLockReadGuard<'_, T> {
self.client.entity_component(self.entity)
diff --git a/azalea/src/entity_ref/shared_impls.rs b/azalea/src/entity_ref/shared_impls.rs
index f6aa332e..79396f56 100644
--- a/azalea/src/entity_ref/shared_impls.rs
+++ b/azalea/src/entity_ref/shared_impls.rs
@@ -2,7 +2,7 @@ use azalea_core::{entity_id::MinecraftEntityId, position::Vec3};
use azalea_entity::{
Attributes, Dead, EntityUuid, Physics, Position, dimensions::EntityDimensions, metadata::Health,
};
-use azalea_world::InstanceName;
+use azalea_world::WorldName;
use uuid::Uuid;
use super::EntityRef;
@@ -141,21 +141,29 @@ impl_entity_functions! {
}
Client:
- /// Get the name of the instance (world) that the bot is in.
+ #[deprecated = "renamed to `world_name`."]
+ EntityRef:
+ #[deprecated = "renamed to `world_name`."]
+ pub fn instance_name(&self) -> WorldName {
+ self.world_name()
+ }
+
+ Client:
+ /// Get the name of the world that the bot is in.
///
/// This can be used to check if the client is in the same world as another
/// entity.
- #[doc(alias("world_name", "dimension_name"))]
+ #[doc(alias("dimension_name"))]
EntityRef:
- /// Get the name of the instance (world) that the entity is in.
+ /// Get the name of the world that the entity is in.
///
/// This can be used to check if the entity is in the same world as another
/// entity.
///
- /// Also see [`Client::instance_name`],
- #[doc(alias("world_name", "dimension_name"))]
- pub fn instance_name(&self) -> InstanceName {
- (*self.component::<InstanceName>()).clone()
+ /// Also see [`Client::world_name`],
+ #[doc(alias("dimension_name"))]
+ pub fn world_name(&self) -> WorldName {
+ (*self.component::<WorldName>()).clone()
}
Client: