// Path: src/main/java/edu/self/startux/craftBay/event/AuctionBidEvent.java
// public class AuctionBidEvent extends AuctionEvent {
//         private static HandlerList handlers = new HandlerList();
//         private Merchant bidder, oldWinner;
//         private MoneyAmount amount, oldPrice;
// 
//         public AuctionBidEvent(Auction auction, Merchant bidder, MoneyAmount amount, Merchant oldWinner, MoneyAmount oldPrice) {
//                 super(auction);
//                 this.bidder = bidder;
//                 this.amount = amount;
//                 this.oldWinner = oldWinner;
//                 this.oldPrice = oldPrice;
//         }
// 
//         public static HandlerList getHandlerList() {
//                 return handlers;
//         }
// 
//         @Override
//         public HandlerList getHandlers() {
//                 return handlers;
//         }
// 
//         public Merchant getBidder() {
//                 return bidder;
//         }
// 
//         public MoneyAmount getAmount() {
//                 return amount;
//         }
// 
//         public Merchant getOldWinner() {
//                 return oldWinner;
//         }
// 
//         public MoneyAmount getOldPrice() {
//                 return oldPrice;
//         }
// }
// 
// Path: src/main/java/edu/self/startux/craftBay/event/AuctionStartEvent.java
// public class AuctionStartEvent extends AuctionEvent {
//         private static HandlerList handlers = new HandlerList();
// 
//         public AuctionStartEvent(Auction auction) {
//                 super(auction);
//         }
// 
//         public static HandlerList getHandlerList() {
//                 return handlers;
//         }
// 
//         @Override
//         public HandlerList getHandlers() {
//                 return handlers;
//         }
// }
// 
// Path: src/main/java/edu/self/startux/craftBay/event/AuctionTickEvent.java
// public class AuctionTickEvent extends AuctionEvent {
//         private static HandlerList handlers = new HandlerList();
// 
//         public AuctionTickEvent(Auction auction) {
//                 super(auction);
//         }
// 
//         public static HandlerList getHandlerList() {
//                 return handlers;
//         }
// 
//         @Override
//         public HandlerList getHandlers() {
//                 return handlers;
//         }
// }


