Tuned generator to use a better way to process chunks, closes #1807 #1794 #1740 #1741 #1685

This commit is contained in:
Shoghi Cervantes
2014-07-31 19:27:01 +02:00
parent 95b5979351
commit cb4a970631
10 changed files with 43 additions and 41 deletions

View File

@ -29,6 +29,7 @@ use pocketmine\nbt\tag\Byte;
use pocketmine\nbt\tag\ByteArray;
use pocketmine\nbt\tag\Compound;
use pocketmine\nbt\tag\Enum;
use pocketmine\nbt\tag\Int;
use pocketmine\nbt\tag\IntArray;
use pocketmine\Player;
use pocketmine\utils\Binary;
@ -93,6 +94,8 @@ class Chunk extends BaseChunk{
}
parent::__construct($level, $this->nbt["xPos"], $this->nbt["zPos"], $sections, $this->nbt->Biomes->getValue(), $this->nbt->BiomeColors->getValue(), $this->nbt->Entities->getValue(), $this->nbt->TileEntities->getValue());
unset($this->nbt->Sections);
}
/**
@ -151,6 +154,9 @@ class Chunk extends BaseChunk{
public function toBinary(){
$nbt = $this->getNBT();
$nbt->xPos = new Int("xPos", $this->x);
$nbt->zPos = new Int("zPos", $this->z);
$nbt->Sections = new Enum("Sections", []);
$nbt->Sections->setTagType(NBT::TAG_Compound);
foreach($this->getSections() as $section){