mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-22 00:33:59 +00:00
Added flowers placement
This commit is contained in:
parent
d1610ce7a1
commit
a9c7a6642e
@ -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;
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
@ -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;
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user