mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-21 12:09:43 +00:00
fix player damage sound
This commit is contained in:
parent
53c79a6691
commit
619fa75275
1 changed files with 9 additions and 0 deletions
|
|
@ -1475,6 +1475,15 @@ class Entity extends Position
|
|||
$pk = new EntityEventPacket;
|
||||
$pk->eid = $this->eid;
|
||||
$pk->event = EntityEventPacket::ENTITY_DAMAGE;
|
||||
foreach($this->level->players as $p){
|
||||
if(($p->entity instanceof Entity) && $p->entity->eid == $this->eid){
|
||||
$pk2 = clone $pk;
|
||||
$pk2->eid = 0;
|
||||
$p->dataPacket($pk2);
|
||||
}else{
|
||||
$p->dataPacket(clone $pk);
|
||||
}
|
||||
}
|
||||
$this->server->api->player->broadcastPacket($this->level->players, $pk);
|
||||
}
|
||||
if($this->player instanceof Player){
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue