소스 검색

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