mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-07-12 04:45:12 +00:00
Improved Player generation queue
This commit is contained in:
parent
48041b2f19
commit
16384c2b20
@ -64,6 +64,7 @@ use pocketmine\level\format\FullChunk;
|
|||||||
use pocketmine\level\format\LevelProvider;
|
use pocketmine\level\format\LevelProvider;
|
||||||
use pocketmine\level\Level;
|
use pocketmine\level\Level;
|
||||||
use pocketmine\level\Position;
|
use pocketmine\level\Position;
|
||||||
|
use pocketmine\math\Vector2;
|
||||||
use pocketmine\math\Vector3;
|
use pocketmine\math\Vector3;
|
||||||
use pocketmine\metadata\MetadataValue;
|
use pocketmine\metadata\MetadataValue;
|
||||||
use pocketmine\nbt\NBT;
|
use pocketmine\nbt\NBT;
|
||||||
@ -726,7 +727,7 @@ class Player extends Human implements CommandSender, InventoryHolder, IPlayer{
|
|||||||
}
|
}
|
||||||
|
|
||||||
$i = 0;
|
$i = 0;
|
||||||
while(count($this->loadQueue) < 3 and $generateQueue->count() > 0 and $i < 16){
|
while(count($this->loadQueue) < 8 and $generateQueue->count() > 0 and $i < 32){
|
||||||
$d = $generateQueue->extract();
|
$d = $generateQueue->extract();
|
||||||
$this->getLevel()->generateChunk($d[0], $d[1]);
|
$this->getLevel()->generateChunk($d[0], $d[1]);
|
||||||
++$i;
|
++$i;
|
||||||
@ -1097,14 +1098,13 @@ class Player extends Human implements CommandSender, InventoryHolder, IPlayer{
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
$oldPos = new Vector3($this->x, $this->y, $this->z);
|
$oldPos = new Vector3($this->x, $this->y, $this->z);
|
||||||
if($oldPos->distance($this->newPosition) == 0){
|
if(($distance = $oldPos->distance($this->newPosition)) == 0){
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$revert = false;
|
$revert = false;
|
||||||
|
|
||||||
if($this->newPosition->distance($this) > 100){
|
if($distance > 100){
|
||||||
$this->server->getLogger()->warning($this->getName()." moved too quickly!");
|
|
||||||
$revert = true;
|
$revert = true;
|
||||||
}else{
|
}else{
|
||||||
if($this->chunk === null or !$this->chunk->isGenerated()){
|
if($this->chunk === null or !$this->chunk->isGenerated()){
|
||||||
|
Loading…
x
Reference in New Issue
Block a user