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

@ -512,23 +512,6 @@ class BlockAPI{
}
/*switch($data["block"]){
case 6:
if($target[0] === 60){
break;
}
case 37:
case 38:
if(($target[0] !== 2 and $target[0] !== 3) or $data["face"] !== 1){
return false;
}
break;
case 39://Mushrooms
case 40:
$blockDown = $this->server->api->level->getBlock($data["x"], $data["y"] - 1, $data["z"]);
if(isset(Material::$transparent[$blockDown[0]])){
return false;
}
break;
case 338:
case 83: //Sugarcane
$data["block"] = 83;

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

@ -31,4 +31,14 @@ class RedMushroomBlock 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;
}
}