Skip to content

Commit

Permalink
CurrencySubcommand.kt: use TextArgument instead of StringArgument
Browse files Browse the repository at this point in the history
Allows whitespace symbols etc if surrounded by double quotes
  • Loading branch information
lokka30 committed Jan 5, 2025
1 parent 0da9bd3 commit 86f5511
Showing 1 changed file with 16 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package io.github.arcaneplugins.polyconomy.plugin.bukkit.command.polyconomy.subc
import dev.jorel.commandapi.CommandAPI
import dev.jorel.commandapi.CommandAPICommand
import dev.jorel.commandapi.arguments.DoubleArgument
import dev.jorel.commandapi.arguments.StringArgument
import dev.jorel.commandapi.arguments.TextArgument
import dev.jorel.commandapi.executors.CommandExecutor
import io.github.arcaneplugins.polyconomy.api.currency.Currency
import io.github.arcaneplugins.polyconomy.plugin.bukkit.Polyconomy
Expand Down Expand Up @@ -46,22 +46,22 @@ object CurrencySubcommand : InternalCmd {
CommandAPICommand("symbol")
.withArguments(
CustomArguments.currencyArgument(plugin, "currency"),
StringArgument("newValue"))
TextArgument("newValue"))
.executes(CommandExecutor { sender, args ->
val currency = args.get("currency") as Currency
val newValue = args.get("newValue") as String
throw CommandAPI.failWithString("Not yet implemented!")
}),
CommandAPICommand("amountFormat")
.withArguments(CustomArguments.currencyArgument(plugin, "currency"),
StringArgument("newValue"))
TextArgument("newValue"))
.executes(CommandExecutor { sender, args ->
val currency = args.get("currency") as Currency
val newValue = args.get("newValue") as String
throw CommandAPI.failWithString("Not yet implemented!")
}),
CommandAPICommand("presentationFormat")
.withArguments(StringArgument("newValue"))
.withArguments(TextArgument("newValue"))
.executes(CommandExecutor { sender, args ->
val currency = args.get("currency") as Currency
val newValue = args.get("newValue") as String
Expand All @@ -81,9 +81,9 @@ object CurrencySubcommand : InternalCmd {
.withArguments(
CustomArguments.currencyArgument(plugin, "currency"),
CustomArguments.localeArgument("locale"),
StringArgument("dispNameSingular"),
StringArgument("dispNamePlural"),
StringArgument("dispDecimal"),
TextArgument("dispNameSingular"),
TextArgument("dispNamePlural"),
TextArgument("dispDecimal"),
)
.executes(CommandExecutor { sender, args ->
val locale = args.get("locale") as Locale
Expand All @@ -93,9 +93,9 @@ object CurrencySubcommand : InternalCmd {
.withArguments(
CustomArguments.currencyArgument(plugin, "currency"),
CustomArguments.localeArgument("locale"),
StringArgument("dispNameSingular"),
StringArgument("dispNamePlural"),
StringArgument("dispDecimal"),
TextArgument("dispNameSingular"),
TextArgument("dispNamePlural"),
TextArgument("dispDecimal"),
)
.executes(CommandExecutor { sender, args ->
val locale = args.get("locale") as Locale
Expand All @@ -120,16 +120,16 @@ object CurrencySubcommand : InternalCmd {
.withArguments(
CustomArguments.identityStringArgument("name"),
DoubleArgument("startingBalance"),
StringArgument("symbol"),
TextArgument("symbol"),
DoubleArgument("conversionRate"),
CustomArguments.localeArgument("dispLocale"),
StringArgument("dispNameSingular"),
StringArgument("dispNamePlural"),
StringArgument("dispDecimal"),
TextArgument("dispNameSingular"),
TextArgument("dispNamePlural"),
TextArgument("dispDecimal"),
)
.withOptionalArguments(
StringArgument("presentationFormat"),
StringArgument("amountFormat"),
TextArgument("presentationFormat"),
TextArgument("amountFormat"),
)
.executes(CommandExecutor { sender, args ->
val name = args.get("name") as String
Expand Down

0 comments on commit 86f5511

Please sign in to comment.