fixed bug with the auction end system.

This commit is contained in:
Kiran Hart 2021-06-26 15:50:29 -04:00
parent c2c1846511
commit 5181f1cd9c
3 changed files with 5 additions and 3 deletions

View File

@ -6,7 +6,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>ca.tweetzy</groupId>
<artifactId>auctionhouse</artifactId>
<version>2.17.0</version>
<version>2.17.1</version>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

View File

@ -82,6 +82,7 @@ public class GUIActiveAuctions extends Gui {
case RIGHT:
if (Settings.ALLOW_PLAYERS_TO_ACCEPT_BID.getBoolean() && item.getBidStartPrice() != 0 && !item.getHighestBidder().equals(e.player.getUniqueId())) {
item.setRemainingTime(0);
draw();
}
break;
}

View File

@ -53,7 +53,7 @@ public class TickAuctionsTask extends BukkitRunnable {
}
if (auctionItem.getRemainingTime() <= 0) {
if (auctionItem.getOwner().equals(auctionItem.getHighestBidder())) {
if (auctionItem.getHighestBidder().equals(auctionItem.getOwner())) {
auctionItem.setExpired(true);
continue;
}
@ -67,7 +67,8 @@ public class TickAuctionsTask extends BukkitRunnable {
AuctionEndEvent auctionEndEvent = new AuctionEndEvent(Bukkit.getOfflinePlayer(auctionItem.getOwner()), auctionWinner, auctionItem, AuctionSaleType.USED_BIDDING_SYSTEM);
AuctionHouse.getInstance().getServer().getPluginManager().callEvent(auctionEndEvent);
if (!auctionEndEvent.isCancelled()) continue;
if (auctionEndEvent.isCancelled()) continue;
AuctionHouse.getInstance().getEconomyManager().withdrawPlayer(auctionWinner, auctionItem.getCurrentPrice());
AuctionHouse.getInstance().getEconomyManager().depositPlayer(Bukkit.getOfflinePlayer(auctionItem.getOwner()), auctionItem.getCurrentPrice());