diff --git a/src/API/BlockAPI.php b/src/API/BlockAPI.php index 86419be3d..a134f9f54 100644 --- a/src/API/BlockAPI.php +++ b/src/API/BlockAPI.php @@ -487,46 +487,6 @@ class BlockAPI{ } }*/ - - - /* - $replace = false; - switch($data["block"]){ - case 44: //Slabs - if($data["face"] === 0){ - if($target[0] === 44 and ($target[1] & 0x08) === 0x08 and ($target[1] & 0x07) === ($data["meta"] & 0x07)){ - $replace = true; - $data["block"] = 43; - $data["meta"] = $data["meta"] & 0x07; - }else{ - $data["meta"] |= 0x08; - } - }elseif($data["face"] === 1){ - if($target[0] === 44 and ($target[1] & 0x08) === 0 and ($target[1] & 0x07) === ($data["meta"] & 0x07)){ - $replace = true; - $data["block"] = 43; - $data["meta"] = $data["meta"] & 0x07; - } - }else{ - $data2 = $data; - BlockFace::setPosition($data2, $data["face"]); - $b = $this->server->api->level->getBlock($data2["x"], $data2["y"], $data2["z"]); - if($b[0] === 44 and ($b[1] & 0x07) === ($data["meta"] & 0x07)){ - $data = $data2; - $replace = true; - $data["block"] = 43; - $data["meta"] = $data["meta"] & 0x07; - }else{ - $data["meta"] = $data["meta"] & 0x07; - if($data["fy"] > 0.5){ - $data["meta"] |= 0x08; - } - } - } - break; - } - */ - if($block->y > 127 or $block->y < 0){ return false; } diff --git a/src/classes/material/block/plant/CyanFlower.php b/src/classes/material/block/plant/CyanFlower.php index 0810b937c..1359809d3 100644 --- a/src/classes/material/block/plant/CyanFlower.php +++ b/src/classes/material/block/plant/CyanFlower.php @@ -30,5 +30,14 @@ class CyanFlowerBlock extends FlowableBlock{ parent::__construct(CYAN_FLOWER, 0, "Cyan Flower"); $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->getID() === 2 or $down->getID() === 3 or $down->getID() === 60){ + $level->setBlock($block, $this->id, $this->getMetadata()); + return true; + } + } + return false; + } } \ No newline at end of file diff --git a/src/classes/material/block/plant/Dandelion.php b/src/classes/material/block/plant/Dandelion.php index fdb46f464..74b125757 100644 --- a/src/classes/material/block/plant/Dandelion.php +++ b/src/classes/material/block/plant/Dandelion.php @@ -30,5 +30,14 @@ class DandelionBlock extends FlowableBlock{ parent::__construct(DANDELION, 0, "Dandelion"); $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->getID() === 2 or $down->getID() === 3 or $down->getID() === 60){ + $level->setBlock($block, $this->id, $this->getMetadata()); + return true; + } + } + return false; + } } \ No newline at end of file