mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-08 10:53:05 +00:00
@ -49,7 +49,10 @@ class Beetroot extends Flowable{
|
|||||||
|
|
||||||
public function onActivate(Item $item, Player $player = null){
|
public function onActivate(Item $item, Player $player = null){
|
||||||
if($item->getID() === Item::DYE and $item->getDamage() === 0x0F){ //Bonemeal
|
if($item->getID() === Item::DYE and $item->getDamage() === 0x0F){ //Bonemeal
|
||||||
$this->meta = 0x07;
|
$this->meta += mt_rand(2, 5);
|
||||||
|
if($this->meta > 7){
|
||||||
|
$this->meta = 7;
|
||||||
|
}
|
||||||
$this->getLevel()->setBlock($this, $this, true, true);
|
$this->getLevel()->setBlock($this, $this, true, true);
|
||||||
$item->count--;
|
$item->count--;
|
||||||
|
|
||||||
|
@ -50,7 +50,10 @@ class Carrot extends Flowable{
|
|||||||
|
|
||||||
public function onActivate(Item $item, Player $player = null){
|
public function onActivate(Item $item, Player $player = null){
|
||||||
if($item->getID() === Item::DYE and $item->getDamage() === 0x0F){ //Bonemeal
|
if($item->getID() === Item::DYE and $item->getDamage() === 0x0F){ //Bonemeal
|
||||||
$this->meta = 0x07;
|
$this->meta += mt_rand(2, 5);
|
||||||
|
if($this->meta > 7){
|
||||||
|
$this->meta = 7;
|
||||||
|
}
|
||||||
$this->getLevel()->setBlock($this, $this, true);
|
$this->getLevel()->setBlock($this, $this, true);
|
||||||
$item->count--;
|
$item->count--;
|
||||||
|
|
||||||
|
@ -50,7 +50,10 @@ class Potato extends Flowable{
|
|||||||
|
|
||||||
public function onActivate(Item $item, Player $player = null){
|
public function onActivate(Item $item, Player $player = null){
|
||||||
if($item->getID() === Item::DYE and $item->getDamage() === 0x0F){ //Bonemeal
|
if($item->getID() === Item::DYE and $item->getDamage() === 0x0F){ //Bonemeal
|
||||||
$this->meta = 0x07;
|
$this->meta += mt_rand(2, 5);
|
||||||
|
if($this->meta > 7){
|
||||||
|
$this->meta = 7;
|
||||||
|
}
|
||||||
$this->getLevel()->setBlock($this, $this, true);
|
$this->getLevel()->setBlock($this, $this, true);
|
||||||
if(($player->gamemode & 0x01) === 0){
|
if(($player->gamemode & 0x01) === 0){
|
||||||
$item->count--;
|
$item->count--;
|
||||||
|
@ -50,7 +50,10 @@ class Wheat extends Flowable{
|
|||||||
|
|
||||||
public function onActivate(Item $item, Player $player = null){
|
public function onActivate(Item $item, Player $player = null){
|
||||||
if($item->getID() === Item::DYE and $item->getDamage() === 0x0F){ //Bonemeal
|
if($item->getID() === Item::DYE and $item->getDamage() === 0x0F){ //Bonemeal
|
||||||
$this->meta = 0x07;
|
$this->meta += mt_rand(2, 5);
|
||||||
|
if($this->meta > 7){
|
||||||
|
$this->meta = 7;
|
||||||
|
}
|
||||||
$this->getLevel()->setBlock($this, $this, true);
|
$this->getLevel()->setBlock($this, $this, true);
|
||||||
if(($player->gamemode & 0x01) === 0){
|
if(($player->gamemode & 0x01) === 0){
|
||||||
$item->count--;
|
$item->count--;
|
||||||
|
Reference in New Issue
Block a user