FIx DeadBush can be placed at any block
DeadBush can be placed only at SAND PODZOL HARDENED_CLAY and STAINED_CLAY
This commit is contained in:
parent
240c9079f9
commit
3b5495bfb2
1 changed files with 10 additions and 0 deletions
|
|
@ -23,6 +23,7 @@ namespace pocketmine\block;
|
|||
|
||||
use pocketmine\level\Level;
|
||||
use pocketmine\item\Item;
|
||||
use pocketmine\Player;
|
||||
|
||||
class DeadBush extends Flowable{
|
||||
|
||||
|
|
@ -36,6 +37,15 @@ class DeadBush extends Flowable{
|
|||
return "Dead Bush";
|
||||
}
|
||||
|
||||
public function place(Item $item, Block $block, Block $target, $face, $fx, $fy, $fz, Player $player = null){
|
||||
$down = $this->getSide(0);
|
||||
if($down->getId() === Block::SAND or $down->getId() === Block::PODZOL or
|
||||
$down->getId() === Block::HARDENED_CLAY or $down->getId() === Block::STAINED_CLAY){
|
||||
$this->getLevel()->setBlock($block, $this, true);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public function onUpdate($type){
|
||||
if($type === Level::BLOCK_UPDATE_NORMAL){
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue