From 75efbc83fdc4a47f880e95259a339d41839af01a Mon Sep 17 00:00:00 2001 From: mat Date: Wed, 19 Mar 2025 21:35:47 +0000 Subject: make SendPacketEvent a bevy trigger --- azalea-client/src/test_simulation.rs | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'azalea-client/src/test_simulation.rs') diff --git a/azalea-client/src/test_simulation.rs b/azalea-client/src/test_simulation.rs index 564db0cf..0f34c14e 100644 --- a/azalea-client/src/test_simulation.rs +++ b/azalea-client/src/test_simulation.rs @@ -113,6 +113,15 @@ impl Simulation { pub fn has_component(&self) -> bool { self.app.world().get::(self.entity).is_some() } + pub fn resource(&self) -> T { + self.app.world().get_resource::().unwrap().clone() + } + pub fn with_resource(&self, f: impl FnOnce(&T)) { + f(self.app.world().get_resource::().unwrap()); + } + pub fn with_resource_mut(&mut self, f: impl FnOnce(Mut)) { + f(self.app.world_mut().get_resource_mut::().unwrap()); + } pub fn chunk(&self, chunk_pos: ChunkPos) -> Option>> { self.component::() -- cgit v1.2.3