random.nextInt() has 0 inclusive, we need to add 1

This commit is contained in:
nossr50 2013-02-16 14:44:41 -08:00
parent 4c6f2da78a
commit 08882e58b6

View File

@ -212,7 +212,7 @@ public final class Misc {
* @param quantity The amount of items to drop
*/
public static void randomDropItems(Location location, ItemStack is, int chance, int quantity) {
int dropCount = random.nextInt(quantity);
int dropCount = random.nextInt(quantity + 1);
if(dropCount > 0) {
is.setAmount(dropCount);