mirror of
https://github.com/kiranhart/Auction-House.git
synced 2025-02-09 18:11:31 +01:00
Fixed bug where sell menu would exit / not give item back if listing fee could not be paid
Took 2 minutes
This commit is contained in:
parent
c9c6462f04
commit
e161603868
@ -628,7 +628,7 @@ public class AuctionAPI {
|
||||
return NBTEditor.contains(item, "AuctionHouseRepaired");
|
||||
}
|
||||
|
||||
private double calculateListingFee(double basePrice) {
|
||||
public double calculateListingFee(double basePrice) {
|
||||
return Settings.TAX_LISTING_FEE_PERCENTAGE.getBoolean() ? (Settings.TAX_LISTING_FEE.getDouble() / 100D) * basePrice : Settings.TAX_LISTING_FEE.getDouble();
|
||||
}
|
||||
|
||||
|
@ -9,6 +9,7 @@ import ca.tweetzy.auctionhouse.helpers.ConfigurationItemHelper;
|
||||
import ca.tweetzy.auctionhouse.settings.Settings;
|
||||
import ca.tweetzy.core.compatibility.XMaterial;
|
||||
import ca.tweetzy.core.gui.events.GuiClickEvent;
|
||||
import ca.tweetzy.core.hooks.EconomyManager;
|
||||
import ca.tweetzy.core.input.ChatPrompt;
|
||||
import ca.tweetzy.core.input.PlayerChatInput;
|
||||
import ca.tweetzy.core.utils.NumberUtils;
|
||||
@ -330,6 +331,15 @@ public class GUISellItem extends AbstractPlaceholderGui {
|
||||
return;
|
||||
}
|
||||
|
||||
if (Settings.TAX_ENABLED.getBoolean() && Settings.TAX_CHARGE_LISTING_FEE.getBoolean()) {
|
||||
final double listingFee = AuctionAPI.getInstance().calculateListingFee(this.isBiddingItem && !isAllowingBuyNow || !Settings.ALLOW_USAGE_OF_BUY_NOW_SYSTEM.getBoolean() ? -1 : buyNowPrice);
|
||||
|
||||
if (!EconomyManager.hasBalance(e.player, listingFee)) {
|
||||
AuctionHouse.getInstance().getLocale().getMessage("auction.tax.cannotpaylistingfee").processPlaceholder("price", listingFee).sendPrefixedMessage(e.player);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (Settings.ASK_FOR_LISTING_CONFIRMATION.getBoolean()) {
|
||||
setAllowClose(true);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user