growGrass() публичный статический Метод

public static growGrass ( pocketmine\level\ChunkManager $level, Vector3 $pos, Random $random, $count = 15, $radius = 10 )
$level pocketmine\level\ChunkManager
$pos pocketmine\math\Vector3
$random pocketmine\utils\Random
Пример #1
0
 public function onActivate(Item $item, Player $player = null)
 {
     if ($item->getID() === Item::DYE and $item->getDamage() === 0xf) {
         $item->count--;
         TallGrassObject::growGrass($this->getLevel(), $this, new Random(mt_rand()), 8, 2);
         return true;
     } elseif ($item->isHoe()) {
         $item->useOn($this);
         $this->getLevel()->setBlock($this, new Farmland());
         return true;
     }
     return false;
 }
Пример #2
0
 public function onActivate(Item $item, Player $player = \null)
 {
     if ($item->getId() === Item::DYE and $item->getDamage() === 0xf) {
         $item->count--;
         TallGrassObject::growGrass($this->getLevel(), $this, new Random(\mt_rand()), 8, 2);
         return \true;
     } elseif ($item->isHoe()) {
         $item->useOn($this);
         $this->getLevel()->setBlock($this, new Farmland());
         return \true;
     } elseif ($item->isShovel() and $this->getSide(1)->getId() === Block::AIR) {
         $item->useOn($this);
         $this->getLevel()->setBlock($this, new GrassPath());
         return \true;
     }
     return \false;
 }