mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-12 17:47:32 +00:00
Merge remote-tracking branch 'origin/dev' into dev
This commit is contained in:
commit
08728efcdd
4 files changed
+16
-2
No files matched your search
@@ -126,7 +126,7 @@ public class GuiAuctionBidding extends GuiAuctionInterface implements ISubGuiLis
|
||||
private void openBidSubGui() {
|
||||
if (listing == null) return;
|
||||
long minBid = listing.getMinimumBid(AuctionClientConfig.getMinBidIncrement());
|
||||
setSubGui(new SubGuiAuctionBid(listing.id, minBid, playerBalance));
|
||||
setSubGui(new SubGuiAuctionBid(listing.id, minBid, listing.buyoutPrice, playerBalance));
|
||||
}
|
||||
|
||||
private void openBuyNowSubGui() {
|
||||
|
||||
@@ -23,14 +23,16 @@ public class SubGuiAuctionBid extends SubGuiInterface implements ITextfieldListe
|
||||
|
||||
private final String listingId;
|
||||
private final long minimumBid;
|
||||
private final long buyoutPrice;
|
||||
private final long playerBalance;
|
||||
private long bidAmount;
|
||||
private boolean successful = false;
|
||||
private String errorMessage = null;
|
||||
|
||||
public SubGuiAuctionBid(String listingId, long minimumBid, long playerBalance) {
|
||||
public SubGuiAuctionBid(String listingId, long minimumBid, long buyoutPrice, long playerBalance) {
|
||||
this.listingId = listingId;
|
||||
this.minimumBid = minimumBid;
|
||||
this.buyoutPrice = buyoutPrice;
|
||||
this.playerBalance = playerBalance;
|
||||
this.bidAmount = minimumBid;
|
||||
|
||||
@@ -129,6 +131,12 @@ public class SubGuiAuctionBid extends SubGuiInterface implements ITextfieldListe
|
||||
return;
|
||||
}
|
||||
|
||||
if (buyoutPrice > 0 && bidAmount >= buyoutPrice) {
|
||||
errorMessage = StatCollector.translateToLocal("auction.error.bidExceedsBuyout");
|
||||
updateErrorLabel();
|
||||
return;
|
||||
}
|
||||
|
||||
// Send bid packet
|
||||
AuctionActionPacket.placeBid(listingId, bidAmount);
|
||||
successful = true;
|
||||
|
||||
@@ -585,6 +585,11 @@ public class AuctionController implements IAuctionHandler {
|
||||
return "Bid must be at least " + minBid + " " + ConfigMarket.CurrencyName + ".";
|
||||
}
|
||||
|
||||
// Prevent bidding at or above buyout price
|
||||
if (listing.hasBuyout() && bidAmount >= listing.buyoutPrice) {
|
||||
return "Your bid meets or exceeds the buyout price. Use Buy Now instead.";
|
||||
}
|
||||
|
||||
// Check currency
|
||||
PlayerData playerData = PlayerData.get(player);
|
||||
if (playerData == null) {
|
||||
|
||||
Reference in new issue
Block a user