From 7853a144589347ac37f919b0ff34b6e351bb1ba0 Mon Sep 17 00:00:00 2001 From: ArkQuark <74979909+ArkQuark@users.noreply.github.com> Date: Sat, 28 Jan 2023 22:14:12 +0300 Subject: [PATCH] Plants fix --- src/material/block/plant/BeetrootBlock.php | 8 ++++---- src/material/block/plant/CarrotBlock.php | 10 ++++------ src/material/block/plant/MelonStemBlock.php | 8 ++++---- src/material/block/plant/PotatoBlock.php | 6 +++--- src/material/block/plant/PumpkinStemBlock.php | 8 ++++---- src/material/block/plant/WheatBlock.php | 9 ++++----- 6 files changed, 23 insertions(+), 26 deletions(-) diff --git a/src/material/block/plant/BeetrootBlock.php b/src/material/block/plant/BeetrootBlock.php index 034cdeeb..8fdfd55e 100644 --- a/src/material/block/plant/BeetrootBlock.php +++ b/src/material/block/plant/BeetrootBlock.php @@ -54,13 +54,13 @@ class BeetrootBlock extends FlowableBlock{ } public function getDrops(Item $item, Player $player){ - $drops = array(); + $drops = []; if($this->meta >= 0x07){ - $drops[] = array(BEETROOT, 0, 1); + $drops[] = [BEETROOT, 0, 1]; } for($i = 0; $i < 3; ++$i){ - if(mt_rand(0,15) <= $this->meta){ //a way from 1.4.7 - $drops[] = array(BEETROOT_SEEDS, 0, 1); + if(mt_rand(0, 15) <= $this->meta){ //a way from 1.4.7 + $drops[] = [BEETROOT_SEEDS, 0, 1]; } } return $drops; diff --git a/src/material/block/plant/CarrotBlock.php b/src/material/block/plant/CarrotBlock.php index 5e407666..b2864855 100644 --- a/src/material/block/plant/CarrotBlock.php +++ b/src/material/block/plant/CarrotBlock.php @@ -54,14 +54,12 @@ class CarrotBlock extends FlowableBlock{ } public function getDrops(Item $item, Player $player){ - $drops = array(); + $drops = []; if($this->meta >= 0x07){ - $drops[] = array(CARROT, 0, mt_rand(1, 4)); + $drops[] = [CARROT, 0, mt_rand(1, 4)]; } - for($i = 0; $i < 3; ++$i){ - if(mt_rand(0,15) <= $this->meta){ //a way from 1.4.7 - $drops[] = array(CARROT, 0, 1); - } + else{ + $drops[] = [CARROT, 0, 1]; } return $drops; } diff --git a/src/material/block/plant/MelonStemBlock.php b/src/material/block/plant/MelonStemBlock.php index f786d3d0..f877bf27 100644 --- a/src/material/block/plant/MelonStemBlock.php +++ b/src/material/block/plant/MelonStemBlock.php @@ -64,15 +64,15 @@ class MelonStemBlock extends FlowableBlock{ } public function getDrops(Item $item, Player $player){ - $drops = array(); + $drops = []; if($this->meta >= 0x07){ - $drops[] = array(MELON_SEEDS, 0, mt_rand(1, 2)); + $drops[] = [MELON_SEEDS, 0, mt_rand(1, 2)]; } elseif($this->meta >= 0x01 and $this->meta <= 0x07){ - $drops[] = array(MELON_SEEDS, 0, 1); + $drops[] = [MELON_SEEDS, 0, 1]; } else{ - $drops[] = array(MELON_SEEDS, 0, 0); + $drops[] = [MELON_SEEDS, 0, 0]; } return $drops; } diff --git a/src/material/block/plant/PotatoBlock.php b/src/material/block/plant/PotatoBlock.php index 69cf4903..ec1bd3e6 100644 --- a/src/material/block/plant/PotatoBlock.php +++ b/src/material/block/plant/PotatoBlock.php @@ -54,11 +54,11 @@ class PotatoBlock extends FlowableBlock{ } public function getDrops(Item $item, Player $player){ - $drops = array(); + $drops = []; if($this->meta >= 0x07){ - $drops[] = array(POTATO, 0, mt_rand(1, 4)); + $drops[] = [POTATO, 0, mt_rand(1, 4)]; }else{ - $drops[] = array(POTATO, 0, 1); + $drops[] = [POTATO, 0, 1]; } return $drops; } diff --git a/src/material/block/plant/PumpkinStemBlock.php b/src/material/block/plant/PumpkinStemBlock.php index e7ee58b1..68444084 100644 --- a/src/material/block/plant/PumpkinStemBlock.php +++ b/src/material/block/plant/PumpkinStemBlock.php @@ -64,15 +64,15 @@ class PumpkinStemBlock extends FlowableBlock{ } public function getDrops(Item $item, Player $player){ - $drops = array(); + $drops = []; if($this->meta >= 0x07){ - $drops[] = array(PUMPKIN_SEEDS, 0, mt_rand(1, 2)); + $drops[] = [PUMPKIN_SEEDS, 0, mt_rand(1, 2)]; } elseif($this->meta >= 0x01 and $this->meta <= 0x07){ - $drops[] = array(PUMPKIN_SEEDS, 0, 1); + $drops[] = [PUMPKIN_SEEDS, 0, 1]; } else{ - $drops[] = array(PUMPKIN_SEEDS, 0, 0); + $drops[] = [PUMPKIN_SEEDS, 0, 0]; } return $drops; } diff --git a/src/material/block/plant/WheatBlock.php b/src/material/block/plant/WheatBlock.php index 5dbc36e2..f9ec0105 100644 --- a/src/material/block/plant/WheatBlock.php +++ b/src/material/block/plant/WheatBlock.php @@ -55,14 +55,13 @@ class WheatBlock extends FlowableBlock{ } public function getDrops(Item $item, Player $player){ - $drops = array(); + $drops = []; if($this->meta >= 0x07){ - $drops[] = array(WHEAT, 0, 1); - $drops[] = array(WHEAT_SEEDS, 0, mt_rand(0, 3)); + $drops[] = [WHEAT, 0, 1]; }else{ for($i = 0; $i < 3; ++$i){ - if(mt_rand(0,15) <= $this->meta){ //a way from 1.4.7 - $drops[] = array(WHEAT_SEEDS, 0, 1); + if(mt_rand(0, 15) <= $this->meta){ //a way from 1.4.7 + $drops[] = [WHEAT_SEEDS, 0, 1]; } }