Block: added burnsForever()

This commit is contained in:
Dylan K. Taylor 2018-03-13 11:35:09 +00:00
parent e66b1953de
commit 64540f36be
4 changed files with 18 additions and 1 deletions

View File

@ -516,6 +516,15 @@ class Block extends Position implements BlockIds, Metadatable{
return 0;
}
/**
* Returns whether fire lit on this block will burn indefinitely.
*
* @return bool
*/
public function burnsForever() : bool{
return false;
}
/**
* Returns the Block on the side $side, works like Vector3::getSide()
*

View File

@ -94,7 +94,7 @@ class Fire extends Flowable{
}
public function onRandomTick() : void{
if($this->getSide(Vector3::SIDE_DOWN)->getId() !== self::NETHERRACK){
if(!$this->getSide(Vector3::SIDE_DOWN)->burnsForever()){
if(mt_rand(0, 2) === 0){
if($this->meta === 0x0F){
$this->level->setBlock($this, BlockFactory::get(Block::AIR));

View File

@ -66,4 +66,8 @@ class Magma extends Solid{
$entity->attack($ev);
}
}
public function burnsForever() : bool{
return true;
}
}

View File

@ -48,4 +48,8 @@ class Netherrack extends Solid{
public function getToolHarvestLevel() : int{
return TieredTool::TIER_WOODEN;
}
public function burnsForever() : bool{
return true;
}
}