Fix some of the implicit immutability issues of EmptySubChunk

it's useful to have an immutable stub around for the sake of feeding back dummy read values, but for write values it has to barf instead of being quiet.
There's still some issues with LightArray which I don't currently have a solution for, but I'm thinking about separating light storage from chunks anyway.
This commit is contained in:
Dylan K. Taylor
2020-09-07 14:43:26 +01:00
parent 5fbc842f7a
commit 01f8116cdd
6 changed files with 22 additions and 28 deletions

View File

@ -156,7 +156,7 @@ class Flat extends Generator{
$count = count($this->structure);
for($sy = 0; $sy < $count; $sy += 16){
$subchunk = $this->chunk->getSubChunk($sy >> 4);
$subchunk = $this->chunk->getWritableSubChunk($sy >> 4);
for($y = 0; $y < 16 and isset($this->structure[$y | $sy]); ++$y){
$id = $this->structure[$y | $sy];