You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jul 1, 2024. It is now read-only.
ensure there is a line of sight
loop {
sleep_ticks(&mut server_msg_rcvr, 1).await;
let chunk = self_position.chunk_column();
let player_positions = h.world.observe_entities(chunk, |entity| {
let network_entity = entity.to_network().unwrap();
TryAsEntityRef::<Player>::try_as_entity_ref(entity).map(|player| {
(player.get_entity().position.clone(), network_entity)
})
}).await;
let target_object = CollisionShape {
x1: target_position.x - network_entity.width() as f64 / 2.0,
y1: target_position.y,
z1: target_position.z - network_entity.width() as f64 / 2.0,
x2: target_position.x + network_entity.width() as f64 / 2.0,
y2: target_position.y + network_entity.height() as f64,
z2: target_position.z + network_entity.width() as f64 / 2.0,
};
let mut translation = Translation {
x: target_position.x - self_position.x,
y: target_position.y - self_position.y,
z: target_position.z - self_position.z,
};
translation.set_norm(ZOMBIE_SPEED);
e.get_entity_mut().position += authorized_translation;
(e.get_entity().position.clone(), EntityChanges::position())
}).await;
self_position = match new_pos {
Some(pos) => pos,
None => break,
};
minecraft-protocol/minecraft-server/src/entities/monsters/zombies.rs
Line 84 in ec83b94
The text was updated successfully, but these errors were encountered: