mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-20 11:39:43 +00:00
Changes in Entity events
This commit is contained in:
parent
683c05f206
commit
c1aec49ad1
5 changed files with 23 additions and 20 deletions
|
|
@ -77,7 +77,7 @@ class Entity extends stdClass{
|
|||
|
||||
public function update(){
|
||||
if($this->class === ENTITY_ITEM and $this->closed === false){
|
||||
$this->server->api->dhandle("entity.move", $this->eid);
|
||||
$this->server->api->dhandle("entity.move", $this);
|
||||
$player = $this->server->query("SELECT EID FROM entities WHERE class == ".ENTITY_PLAYER." AND abs(x - {$this->x}) <= 1.5 AND abs(y - {$this->y}) <= 1.5 AND abs(z - {$this->z}) <= 1.5 LIMIT 1;", true);
|
||||
if($player !== true and $player !== false){
|
||||
if($this->server->api->dhandle("player.item.pick", array(
|
||||
|
|
@ -163,8 +163,8 @@ class Entity extends stdClass{
|
|||
|
||||
public function close(){
|
||||
if($this->closed === false){
|
||||
$this->server->query("DELETE FROM entities WHERE EID = ".$this->eid.";");
|
||||
$this->server->api->dhandle("entity.remove", $this->eid);
|
||||
$this->server->query("DELETE FROM entities WHERE EID = ".$this.";");
|
||||
$this->server->api->dhandle("entity.remove", $this);
|
||||
$this->closed = true;
|
||||
$this->__destruct();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue