From dd47ce06ebcab856d2efb3e753c6d5b1a0c57e28 Mon Sep 17 00:00:00 2001 From: EpicKnarvik97 Date: Sun, 13 Nov 2022 22:39:11 +0000 Subject: [PATCH] Makes sure forced refunds always refund the full amount --- .../knarcraft/paidsigns/manager/TrackedSignManager.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/main/java/net/knarcraft/paidsigns/manager/TrackedSignManager.java b/src/main/java/net/knarcraft/paidsigns/manager/TrackedSignManager.java index abeef20..33a7cc2 100644 --- a/src/main/java/net/knarcraft/paidsigns/manager/TrackedSignManager.java +++ b/src/main/java/net/knarcraft/paidsigns/manager/TrackedSignManager.java @@ -153,7 +153,13 @@ public final class TrackedSignManager { return; } 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); if (offlinePlayer instanceof Player player) { PaidSigns.getStringFormatter().displaySuccessMessage(player, String.format(