Clone initial chunk in Flat.php

The Flat generator destroys Chunk at 0,0.

What happens is that it request the level to read Chunk at 0,0.  It then uses that chunk to create the template chunk.  However this obliterates whatever was in Chunk at 0,0.

Added a line to "clone" this chunk, so when parsePreset generates the template chunk, all this goes to a copy rather than the original file chunk 0,0.
This commit is contained in:
Alex 2015-03-19 15:41:26 +01:00
parent 6bf30c133a
commit 8ae9cd4eaf

View File

@ -106,7 +106,7 @@ class Flat extends Generator{
} }
$this->chunk = $this->level->getChunk(0, 0); $this->chunk = clone $this->level->getChunk(0, 0);
$this->chunk->setGenerated(); $this->chunk->setGenerated();
for($Z = 0; $Z < 16; ++$Z){ for($Z = 0; $Z < 16; ++$Z){