Implemented sky light generation-time population and updating, obsolete and close #160

This commit is contained in:
Dylan K. Taylor
2017-04-18 13:05:01 +01:00
parent 5e6a0e7ba0
commit dab73d8950
13 changed files with 417 additions and 154 deletions

View File

@ -159,9 +159,11 @@ class SubChunk{
}
public function getHighestBlockAt(int $x, int $z) : int{
for($y = 15; $y >= 0; --$y){
if($this->ids{($x << 8) | ($z << 4) | $y} !== "\x00"){
return $y;
$low = ($x << 8) | ($z << 4);
$i = $low | 0x0f;
for(; $i >= $low; --$i){
if($this->ids{$i} !== "\x00"){
return $i & 0x0f;
}
}