Basic implementation of Fire

This commit is contained in:
Shoghi Cervantes
2013-06-09 14:59:02 +02:00
parent 2f6ddb6aa4
commit 2976db25c3
14 changed files with 73 additions and 5 deletions

View File

@ -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;
}
}