mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-21 20:19:44 +00:00
Plants fix
This commit is contained in:
parent
c8c92048ba
commit
7853a14458
6 changed files with 23 additions and 26 deletions
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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];
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue