Fixed #313 Entities are updated depending on near block updates [gh#313]

This commit is contained in:
Shoghi Cervantes
2013-06-03 12:20:07 +02:00
parent 4b6e456c65
commit d1f2f82c6d
4 changed files with 19 additions and 2 deletions

View File

@ -82,7 +82,7 @@ class Entity extends Position{
$this->closed = false;
$this->name = "";
$this->tickCounter = 0;
$this->server->query("INSERT OR REPLACE INTO entities (EID, level, type, class, health) VALUES (".$this->eid.", '".$this->level->getName()."', ".$this->type.", ".$this->class.", ".$this->health.");");
$this->server->query("INSERT OR REPLACE INTO entities (EID, level, type, class, health, hasUpdate) VALUES (".$this->eid.", '".$this->level->getName()."', ".$this->type.", ".$this->class.", ".$this->health.", 0);");
$this->x = isset($this->data["x"]) ? $this->data["x"]:0;
$this->y = isset($this->data["y"]) ? $this->data["y"]:0;
$this->z = isset($this->data["z"]) ? $this->data["z"]:0;

View File

@ -261,6 +261,7 @@ class Level{
if($update === true){
$this->server->api->block->blockUpdateAround($pos, BLOCK_UPDATE_NORMAL, 1);
$this->server->api->entity->updateRadius($pos, 3);
}
if($tiles === true){
if(($t = $this->server->api->tileentity->get($pos)) !== false){