🐛fixed bug where users can bypass sell limit when using the list button within the main gui

Took 3 minutes

Took 4 minutes
This commit is contained in:
Kiran Hart 2023-02-23 12:45:46 -05:00
parent e0e2d1c20f
commit fc6574efb9
No known key found for this signature in database
GPG Key ID: 5F36C7BC79D3EBC3
2 changed files with 11 additions and 8 deletions

View File

@ -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()) {

View File

@ -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));
}));
});
}