Added Mushroom placement

This commit is contained in:
Shoghi Cervantes Pueyo 2013-02-03 20:24:22 +01:00
parent a9c7a6642e
commit 3ecbe7dbf7
3 changed files with 21 additions and 18 deletions

View file

@ -31,4 +31,14 @@ class BrownMushroomBlock extends FlowableBlock{
$this->isFlowable = true;
}
public function place(BlockAPI $level, Item $item, Player $player, Block $block, Block $target, $face, $fx, $fy, $fz){
if($block->inWorld === true){
$down = $level->getBlockFace($block, 0);
if($down->isTransparent === false){
$level->setBlock($block, $this->id, $this->getMetadata());
return true;
}
}
return false;
}
}

View file

@ -30,5 +30,15 @@ class RedMushroomBlock extends FlowableBlock{
parent::__construct(RED_MUSHROOM, 0, "Red Mushroom");
$this->isFlowable = true;
}
public function place(BlockAPI $level, Item $item, Player $player, Block $block, Block $target, $face, $fx, $fy, $fz){
if($block->inWorld === true){
$down = $level->getBlockFace($block, 0);
if($down->isTransparent === false){
$level->setBlock($block, $this->id, $this->getMetadata());
return true;
}
}
return false;
}
}