Browse Source

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

nossr50 12 năm trước cách đây
mục cha
commit
08882e58b6
1 tập tin đã thay đổi với 1 bổ sung1 xóa
  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);