From c23802ec6983d0272d2c7be06c50fd05ec782de9 Mon Sep 17 00:00:00 2001 From: Brianna Date: Fri, 17 Jul 2020 21:09:05 -0500 Subject: [PATCH] Count failed chances as successful attempts. --- src/main/java/com/songoda/ultimatekits/kit/Kit.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/main/java/com/songoda/ultimatekits/kit/Kit.java b/src/main/java/com/songoda/ultimatekits/kit/Kit.java index 87cfb02..d0a2f73 100644 --- a/src/main/java/com/songoda/ultimatekits/kit/Kit.java +++ b/src/main/java/com/songoda/ultimatekits/kit/Kit.java @@ -306,7 +306,6 @@ public class Kit { } private boolean generateRandomItem(List innerContents, int itemGiveAmount, Player player) { - if (innerContents.size() != itemGiveAmount || kitAnimation != KitAnimation.NONE) Collections.shuffle(innerContents); @@ -314,8 +313,8 @@ public class Kit { if (itemGiveAmount == 0) break; double ch = item.getChance() == 0 ? 100 : item.getChance(); double rand = Math.random() * 100; + itemGiveAmount--; if (rand < ch || ch == 100) { - itemGiveAmount--; ItemStack parseStack = item.getContent().process(player); if (kitAnimation != KitAnimation.NONE) {