mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-22 00:33:59 +00:00
Fixed #1584 duplicated death messages
This commit is contained in:
parent
1f882f42d3
commit
9604907566
@ -2119,6 +2119,9 @@ class Player extends Human implements CommandSender, InventoryHolder, IPlayer{
|
||||
}
|
||||
|
||||
public function kill(){
|
||||
if($this->dead or $this->spawned === false){
|
||||
return;
|
||||
}
|
||||
parent::kill();
|
||||
$message = $this->getName() ." died";
|
||||
$cause = $this->getLastDamageCause();
|
||||
|
@ -957,6 +957,9 @@ abstract class Entity extends Position implements Metadatable{
|
||||
}
|
||||
|
||||
public function kill(){
|
||||
if($this->dead){
|
||||
return;
|
||||
}
|
||||
$this->setHealth(0);
|
||||
$this->dead = true;
|
||||
$this->scheduleUpdate();
|
||||
|
@ -84,6 +84,9 @@ abstract class Living extends Entity implements Damageable{
|
||||
}
|
||||
|
||||
public function kill(){
|
||||
if($this->dead){
|
||||
return;
|
||||
}
|
||||
parent::kill();
|
||||
$this->server->getPluginManager()->callEvent($ev = new EntityDeathEvent($this, $this->getDrops()));
|
||||
foreach($ev->getDrops() as $item){
|
||||
|
Loading…
x
Reference in New Issue
Block a user