mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-05-13 09:19:42 +00:00
Merge pull request #2631 from 64FF00/master
TallGrass blocks should be only placed on grass blocks
This commit is contained in:
commit
5067b96184
@ -23,6 +23,7 @@ namespace pocketmine\block;
|
||||
|
||||
use pocketmine\item\Item;
|
||||
use pocketmine\level\Level;
|
||||
use pocketmine\Player;
|
||||
|
||||
class TallGrass extends Flowable{
|
||||
|
||||
@ -45,6 +46,17 @@ class TallGrass extends Flowable{
|
||||
];
|
||||
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){
|
||||
@ -67,4 +79,4 @@ class TallGrass extends Flowable{
|
||||
return [];
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user