mirror of
https://github.com/songoda/UltimateKits.git
synced 2024-11-08 19:51:36 +01:00
cleanup
This commit is contained in:
parent
4be7e3c50b
commit
8ce97e7702
@ -276,11 +276,11 @@ public class Kit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private boolean giveKit(Player player, Key key) {
|
private boolean giveKit(Player player, Key key) {
|
||||||
if (plugin.getConfig().getBoolean("Main.Prevent The Redeeming of a Kit When Inventory Is Full") && !hasRoom(player)) {
|
if (Settings.NO_REDEEM_WHEN_FULL.getBoolean() && !hasRoom(player)) {
|
||||||
plugin.getLocale().getMessage("event.claim.full").sendPrefixedMessage(player);
|
plugin.getLocale().getMessage("event.claim.full").sendPrefixedMessage(player);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (plugin.getConfig().getBoolean("Main.Sounds Enabled") && kitAnimation == KitAnimation.NONE)
|
if (Settings.SOUNDS_ENABLED.getBoolean() && kitAnimation == KitAnimation.NONE)
|
||||||
CompatibleSound.ENTITY_PLAYER_LEVELUP.play(player, 0.6F, 15.0F);
|
CompatibleSound.ENTITY_PLAYER_LEVELUP.play(player, 0.6F, 15.0F);
|
||||||
|
|
||||||
List<KitItem> innerContents = new ArrayList<>(getContents());
|
List<KitItem> innerContents = new ArrayList<>(getContents());
|
||||||
@ -353,7 +353,11 @@ public class Kit {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!chosenItem) generateRandomItem(innerContents, amtToGive, player, (int) (Math.random() * canChoose));
|
if (!chosenItem && canChoose != 0 && forceSelect == -1) {
|
||||||
|
return generateRandomItem(innerContents, amtToGive, player, (int) (Math.random() * canChoose));
|
||||||
|
} else if (!chosenItem) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
player.updateInventory();
|
player.updateInventory();
|
||||||
return true;
|
return true;
|
||||||
|
Loading…
Reference in New Issue
Block a user