9
0
mirror of https://github.com/Auxilor/EcoBits.git synced 2025-12-19 15:09:19 +00:00

Merge pull request #13 from aven0xx/master

Recipient Payment Notification
This commit is contained in:
Will FP
2025-08-01 09:38:59 +01:00
committed by GitHub
2 changed files with 12 additions and 0 deletions

View File

@@ -88,6 +88,17 @@ class CommandPay(
recipient.adjustBalance(currency, amount.toBigDecimal())
player.adjustBalance(currency, -amount.toBigDecimal())
// Send a message to recipient if connected
if (recipient.isOnline) {
(recipient.player as Player).sendMessage(
plugin.langYml.getMessage("received-money", StringUtils.FormatOption.WITHOUT_PLACEHOLDERS)
.replace("%player%", player.savedDisplayName)
.replace("%amount%", amount.toNiceString())
.replace("%currency%", currency.name)
)
}
player.sendMessage(
plugin.langYml.getMessage("paid-player", StringUtils.FormatOption.WITHOUT_PLACEHOLDERS)
.replace("%player%", recipient.savedDisplayName)

View File

@@ -20,6 +20,7 @@ messages:
cannot-afford: "&cYou can't afford to do this!"
paid-player: "&fYou paid %player%&r &a%amount%&r &f%currency%&f!"
too-much: "&fYou can't pay %player%&r this many &f%currency%&f as they already have too many!"
received-money: "&fYou received &a%amount% &f%currency% from %player%."
top:
name-empty: "&cEmpty"
amount-empty: "&cEmpty"