Makes sure forced refunds always refund the full amount
This commit is contained in:
parent
e7c40fb4b0
commit
dd47ce06eb
@ -153,7 +153,13 @@ public final class TrackedSignManager {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
OfflinePlayer offlinePlayer = Bukkit.getOfflinePlayer(trackedSign.playerId());
|
OfflinePlayer offlinePlayer = Bukkit.getOfflinePlayer(trackedSign.playerId());
|
||||||
double refundSum = trackedSign.cost() / 100 * PaidSigns.getInstance().getRefundPercentage();
|
double refundSum;
|
||||||
|
if (forceRefund) {
|
||||||
|
//In the case where a refund is forced, the normal refund rate should not apply
|
||||||
|
refundSum = trackedSign.cost();
|
||||||
|
} else {
|
||||||
|
refundSum = trackedSign.cost() / 100 * PaidSigns.getInstance().getRefundPercentage();
|
||||||
|
}
|
||||||
EconomyManager.deposit(offlinePlayer, refundSum);
|
EconomyManager.deposit(offlinePlayer, refundSum);
|
||||||
if (offlinePlayer instanceof Player player) {
|
if (offlinePlayer instanceof Player player) {
|
||||||
PaidSigns.getStringFormatter().displaySuccessMessage(player, String.format(
|
PaidSigns.getStringFormatter().displaySuccessMessage(player, String.format(
|
||||||
|
Loading…
Reference in New Issue
Block a user