mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-21 00:07:30 +00:00
Block: added burnsForever()
This commit is contained in:
parent
e66b1953de
commit
64540f36be
@ -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()
|
||||
*
|
||||
|
@ -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));
|
||||
|
@ -66,4 +66,8 @@ class Magma extends Solid{
|
||||
$entity->attack($ev);
|
||||
}
|
||||
}
|
||||
|
||||
public function burnsForever() : bool{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
@ -48,4 +48,8 @@ class Netherrack extends Solid{
|
||||
public function getToolHarvestLevel() : int{
|
||||
return TieredTool::TIER_WOODEN;
|
||||
}
|
||||
|
||||
public function burnsForever() : bool{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user