mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-05-14 17:59:41 +00:00
TallGrass blocks should be only placed on grass blocks
This commit is contained in:
parent
9134a69936
commit
7905fbdd29
@ -23,6 +23,7 @@ namespace pocketmine\block;
|
|||||||
|
|
||||||
use pocketmine\item\Item;
|
use pocketmine\item\Item;
|
||||||
use pocketmine\level\Level;
|
use pocketmine\level\Level;
|
||||||
|
use pocketmine\Player;
|
||||||
|
|
||||||
class TallGrass extends Flowable{
|
class TallGrass extends Flowable{
|
||||||
|
|
||||||
@ -45,6 +46,17 @@ class TallGrass extends Flowable{
|
|||||||
];
|
];
|
||||||
return $names[$this->meta & 0x03];
|
return $names[$this->meta & 0x03];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function place(Item $item, Block $block, Block $target, $face, $fx, $fy, $fz, Player $player = null){
|
||||||
|
$down = $this->getSide(0);
|
||||||
|
if($down->getId() === self::GRASS){
|
||||||
|
$this->getLevel()->setBlock($block, $this, true);
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public function onUpdate($type){
|
public function onUpdate($type){
|
||||||
@ -67,4 +79,4 @@ class TallGrass extends Flowable{
|
|||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user