diff --git a/eco-core/core-plugin/src/main/kotlin/com/willfp/boosters/boosters/Booster.kt b/eco-core/core-plugin/src/main/kotlin/com/willfp/boosters/boosters/Booster.kt index a1721c8..1337b49 100644 --- a/eco-core/core-plugin/src/main/kotlin/com/willfp/boosters/boosters/Booster.kt +++ b/eco-core/core-plugin/src/main/kotlin/com/willfp/boosters/boosters/Booster.kt @@ -51,7 +51,7 @@ class Booster( return ItemStackBuilder(Items.lookup(config.getString("gui.item"))) .setDisplayName(config.getFormattedString("gui.name")) .addLoreLines( - config.getFormattedStrings("gui.lore", StringUtils.FormatOption.WITHOUT_PLACEHOLDERS) + config.getStrings("gui.lore") .map { it.replace("%amount%", player.getAmountOfBooster(this).toString()) } .formatEco(player) ) diff --git a/eco-core/core-plugin/src/main/kotlin/com/willfp/boosters/commands/CommandGive.kt b/eco-core/core-plugin/src/main/kotlin/com/willfp/boosters/commands/CommandGive.kt index 986f8e1..6cf6e61 100644 --- a/eco-core/core-plugin/src/main/kotlin/com/willfp/boosters/commands/CommandGive.kt +++ b/eco-core/core-plugin/src/main/kotlin/com/willfp/boosters/commands/CommandGive.kt @@ -36,6 +36,12 @@ class CommandGive(plugin: EcoPlugin) : return } + var amount = 1 + + if (args.size >= 3) { + amount = args[2].toIntOrNull() ?: amount + } + this.plugin.scheduler.runAsync { @Suppress("DEPRECATION") val player = Bukkit.getOfflinePlayer(args[0]) @@ -45,13 +51,14 @@ class CommandGive(plugin: EcoPlugin) : } this.plugin.scheduler.run { - player.setAmountOfBooster(booster, player.getAmountOfBooster(booster) + 1) + player.setAmountOfBooster(booster, player.getAmountOfBooster(booster) + amount) } sender.sendMessage( plugin.langYml.getMessage("gave-booster", StringUtils.FormatOption.WITHOUT_PLACEHOLDERS) .replace("%player%", player.name ?: return@runAsync) .replace("%booster%", booster.id) + .replace("%amount%", amount.toString()) ) } } @@ -77,6 +84,22 @@ class CommandGive(plugin: EcoPlugin) : return completions } + if (args.size == 3) { + StringUtil.copyPartialMatches( + args[1], + listOf( + "1", + "2", + "3", + "4", + "5", + "10" + ), + completions + ) + return completions + } + return emptyList() } }