diff options
| author | mat <git@matdoes.dev> | 2025-02-21 22:50:19 +0000 |
|---|---|---|
| committer | mat <git@matdoes.dev> | 2025-02-21 22:50:39 +0000 |
| commit | 27945c8870c832970dfe15b9bf9f567c0ad96ea4 (patch) | |
| tree | 08c6598d52ac379505ec556ffb7d40aec5dcb3d8 /azalea-client/src/client.rs | |
| parent | f5f15362f2cb48088eb8ccf80988f994fecd81c9 (diff) | |
| download | azalea-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.rs | 5 |
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 |
