Check to see if there are no items left to give before continuing.
This commit is contained in:
parent
85011e0453
commit
6e94ac24db
|
@ -324,13 +324,13 @@ public class Kit {
|
|||
itemGiveAmount--;
|
||||
if (rand < ch || ch == 100) {
|
||||
|
||||
ItemStack parseStack = item.getContent().process(player);
|
||||
if (kitAnimation != KitAnimation.NONE) {
|
||||
// TODO: this is a very bad way to solve this problem.
|
||||
// Giving the player kit rewards really should be done outside of the Kit class.
|
||||
plugin.getGuiManager().showGUI(player, new AnimatedKitGui(plugin, player, this, parseStack));
|
||||
plugin.getGuiManager().showGUI(player, new AnimatedKitGui(plugin, player, this, item.getItemForDisplay()));
|
||||
return true;
|
||||
} else {
|
||||
ItemStack parseStack = item.getContent().process(player);
|
||||
if (item.getContent() instanceof KitContentEconomy
|
||||
|| item.getContent() instanceof KitContentCommand)
|
||||
continue;
|
||||
|
@ -347,7 +347,7 @@ public class Kit {
|
|||
}
|
||||
}
|
||||
|
||||
if (itemGiveAmount != 0) {
|
||||
if (itemGiveAmount > 0 && !innerContents.isEmpty()) {
|
||||
return generateRandomItem(innerContents, itemGiveAmount, player);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue