mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-07-22 19:06:35 +00:00
parent
31bb6d1a68
commit
4c2a1c8684
@ -49,7 +49,10 @@ class Beetroot extends Flowable{
|
||||
|
||||
public function onActivate(Item $item, Player $player = null){
|
||||
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);
|
||||
$item->count--;
|
||||
|
||||
|
@ -50,7 +50,10 @@ class Carrot extends Flowable{
|
||||
|
||||
public function onActivate(Item $item, Player $player = null){
|
||||
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);
|
||||
$item->count--;
|
||||
|
||||
|
@ -50,7 +50,10 @@ class Potato extends Flowable{
|
||||
|
||||
public function onActivate(Item $item, Player $player = null){
|
||||
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);
|
||||
if(($player->gamemode & 0x01) === 0){
|
||||
$item->count--;
|
||||
|
@ -50,7 +50,10 @@ class Wheat extends Flowable{
|
||||
|
||||
public function onActivate(Item $item, Player $player = null){
|
||||
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);
|
||||
if(($player->gamemode & 0x01) === 0){
|
||||
$item->count--;
|
||||
|
Loading…
x
Reference in New Issue
Block a user