Merge pull request #2631 from 64FF00/master

TallGrass blocks should be only placed on grass blocks
This commit is contained in:
Shoghi Cervantes 2015-03-17 17:49:46 +01:00
commit 5067b96184

View File

@ -23,6 +23,7 @@ namespace pocketmine\block;
use pocketmine\item\Item;
use pocketmine\level\Level;
use pocketmine\Player;
class TallGrass extends Flowable{
@ -46,6 +47,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){
if($type === Level::BLOCK_UPDATE_NORMAL){