mirror of
https://github.com/kiranhart/Auction-House.git
synced 2025-01-07 12:47:36 +01:00
🔢 Fix negative bidding
Took 3 minutes
This commit is contained in:
parent
9e02748911
commit
768e234c88
@ -277,12 +277,17 @@ public class GUIAuctionHouse extends AbstractPlaceholderGui {
|
||||
string = ChatColor.stripColor(string);
|
||||
|
||||
if (!NumberUtils.isDouble(string)) {
|
||||
AuctionHouse.getInstance().getLocale().getMessage("general.notanumber").processPlaceholder("value", string).sendPrefixedMessage(player);
|
||||
AuctionHouse.getInstance().getLocale().getMessage("general.notanumber").processPlaceholder("value", string).sendPrefixedMessage(player);
|
||||
return false;
|
||||
}
|
||||
|
||||
double value = Double.parseDouble(string);
|
||||
|
||||
if (value <= 0) {
|
||||
AuctionHouse.getInstance().getLocale().getMessage("general.cannotbezero").sendPrefixedMessage(e.player);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (value > Settings.MAX_AUCTION_INCREMENT_PRICE.getDouble()) {
|
||||
AuctionHouse.getInstance().getLocale().getMessage("pricing.maxbidincrementprice").processPlaceholder("price", Settings.MAX_AUCTION_INCREMENT_PRICE.getDouble()).sendPrefixedMessage(e.player);
|
||||
return false;
|
||||
|
@ -92,12 +92,17 @@ public class GUIBid extends AbstractPlaceholderGui {
|
||||
string = ChatColor.stripColor(string);
|
||||
|
||||
if (!NumberUtils.isDouble(string)) {
|
||||
AuctionHouse.getInstance().getLocale().getMessage("general.notanumber").processPlaceholder("value", string).sendPrefixedMessage(player);
|
||||
AuctionHouse.getInstance().getLocale().getMessage("general.notanumber").processPlaceholder("value", string).sendPrefixedMessage(player);
|
||||
return false;
|
||||
}
|
||||
|
||||
double value = Double.parseDouble(string);
|
||||
|
||||
if (value <= 0) {
|
||||
AuctionHouse.getInstance().getLocale().getMessage("general.cannotbezero").sendPrefixedMessage(e.player);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (value > Settings.MAX_AUCTION_INCREMENT_PRICE.getDouble()) {
|
||||
AuctionHouse.getInstance().getLocale().getMessage("pricing.maxbidincrementprice").processPlaceholder("price", Settings.MAX_AUCTION_INCREMENT_PRICE.getDouble()).sendPrefixedMessage(e.player);
|
||||
return false;
|
||||
|
@ -43,6 +43,7 @@ public class LocaleSettings {
|
||||
languageNodes.put("general.locked", "&cThe Auction House is currently locked!");
|
||||
languageNodes.put("general.playernotfound", "&cCould not find the player &4%player%");
|
||||
languageNodes.put("general.notenoughmoney", "&cYou do not have enough money!");
|
||||
languageNodes.put("general.cannotbezero", "&cPlease provide a number greater than zero");
|
||||
languageNodes.put("general.cantbidonown", "&cYou cannot bid on your own item!");
|
||||
languageNodes.put("general.alreadyhighestbidder", "&cYou are already the highest bidder!");
|
||||
languageNodes.put("general.cantbuyown", "&cYou cannot buy your own item!");
|
||||
|
Loading…
Reference in New Issue
Block a user