doGarbageCollection() public method

public doGarbageCollection ( )
Exemplo n.º 1
0
 public function doChunkGarbageCollection()
 {
     $this->timings->doChunkGC->startTiming();
     $X = null;
     $Z = null;
     foreach ($this->chunks as $index => $chunk) {
         if (!isset($this->unloadQueue[$index]) and (!isset($this->usedChunks[$index]) or count($this->usedChunks[$index]) === 0)) {
             if (PHP_INT_SIZE === 8) {
                 $X = $index >> 32 << 32 >> 32;
                 $Z = ($index & 4294967295.0) << 32 >> 32;
             } else {
                 list($X, $Z) = explode(":", $index);
                 $X = (int) $X;
                 $Z = (int) $Z;
             }
             if (!$this->isSpawnChunk($X, $Z)) {
                 $this->unloadChunkRequest($X, $Z, true);
             }
         }
     }
     foreach ($this->provider->getLoadedChunks() as $chunk) {
         if (!isset($this->chunks[PHP_INT_SIZE === 8 ? ($chunk->getX() & 4294967295.0) << 32 | $chunk->getZ() & 4294967295.0 : $chunk->getX() . ":" . $chunk->getZ()])) {
             $this->provider->unloadChunk($chunk->getX(), $chunk->getZ(), false);
         }
     }
     $this->provider->doGarbageCollection();
     $this->timings->doChunkGC->stopTiming();
 }
Exemplo n.º 2
0
 public function doChunkGarbageCollection()
 {
     $this->timings->doChunkGC->startTiming();
     $X = \null;
     $Z = \null;
     foreach ($this->chunks as $index => $chunk) {
         if (!isset($this->unloadQueue[$index]) and (!isset($this->usedChunks[$index]) or \count($this->usedChunks[$index]) === 0)) {
             $X = $index >> 32 << 32 >> 32;
             $Z = ($index & 0xffffffff) << 32 >> 32;
             if (!$this->isSpawnChunk($X, $Z)) {
                 $this->unloadChunkRequest($X, $Z, \true);
             }
         }
     }
     foreach ($this->provider->getLoadedChunks() as $chunk) {
         if (!isset($this->chunks[($chunk->getX() & 0xffffffff) << 32 | $chunk->getZ() & 0xffffffff])) {
             $this->provider->unloadChunk($chunk->getX(), $chunk->getZ(), \false);
         }
     }
     $this->provider->doGarbageCollection();
     $this->timings->doChunkGC->stopTiming();
 }
Exemplo n.º 3
0
 public function doChunkGarbageCollection()
 {
     $this->timings->doChunkGC->startTiming();
     $X = null;
     $Z = null;
     foreach ($this->chunks as $index => $chunk) {
         if (!isset($this->unloadQueue[$index]) and (!isset($this->usedChunks[$index]) or count($this->usedChunks[$index]) === 0)) {
             Level::getXZ($index, $X, $Z);
             if (!$this->isSpawnChunk($X, $Z)) {
                 $this->unloadChunkRequest($X, $Z, true);
             }
         }
     }
     foreach ($this->provider->getLoadedChunks() as $chunk) {
         if (!isset($this->chunks[Level::chunkHash($chunk->getX(), $chunk->getZ())])) {
             $this->provider->unloadChunk($chunk->getX(), $chunk->getZ(), false);
         }
     }
     $this->provider->doGarbageCollection();
     $this->timings->doChunkGC->stopTiming();
 }
Exemplo n.º 4
0
 public function doChunkGarbageCollection()
 {
     $this->timings->doChunkGC->startTiming();
     $X = \null;
     $Z = \null;
     foreach ($this->chunks as $index => $chunk) {
         if (!isset($this->unloadQueue[$index]) and (!isset($this->usedChunks[$index]) or \count($this->usedChunks[$index]) === 0)) {
             list($X, $Z) = \explode(":", $index);
             $X = (int) $X;
             $Z = (int) $Z;
             if (!$this->isSpawnChunk($X, $Z)) {
                 $this->unloadChunkRequest($X, $Z, \true);
             }
         }
     }
     foreach ($this->provider->getLoadedChunks() as $chunk) {
         if (!isset($this->chunks[$chunk->getX() . ":" . $chunk->getZ()])) {
             $this->provider->unloadChunk($chunk->getX(), $chunk->getZ(), \false);
         }
     }
     $this->provider->doGarbageCollection();
     $this->timings->doChunkGC->stopTiming();
 }