mirror of
https://github.com/kiranhart/Auction-House.git
synced 2025-02-16 19:21:20 +01:00
fixed issue where when using confirm listing and the sell gui, it will take the item in the player hand even if its not the item being sold
Took 4 minutes
This commit is contained in:
parent
49326fbcaa
commit
6ee10a655b
@ -60,11 +60,6 @@ public final class CommandSell extends AbstractCommand {
|
||||
return ReturnType.FAILURE;
|
||||
}
|
||||
|
||||
// Check list delay
|
||||
if (!auctionPlayer.canListItem()) {
|
||||
return ReturnType.FAILURE;
|
||||
}
|
||||
|
||||
// Open the sell menu enabled
|
||||
if (args.length == 0) {
|
||||
if (!Settings.ALLOW_USAGE_OF_SELL_GUI.getBoolean()) {
|
||||
@ -281,6 +276,11 @@ public final class CommandSell extends AbstractCommand {
|
||||
// update the listing time to the max allowed time if it wasn't set using the command flag
|
||||
allowedTime = allowedTime != 0 ? allowedTime : auctionPlayer.getAllowedSellTime(isBiddingItem ? AuctionSaleType.USED_BIDDING_SYSTEM : AuctionSaleType.WITHOUT_BIDDING_SYSTEM);
|
||||
|
||||
// Check list delay
|
||||
if (!auctionPlayer.canListItem()) {
|
||||
return ReturnType.FAILURE;
|
||||
}
|
||||
|
||||
if (isBundle) {
|
||||
AuctionHouse.getInstance().getGuiManager().showGUI(player, new GUIBundleCreation(
|
||||
auctionPlayer,
|
||||
|
@ -341,8 +341,11 @@ public class GUISellItem extends AbstractPlaceholderGui {
|
||||
}
|
||||
|
||||
if (Settings.ASK_FOR_LISTING_CONFIRMATION.getBoolean()) {
|
||||
setAllowClose(true);
|
||||
if (!this.auctionPlayer.canListItem()) {
|
||||
return;
|
||||
}
|
||||
|
||||
setAllowClose(true);
|
||||
AuctionHouse.getInstance().getGuiManager().showGUI(e.player, new GUIConfirmListing(
|
||||
e.player,
|
||||
this.itemToBeListed.clone(),
|
||||
@ -357,6 +360,10 @@ public class GUISellItem extends AbstractPlaceholderGui {
|
||||
false
|
||||
));
|
||||
} else {
|
||||
if (!this.auctionPlayer.canListItem()) {
|
||||
return;
|
||||
}
|
||||
|
||||
AuctionAPI.getInstance().listAuction(
|
||||
e.player,
|
||||
this.itemToBeListed.clone(),
|
||||
|
@ -8,8 +8,6 @@ import ca.tweetzy.auctionhouse.guis.AbstractPlaceholderGui;
|
||||
import ca.tweetzy.auctionhouse.guis.GUIAuctionHouse;
|
||||
import ca.tweetzy.auctionhouse.helpers.MaterialCategorizer;
|
||||
import ca.tweetzy.auctionhouse.settings.Settings;
|
||||
import ca.tweetzy.core.compatibility.CompatibleHand;
|
||||
import ca.tweetzy.core.utils.PlayerUtils;
|
||||
import ca.tweetzy.core.utils.TextUtils;
|
||||
import ca.tweetzy.core.utils.items.TItemBuilder;
|
||||
import org.bukkit.entity.Player;
|
||||
@ -72,8 +70,9 @@ public class GUIConfirmListing extends AbstractPlaceholderGui {
|
||||
System.currentTimeMillis() + (this.allowedTime * 1000L)
|
||||
);
|
||||
|
||||
setOnOpen(open -> PlayerUtils.takeActiveItem(open.player, CompatibleHand.MAIN_HAND, originalItem.getAmount()));
|
||||
setOnClose(close -> close.player.getInventory().addItem(originalItem));
|
||||
// todo add back if dupe is brought back to life
|
||||
// setOnOpen(open -> PlayerUtils.takeActiveItem(open.player, CompatibleHand.MAIN_HAND, originalItem.getAmount()));
|
||||
// setOnClose(close -> close.player.getInventory().addItem(originalItem));
|
||||
|
||||
setTitle(TextUtils.formatText(Settings.GUI_CONFIRM_LISTING_TITLE.getString()));
|
||||
setAcceptsItems(false);
|
||||
|
Loading…
Reference in New Issue
Block a user