mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-05-13 17:29:44 +00:00
Block saving chunks too big
This commit is contained in:
parent
f8c144be31
commit
f30986d187
@ -619,9 +619,9 @@ class Level implements ChunkManager, Metadatable{
|
||||
foreach($this->chunkTickList as $index => $players){
|
||||
Level::getXZ($index, $chunkX, $chunkZ);
|
||||
|
||||
$chunk = $this->getChunk($chunkX, $chunkZ, false);
|
||||
|
||||
if($chunk === null){
|
||||
|
||||
if(!isset($this->chunks[$index]) or ($chunk = $this->getChunk($chunkX, $chunkZ, false)) === null){
|
||||
unset($this->chunkTickList[$index]);
|
||||
continue;
|
||||
}elseif($players <= 0){
|
||||
@ -629,6 +629,8 @@ class Level implements ChunkManager, Metadatable{
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
foreach($chunk->getEntities() as $entity){
|
||||
$entity->scheduleUpdate();
|
||||
}
|
||||
|
@ -32,6 +32,7 @@ use pocketmine\nbt\tag\Int;
|
||||
use pocketmine\nbt\tag\IntArray;
|
||||
use pocketmine\nbt\tag\Long;
|
||||
use pocketmine\utils\Binary;
|
||||
use pocketmine\utils\ChunkException;
|
||||
use pocketmine\utils\MainLogger;
|
||||
|
||||
class RegionLoader{
|
||||
@ -182,6 +183,9 @@ class RegionLoader{
|
||||
|
||||
protected function saveChunk($x, $z, $chunkData){
|
||||
$length = strlen($chunkData) + 1;
|
||||
if($length + 4 > self::MAX_SECTOR_LENGTH){
|
||||
throw new ChunkException("Chunk is too big! ".($length + 4)." > ".self::MAX_SECTOR_LENGTH);
|
||||
}
|
||||
$sectors = (int) ceil(($length + 4) / 4096);
|
||||
$index = self::getChunkOffset($x, $z);
|
||||
if($this->locationTable[$index][1] < $sectors){
|
||||
|
Loading…
x
Reference in New Issue
Block a user