mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-05-18 11:45:30 +00:00
"Better" Tall Grass drops
This commit is contained in:
parent
cf5bc916c0
commit
0f01570d01
@ -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;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user