Improve our drop handling.

This commit is contained in:
GJ
2013-10-09 11:44:45 -04:00
parent 6eaec5ffab
commit 0c83bf2a80
10 changed files with 54 additions and 162 deletions

View File

@ -138,7 +138,7 @@ public final class Misc {
* @param is The item to drop
* @param chance The percentage chance for the item to drop
*/
public static void randomDropItem(Location location, ItemStack is, int chance) {
public static void randomDropItem(Location location, ItemStack is, double chance) {
if (random.nextInt(100) < chance) {
dropItem(location, is);
}
@ -160,6 +160,12 @@ public final class Misc {
}
}
public static void randomDropItems(Location location, Collection<ItemStack> drops, double chance) {
for (ItemStack item : drops) {
randomDropItem(location, item, chance);
}
}
/**
* Drop an item at a given location.
*