Merge pull request #3 from GameHerobrine/master

bonemeal fix i guess
This commit is contained in:
kotyara 2022-05-09 15:11:35 +00:00 • committed by GitHub
commit 571f3d5570
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 24 additions and 6 deletions

View file

@ -38,7 +38,10 @@ class BeetrootBlock extends FlowableBlock{
public function onActivate(Item $item, Player $player){
if($item->getID() === DYE and $item->getMetadata() === 0x0F){ //Bonemeal
$this->meta = 0x07;
$this->meta += mt_rand(0, 3) + 2;
if ($this->meta > 7) {
$this->meta = 7;
}
$this->level->setBlock($this, $this, true, false, true);
if(($player->gamemode & 0x01) === 0){
$player->removeItem(DYE,0x0F,1);

View file

@ -38,7 +38,10 @@ class CarrotBlock extends FlowableBlock{
public function onActivate(Item $item, Player $player){
if($item->getID() === DYE and $item->getMetadata() === 0x0F){ //Bonemeal
$this->meta = 0x07;
$this->meta += mt_rand(0, 3) + 2;
if ($this->meta > 7) {
$this->meta = 7;
}
$this->level->setBlock($this, $this, true, false, true);
if(($player->gamemode & 0x01) === 0){
$player->removeItem(DYE,0x0F,1);

View file

@ -69,7 +69,10 @@ class MelonStemBlock extends FlowableBlock{
public function onActivate(Item $item, Player $player){
if($item->getID() === DYE and $item->getMetadata() === 0x0F){ //Bonemeal
$this->meta = 0x07;
$this->meta += mt_rand(0, 3) + 2;
if ($this->meta > 7) {
$this->meta = 7;
}
$this->level->setBlock($this, $this, true, false, true);
if(($player->gamemode & 0x01) === 0){
$player->removeItem(DYE,0x0F,1);

View file

@ -38,7 +38,10 @@ class PotatoBlock extends FlowableBlock{
public function onActivate(Item $item, Player $player){
if($item->getID() === DYE and $item->getMetadata() === 0x0F){ //Bonemeal
$this->meta = 0x07;
$this->meta += mt_rand(0, 3) + 2;
if ($this->meta > 7) {
$this->meta = 7;
}
$this->level->setBlock($this, $this, true, false, true);
if(($player->gamemode & 0x01) === 0){
$player->removeItem(DYE,0x0F,1);

View file

@ -69,7 +69,10 @@ class PumpkinStemBlock extends FlowableBlock{
public function onActivate(Item $item, Player $player){
if($item->getID() === DYE and $item->getMetadata() === 0x0F){ //Bonemeal
$this->meta = 0x07;
$this->meta += mt_rand(0, 3) + 2;
if ($this->meta > 7) {
$this->meta = 7;
}
$this->level->setBlock($this, $this, true, false, true);
if(($player->gamemode & 0x01) === 0){
$player->removeItem(DYE,0x0F,1);

View file

@ -38,7 +38,10 @@ class WheatBlock extends FlowableBlock{
public function onActivate(Item $item, Player $player){
if($item->getID() === DYE and $item->getMetadata() === 0x0F){ //Bonemeal
$this->meta = 0x07;
$this->meta += mt_rand(0, 3) + 2;
if ($this->meta > 7) {
$this->meta = 7;
}
$this->level->setBlock($this, $this, true, false, true);
if(($player->gamemode & 0x01) === 0){
$player->removeItem(DYE,0x0F,1);