diff --git a/src/main/java/ca/tweetzy/auctionhouse/commands/CommandSell.java b/src/main/java/ca/tweetzy/auctionhouse/commands/CommandSell.java index 504593d..047abd0 100644 --- a/src/main/java/ca/tweetzy/auctionhouse/commands/CommandSell.java +++ b/src/main/java/ca/tweetzy/auctionhouse/commands/CommandSell.java @@ -299,13 +299,11 @@ public final class CommandSell extends AbstractCommand { } // update the listing time to the max allowed time if it wasn't set using the command flag -// allowedTime = allowedTime != 0 ? allowedTime : auctionPlayer.getAllowedSellTime( -// buyNowPrice != null && startingBid != null ? -// /*isBiddingItem ?*/ AuctionSaleType.USED_BIDDING_SYSTEM : AuctionSaleType.WITHOUT_BIDDING_SYSTEM -// ); + allowedTime = allowedTime != 0 ? allowedTime : auctionPlayer.getAllowedSellTime( + isBiddingItem ? AuctionSaleType.USED_BIDDING_SYSTEM : AuctionSaleType.WITHOUT_BIDDING_SYSTEM + ); + - allowedTime = allowedTime != 0 ? allowedTime : auctionPlayer.getAllowedSellTime(AuctionSaleType.WITHOUT_BIDDING_SYSTEM); - Bukkit.broadcastMessage(""+allowedTime); // Check list delay if (!auctionPlayer.canListItem()) { diff --git a/src/main/java/ca/tweetzy/auctionhouse/guis/GUIAuctionHouse.java b/src/main/java/ca/tweetzy/auctionhouse/guis/GUIAuctionHouse.java index e6a3c02..e52f2df 100644 --- a/src/main/java/ca/tweetzy/auctionhouse/guis/GUIAuctionHouse.java +++ b/src/main/java/ca/tweetzy/auctionhouse/guis/GUIAuctionHouse.java @@ -526,8 +526,13 @@ public class GUIAuctionHouse extends AbstractPlaceholderGui { return; } - AuctionHouse.getInstance().getGuiManager().showGUI(player, new GUISellListingType(auctionPlayer, selected -> { - AuctionHouse.getInstance().getGuiManager().showGUI(player, new GUISellPlaceItem(auctionPlayer, GUISellPlaceItem.ViewMode.SINGLE_ITEM, selected)); + if (this.auctionPlayer.isAtSellLimit()) { + AuctionHouse.getInstance().getLocale().getMessage("general.sellinglimit").sendPrefixedMessage(player); + return; + } + + AuctionHouse.getInstance().getGuiManager().showGUI(player, new GUISellListingType(this.auctionPlayer, selected -> { + AuctionHouse.getInstance().getGuiManager().showGUI(player, new GUISellPlaceItem(this.auctionPlayer, GUISellPlaceItem.ViewMode.SINGLE_ITEM, selected)); })); }); }