mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-11 14:05:35 +00:00
Bonemeal usage count
This commit is contained in:
parent
8e127e60a0
commit
51f4faf22e
@ -76,6 +76,7 @@ class MelonStemBlock extends FlowableBlock{
|
|||||||
if($item->getID() === DYE and $item->getMetadata() === 0x0F){ //Bonemeal
|
if($item->getID() === DYE and $item->getMetadata() === 0x0F){ //Bonemeal
|
||||||
$this->meta = 0x07;
|
$this->meta = 0x07;
|
||||||
$this->level->setBlock($this, $this);
|
$this->level->setBlock($this, $this);
|
||||||
|
$item->count--;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
@ -55,6 +55,7 @@ class SaplingBlock extends FlowableBlock{
|
|||||||
public function onActivate(Item $item, Player $player){
|
public function onActivate(Item $item, Player $player){
|
||||||
if($item->getID() === DYE and $item->getMetadata() === 0x0F){ //Bonemeal
|
if($item->getID() === DYE and $item->getMetadata() === 0x0F){ //Bonemeal
|
||||||
TreeObject::growTree($this->level, $this, new Random(), $this->meta & 0x03);
|
TreeObject::growTree($this->level, $this, new Random(), $this->meta & 0x03);
|
||||||
|
$item->count--;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
@ -45,6 +45,7 @@ class WheatBlock extends FlowableBlock{
|
|||||||
if($item->getID() === DYE and $item->getMetadata() === 0x0F){ //Bonemeal
|
if($item->getID() === DYE and $item->getMetadata() === 0x0F){ //Bonemeal
|
||||||
$this->meta = 0x07;
|
$this->meta = 0x07;
|
||||||
$this->level->setBlock($this, $this);
|
$this->level->setBlock($this, $this);
|
||||||
|
$item->count--;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
@ -38,6 +38,7 @@ class GrassBlock extends SolidBlock{
|
|||||||
|
|
||||||
public function onActivate(Item $item, Player $player){
|
public function onActivate(Item $item, Player $player){
|
||||||
if($item->getID() === DYE and $item->getMetadata() === 0x0F){
|
if($item->getID() === DYE and $item->getMetadata() === 0x0F){
|
||||||
|
$item->count--;
|
||||||
TallGrassObject::growGrass($this->level, $this, new Random());
|
TallGrassObject::growGrass($this->level, $this, new Random());
|
||||||
return true;
|
return true;
|
||||||
}elseif($item->isHoe()){
|
}elseif($item->isHoe()){
|
||||||
|
Loading…
x
Reference in New Issue
Block a user