mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-20 11:39:43 +00:00
Huge commit (Block API, changed events)
Changed Session to Player Block API Block Data
This commit is contained in:
parent
e47bacce74
commit
b867ba559e
10 changed files with 311 additions and 102 deletions
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue