Send mob door cracks to nearby players
This commit is contained in:
@@ -1056,6 +1056,25 @@ impl Game<'_> {
|
||||
}
|
||||
MobEvent::DestroyProgress { mob, pos, progress } => {
|
||||
self.destroy_block_progress(mob as i32, pos, progress);
|
||||
// ServerLevel.destroyBlockProgress: every player nearby sees it.
|
||||
if let Some(host) = self.lan.as_ref() {
|
||||
host.hub.broadcast_near(
|
||||
[f64::from(pos[0]), f64::from(pos[1]), f64::from(pos[2])],
|
||||
64.0,
|
||||
&horizon_protocol::packets::play::Clientbound::BlockDestruction(
|
||||
horizon_protocol::packets::play::BlockDestruction {
|
||||
id: mob as i32,
|
||||
pos,
|
||||
progress: if (0..10).contains(&progress) {
|
||||
progress as u8
|
||||
} else {
|
||||
255
|
||||
},
|
||||
},
|
||||
),
|
||||
None,
|
||||
);
|
||||
}
|
||||
}
|
||||
MobEvent::LevelEvent { id, pos, data } => self.level_event_at(id, pos, data),
|
||||
MobEvent::SetBlockName { pos, name, effect } => {
|
||||
|
||||
Reference in New Issue
Block a user