diff --git a/src/API/EntityAPI.php b/src/API/EntityAPI.php index f4d6375ed..c3c15ed5d 100644 --- a/src/API/EntityAPI.php +++ b/src/API/EntityAPI.php @@ -48,6 +48,7 @@ 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){ while(($e = $l->fetchArray(SQLITE3_ASSOC)) !== false){ $e = $this->get($e["EID"]); @@ -128,9 +129,9 @@ class EntityAPI{ "x" => $pos->x, "y" => $pos->y + 0.19, "z" => $pos->z, - "speedX" => mt_rand(-3, 3) / 8, - "speedY" => mt_rand(5, 8) / 1.5, - "speedZ" => mt_rand(-3, 3) / 8, + //"speedX" => mt_rand(-3, 3) / 8, + "speedY" => mt_rand(5, 8) / 2, + //"speedZ" => mt_rand(-3, 3) / 8, "item" => $item, ); if($this->server->api->handle("item.drop", $data) !== false){ diff --git a/src/PocketMinecraftServer.php b/src/PocketMinecraftServer.php index dcddaec33..2bc45c22e 100644 --- a/src/PocketMinecraftServer.php +++ b/src/PocketMinecraftServer.php @@ -498,11 +498,7 @@ class PocketMinecraftServer{ if(!is_callable($callback)){ return false; } - $add = ""; $chcnt = $this->scheduleCnt++; - if($repeat === false){ - $add = '$this->schedule['.$chcnt.']=null;unset($this->schedule['.$chcnt.']);'; - } $this->schedule[$chcnt] = array($callback, $data, $eventName); $this->query("INSERT INTO actions (ID, interval, last, repeat) VALUES(".$chcnt.", ".($ticks / 20).", ".microtime(true).", ".(((bool) $repeat) === true ? 1:0).");"); return $chcnt;