mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-20 11:39:43 +00:00
Removed server.tick event
This commit is contained in:
parent
911577e9b8
commit
5def864aca
5 changed files with 13 additions and 5 deletions
|
|
@ -48,14 +48,20 @@ class EntityAPI{
|
|||
|
||||
public function updateEntities(){
|
||||
$l = $this->server->query("SELECT EID FROM entities WHERE hasUpdate = 1;");
|
||||
$this->server->query("UPDATE entities SET hasUpdate = 0;");
|
||||
|
||||
if($l !== false and $l !== true){
|
||||
$q = "";
|
||||
while(($e = $l->fetchArray(SQLITE3_ASSOC)) !== false){
|
||||
$e = $this->get($e["EID"]);
|
||||
if($e instanceof Entity){
|
||||
console($e->eid);
|
||||
$e->update();
|
||||
$q .= "UPDATE entities SET hasUpdate = 0 WHERE EID = ".$e->eid.";";
|
||||
}
|
||||
}
|
||||
if($q !== ""){
|
||||
$this->server->query("BEGIN TRANSACTION;".$q.";COMMIT;");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue