mirror of
https://github.com/kiranhart/Auction-House.git
synced 2024-11-26 06:05:25 +01:00
force close inv if open listing menu after list / confirm is off
Took 16 minutes
This commit is contained in:
parent
8534fed83b
commit
4cd6bc7ea5
@ -46,7 +46,6 @@ import ca.tweetzy.core.gui.events.GuiClickEvent;
|
|||||||
import ca.tweetzy.core.hooks.EconomyManager;
|
import ca.tweetzy.core.hooks.EconomyManager;
|
||||||
import ca.tweetzy.core.utils.NumberUtils;
|
import ca.tweetzy.core.utils.NumberUtils;
|
||||||
import ca.tweetzy.core.utils.TextUtils;
|
import ca.tweetzy.core.utils.TextUtils;
|
||||||
import ca.tweetzy.core.utils.items.TItemBuilder;
|
|
||||||
import ca.tweetzy.core.utils.nms.NBTEditor;
|
import ca.tweetzy.core.utils.nms.NBTEditor;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
@ -79,6 +78,10 @@ public class GUIAuctionHouse extends AbstractPlaceholderGui {
|
|||||||
public GUIAuctionHouse(AuctionPlayer auctionPlayer) {
|
public GUIAuctionHouse(AuctionPlayer auctionPlayer) {
|
||||||
super(auctionPlayer);
|
super(auctionPlayer);
|
||||||
this.auctionPlayer = auctionPlayer;
|
this.auctionPlayer = auctionPlayer;
|
||||||
|
|
||||||
|
if (!Bukkit.getOfflinePlayer(this.auctionPlayer.getUuid()).isOnline())
|
||||||
|
return;
|
||||||
|
|
||||||
setTitle(TextUtils.formatText(Settings.GUI_AUCTION_HOUSE_TITLE.getString()));
|
setTitle(TextUtils.formatText(Settings.GUI_AUCTION_HOUSE_TITLE.getString()));
|
||||||
setRows(6);
|
setRows(6);
|
||||||
setAcceptsItems(false);
|
setAcceptsItems(false);
|
||||||
|
@ -146,6 +146,8 @@ public final class GUIBundleCreation extends AbstractPlaceholderGui {
|
|||||||
|
|
||||||
if (Settings.OPEN_MAIN_AUCTION_HOUSE_AFTER_MENU_LIST.getBoolean())
|
if (Settings.OPEN_MAIN_AUCTION_HOUSE_AFTER_MENU_LIST.getBoolean())
|
||||||
instance.getGuiManager().showGUI(auctionPlayer.getPlayer(), new GUIAuctionHouse(auctionPlayer));
|
instance.getGuiManager().showGUI(auctionPlayer.getPlayer(), new GUIAuctionHouse(auctionPlayer));
|
||||||
|
else
|
||||||
|
AuctionHouse.newChain().sync(player::closeInventory).execute();
|
||||||
});
|
});
|
||||||
}));
|
}));
|
||||||
} else {
|
} else {
|
||||||
@ -159,6 +161,8 @@ public final class GUIBundleCreation extends AbstractPlaceholderGui {
|
|||||||
|
|
||||||
if (Settings.OPEN_MAIN_AUCTION_HOUSE_AFTER_MENU_LIST.getBoolean())
|
if (Settings.OPEN_MAIN_AUCTION_HOUSE_AFTER_MENU_LIST.getBoolean())
|
||||||
instance.getGuiManager().showGUI(auctionPlayer.getPlayer(), new GUIAuctionHouse(auctionPlayer));
|
instance.getGuiManager().showGUI(auctionPlayer.getPlayer(), new GUIAuctionHouse(auctionPlayer));
|
||||||
|
else
|
||||||
|
AuctionHouse.newChain().sync(player::closeInventory).execute();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -345,6 +345,8 @@ public final class GUISellAuction extends AbstractPlaceholderGui {
|
|||||||
|
|
||||||
if (Settings.OPEN_MAIN_AUCTION_HOUSE_AFTER_MENU_LIST.getBoolean())
|
if (Settings.OPEN_MAIN_AUCTION_HOUSE_AFTER_MENU_LIST.getBoolean())
|
||||||
click.manager.showGUI(click.player, new GUIAuctionHouse(this.auctionPlayer));
|
click.manager.showGUI(click.player, new GUIAuctionHouse(this.auctionPlayer));
|
||||||
|
else
|
||||||
|
AuctionHouse.newChain().sync(click.player::closeInventory).execute();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -209,6 +209,7 @@ public final class GUISellBin extends AbstractPlaceholderGui {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void performAuctionListing(GuiClickEvent click) {
|
private void performAuctionListing(GuiClickEvent click) {
|
||||||
|
|
||||||
AuctionCreator.create(this.auctionPlayer, createListingItem(), (originalListing, listingResult) -> {
|
AuctionCreator.create(this.auctionPlayer, createListingItem(), (originalListing, listingResult) -> {
|
||||||
if (listingResult != ListingResult.SUCCESS) {
|
if (listingResult != ListingResult.SUCCESS) {
|
||||||
click.player.closeInventory();
|
click.player.closeInventory();
|
||||||
@ -219,6 +220,8 @@ public final class GUISellBin extends AbstractPlaceholderGui {
|
|||||||
|
|
||||||
if (Settings.OPEN_MAIN_AUCTION_HOUSE_AFTER_MENU_LIST.getBoolean())
|
if (Settings.OPEN_MAIN_AUCTION_HOUSE_AFTER_MENU_LIST.getBoolean())
|
||||||
click.manager.showGUI(click.player, new GUIAuctionHouse(this.auctionPlayer));
|
click.manager.showGUI(click.player, new GUIAuctionHouse(this.auctionPlayer));
|
||||||
|
else
|
||||||
|
AuctionHouse.newChain().sync(click.player::closeInventory).execute();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user