aboutsummaryrefslogtreecommitdiff
path: root/azalea-client/src/client.rs
diff options
context:
space:
mode:
authormat <git@matdoes.dev>2025-02-21 22:50:19 +0000
committermat <git@matdoes.dev>2025-02-21 22:50:39 +0000
commit27945c8870c832970dfe15b9bf9f567c0ad96ea4 (patch)
tree08c6598d52ac379505ec556ffb7d40aec5dcb3d8 /azalea-client/src/client.rs
parentf5f15362f2cb48088eb8ccf80988f994fecd81c9 (diff)
downloadazalea-drasl-27945c8870c832970dfe15b9bf9f567c0ad96ea4.tar.xz
despawn entities when switching worlds and some testbot fixes
Diffstat (limited to 'azalea-client/src/client.rs')
-rw-r--r--azalea-client/src/client.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/azalea-client/src/client.rs b/azalea-client/src/client.rs
index c81f6f28..131aef16 100644
--- a/azalea-client/src/client.rs
+++ b/azalea-client/src/client.rs
@@ -555,6 +555,11 @@ impl Client {
self.query::<Option<&T>>(&mut self.ecs.lock()).cloned()
}
+ /// Get a resource from the ECS. This will clone the resource and return it.
+ pub fn resource<T: Resource + Clone>(&self) -> T {
+ self.ecs.lock().resource::<T>().clone()
+ }
+
/// Get a required component for this client and call the given function.
///
/// Similar to [`Self::component`], but doesn't clone the component since