Count failed chances as successful attempts.

This commit is contained in:
Brianna 2020-07-17 21:09:05 -05:00
parent d931173733
commit c23802ec69

View File

@ -306,7 +306,6 @@ public class Kit {
}
private boolean generateRandomItem(List<KitItem> 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;
if (rand < ch || ch == 100) {
itemGiveAmount--;
if (rand < ch || ch == 100) {
ItemStack parseStack = item.getContent().process(player);
if (kitAnimation != KitAnimation.NONE) {