"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){
$drops = array();
if(mt_rand(1,10) === 1){//Seeds
$drops[] = array(WHEAT_SEEDS, 0, 1);
}
if(mt_rand(1,15) === 1){//Carrots
$drops[] = array(CARROT, 0, 1);
}
if(mt_rand(1,15) === 1){//Potatoes
$drops[] = array(POTATO, 0, 1);
}
if(mt_rand(1,15) === 1){//Beetroot Seeds
$drops[] = array(BEETROOT_SEEDS, 0, 1);
}
if(mt_rand(1,20) === 1){//Melon Seeds
$drops[] = array(MELON_SEEDS, 0, 1);
}
if(mt_rand(1,15) === 1){//Melon Seeds
$drops[] = array(PUMPKIN_SEEDS, 0, 1);
$possibleDrops = array(
array(WHEAT_SEEDS, 0, 1),
array(CARROT, 0, 1),
array(POTATO, 0, 1),
array(BEETROOT_SEEDS, 0, 1),
array(MELON_SEEDS, 0, 1),
array(PUMPKIN_SEEDS, 0, 1),
0,
0,
0,
0,
0,
0,
0,
0,
);
if(($item = $possibleDrops[mt_rand(0, count($possibleDrops) - 1)]) !== 0){
$drops[] = $item;
}
return $drops;
}