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