mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-07 18:32:55 +00:00
Huge commit (Block API, changed events)
Changed Session to Player Block API Block Data
This commit is contained in:
@ -121,7 +121,7 @@ class Entity extends stdClass{
|
||||
public function close(){
|
||||
if($this->closed === false){
|
||||
$this->server->query("DELETE FROM entities WHERE EID = ".$this->eid.";");
|
||||
$this->server->trigger("onEntityRemove", $this->eid);
|
||||
$this->server->trigger("entity.remove", $this->eid);
|
||||
$this->closed = true;
|
||||
}
|
||||
}
|
||||
@ -186,7 +186,7 @@ class Entity extends stdClass{
|
||||
public function setHealth($health, $cause = ""){
|
||||
$this->health = (int) $health;
|
||||
$this->server->query("UPDATE entities SET health = ".$this->health." WHERE EID = ".$this->eid.";");
|
||||
$this->server->trigger("onHealthChange", array("eid" => $this->eid, "health" => $health, "cause" => $cause));
|
||||
$this->server->trigger("entity.health.change", array("eid" => $this->eid, "health" => $health, "cause" => $cause));
|
||||
if($this->player !== false){
|
||||
$this->player->dataPacket(MC_SET_HEALTH, array(
|
||||
"health" => $this->health,
|
||||
|
Reference in New Issue
Block a user