mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-07 10:22:56 +00:00
Basic implementation of Fire
This commit is contained in:
@ -31,7 +31,25 @@ class FireBlock extends FlowableBlock{
|
||||
$this->isReplaceable = true;
|
||||
$this->breakable = false;
|
||||
$this->isFullBlock = true;
|
||||
|
||||
}
|
||||
|
||||
public function onUpdate($type){
|
||||
if($type === BLOCK_UPDATE_NORMAL){
|
||||
for($s = 0; $s <= 5; ++$s){
|
||||
$side = $this->getSide($s);
|
||||
if($side->getID() !== AIR and !($side instanceof LiquidBlock)){
|
||||
return false;
|
||||
}
|
||||
}
|
||||
$this->level->setBlock($this, new AirBlock(), false);
|
||||
return BLOCK_UPDATE_NORMAL;
|
||||
}elseif($type === BLOCK_UPDATE_RANDOM){
|
||||
if($this->getSide(0)->getID() !== NETHERRACK){
|
||||
$this->level->setBlock($this, new AirBlock(), false);
|
||||
return BLOCK_UPDATE_NORMAL;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user