Fixes a bug in refunding
This commit is contained in:
parent
c2ffe5e903
commit
a7d1da7f8a
@ -58,4 +58,14 @@ public final class EconomyManager {
|
|||||||
economy.withdrawPlayer(player, cost);
|
economy.withdrawPlayer(player, cost);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Deposits a given sum into the given player's account
|
||||||
|
*
|
||||||
|
* @param player <p>The player to deposit money to</p>
|
||||||
|
* @param sum <p>The amount of money to deposit</p>
|
||||||
|
*/
|
||||||
|
public static void deposit(OfflinePlayer player, double sum) {
|
||||||
|
economy.depositPlayer(player, sum);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -64,7 +64,7 @@ public final class TrackedSignManager {
|
|||||||
}
|
}
|
||||||
OfflinePlayer offlinePlayer = Bukkit.getOfflinePlayer(trackedSign.getPlayerId());
|
OfflinePlayer offlinePlayer = Bukkit.getOfflinePlayer(trackedSign.getPlayerId());
|
||||||
double refundSum = trackedSign.getCost() / 100 * PaidSigns.getInstance().getRefundPercentage();
|
double refundSum = trackedSign.getCost() / 100 * PaidSigns.getInstance().getRefundPercentage();
|
||||||
EconomyManager.withdraw(offlinePlayer, -refundSum);
|
EconomyManager.deposit(offlinePlayer, refundSum);
|
||||||
if (offlinePlayer instanceof Player player) {
|
if (offlinePlayer instanceof Player player) {
|
||||||
player.sendMessage(String.format(StringFormatter.replacePlaceholders(
|
player.sendMessage(String.format(StringFormatter.replacePlaceholders(
|
||||||
StringFormatter.getTranslatedInfoMessage(TranslatableMessage.SUCCESS_REFUNDED),
|
StringFormatter.getTranslatedInfoMessage(TranslatableMessage.SUCCESS_REFUNDED),
|
||||||
|
Loading…
Reference in New Issue
Block a user