import edu.self.startux.craftBay.event.AuctionBidEvent;
import edu.self.startux.craftBay.event.AuctionStartEvent;
import edu.self.startux.craftBay.event.AuctionTickEvent;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.ListIterator;
import java.util.Map;
import java.util.UUID;
        bids.addLast(bid);
    }

    @Override
    public boolean bid(Merchant bidder, MoneyAmount bid) {
        if (getState() != AuctionState.RUNNING) return false;
        if (bidder.equals(getOwner()) && !bidder.equals(BankMerchant.getInstance())) {
            bidder.warn(getPlugin().getMessage("auction.bid.IsOwner").set(this, bidder));
            return false;
        }
        if (plugin.getDenyDoubleBid() && bidder.getUuid().equals(lastBidder)) {
            bidder.warn(getPlugin().getMessage("auction.bid.DoubleBid").set(this, bidder));
            return false;
        }
        if (bidder.equals(getWinner()) && bid.getDouble() <= getMaxBid().getDouble() && bidder != BankMerchant.getInstance()) {
            bidder.warn(getPlugin().getMessage("auction.bid.UnderbidSelf").set(this, bidder));
            return false;
        }
        if (bid.getDouble() < getMinimalBid().getDouble()) {
            bidder.warn(getPlugin().getMessage("auction.bid.BidTooSmall").set(this, bidder));
            return false;
        }
        if (!bidder.hasAmount(bid)) {
            bidder.warn(getPlugin().getMessage("auction.bid.TooPoor").set(this, bidder));
            return false;
        }
        MoneyAmount oldPrice = getWinningBid();
        Merchant oldWinner = getWinner();
        addBid(new Bid(bidder, bid));
        if (timeLeft < 10 && !bidder.equals(oldWinner)) { timeLeft = 10; }
// Path: src/main/java/edu/self/startux/craftBay/event/AuctionBidEvent.java
// public class AuctionBidEvent extends AuctionEvent {
//         private static HandlerList handlers = new HandlerList();
//         private Merchant bidder, oldWinner;
//         private MoneyAmount amount, oldPrice;
// 
//         public AuctionBidEvent(Auction auction, Merchant bidder, MoneyAmount amount, Merchant oldWinner, MoneyAmount oldPrice) {
//                 super(auction);
//                 this.bidder = bidder;
//                 this.amount = amount;
//                 this.oldWinner = oldWinner;
//                 this.oldPrice = oldPrice;
//         }
// 
//         public static HandlerList getHandlerList() {
//                 return handlers;
//         }
// 
//         @Override
//         public HandlerList getHandlers() {
//                 return handlers;
//         }
// 
//         public Merchant getBidder() {
//                 return bidder;
//         }
// 
//         public MoneyAmount getAmount() {
//                 return amount;
//         }
// 
//         public Merchant getOldWinner() {
//                 return oldWinner;
//         }
// 
//         public MoneyAmount getOldPrice() {
//                 return oldPrice;
//         }
// }
// 
// Path: src/main/java/edu/self/startux/craftBay/event/AuctionStartEvent.java
// public class AuctionStartEvent extends AuctionEvent {
//         private static HandlerList handlers = new HandlerList();
// 
//         public AuctionStartEvent(Auction auction) {
//                 super(auction);
//         }
// 
//         public static HandlerList getHandlerList() {
//                 return handlers;
//         }
// 
//         @Override
//         public HandlerList getHandlers() {
//                 return handlers;
//         }
// }
// 
// Path: src/main/java/edu/self/startux/craftBay/event/AuctionTickEvent.java
// public class AuctionTickEvent extends AuctionEvent {
//         private static HandlerList handlers = new HandlerList();
// 
//         public AuctionTickEvent(Auction auction) {
//                 super(auction);
//         }
// 
//         public static HandlerList getHandlerList() {
//                 return handlers;
//         }
// 
//         @Override
//         public HandlerList getHandlers() {
//                 return handlers;
//         }
// }


// Path: src/main/java/edu/self/startux/craftBay/TimedAuction.java
import edu.self.startux.craftBay.event.AuctionBidEvent;
import edu.self.startux.craftBay.event.AuctionStartEvent;
import edu.self.startux.craftBay.event.AuctionTickEvent;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.ListIterator;
import java.util.Map;
import java.util.UUID;

        bids.addLast(bid);
    }

    @Override
    public boolean bid(Merchant bidder, MoneyAmount bid) {
        if (getState() != AuctionState.RUNNING) return false;
        if (bidder.equals(getOwner()) && !bidder.equals(BankMerchant.getInstance())) {
            bidder.warn(getPlugin().getMessage("auction.bid.IsOwner").set(this, bidder));
            return false;
        }
        if (plugin.getDenyDoubleBid() && bidder.getUuid().equals(lastBidder)) {
            bidder.warn(getPlugin().getMessage("auction.bid.DoubleBid").set(this, bidder));
            return false;
        }
        if (bidder.equals(getWinner()) && bid.getDouble() <= getMaxBid().getDouble() && bidder != BankMerchant.getInstance()) {
            bidder.warn(getPlugin().getMessage("auction.bid.UnderbidSelf").set(this, bidder));
            return false;
        }
        if (bid.getDouble() < getMinimalBid().getDouble()) {
            bidder.warn(getPlugin().getMessage("auction.bid.BidTooSmall").set(this, bidder));
            return false;
        }
        if (!bidder.hasAmount(bid)) {
            bidder.warn(getPlugin().getMessage("auction.bid.TooPoor").set(this, bidder));
            return false;
        }
        MoneyAmount oldPrice = getWinningBid();
        Merchant oldWinner = getWinner();
        addBid(new Bid(bidder, bid));
        if (timeLeft < 10 && !bidder.equals(oldWinner)) { timeLeft = 10; }
        AuctionBidEvent event = new AuctionBidEvent(this, bidder, bid, oldWinner, oldPrice);