use of cn.nukkit.item.ItemMelon in project Nukkit by Nukkit.
the class BlockMelon method getDrops.
@Override
public Item[] getDrops(Item item) {
Random random = new Random();
int count = 3 + random.nextInt(5);
Enchantment fortune = item.getEnchantment(Enchantment.ID_FORTUNE_DIGGING);
if (fortune != null && fortune.getLevel() >= 1) {
count += random.nextInt(fortune.getLevel() + 1);
}
return new Item[] { new ItemMelon(0, Math.min(9, count)) };
}
Aggregations