mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-21 03:59:43 +00:00
fixed hurt sound playing when spawning player
This commit is contained in:
parent
6e6dc3eb4c
commit
053ac5abb9
2 changed files with 3 additions and 3 deletions
|
|
@ -1534,7 +1534,7 @@ class Entity extends Position
|
|||
return $damage;
|
||||
}
|
||||
|
||||
public function setHealth($health, $cause = "generic", $force = false)
|
||||
public function setHealth($health, $cause = "generic", $force = false, $allowHarm = true)
|
||||
{
|
||||
$health = (int) $health;
|
||||
$harm = false;
|
||||
|
|
@ -1558,7 +1558,7 @@ class Entity extends Position
|
|||
"cause" => $cause
|
||||
)) !== false or $force === true){
|
||||
$this->health = min(127, max(- 127, $health));
|
||||
if($harm === true){
|
||||
if($harm === true && $allowHarm){
|
||||
$pk = new EntityEventPacket;
|
||||
$pk->eid = $this->eid;
|
||||
$pk->event = EntityEventPacket::ENTITY_DAMAGE;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue