mirror of
https://github.com/Auxilor/EcoBits.git
synced 2026-01-06 15:52:04 +00:00
Fixed commands
This commit is contained in:
@@ -63,7 +63,7 @@ class CommandGive(
|
||||
return
|
||||
}
|
||||
|
||||
player.adjustBalance(currency, amount)
|
||||
player.adjustBalance(currency, amount.toBigDecimal())
|
||||
|
||||
sender.sendMessage(
|
||||
plugin.langYml.getMessage("gave-currency", StringUtils.FormatOption.WITHOUT_PLACEHOLDERS)
|
||||
|
||||
@@ -49,7 +49,7 @@ class CommandGivesilent(
|
||||
|
||||
val amount = args[2 + argOffset].toDoubleOrNull() ?: return
|
||||
|
||||
player.adjustBalance(currency, amount)
|
||||
player.adjustBalance(currency, amount.toBigDecimal())
|
||||
}
|
||||
|
||||
override fun tabComplete(sender: CommandSender, args: List<String>): List<String> {
|
||||
|
||||
@@ -72,18 +72,18 @@ class CommandPay(
|
||||
return
|
||||
}
|
||||
|
||||
if (player.getBalance(currency) < amount) {
|
||||
if (player.getBalance(currency) < amount.toBigDecimal()) {
|
||||
player.sendMessage(plugin.langYml.getMessage("cannot-afford"))
|
||||
return
|
||||
}
|
||||
|
||||
if (recipient.getBalance(currency) + amount > currency.max) {
|
||||
if (recipient.getBalance(currency) + amount.toBigDecimal() > currency.max) {
|
||||
player.sendMessage(plugin.langYml.getMessage("too-much"))
|
||||
return
|
||||
}
|
||||
|
||||
recipient.adjustBalance(currency, amount)
|
||||
player.adjustBalance(currency, -amount)
|
||||
recipient.adjustBalance(currency, amount.toBigDecimal())
|
||||
player.adjustBalance(currency, -amount.toBigDecimal())
|
||||
|
||||
player.sendMessage(
|
||||
plugin.langYml.getMessage("paid-player", StringUtils.FormatOption.WITHOUT_PLACEHOLDERS)
|
||||
|
||||
@@ -64,7 +64,7 @@ class CommandSet(
|
||||
return
|
||||
}
|
||||
|
||||
player.setBalance(currency, amount)
|
||||
player.setBalance(currency, amount.toBigDecimal())
|
||||
|
||||
sender.sendMessage(
|
||||
plugin.langYml.getMessage("set-currency", StringUtils.FormatOption.WITHOUT_PLACEHOLDERS)
|
||||
|
||||
@@ -64,7 +64,7 @@ class CommandTake(
|
||||
return
|
||||
}
|
||||
|
||||
player.adjustBalance(currency, -amount)
|
||||
player.adjustBalance(currency, -amount.toBigDecimal())
|
||||
|
||||
sender.sendMessage(
|
||||
plugin.langYml.getMessage("took-currency", StringUtils.FormatOption.WITHOUT_PLACEHOLDERS)
|
||||
|
||||
@@ -49,7 +49,7 @@ class CommandTakesilent(
|
||||
|
||||
val amount = args[2 + argOffset].toDoubleOrNull() ?: return
|
||||
|
||||
player.adjustBalance(currency, -amount)
|
||||
player.adjustBalance(currency, -amount.toBigDecimal())
|
||||
}
|
||||
|
||||
override fun tabComplete(sender: CommandSender, args: List<String>): List<String> {
|
||||
|
||||
Reference in New Issue
Block a user