Rename Living->callDeathEvent() to Living->onDeath()

This commit is contained in:
Dylan K. Taylor 2017-12-07 12:26:49 +00:00
parent 67a09a9b16
commit b06ca6eb0b
2 changed files with 3 additions and 3 deletions

View File

@ -3457,7 +3457,7 @@ class Player extends Human implements CommandSender, ChunkLoader, IPlayer{
$this->sendRespawnPacket($this->getSpawn()); $this->sendRespawnPacket($this->getSpawn());
} }
protected function callDeathEvent(){ protected function onDeath(){
$message = "death.attack.generic"; $message = "death.attack.generic";
$params = [ $params = [

View File

@ -441,10 +441,10 @@ abstract class Living extends Entity implements Damageable{
return; return;
} }
parent::kill(); parent::kill();
$this->callDeathEvent(); $this->onDeath();
} }
protected function callDeathEvent(){ protected function onDeath(){
$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){
$this->getLevel()->dropItem($this, $item); $this->getLevel()->dropItem($this, $item);