Fixed bonemeal on plants and grass

This commit is contained in:
ArkQuark 2021-12-24 01:06:03 +03:00
parent 05ae15ef74
commit 4a5d4e89e5
8 changed files with 10 additions and 10 deletions

View file

@ -41,7 +41,7 @@ class BeetrootBlock extends FlowableBlock{
$this->meta = 0x07;
$this->level->setBlock($this, $this, true, false, true);
if(($player->gamemode & 0x01) === 0){
$item->count--;
$player->removeItem(DYE,0x0F,1);
}
return true;
}

View file

@ -41,7 +41,7 @@ class CarrotBlock extends FlowableBlock{
$this->meta = 0x07;
$this->level->setBlock($this, $this, true, false, true);
if(($player->gamemode & 0x01) === 0){
$item->count--;
$player->removeItem(DYE,0x0F,1);
}
return true;
}

View file

@ -72,7 +72,7 @@ class MelonStemBlock extends FlowableBlock{
$this->meta = 0x07;
$this->level->setBlock($this, $this, true, false, true);
if(($player->gamemode & 0x01) === 0){
$item->count--;
$player->removeItem(DYE,0x0F,1);
}
return true;
}

View file

@ -41,7 +41,7 @@ class PotatoBlock extends FlowableBlock{
$this->meta = 0x07;
$this->level->setBlock($this, $this, true, false, true);
if(($player->gamemode & 0x01) === 0){
$item->count--;
$player->removeItem(DYE,0x0F,1);
}
return true;
}

View file

@ -72,7 +72,7 @@ class PumpkinStemBlock extends FlowableBlock{
$this->meta = 0x07;
$this->level->setBlock($this, $this, true, false, true);
if(($player->gamemode & 0x01) === 0){
$item->count--;
$player->removeItem(DYE,0x0F,1);
}
return true;
}

View file

@ -53,7 +53,7 @@ class SaplingBlock extends FlowableBlock{
if($item->getID() === DYE and $item->getMetadata() === 0x0F){ //Bonemeal
TreeObject::growTree($this->level, $this, new Random(), $this->meta & 0x03);
if(($player->gamemode & 0x01) === 0){
$item->count--;
$player->removeItem(DYE,0x0F,1);
}
return true;
}

View file

@ -41,7 +41,7 @@ class WheatBlock extends FlowableBlock{
$this->meta = 0x07;
$this->level->setBlock($this, $this, true, false, true);
if(($player->gamemode & 0x01) === 0){
$item->count--;
$player->removeItem(DYE,0x0F,1);
}
return true;
}

View file

@ -33,10 +33,10 @@ class GrassBlock extends SolidBlock{
public function onActivate(Item $item, Player $player){
if($item->getID() === DYE and $item->getMetadata() === 0x0F){
if(($player->gamemode & 0x01) === 0){
$item->count--;
}
TallGrassObject::growGrass($this->level, $this, new Random(), 8, 2);
if(($player->gamemode & 0x01) === 0){
$player->removeItem(DYE,0x0F,1);
}
return true;
}elseif($item->isHoe()){
if(($player->gamemode & 0x01) === 0){