Skip to content

Commit

Permalink
Chunk cache is now non-optional, close pmmp#1448
Browse files Browse the repository at this point in the history
  • Loading branch information
dktapps committed Oct 4, 2017
1 parent bf68a6a commit a8c6e14
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 7 deletions.
5 changes: 1 addition & 4 deletions src/pocketmine/level/Level.php
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,6 @@ class Level implements ChunkManager, Metadatable{
/** @var BatchPacket[] */
private $chunkCache = [];

private $cacheChunks = false;

private $sendTimeTicker = 0;

/** @var Server */
Expand Down Expand Up @@ -337,7 +335,6 @@ public function __construct(Server $server, string $name, string $path, string $
$this->chunkGenerationQueueSize = (int) $this->server->getProperty("chunk-generation.queue-size", 8);
$this->chunkPopulationQueueSize = (int) $this->server->getProperty("chunk-generation.population-queue-size", 2);
$this->clearChunksOnTick = (bool) $this->server->getProperty("chunk-ticking.clear-tick-list", true);
$this->cacheChunks = (bool) $this->server->getProperty("chunk-sending.cache-chunks", true);

$dontTickBlocks = $this->server->getProperty("chunk-ticking.disable-block-ticking", []);
$this->randomTickBlocks = new \SplFixedArray(256);
Expand Down Expand Up @@ -2408,7 +2405,7 @@ public function chunkRequestCallback(int $x, int $z, BatchPacket $payload){

$index = Level::chunkHash($x, $z);

if(!isset($this->chunkCache[$index]) and $this->cacheChunks and $this->server->getMemoryManager()->canUseChunkCache()){
if(!isset($this->chunkCache[$index]) and $this->server->getMemoryManager()->canUseChunkCache()){
$this->chunkCache[$index] = $payload;
$this->sendChunkFromCache($x, $z);
$this->timings->syncChunkSendTimer->stopTiming();
Expand Down
3 changes: 0 additions & 3 deletions src/pocketmine/resources/pocketmine.yml
Original file line number Diff line number Diff line change
Expand Up @@ -130,9 +130,6 @@ chunk-sending:
per-tick: 4
#Radius of chunks that need to be sent before spawning the player
spawn-radius: 4
#Save a serialized copy of the chunk in memory for faster sending
#Useful in mostly-static worlds where lots of players join at the same time
cache-chunks: true

chunk-ticking:
#Max amount of chunks processed each tick
Expand Down

0 comments on commit a8c6e14

Please sign in to comment.