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

@ -65,7 +65,7 @@ class Grass extends Solid{
public function onRandomTick() : void{
$lightAbove = $this->level->getFullLightAt($this->x, $this->y + 1, $this->z);
if($lightAbove < 4 and BlockFactory::$lightFilter[$this->level->getBlockIdAt($this->x, $this->y + 1, $this->z)] >= 3){ //2 plus 1 standard filter amount
if($lightAbove < 4 and BlockFactory::$lightFilter[$this->level->getFullBlock($this->x, $this->y + 1, $this->z)] >= 3){ //2 plus 1 standard filter amount
//grass dies
$ev = new BlockSpreadEvent($this, $this, BlockFactory::get(Block::DIRT));
$ev->call();
@ -82,7 +82,7 @@ class Grass extends Solid{
$this->level->getBlockIdAt($x, $y, $z) !== Block::DIRT or
$this->level->getBlockDataAt($x, $y, $z) === 1 or
$this->level->getFullLightAt($x, $y + 1, $z) < 4 or
BlockFactory::$lightFilter[$this->level->getBlockIdAt($x, $y + 1, $z)] >= 3
BlockFactory::$lightFilter[$this->level->getFullBlock($x, $y + 1, $z)] >= 3
){
continue;
}