"Better" Tall Grass drops

This commit is contained in:
Shoghi Cervantes 2013-11-26 13:20:19 +01:00
parent cf5bc916c0
commit 0f01570d01

View File

@ -44,23 +44,24 @@ class TallGrassBlock extends FlowableBlock{
public function getDrops(Item $item, Player $player){ public function getDrops(Item $item, Player $player){
$drops = array(); $drops = array();
if(mt_rand(1,10) === 1){//Seeds $possibleDrops = array(
$drops[] = array(WHEAT_SEEDS, 0, 1); array(WHEAT_SEEDS, 0, 1),
} array(CARROT, 0, 1),
if(mt_rand(1,15) === 1){//Carrots array(POTATO, 0, 1),
$drops[] = array(CARROT, 0, 1); array(BEETROOT_SEEDS, 0, 1),
} array(MELON_SEEDS, 0, 1),
if(mt_rand(1,15) === 1){//Potatoes array(PUMPKIN_SEEDS, 0, 1),
$drops[] = array(POTATO, 0, 1); 0,
} 0,
if(mt_rand(1,15) === 1){//Beetroot Seeds 0,
$drops[] = array(BEETROOT_SEEDS, 0, 1); 0,
} 0,
if(mt_rand(1,20) === 1){//Melon Seeds 0,
$drops[] = array(MELON_SEEDS, 0, 1); 0,
} 0,
if(mt_rand(1,15) === 1){//Melon Seeds );
$drops[] = array(PUMPKIN_SEEDS, 0, 1); if(($item = $possibleDrops[mt_rand(0, count($possibleDrops) - 1)]) !== 0){
$drops[] = $item;
} }
return $drops; return $drops;
} }