diff --git a/src/main/java/ca/tweetzy/auctionhouse/commands/CommandSell.java b/src/main/java/ca/tweetzy/auctionhouse/commands/CommandSell.java index 1284205..7eecdb3 100644 --- a/src/main/java/ca/tweetzy/auctionhouse/commands/CommandSell.java +++ b/src/main/java/ca/tweetzy/auctionhouse/commands/CommandSell.java @@ -348,7 +348,7 @@ public final class CommandSell extends AbstractCommand { AuctionHouse.getInstance().getAuctionPlayerManager().processSell(player); player.closeInventory(); - PlayerUtils.giveItem(player, auctionedItem.getItem()); +// PlayerUtils.giveItem(player, auctionedItem.getItem()); auctionPlayer.setItemBeingListed(null); return; } diff --git a/src/main/java/ca/tweetzy/auctionhouse/guis/confirmation/GUIListingConfirm.java b/src/main/java/ca/tweetzy/auctionhouse/guis/confirmation/GUIListingConfirm.java index d78dd3d..a60f58a 100644 --- a/src/main/java/ca/tweetzy/auctionhouse/guis/confirmation/GUIListingConfirm.java +++ b/src/main/java/ca/tweetzy/auctionhouse/guis/confirmation/GUIListingConfirm.java @@ -26,6 +26,9 @@ import ca.tweetzy.core.utils.TextUtils; import org.bukkit.entity.Player; import org.bukkit.event.inventory.ClickType; +import java.util.HashSet; +import java.util.Set; +import java.util.UUID; import java.util.function.Consumer; public final class GUIListingConfirm extends AbstractPlaceholderGui { @@ -33,6 +36,8 @@ public final class GUIListingConfirm extends AbstractPlaceholderGui { private final AuctionedItem auctionedItem; private final Consumer result; + private final Set resulted = new HashSet<>(); + public GUIListingConfirm(Player player, AuctionedItem auctionedItem, Consumer result) { super(player); this.auctionedItem = auctionedItem; @@ -44,16 +49,23 @@ public final class GUIListingConfirm extends AbstractPlaceholderGui { draw(); } + private void draw() { setItems(0, 3, getConfirmListingYesItem()); setItem(0, 4, this.auctionedItem.getDisplayStack(AuctionStackType.LISTING_PREVIEW)); setItems(5, 8, getConfirmListingNoItem()); setActionForRange(5, 8, ClickType.LEFT, e -> { + if (resulted.contains(e.player.getUniqueId())) return; + resulted.add(e.player.getUniqueId()); + setAllowClose(true); this.result.accept(false); }); setActionForRange(0, 3, ClickType.LEFT, e -> { + if (resulted.contains(e.player.getUniqueId())) return; + resulted.add(e.player.getUniqueId()); + setAllowClose(true); this.result.accept(true); }); diff --git a/src/main/java/ca/tweetzy/auctionhouse/helpers/AuctionCreator.java b/src/main/java/ca/tweetzy/auctionhouse/helpers/AuctionCreator.java index df64312..8c4858d 100644 --- a/src/main/java/ca/tweetzy/auctionhouse/helpers/AuctionCreator.java +++ b/src/main/java/ca/tweetzy/auctionhouse/helpers/AuctionCreator.java @@ -37,6 +37,7 @@ import org.bukkit.Bukkit; import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack; +import java.util.UUID; import java.util.concurrent.atomic.AtomicReference; import java.util.function.BiConsumer; @@ -149,7 +150,6 @@ public final class AuctionCreator { //==================================================================================== - // Actually attempt the insertion now AuctionHouse.getInstance().getDataManager().insertAuctionAsync(auctionItem, (error, inserted) -> { auctionPlayer.setItemBeingListed(null);