Allow static properties and state masks to vary based on variant

This commit is contained in:
Dylan K. Taylor
2018-10-06 17:33:28 +01:00
parent 9338061390
commit a430f7f4f7
8 changed files with 64 additions and 102 deletions

View File

@ -394,7 +394,7 @@ class Chunk{
public function recalculateHeightMapColumn(int $x, int $z) : int{
$max = $this->getHighestBlockAt($x, $z);
for($y = $max; $y >= 0; --$y){
if(BlockFactory::$lightFilter[$id = $this->getBlockId($x, $y, $z)] > 1 or BlockFactory::$diffusesSkyLight[$id]){
if(BlockFactory::$lightFilter[$state = $this->getFullBlock($x, $y, $z)] > 1 or BlockFactory::$diffusesSkyLight[$state]){
break;
}
}
@ -426,7 +426,7 @@ class Chunk{
$light = 15;
for(; $y >= 0; --$y){
if($light > 0){
$light -= BlockFactory::$lightFilter[$this->getBlockId($x, $y, $z)];
$light -= BlockFactory::$lightFilter[$this->getFullBlock($x, $y, $z)];
if($light <= 0){
break;
}