diff options
| author | mat <git@matdoes.dev> | 2025-01-12 05:07:53 +0000 |
|---|---|---|
| committer | mat <git@matdoes.dev> | 2025-01-12 05:07:53 +0000 |
| commit | 608ccb8e54454460a1b41a456f99b16d70fb5913 (patch) | |
| tree | 763c879fd83e64d946a6a7d210eed995b8aaf5de /azalea-entity/src/plugin/mod.rs | |
| parent | a5cb21f039ab2aa08b8f78a86d3924479c1bbe33 (diff) | |
| download | azalea-drasl-608ccb8e54454460a1b41a456f99b16d70fb5913.tar.xz | |
fix panic on bot disconnect
Diffstat (limited to 'azalea-entity/src/plugin/mod.rs')
| -rw-r--r-- | azalea-entity/src/plugin/mod.rs | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/azalea-entity/src/plugin/mod.rs b/azalea-entity/src/plugin/mod.rs index 52178c7b..e8889637 100644 --- a/azalea-entity/src/plugin/mod.rs +++ b/azalea-entity/src/plugin/mod.rs @@ -4,7 +4,10 @@ mod relative_updates; use std::collections::HashSet; use azalea_block::{fluid_state::FluidKind, BlockState}; -use azalea_core::position::{BlockPos, ChunkPos, Vec3}; +use azalea_core::{ + position::{BlockPos, ChunkPos, Vec3}, + tick::GameTick, +}; use azalea_world::{InstanceContainer, InstanceName, MinecraftEntityId}; use bevy_app::{App, Plugin, PreUpdate, Update}; use bevy_ecs::prelude::*; @@ -59,7 +62,7 @@ impl Plugin for EntityPlugin { ), ) .add_systems(Update, update_bounding_box) - .add_systems(PreUpdate, update_in_loaded_chunk) + .add_systems(GameTick, update_in_loaded_chunk) .init_resource::<EntityUuidIndex>(); } } @@ -215,6 +218,7 @@ pub fn update_in_loaded_chunk( for (entity, instance_name, position) in &query { let player_chunk_pos = ChunkPos::from(position); let Some(instance_lock) = instance_container.get(instance_name) else { + commands.entity(entity).remove::<InLoadedChunk>(); continue; }; |
