🔨 fixed request minimum/maximum prices using incorrect values. Closes #102

Took 2 minutes
This commit is contained in:
Kiran Hart 2024-10-11 11:26:08 -04:00
parent 5539088f16
commit 8b4736fd67
No known key found for this signature in database
GPG Key ID: 5F36C7BC79D3EBC3
2 changed files with 9 additions and 4 deletions

View File

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

View File

@ -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,