From 6fc7ee2775e8e09e526da7cf135777cc01044ba7 Mon Sep 17 00:00:00 2001 From: Shoghi Cervantes Date: Mon, 27 Apr 2015 14:19:01 +0200 Subject: [PATCH] Fixed some bad defaults, improved spawning --- src/pocketmine/MemoryManager.php | 4 ++-- src/pocketmine/Player.php | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/pocketmine/MemoryManager.php b/src/pocketmine/MemoryManager.php index 338bb37e1..3fd444d7c 100644 --- a/src/pocketmine/MemoryManager.php +++ b/src/pocketmine/MemoryManager.php @@ -67,11 +67,11 @@ class MemoryManager{ $this->continuousTrigger = (bool) $this->server->getProperty("memory.continuous-trigger", true); $this->continuousTriggerRate = (int) $this->server->getProperty("memory.continuous-trigger-rate", 30); - $this->garbageCollectionPeriod = (int) $this->server->getProperty("memory.garbage-collection.period", 12000); + $this->garbageCollectionPeriod = (int) $this->server->getProperty("memory.garbage-collection.period", 36000); $this->garbageCollectionTrigger = (bool) $this->server->getProperty("memory.garbage-collection.low-memory-trigger", true); $this->garbageCollectionAsync = (bool) $this->server->getProperty("memory.garbage-collection.collect-async-worker", true); - $this->chunkLimit = (int) $this->server->getProperty("memory.max-chunks.trigger-limit", 12000); + $this->chunkLimit = (int) $this->server->getProperty("memory.max-chunks.trigger-limit", 96); $this->chunkCollect = (bool) $this->server->getProperty("memory.max-chunks.trigger-chunk-collect", true); $this->chunkTrigger = (bool) $this->server->getProperty("memory.max-chunks.low-memory-trigger", true); diff --git a/src/pocketmine/Player.php b/src/pocketmine/Player.php index b1b069526..c2dad5e0c 100644 --- a/src/pocketmine/Player.php +++ b/src/pocketmine/Player.php @@ -648,7 +648,7 @@ class Player extends Human implements CommandSender, InventoryHolder, IPlayer{ $this->level->requestChunk($X, $Z, $this, LevelProvider::ORDER_ZXY); } - if($this->chunkLoadCount >= $this->spawnThreshold and $this->spawned === false){ + if($this->chunkLoadCount >= $this->spawnThreshold and $this->spawned === false and $this->teleportPosition === null){ $this->spawned = true; $this->sendSettings(); @@ -1608,6 +1608,8 @@ class Player extends Human implements CommandSender, InventoryHolder, IPlayer{ $this->dataPacket($pk->setChannel(Network::CHANNEL_PRIORITY)); } + $this->teleportPosition = $this->getPosition(); + $this->orderChunks(); $this->sendNextChunk(); break;