Explorar o código

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

nossr50 %!s(int64=12) %!d(string=hai) anos
pai
achega
08882e58b6
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      src/main/java/com/gmail/nossr50/util/Misc.java

+ 1 - 1
src/main/java/com/gmail/nossr50/util/Misc.java

@@ -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);