mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-15 07:55:31 +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(){
|
public function kill(){
|
||||||
|
if($this->dead or $this->spawned === false){
|
||||||
|
return;
|
||||||
|
}
|
||||||
parent::kill();
|
parent::kill();
|
||||||
$message = $this->getName() ." died";
|
$message = $this->getName() ." died";
|
||||||
$cause = $this->getLastDamageCause();
|
$cause = $this->getLastDamageCause();
|
||||||
|
@ -957,6 +957,9 @@ abstract class Entity extends Position implements Metadatable{
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function kill(){
|
public function kill(){
|
||||||
|
if($this->dead){
|
||||||
|
return;
|
||||||
|
}
|
||||||
$this->setHealth(0);
|
$this->setHealth(0);
|
||||||
$this->dead = true;
|
$this->dead = true;
|
||||||
$this->scheduleUpdate();
|
$this->scheduleUpdate();
|
||||||
|
@ -84,6 +84,9 @@ abstract class Living extends Entity implements Damageable{
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function kill(){
|
public function kill(){
|
||||||
|
if($this->dead){
|
||||||
|
return;
|
||||||
|
}
|
||||||
parent::kill();
|
parent::kill();
|
||||||
$this->server->getPluginManager()->callEvent($ev = new EntityDeathEvent($this, $this->getDrops()));
|
$this->server->getPluginManager()->callEvent($ev = new EntityDeathEvent($this, $this->getDrops()));
|
||||||
foreach($ev->getDrops() as $item){
|
foreach($ev->getDrops() as $item){
|
||||||
|
Loading…
x
Reference in New Issue
Block a user