Fixed #1584 duplicated death messages

This commit is contained in:
Shoghi Cervantes 2014-07-09 20:25:40 +02:00
parent 1f882f42d3
commit 9604907566
3 changed files with 9 additions and 0 deletions

View File

@ -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();

View File

@ -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();

View File

@ -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){