9
0
mirror of https://github.com/Auxilor/EcoBits.git synced 2026-01-06 15:52:04 +00:00

Fixed commands

This commit is contained in:
Auxilor
2023-05-17 17:02:19 +01:00
parent 82984018f3
commit d2946c172c
6 changed files with 9 additions and 9 deletions

View File

@@ -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)

View File

@@ -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> {

View File

@@ -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)

View File

@@ -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)

View File

@@ -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)

View File

@@ -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> {