Never dupe kits.

This commit is contained in:
Brianna 2020-06-11 10:04:09 -05:00
parent c0bfa2431a
commit 634d080630
1 changed files with 3 additions and 1 deletions

View File

@ -308,7 +308,7 @@ public class Kit {
if (innerContents.size() != itemGiveAmount || kitAnimation != KitAnimation.NONE)
Collections.shuffle(innerContents);
for (KitItem item : innerContents) {
for (KitItem item : new ArrayList<>(innerContents)) {
if (itemGiveAmount == 0) break;
double ch = item.getChance() == 0 ? 100 : item.getChance();
double rand = Math.random() * 100;
@ -326,6 +326,8 @@ public class Kit {
|| item.getContent() instanceof KitContentCommand)
continue;
innerContents.remove(item);
if (Settings.AUTO_EQUIP_ARMOR.getBoolean() && ArmorType.equip(player, parseStack)) continue;
Map<Integer, ItemStack> overfilled = player.getInventory().addItem(parseStack);