mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-05-18 11:45:30 +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(){
|
public function updateEntities(){
|
||||||
$l = $this->server->query("SELECT EID FROM entities WHERE hasUpdate = 1;");
|
$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){
|
if($l !== false and $l !== true){
|
||||||
while(($e = $l->fetchArray(SQLITE3_ASSOC)) !== false){
|
while(($e = $l->fetchArray(SQLITE3_ASSOC)) !== false){
|
||||||
$e = $this->get($e["EID"]);
|
$e = $this->get($e["EID"]);
|
||||||
@ -128,9 +129,9 @@ class EntityAPI{
|
|||||||
"x" => $pos->x,
|
"x" => $pos->x,
|
||||||
"y" => $pos->y + 0.19,
|
"y" => $pos->y + 0.19,
|
||||||
"z" => $pos->z,
|
"z" => $pos->z,
|
||||||
"speedX" => mt_rand(-3, 3) / 8,
|
//"speedX" => mt_rand(-3, 3) / 8,
|
||||||
"speedY" => mt_rand(5, 8) / 1.5,
|
"speedY" => mt_rand(5, 8) / 2,
|
||||||
"speedZ" => mt_rand(-3, 3) / 8,
|
//"speedZ" => mt_rand(-3, 3) / 8,
|
||||||
"item" => $item,
|
"item" => $item,
|
||||||
);
|
);
|
||||||
if($this->server->api->handle("item.drop", $data) !== false){
|
if($this->server->api->handle("item.drop", $data) !== false){
|
||||||
|
@ -498,11 +498,7 @@ class PocketMinecraftServer{
|
|||||||
if(!is_callable($callback)){
|
if(!is_callable($callback)){
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
$add = "";
|
|
||||||
$chcnt = $this->scheduleCnt++;
|
$chcnt = $this->scheduleCnt++;
|
||||||
if($repeat === false){
|
|
||||||
$add = '$this->schedule['.$chcnt.']=null;unset($this->schedule['.$chcnt.']);';
|
|
||||||
}
|
|
||||||
$this->schedule[$chcnt] = array($callback, $data, $eventName);
|
$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).");");
|
$this->query("INSERT INTO actions (ID, interval, last, repeat) VALUES(".$chcnt.", ".($ticks / 20).", ".microtime(true).", ".(((bool) $repeat) === true ? 1:0).");");
|
||||||
return $chcnt;
|
return $chcnt;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user