mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-05-18 03:35:33 +00:00
Fixed entities being updated when they shouldn't
This commit is contained in:
parent
2dd188a0bd
commit
a5bc95e733
@ -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){
|
||||
|
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user