浏览代码

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

nossr50 12 年之前
父节点
当前提交
08882e58b6
共有 1 个文件被更改,包括 1 次插入1 次删除
  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);