DeadBush: match placement condition with break condition, fixes #2116

This commit is contained in:
Dylan K. Taylor 2018-03-30 11:54:57 +01:00
parent d53258c943
commit 5d32587cf7

View File

@ -26,6 +26,7 @@ namespace pocketmine\block;
use pocketmine\item\Item;
use pocketmine\item\ItemFactory;
use pocketmine\math\Vector3;
use pocketmine\Player;
class DeadBush extends Flowable{
@ -39,6 +40,14 @@ class DeadBush extends Flowable{
return "Dead Bush";
}
public function place(Item $item, Block $blockReplace, Block $blockClicked, int $face, Vector3 $clickVector, Player $player = null) : bool{
if(!$this->getSide(Vector3::SIDE_DOWN)->isTransparent()){
return parent::place($item, $blockReplace, $blockClicked, $face, $clickVector, $player);
}
return false;
}
public function onNearbyBlockChange() : void{
if($this->getSide(Vector3::SIDE_DOWN)->isTransparent()){
$this->getLevel()->useBreakOn($this);