diff --git a/src/main/java/ca/tweetzy/auctionhouse/commands/CommandRequest.java b/src/main/java/ca/tweetzy/auctionhouse/commands/CommandRequest.java index a39fbef..7f8de25 100644 --- a/src/main/java/ca/tweetzy/auctionhouse/commands/CommandRequest.java +++ b/src/main/java/ca/tweetzy/auctionhouse/commands/CommandRequest.java @@ -107,7 +107,7 @@ public class CommandRequest extends Command { } if (args.length < 1) { - AuctionHouse.getGuiManager().showGUI(player, new GUIRequestItem(auctionPlayer, originalItem, originalItem.getAmount(), 1)); + AuctionHouse.getGuiManager().showGUI(player, new GUIRequestItem(auctionPlayer, originalItem, originalItem.getAmount(), Settings.MIN_REQUEST_PRICE.getDouble())); return ReturnType.SUCCESS; } @@ -137,12 +137,12 @@ public class CommandRequest extends Command { // check min/max prices final double price = Double.parseDouble(args[0]); - if (price < Settings.MIN_AUCTION_PRICE.getDouble()) { + if (price < Settings.MIN_REQUEST_PRICE.getDouble()) { AuctionHouse.getInstance().getLocale().getMessage("pricing.request.min price").processPlaceholder("price", Settings.MIN_REQUEST_PRICE.getDouble()).sendPrefixedMessage(player); return ReturnType.FAIL; } - if (price > Settings.MAX_AUCTION_PRICE.getDouble()) { + if (price > Settings.MAX_REQUEST_PRICE.getDouble()) { AuctionHouse.getInstance().getLocale().getMessage("pricing.request.max price").processPlaceholder("price", Settings.MAX_REQUEST_PRICE.getDouble()).sendPrefixedMessage(player); return ReturnType.FAIL; } diff --git a/src/main/java/ca/tweetzy/auctionhouse/guis/sell/GUIRequestItem.java b/src/main/java/ca/tweetzy/auctionhouse/guis/sell/GUIRequestItem.java index 1457590..3168da5 100644 --- a/src/main/java/ca/tweetzy/auctionhouse/guis/sell/GUIRequestItem.java +++ b/src/main/java/ca/tweetzy/auctionhouse/guis/sell/GUIRequestItem.java @@ -138,11 +138,16 @@ public final class GUIRequestItem extends AuctionBaseGUI { return false; } - if (newPrice > Settings.MAX_AUCTION_PRICE.getDouble()) { + if (newPrice > Settings.MAX_REQUEST_PRICE.getDouble()) { AuctionHouse.getInstance().getLocale().getMessage("pricing.request.max price").processPlaceholder("price", Settings.MAX_REQUEST_PRICE.getDouble()).sendPrefixedMessage(player); return false; } + if (newPrice < Settings.MIN_REQUEST_PRICE.getDouble()) { + AuctionHouse.getInstance().getLocale().getMessage("pricing.request.min price").processPlaceholder("price", Settings.MIN_REQUEST_PRICE.getDouble()).sendPrefixedMessage(player); + return false; + } + click.manager.showGUI(click.player, new GUIRequestItem( GUIRequestItem.this.auctionPlayer, GUIRequestItem.this.itemRequested,