mirror of
https://github.com/kiranhart/Auction-House.git
synced 2025-01-20 14:51:19 +01:00
➡️ added placeholderapi support to all gui item names and lore
Took 7 minutes
This commit is contained in:
parent
faf4e9801a
commit
6071bad99a
@ -508,7 +508,7 @@ public class AuctionAPI {
|
||||
*/
|
||||
public ItemStack createBundledItem(ItemStack baseItem, ItemStack... items) {
|
||||
Objects.requireNonNull(items, "Cannot create a bundled item with no items");
|
||||
ItemStack item = ConfigurationItemHelper.createConfigurationItem(Settings.ITEM_BUNDLE_ITEM.getString(), Settings.ITEM_BUNDLE_NAME.getString(), Settings.ITEM_BUNDLE_LORE.getStringList(), new HashMap<String, Object>() {{
|
||||
ItemStack item = ConfigurationItemHelper.createConfigurationItem(null, Settings.ITEM_BUNDLE_ITEM.getString(), Settings.ITEM_BUNDLE_NAME.getString(), Settings.ITEM_BUNDLE_LORE.getStringList(), new HashMap<String, Object>() {{
|
||||
put("%item_name%", getItemName(baseItem));
|
||||
}});
|
||||
|
||||
|
@ -203,6 +203,9 @@ public class PlaceholderAPIHook extends PlaceholderExpansion {
|
||||
@UtilityClass
|
||||
public static final class PAPIReplacer {
|
||||
public String tryReplace(Player player, String msg) {
|
||||
if (player == null)
|
||||
return msg;
|
||||
|
||||
if (Bukkit.getPluginManager().isPluginEnabled("PlaceholderAPI"))
|
||||
msg = PlaceholderAPI.setPlaceholders(player, msg);
|
||||
return msg;
|
||||
|
@ -41,14 +41,14 @@ public abstract class AbstractPlaceholderGui extends Gui {
|
||||
public AbstractPlaceholderGui(Player player) {
|
||||
this.player = player;
|
||||
setUseLockedCells(true);
|
||||
setDefaultItem(ConfigurationItemHelper.createConfigurationItem(Settings.GUI_FILLER.getString()));
|
||||
setDefaultItem(ConfigurationItemHelper.createConfigurationItem(this.player, Settings.GUI_FILLER.getString()));
|
||||
setNavigateSound(XSound.matchXSound(Settings.SOUNDS_NAVIGATE_GUI_PAGES.getString()).orElse(XSound.ENTITY_BAT_TAKEOFF));
|
||||
}
|
||||
|
||||
public AbstractPlaceholderGui(AuctionPlayer player) {
|
||||
this.player = player.getPlayer();
|
||||
setUseLockedCells(true);
|
||||
setDefaultItem(ConfigurationItemHelper.createConfigurationItem(Settings.GUI_FILLER.getString()));
|
||||
setDefaultItem(ConfigurationItemHelper.createConfigurationItem(this.player, Settings.GUI_FILLER.getString()));
|
||||
setNavigateSound(XSound.matchXSound(Settings.SOUNDS_NAVIGATE_GUI_PAGES.getString()).orElse(XSound.ENTITY_BAT_TAKEOFF));
|
||||
}
|
||||
|
||||
@ -59,63 +59,63 @@ public abstract class AbstractPlaceholderGui extends Gui {
|
||||
}
|
||||
|
||||
protected ItemStack getBackButtonItem() {
|
||||
return ConfigurationItemHelper.createConfigurationItem(Settings.GUI_BACK_BTN_ITEM.getString(), Settings.GUI_BACK_BTN_NAME.getString(), Settings.GUI_BACK_BTN_LORE.getStringList(), null);
|
||||
return ConfigurationItemHelper.createConfigurationItem(this.player, Settings.GUI_BACK_BTN_ITEM.getString(), Settings.GUI_BACK_BTN_NAME.getString(), Settings.GUI_BACK_BTN_LORE.getStringList(), null);
|
||||
}
|
||||
|
||||
protected ItemStack getPreviousPageItem() {
|
||||
return ConfigurationItemHelper.createConfigurationItem(Settings.GUI_PREV_PAGE_BTN_ITEM.getString(), Settings.GUI_PREV_PAGE_BTN_NAME.getString(), Settings.GUI_PREV_PAGE_BTN_LORE.getStringList(), null);
|
||||
return ConfigurationItemHelper.createConfigurationItem(this.player, Settings.GUI_PREV_PAGE_BTN_ITEM.getString(), Settings.GUI_PREV_PAGE_BTN_NAME.getString(), Settings.GUI_PREV_PAGE_BTN_LORE.getStringList(), null);
|
||||
}
|
||||
|
||||
protected ItemStack getNextPageItem() {
|
||||
return ConfigurationItemHelper.createConfigurationItem(Settings.GUI_NEXT_PAGE_BTN_ITEM.getString(), Settings.GUI_NEXT_PAGE_BTN_NAME.getString(), Settings.GUI_NEXT_PAGE_BTN_LORE.getStringList(), null);
|
||||
return ConfigurationItemHelper.createConfigurationItem(this.player, Settings.GUI_NEXT_PAGE_BTN_ITEM.getString(), Settings.GUI_NEXT_PAGE_BTN_NAME.getString(), Settings.GUI_NEXT_PAGE_BTN_LORE.getStringList(), null);
|
||||
}
|
||||
|
||||
protected ItemStack getRefreshButtonItem() {
|
||||
return ConfigurationItemHelper.createConfigurationItem(Settings.GUI_REFRESH_BTN_ITEM.getString(), Settings.GUI_REFRESH_BTN_NAME.getString(), Settings.GUI_REFRESH_BTN_LORE.getStringList(), null);
|
||||
return ConfigurationItemHelper.createConfigurationItem(this.player, Settings.GUI_REFRESH_BTN_ITEM.getString(), Settings.GUI_REFRESH_BTN_NAME.getString(), Settings.GUI_REFRESH_BTN_LORE.getStringList(), null);
|
||||
}
|
||||
|
||||
protected ItemStack getCloseButtonItem() {
|
||||
return ConfigurationItemHelper.createConfigurationItem(Settings.GUI_CLOSE_BTN_ITEM.getString(), Settings.GUI_CLOSE_BTN_NAME.getString(), Settings.GUI_CLOSE_BTN_LORE.getStringList(), null);
|
||||
return ConfigurationItemHelper.createConfigurationItem(this.player, Settings.GUI_CLOSE_BTN_ITEM.getString(), Settings.GUI_CLOSE_BTN_NAME.getString(), Settings.GUI_CLOSE_BTN_LORE.getStringList(), null);
|
||||
}
|
||||
|
||||
protected ItemStack getIncreaseQtyButtonItem() {
|
||||
return ConfigurationItemHelper.createConfigurationItem(Settings.GUI_CONFIRM_INCREASE_QTY_ITEM.getString(), Settings.GUI_CONFIRM_INCREASE_QTY_NAME.getString(), Settings.GUI_CONFIRM_INCREASE_QTY_LORE.getStringList(), null);
|
||||
return ConfigurationItemHelper.createConfigurationItem(this.player, Settings.GUI_CONFIRM_INCREASE_QTY_ITEM.getString(), Settings.GUI_CONFIRM_INCREASE_QTY_NAME.getString(), Settings.GUI_CONFIRM_INCREASE_QTY_LORE.getStringList(), null);
|
||||
}
|
||||
|
||||
protected ItemStack getDecreaseQtyButtonItem() {
|
||||
return ConfigurationItemHelper.createConfigurationItem(Settings.GUI_CONFIRM_DECREASE_QTY_ITEM.getString(), Settings.GUI_CONFIRM_DECREASE_QTY_NAME.getString(), Settings.GUI_CONFIRM_DECREASE_QTY_LORE.getStringList(), null);
|
||||
return ConfigurationItemHelper.createConfigurationItem(this.player, Settings.GUI_CONFIRM_DECREASE_QTY_ITEM.getString(), Settings.GUI_CONFIRM_DECREASE_QTY_NAME.getString(), Settings.GUI_CONFIRM_DECREASE_QTY_LORE.getStringList(), null);
|
||||
}
|
||||
|
||||
// confirms
|
||||
protected ItemStack getConfirmCancelYesItem() {
|
||||
return ConfigurationItemHelper.createConfigurationItem(Settings.GUI_CONFIRM_CANCEL_YES_ITEM.getString(), Settings.GUI_CONFIRM_CANCEL_YES_NAME.getString(), Settings.GUI_CONFIRM_CANCEL_YES_LORE.getStringList(), null);
|
||||
return ConfigurationItemHelper.createConfigurationItem(this.player, Settings.GUI_CONFIRM_CANCEL_YES_ITEM.getString(), Settings.GUI_CONFIRM_CANCEL_YES_NAME.getString(), Settings.GUI_CONFIRM_CANCEL_YES_LORE.getStringList(), null);
|
||||
}
|
||||
|
||||
protected ItemStack getConfirmCancelNoItem() {
|
||||
return ConfigurationItemHelper.createConfigurationItem(Settings.GUI_CONFIRM_CANCEL_NO_ITEM.getString(), Settings.GUI_CONFIRM_CANCEL_NO_NAME.getString(), Settings.GUI_CONFIRM_CANCEL_NO_LORE.getStringList(), null);
|
||||
return ConfigurationItemHelper.createConfigurationItem(this.player, Settings.GUI_CONFIRM_CANCEL_NO_ITEM.getString(), Settings.GUI_CONFIRM_CANCEL_NO_NAME.getString(), Settings.GUI_CONFIRM_CANCEL_NO_LORE.getStringList(), null);
|
||||
}
|
||||
|
||||
protected ItemStack getConfirmBuyYesItem() {
|
||||
return ConfigurationItemHelper.createConfigurationItem(Settings.GUI_CONFIRM_BUY_YES_ITEM.getString(), Settings.GUI_CONFIRM_BUY_YES_NAME.getString(), Settings.GUI_CONFIRM_BUY_YES_LORE.getStringList(), null);
|
||||
return ConfigurationItemHelper.createConfigurationItem(this.player, Settings.GUI_CONFIRM_BUY_YES_ITEM.getString(), Settings.GUI_CONFIRM_BUY_YES_NAME.getString(), Settings.GUI_CONFIRM_BUY_YES_LORE.getStringList(), null);
|
||||
}
|
||||
|
||||
protected ItemStack getConfirmBuyNoItem() {
|
||||
return ConfigurationItemHelper.createConfigurationItem(Settings.GUI_CONFIRM_BUY_NO_ITEM.getString(), Settings.GUI_CONFIRM_BUY_NO_NAME.getString(), Settings.GUI_CONFIRM_BUY_NO_LORE.getStringList(), null);
|
||||
return ConfigurationItemHelper.createConfigurationItem(this.player, Settings.GUI_CONFIRM_BUY_NO_ITEM.getString(), Settings.GUI_CONFIRM_BUY_NO_NAME.getString(), Settings.GUI_CONFIRM_BUY_NO_LORE.getStringList(), null);
|
||||
}
|
||||
|
||||
protected ItemStack getConfirmListingYesItem() {
|
||||
return ConfigurationItemHelper.createConfigurationItem(Settings.GUI_CONFIRM_LISTING_YES_ITEM.getString(), Settings.GUI_CONFIRM_LISTING_YES_NAME.getString(), Settings.GUI_CONFIRM_LISTING_YES_LORE.getStringList(), null);
|
||||
return ConfigurationItemHelper.createConfigurationItem(this.player, Settings.GUI_CONFIRM_LISTING_YES_ITEM.getString(), Settings.GUI_CONFIRM_LISTING_YES_NAME.getString(), Settings.GUI_CONFIRM_LISTING_YES_LORE.getStringList(), null);
|
||||
}
|
||||
|
||||
protected ItemStack getConfirmListingNoItem() {
|
||||
return ConfigurationItemHelper.createConfigurationItem(Settings.GUI_CONFIRM_LISTING_NO_ITEM.getString(), Settings.GUI_CONFIRM_LISTING_NO_NAME.getString(), Settings.GUI_CONFIRM_LISTING_NO_LORE.getStringList(), null);
|
||||
return ConfigurationItemHelper.createConfigurationItem(this.player, Settings.GUI_CONFIRM_LISTING_NO_ITEM.getString(), Settings.GUI_CONFIRM_LISTING_NO_NAME.getString(), Settings.GUI_CONFIRM_LISTING_NO_LORE.getStringList(), null);
|
||||
}
|
||||
|
||||
protected ItemStack getConfirmBidYesItem() {
|
||||
return ConfigurationItemHelper.createConfigurationItem(Settings.GUI_CONFIRM_BID_YES_ITEM.getString(), Settings.GUI_CONFIRM_BID_YES_NAME.getString(), Settings.GUI_CONFIRM_BID_YES_LORE.getStringList(), null);
|
||||
return ConfigurationItemHelper.createConfigurationItem(this.player, Settings.GUI_CONFIRM_BID_YES_ITEM.getString(), Settings.GUI_CONFIRM_BID_YES_NAME.getString(), Settings.GUI_CONFIRM_BID_YES_LORE.getStringList(), null);
|
||||
}
|
||||
|
||||
protected ItemStack getConfirmBidNoItem() {
|
||||
return ConfigurationItemHelper.createConfigurationItem(Settings.GUI_CONFIRM_BID_NO_ITEM.getString(), Settings.GUI_CONFIRM_BID_NO_NAME.getString(), Settings.GUI_CONFIRM_BID_NO_LORE.getStringList(), null);
|
||||
return ConfigurationItemHelper.createConfigurationItem(this.player, Settings.GUI_CONFIRM_BID_NO_ITEM.getString(), Settings.GUI_CONFIRM_BID_NO_NAME.getString(), Settings.GUI_CONFIRM_BID_NO_LORE.getStringList(), null);
|
||||
}
|
||||
}
|
||||
|
@ -146,7 +146,7 @@ public class GUIActiveAuctions extends AbstractPlaceholderGui {
|
||||
|
||||
setButton(5, 4, getRefreshButtonItem(), e -> e.manager.showGUI(e.player, new GUIActiveAuctions(this.auctionPlayer)));
|
||||
|
||||
setButton(5, 1, ConfigurationItemHelper.createConfigurationItem(Settings.GUI_ACTIVE_AUCTIONS_ITEM.getString(), Settings.GUI_ACTIVE_AUCTIONS_NAME.getString(), Settings.GUI_ACTIVE_AUCTIONS_LORE.getStringList(), null), e -> {
|
||||
setButton(5, 1, ConfigurationItemHelper.createConfigurationItem(this.player, Settings.GUI_ACTIVE_AUCTIONS_ITEM.getString(), Settings.GUI_ACTIVE_AUCTIONS_NAME.getString(), Settings.GUI_ACTIVE_AUCTIONS_LORE.getStringList(), null), e -> {
|
||||
this.auctionPlayer.getItems(false).forEach(item -> item.setExpired(true));
|
||||
draw();
|
||||
});
|
||||
|
@ -498,7 +498,7 @@ public class GUIAuctionHouse extends AbstractPlaceholderGui {
|
||||
*/
|
||||
private void drawVariableButtons() {
|
||||
if (Settings.GUI_AUCTION_HOUSE_ITEMS_YOUR_AUCTIONS_ENABLED.getBoolean()) {
|
||||
setButton(Settings.GUI_AUCTION_HOUSE_ITEMS_YOUR_AUCTIONS_SLOT.getInt(), ConfigurationItemHelper.createConfigurationItem(Settings.GUI_AUCTION_HOUSE_ITEMS_YOUR_AUCTIONS_ITEM.getString(), Settings.GUI_AUCTION_HOUSE_ITEMS_YOUR_AUCTIONS_NAME.getString(), PlaceholderAPIHook.PAPIReplacer.tryReplace(this.auctionPlayer.getPlayer(), Settings.GUI_AUCTION_HOUSE_ITEMS_YOUR_AUCTIONS_LORE.getStringList()), new HashMap<String, Object>() {{
|
||||
setButton(Settings.GUI_AUCTION_HOUSE_ITEMS_YOUR_AUCTIONS_SLOT.getInt(), ConfigurationItemHelper.createConfigurationItem(this.player, Settings.GUI_AUCTION_HOUSE_ITEMS_YOUR_AUCTIONS_ITEM.getString(), Settings.GUI_AUCTION_HOUSE_ITEMS_YOUR_AUCTIONS_NAME.getString(), PlaceholderAPIHook.PAPIReplacer.tryReplace(this.auctionPlayer.getPlayer(), Settings.GUI_AUCTION_HOUSE_ITEMS_YOUR_AUCTIONS_LORE.getStringList()), new HashMap<String, Object>() {{
|
||||
put("%active_player_auctions%", auctionPlayer.getItems(false).size());
|
||||
put("%player_balance%", Settings.USE_SHORT_NUMBERS_ON_PLAYER_BALANCE.getBoolean() ? AuctionAPI.getInstance().getFriendlyNumber(EconomyManager.getBalance(auctionPlayer.getPlayer())) : AuctionAPI.getInstance().formatNumber(EconomyManager.getBalance(auctionPlayer.getPlayer())));
|
||||
}}), e -> {
|
||||
@ -508,7 +508,7 @@ public class GUIAuctionHouse extends AbstractPlaceholderGui {
|
||||
}
|
||||
|
||||
if (Settings.GUI_AUCTION_HOUSE_ITEMS_COLLECTION_BIN_ENABLED.getBoolean()) {
|
||||
setButton(Settings.GUI_AUCTION_HOUSE_ITEMS_COLLECTION_BIN_SLOT.getInt(), ConfigurationItemHelper.createConfigurationItem(Settings.GUI_AUCTION_HOUSE_ITEMS_COLLECTION_BIN_ITEM.getString(), Settings.GUI_AUCTION_HOUSE_ITEMS_COLLECTION_BIN_NAME.getString(), Settings.GUI_AUCTION_HOUSE_ITEMS_COLLECTION_BIN_LORE.getStringList(), new HashMap<String, Object>() {{
|
||||
setButton(Settings.GUI_AUCTION_HOUSE_ITEMS_COLLECTION_BIN_SLOT.getInt(), ConfigurationItemHelper.createConfigurationItem(this.player, Settings.GUI_AUCTION_HOUSE_ITEMS_COLLECTION_BIN_ITEM.getString(), Settings.GUI_AUCTION_HOUSE_ITEMS_COLLECTION_BIN_NAME.getString(), Settings.GUI_AUCTION_HOUSE_ITEMS_COLLECTION_BIN_LORE.getStringList(), new HashMap<String, Object>() {{
|
||||
put("%expired_player_auctions%", auctionPlayer.getItems(true).size());
|
||||
}}), e -> {
|
||||
cleanup();
|
||||
@ -517,7 +517,7 @@ public class GUIAuctionHouse extends AbstractPlaceholderGui {
|
||||
}
|
||||
|
||||
if (Settings.GUI_AUCTION_HOUSE_ITEMS_TRANSACTIONS_ENABLED.getBoolean()) {
|
||||
setButton(Settings.GUI_AUCTION_HOUSE_ITEMS_TRANSACTIONS_SLOT.getInt(), ConfigurationItemHelper.createConfigurationItem(Settings.GUI_AUCTION_HOUSE_ITEMS_TRANSACTIONS_ITEM.getString(), Settings.GUI_AUCTION_HOUSE_ITEMS_TRANSACTIONS_NAME.getString(), Settings.GUI_AUCTION_HOUSE_ITEMS_TRANSACTIONS_LORE.getStringList(), new HashMap<String, Object>() {{
|
||||
setButton(Settings.GUI_AUCTION_HOUSE_ITEMS_TRANSACTIONS_SLOT.getInt(), ConfigurationItemHelper.createConfigurationItem(this.player, Settings.GUI_AUCTION_HOUSE_ITEMS_TRANSACTIONS_ITEM.getString(), Settings.GUI_AUCTION_HOUSE_ITEMS_TRANSACTIONS_NAME.getString(), Settings.GUI_AUCTION_HOUSE_ITEMS_TRANSACTIONS_LORE.getStringList(), new HashMap<String, Object>() {{
|
||||
put("%total_items_bought%", AuctionHouse.getInstance().getTransactionManager().getTotalItemsBought(auctionPlayer.getPlayer().getUniqueId()));
|
||||
put("%total_items_sold%", AuctionHouse.getInstance().getTransactionManager().getTotalItemsSold(auctionPlayer.getPlayer().getUniqueId()));
|
||||
}}), e -> {
|
||||
@ -531,9 +531,9 @@ public class GUIAuctionHouse extends AbstractPlaceholderGui {
|
||||
}
|
||||
|
||||
private void drawPaginationButtons() {
|
||||
setItems(new int[]{Settings.GUI_PREV_PAGE_BTN_SLOT.getInt(), Settings.GUI_NEXT_PAGE_BTN_SLOT.getInt()}, ConfigurationItemHelper.createConfigurationItem(Settings.GUI_FILLER.getString()));
|
||||
setItems(new int[]{Settings.GUI_PREV_PAGE_BTN_SLOT.getInt(), Settings.GUI_NEXT_PAGE_BTN_SLOT.getInt()}, ConfigurationItemHelper.createConfigurationItem(this.player, Settings.GUI_FILLER.getString()));
|
||||
|
||||
setPrevPage(Settings.GUI_PREV_PAGE_BTN_SLOT.getInt(), page == 1 ? ConfigurationItemHelper.createConfigurationItem(Settings.GUI_FILLER.getString()) : getPreviousPageItem());
|
||||
setPrevPage(Settings.GUI_PREV_PAGE_BTN_SLOT.getInt(), page == 1 ? ConfigurationItemHelper.createConfigurationItem(this.player, Settings.GUI_FILLER.getString()) : getPreviousPageItem());
|
||||
|
||||
if (pages > page)
|
||||
setNextPage(Settings.GUI_NEXT_PAGE_BTN_SLOT.getInt(), getNextPageItem());
|
||||
@ -550,7 +550,7 @@ public class GUIAuctionHouse extends AbstractPlaceholderGui {
|
||||
|
||||
if (Settings.REPLACE_HOW_TO_SELL_WITH_LIST_BUTTON.getBoolean()) {
|
||||
if (Settings.GUI_AUCTION_HOUSE_ITEMS_LIST_ITEM_ENABLED.getBoolean()) {
|
||||
setButton(Settings.GUI_AUCTION_HOUSE_ITEMS_LIST_ITEM_SLOT.getInt(), ConfigurationItemHelper.createConfigurationItem(Settings.GUI_AUCTION_HOUSE_ITEMS_LIST_ITEM_ITEM.getString(), Settings.GUI_AUCTION_HOUSE_ITEMS_LIST_ITEM_NAME.getString(), Settings.GUI_AUCTION_HOUSE_ITEMS_LIST_ITEM_LORE.getStringList(), null), e -> {
|
||||
setButton(Settings.GUI_AUCTION_HOUSE_ITEMS_LIST_ITEM_SLOT.getInt(), ConfigurationItemHelper.createConfigurationItem(this.player, Settings.GUI_AUCTION_HOUSE_ITEMS_LIST_ITEM_ITEM.getString(), Settings.GUI_AUCTION_HOUSE_ITEMS_LIST_ITEM_NAME.getString(), Settings.GUI_AUCTION_HOUSE_ITEMS_LIST_ITEM_LORE.getStringList(), null), e -> {
|
||||
// using this will ignore the "SELL_MENU_REQUIRES_USER_TO_HOLD_ITEM" setting
|
||||
if (FloodGateHook.isFloodGateUser(e.player)) {
|
||||
AuctionHouse.getInstance().getLocale().getMessage("commands.no_permission").sendPrefixedMessage(e.player);
|
||||
@ -587,12 +587,12 @@ public class GUIAuctionHouse extends AbstractPlaceholderGui {
|
||||
}
|
||||
} else {
|
||||
if (Settings.GUI_AUCTION_HOUSE_ITEMS_HOW_TO_SELL_ENABLED.getBoolean()) {
|
||||
setButton(Settings.GUI_AUCTION_HOUSE_ITEMS_HOW_TO_SELL_SLOT.getInt(), ConfigurationItemHelper.createConfigurationItem(Settings.GUI_AUCTION_HOUSE_ITEMS_HOW_TO_SELL_ITEM.getString(), Settings.GUI_AUCTION_HOUSE_ITEMS_HOW_TO_SELL_NAME.getString(), Settings.GUI_AUCTION_HOUSE_ITEMS_HOW_TO_SELL_LORE.getStringList(), null), null);
|
||||
setButton(Settings.GUI_AUCTION_HOUSE_ITEMS_HOW_TO_SELL_SLOT.getInt(), ConfigurationItemHelper.createConfigurationItem(this.player, Settings.GUI_AUCTION_HOUSE_ITEMS_HOW_TO_SELL_ITEM.getString(), Settings.GUI_AUCTION_HOUSE_ITEMS_HOW_TO_SELL_NAME.getString(), Settings.GUI_AUCTION_HOUSE_ITEMS_HOW_TO_SELL_LORE.getStringList(), null), null);
|
||||
}
|
||||
}
|
||||
|
||||
if (Settings.GUI_AUCTION_HOUSE_ITEMS_GUIDE_ENABLED.getBoolean()) {
|
||||
setButton(Settings.GUI_AUCTION_HOUSE_ITEMS_GUIDE_SLOT.getInt(), ConfigurationItemHelper.createConfigurationItem(Settings.GUI_AUCTION_HOUSE_ITEMS_GUIDE_ITEM.getString(), Settings.GUI_AUCTION_HOUSE_ITEMS_GUIDE_NAME.getString(), Settings.GUI_AUCTION_HOUSE_ITEMS_GUIDE_LORE.getStringList(), null), null);
|
||||
setButton(Settings.GUI_AUCTION_HOUSE_ITEMS_GUIDE_SLOT.getInt(), ConfigurationItemHelper.createConfigurationItem(this.player, Settings.GUI_AUCTION_HOUSE_ITEMS_GUIDE_ITEM.getString(), Settings.GUI_AUCTION_HOUSE_ITEMS_GUIDE_NAME.getString(), Settings.GUI_AUCTION_HOUSE_ITEMS_GUIDE_LORE.getStringList(), null), null);
|
||||
}
|
||||
|
||||
if (Settings.GUI_REFRESH_BTN_ENABLED.getBoolean()) {
|
||||
@ -653,7 +653,7 @@ public class GUIAuctionHouse extends AbstractPlaceholderGui {
|
||||
put("%filter_sort_order%", auctionPlayer.getAuctionSortType().getTranslatedType());
|
||||
}};
|
||||
|
||||
ItemStack item = materialToBeUsed.equalsIgnoreCase("PLAYER_HEAD") ? ConfigurationItemHelper.createConfigurationItem(AuctionAPI.getInstance().getPlayerHead(this.auctionPlayer.getPlayer().getName()), Settings.GUI_AUCTION_HOUSE_ITEMS_FILTER_MENU_NAME.getString(), Settings.GUI_AUCTION_HOUSE_ITEMS_FILTER_MENU_LORE.getStringList(), replacements) : ConfigurationItemHelper.createConfigurationItem(materialToBeUsed, Settings.GUI_AUCTION_HOUSE_ITEMS_FILTER_MENU_NAME.getString(), Settings.GUI_AUCTION_HOUSE_ITEMS_FILTER_MENU_LORE.getStringList(), replacements);
|
||||
ItemStack item = materialToBeUsed.equalsIgnoreCase("PLAYER_HEAD") ? ConfigurationItemHelper.createConfigurationItem(this.player, AuctionAPI.getInstance().getPlayerHead(this.auctionPlayer.getPlayer().getName()), Settings.GUI_AUCTION_HOUSE_ITEMS_FILTER_MENU_NAME.getString(), Settings.GUI_AUCTION_HOUSE_ITEMS_FILTER_MENU_LORE.getStringList(), replacements) : ConfigurationItemHelper.createConfigurationItem(this.player, materialToBeUsed, Settings.GUI_AUCTION_HOUSE_ITEMS_FILTER_MENU_NAME.getString(), Settings.GUI_AUCTION_HOUSE_ITEMS_FILTER_MENU_LORE.getStringList(), replacements);
|
||||
|
||||
if (Settings.GUI_AUCTION_HOUSE_ITEMS_FILTER_MENU_ENABLED.getBoolean()) {
|
||||
setButton(Settings.GUI_AUCTION_HOUSE_ITEMS_FILTER_MENU_SLOT.getInt(), item, e -> {
|
||||
@ -689,7 +689,7 @@ public class GUIAuctionHouse extends AbstractPlaceholderGui {
|
||||
}
|
||||
|
||||
if (Settings.GUI_AUCTION_HOUSE_ITEMS_FILTER_ENABLED.getBoolean()) {
|
||||
setButton(Settings.GUI_AUCTION_HOUSE_ITEMS_FILTER_SLOT.getInt(), ConfigurationItemHelper.createConfigurationItem(Settings.GUI_AUCTION_HOUSE_ITEMS_FILTER_ITEM.getString(), Settings.GUI_AUCTION_HOUSE_ITEMS_FILTER_NAME.getString(), Settings.GUI_AUCTION_HOUSE_ITEMS_FILTER_LORE.getStringList(), new HashMap<String, Object>() {{
|
||||
setButton(Settings.GUI_AUCTION_HOUSE_ITEMS_FILTER_SLOT.getInt(), ConfigurationItemHelper.createConfigurationItem(this.player, Settings.GUI_AUCTION_HOUSE_ITEMS_FILTER_ITEM.getString(), Settings.GUI_AUCTION_HOUSE_ITEMS_FILTER_NAME.getString(), Settings.GUI_AUCTION_HOUSE_ITEMS_FILTER_LORE.getStringList(), new HashMap<String, Object>() {{
|
||||
put("%filter_category%", auctionPlayer.getSelectedFilter().getTranslatedType());
|
||||
put("%filter_auction_type%", auctionPlayer.getSelectedSaleType().getTranslatedType());
|
||||
put("%filter_sort_order%", auctionPlayer.getAuctionSortType().getTranslatedType());
|
||||
|
@ -51,7 +51,7 @@ public class GUIBans extends AbstractPlaceholderGui {
|
||||
public GUIBans(Player player) {
|
||||
super(player);
|
||||
setTitle(TextUtils.formatText(Settings.GUI_BANS_TITLE.getString()));
|
||||
setDefaultItem(ConfigurationItemHelper.createConfigurationItem(Settings.GUI_BANS_BG_ITEM.getString()));
|
||||
setDefaultItem(ConfigurationItemHelper.createConfigurationItem(this.player, Settings.GUI_BANS_BG_ITEM.getString()));
|
||||
setUseLockedCells(true);
|
||||
setAcceptsItems(false);
|
||||
setAllowDrops(false);
|
||||
@ -63,7 +63,7 @@ public class GUIBans extends AbstractPlaceholderGui {
|
||||
|
||||
private void draw() {
|
||||
reset();
|
||||
setButton(5, 4, ConfigurationItemHelper.createConfigurationItem(Settings.GUI_CLOSE_BTN_ITEM.getString(), Settings.GUI_CLOSE_BTN_NAME.getString(), Settings.GUI_CLOSE_BTN_LORE.getStringList(), null), e -> e.gui.close());
|
||||
setButton(5, 4, ConfigurationItemHelper.createConfigurationItem(this.player, Settings.GUI_CLOSE_BTN_ITEM.getString(), Settings.GUI_CLOSE_BTN_NAME.getString(), Settings.GUI_CLOSE_BTN_LORE.getStringList(), null), e -> e.gui.close());
|
||||
drawItems();
|
||||
}
|
||||
|
||||
@ -80,7 +80,7 @@ public class GUIBans extends AbstractPlaceholderGui {
|
||||
int slot = 0;
|
||||
for (AuctionBan ban : data) {
|
||||
OfflinePlayer offlinePlayer = Bukkit.getOfflinePlayer(ban.getBannedPlayer());
|
||||
setButton(slot++, ConfigurationItemHelper.createConfigurationItem(AuctionAPI.getInstance().getPlayerHead(offlinePlayer.getName()), Settings.GUI_BANS_BAN_NAME.getString(), Settings.GUI_BANS_BAN_LORE.getStringList(), new HashMap<String, Object>() {{
|
||||
setButton(slot++, ConfigurationItemHelper.createConfigurationItem(this.player, AuctionAPI.getInstance().getPlayerHead(offlinePlayer.getName()), Settings.GUI_BANS_BAN_NAME.getString(), Settings.GUI_BANS_BAN_LORE.getStringList(), new HashMap<String, Object>() {{
|
||||
put("%player_name%", offlinePlayer.getName());
|
||||
put("%player_displayname%", AuctionAPI.getInstance().getDisplayName(offlinePlayer));
|
||||
put("%ban_reason%", ban.getReason());
|
||||
|
@ -54,7 +54,7 @@ public class GUIBid extends AbstractPlaceholderGui {
|
||||
this.auctionPlayer = auctionPlayer;
|
||||
this.auctionItem = auctionItem;
|
||||
setTitle(TextUtils.formatText(Settings.GUI_BIDDING_TITLE.getString()));
|
||||
setDefaultItem(ConfigurationItemHelper.createConfigurationItem(Settings.GUI_BIDDING_BG_ITEM.getString()));
|
||||
setDefaultItem(ConfigurationItemHelper.createConfigurationItem(this.player, Settings.GUI_BIDDING_BG_ITEM.getString()));
|
||||
setUseLockedCells(true);
|
||||
setAcceptsItems(false);
|
||||
setAllowDrops(false);
|
||||
@ -66,7 +66,7 @@ public class GUIBid extends AbstractPlaceholderGui {
|
||||
|
||||
private void draw() {
|
||||
setItem(1, 4, this.auctionItem.getItem());
|
||||
setButton(1, 2, ConfigurationItemHelper.createConfigurationItem(Settings.GUI_BIDDING_ITEMS_DEFAULT_ITEM.getString(), Settings.GUI_BIDDING_ITEMS_DEFAULT_NAME.getString(), Settings.GUI_BIDDING_ITEMS_DEFAULT_LORE.getStringList(), null), e -> {
|
||||
setButton(1, 2, ConfigurationItemHelper.createConfigurationItem(this.player, Settings.GUI_BIDDING_ITEMS_DEFAULT_ITEM.getString(), Settings.GUI_BIDDING_ITEMS_DEFAULT_NAME.getString(), Settings.GUI_BIDDING_ITEMS_DEFAULT_LORE.getStringList(), null), e -> {
|
||||
if (Settings.PLAYER_NEEDS_TOTAL_PRICE_TO_BID.getBoolean() && !EconomyManager.hasBalance(e.player, auctionItem.getCurrentPrice() + auctionItem.getBidIncrementPrice())) {
|
||||
AuctionHouse.getInstance().getLocale().getMessage("general.notenoughmoney").sendPrefixedMessage(e.player);
|
||||
return;
|
||||
@ -80,7 +80,7 @@ public class GUIBid extends AbstractPlaceholderGui {
|
||||
});
|
||||
|
||||
// TODO UPDATE BID
|
||||
setButton(1, 6, ConfigurationItemHelper.createConfigurationItem(Settings.GUI_BIDDING_ITEMS_CUSTOM_ITEM.getString(), Settings.GUI_BIDDING_ITEMS_CUSTOM_NAME.getString(), Settings.GUI_BIDDING_ITEMS_CUSTOM_LORE.getStringList(), null), e -> {
|
||||
setButton(1, 6, ConfigurationItemHelper.createConfigurationItem(this.player, Settings.GUI_BIDDING_ITEMS_CUSTOM_ITEM.getString(), Settings.GUI_BIDDING_ITEMS_CUSTOM_NAME.getString(), Settings.GUI_BIDDING_ITEMS_CUSTOM_LORE.getStringList(), null), e -> {
|
||||
e.gui.exit();
|
||||
|
||||
new TitleInput(player, AuctionHouse.getInstance().getLocale().getMessage("titles.enter bid.title").getMessage(), AuctionHouse.getInstance().getLocale().getMessage("titles.enter bid.subtitle").getMessage()) {
|
||||
|
@ -69,7 +69,7 @@ public final class GUIBundleCreation extends AbstractPlaceholderGui {
|
||||
}
|
||||
});
|
||||
|
||||
setButton(getRows() - 1, 4, ConfigurationItemHelper.createConfigurationItem(Settings.GUI_CREATE_BUNDLE_CONFIRM_ITEM.getString(), Settings.GUI_CREATE_BUNDLE_CONFIRM_NAME.getString(), Settings.GUI_CREATE_BUNDLE_CONFIRM_LORE.getStringList(), new HashMap<>()), ClickType.LEFT, e -> {
|
||||
setButton(getRows() - 1, 4, ConfigurationItemHelper.createConfigurationItem(this.player, Settings.GUI_CREATE_BUNDLE_CONFIRM_ITEM.getString(), Settings.GUI_CREATE_BUNDLE_CONFIRM_NAME.getString(), Settings.GUI_CREATE_BUNDLE_CONFIRM_LORE.getStringList(), new HashMap<>()), ClickType.LEFT, e -> {
|
||||
ItemStack firstItem = null;
|
||||
List<ItemStack> validItems = new ArrayList<>();
|
||||
|
||||
|
@ -63,7 +63,7 @@ public class GUIContainerInspect extends AbstractPlaceholderGui {
|
||||
this.container = container;
|
||||
this.fromPurchaseGUI = false;
|
||||
setTitle(TextUtils.formatText(Settings.GUI_INSPECT_TITLE.getString()));
|
||||
setDefaultItem(ConfigurationItemHelper.createConfigurationItem(Settings.GUI_INSPECT_BG_ITEM.getString()));
|
||||
setDefaultItem(ConfigurationItemHelper.createConfigurationItem(this.player, Settings.GUI_INSPECT_BG_ITEM.getString()));
|
||||
setUseLockedCells(false);
|
||||
setAcceptsItems(false);
|
||||
setAllowDrops(false);
|
||||
|
@ -83,12 +83,12 @@ public class GUIExpiredItems extends AbstractPlaceholderGui {
|
||||
setOnPage(e -> draw());
|
||||
|
||||
if (Settings.STORE_PAYMENTS_FOR_MANUAL_COLLECTION.getBoolean())
|
||||
setButton(5, 2, ConfigurationItemHelper.createConfigurationItem(Settings.GUI_EXPIRED_AUCTIONS_PAYMENTS_ITEM.getString(), Settings.GUI_EXPIRED_AUCTIONS_PAYMENTS_NAME.getString(), Settings.GUI_EXPIRED_AUCTIONS_PAYMENTS_LORE.getStringList(), null), e -> {
|
||||
setButton(5, 2, ConfigurationItemHelper.createConfigurationItem(this.player, Settings.GUI_EXPIRED_AUCTIONS_PAYMENTS_ITEM.getString(), Settings.GUI_EXPIRED_AUCTIONS_PAYMENTS_NAME.getString(), Settings.GUI_EXPIRED_AUCTIONS_PAYMENTS_LORE.getStringList(), null), e -> {
|
||||
e.manager.showGUI(e.player, new GUIPaymentCollection(this.auctionPlayer));
|
||||
});
|
||||
|
||||
|
||||
setButton(5, 1, ConfigurationItemHelper.createConfigurationItem(Settings.GUI_EXPIRED_AUCTIONS_ITEM.getString(), Settings.GUI_EXPIRED_AUCTIONS_NAME.getString(), Settings.GUI_EXPIRED_AUCTIONS_LORE.getStringList(), null), e -> {
|
||||
setButton(5, 1, ConfigurationItemHelper.createConfigurationItem(this.player, Settings.GUI_EXPIRED_AUCTIONS_ITEM.getString(), Settings.GUI_EXPIRED_AUCTIONS_NAME.getString(), Settings.GUI_EXPIRED_AUCTIONS_LORE.getStringList(), null), e -> {
|
||||
|
||||
if (this.lastClicked == null) {
|
||||
this.lastClicked = System.currentTimeMillis() + Settings.CLAIM_MS_DELAY.getInt();
|
||||
|
@ -67,7 +67,7 @@ public final class GUIMinItemPrices extends AbstractPlaceholderGui {
|
||||
final List<String> lore = AuctionAPI.getInstance().getItemLore(minItemPrice.getItemStack());
|
||||
lore.addAll(Settings.GUI_MIN_ITEM_PRICES_LORE.getStringList());
|
||||
|
||||
setButton(slot++, ConfigurationItemHelper.createConfigurationItem(minItemPrice.getItemStack(), AuctionAPI.getInstance().getItemName(minItemPrice.getItemStack()), lore, new HashMap<String, Object>() {{
|
||||
setButton(slot++, ConfigurationItemHelper.createConfigurationItem(this.player, minItemPrice.getItemStack(), AuctionAPI.getInstance().getItemName(minItemPrice.getItemStack()), lore, new HashMap<String, Object>() {{
|
||||
put("%price%", AuctionAPI.getInstance().formatNumber(minItemPrice.getPrice()));
|
||||
}}), click -> {
|
||||
AuctionHouse.getInstance().getDataManager().deleteMinItemPrice(Collections.singletonList(minItemPrice.getUuid()));
|
||||
|
@ -77,7 +77,7 @@ public class GUIPaymentCollection extends AbstractPlaceholderGui {
|
||||
setOnPage(e -> draw());
|
||||
|
||||
|
||||
setButton(5, 1, ConfigurationItemHelper.createConfigurationItem(
|
||||
setButton(5, 1, ConfigurationItemHelper.createConfigurationItem(this.player,
|
||||
Settings.GUI_PAYMENT_COLLECTION_ITEM.getString(),
|
||||
PlaceholderAPIHook.PAPIReplacer.tryReplace(this.player, Settings.GUI_PAYMENT_COLLECTION_NAME.getString()),
|
||||
PlaceholderAPIHook.PAPIReplacer.tryReplace(this.player, Settings.GUI_PAYMENT_COLLECTION_LORE.getStringList()), null), e -> {
|
||||
|
@ -54,7 +54,7 @@ public final class GUIAdminExpired extends AbstractPlaceholderGui {
|
||||
private void draw() {
|
||||
reset();
|
||||
|
||||
setButton(5, 4, ConfigurationItemHelper.createConfigurationItem(Settings.GUI_CLOSE_BTN_ITEM.getString(), Settings.GUI_CLOSE_BTN_NAME.getString(), Settings.GUI_CLOSE_BTN_LORE.getStringList(), null), e -> e.gui.close());
|
||||
setButton(5, 4, ConfigurationItemHelper.createConfigurationItem(this.player, Settings.GUI_CLOSE_BTN_ITEM.getString(), Settings.GUI_CLOSE_BTN_NAME.getString(), Settings.GUI_CLOSE_BTN_LORE.getStringList(), null), e -> e.gui.close());
|
||||
|
||||
AuctionHouse.newChain().asyncFirst(() -> this.items.stream().sorted(Comparator.comparingLong(AuctionedItem::getExpiresAt).reversed()).skip((page - 1) * 45L).limit(45).collect(Collectors.toList())).asyncLast(data -> {
|
||||
pages = (int) Math.max(1, Math.ceil(this.items.size() / (double) 45));
|
||||
|
@ -55,7 +55,7 @@ public class GUIAdminItem extends AbstractPlaceholderGui {
|
||||
this.auctionPlayer = auctionPlayer;
|
||||
this.auctionItem = auctionItem;
|
||||
setTitle(TextUtils.formatText(Settings.GUI_ITEM_ADMIN_TITLE.getString()));
|
||||
setDefaultItem(ConfigurationItemHelper.createConfigurationItem(Settings.GUI_ITEM_ADMIN_BG_ITEM.getString()));
|
||||
setDefaultItem(ConfigurationItemHelper.createConfigurationItem(this.player, Settings.GUI_ITEM_ADMIN_BG_ITEM.getString()));
|
||||
setRows(3);
|
||||
setAcceptsItems(false);
|
||||
setUseLockedCells(true);
|
||||
@ -67,7 +67,7 @@ public class GUIAdminItem extends AbstractPlaceholderGui {
|
||||
private void draw() {
|
||||
|
||||
if (Settings.ADMIN_OPTION_SHOW_RETURN_ITEM.getBoolean())
|
||||
setButton(1, 1, ConfigurationItemHelper.createConfigurationItem(Settings.GUI_ITEM_ADMIN_ITEMS_RETURN_ITEM.getString(), Settings.GUI_ITEM_ADMIN_ITEMS_RETURN_NAME.getString(), Settings.GUI_ITEM_ADMIN_ITEMS_RETURN_LORE.getStringList(), null), e -> {
|
||||
setButton(1, 1, ConfigurationItemHelper.createConfigurationItem(this.player, Settings.GUI_ITEM_ADMIN_ITEMS_RETURN_ITEM.getString(), Settings.GUI_ITEM_ADMIN_ITEMS_RETURN_NAME.getString(), Settings.GUI_ITEM_ADMIN_ITEMS_RETURN_LORE.getStringList(), null), e -> {
|
||||
if (!e.player.hasPermission("auctionhouse.admin.returnitem")) return;
|
||||
|
||||
AuctionAdminEvent event = new AuctionAdminEvent(createLog(e.player, AdminAction.RETURN_ITEM));
|
||||
@ -100,7 +100,7 @@ public class GUIAdminItem extends AbstractPlaceholderGui {
|
||||
});
|
||||
|
||||
if (Settings.ADMIN_OPTION_SHOW_CLAIM_ITEM.getBoolean())
|
||||
setButton(1, 3, ConfigurationItemHelper.createConfigurationItem(Settings.GUI_ITEM_ADMIN_ITEMS_CLAIM_ITEM.getString(), Settings.GUI_ITEM_ADMIN_ITEMS_CLAIM_NAME.getString(), Settings.GUI_ITEM_ADMIN_ITEMS_CLAIM_LORE.getStringList(), null), e -> {
|
||||
setButton(1, 3, ConfigurationItemHelper.createConfigurationItem(this.player, Settings.GUI_ITEM_ADMIN_ITEMS_CLAIM_ITEM.getString(), Settings.GUI_ITEM_ADMIN_ITEMS_CLAIM_NAME.getString(), Settings.GUI_ITEM_ADMIN_ITEMS_CLAIM_LORE.getStringList(), null), e -> {
|
||||
if (!e.player.hasPermission("auctionhouse.admin.claimitem")) return;
|
||||
AuctionAdminEvent event = new AuctionAdminEvent(createLog(e.player, AdminAction.CLAIM_ITEM));
|
||||
Bukkit.getServer().getPluginManager().callEvent(event);
|
||||
@ -132,7 +132,7 @@ public class GUIAdminItem extends AbstractPlaceholderGui {
|
||||
});
|
||||
|
||||
if (Settings.ADMIN_OPTION_SHOW_DELETE_ITEM.getBoolean())
|
||||
setButton(1, 5, ConfigurationItemHelper.createConfigurationItem(Settings.GUI_ITEM_ADMIN_ITEMS_DELETE_ITEM.getString(), Settings.GUI_ITEM_ADMIN_ITEMS_DELETE_NAME.getString(), Settings.GUI_ITEM_ADMIN_ITEMS_DELETE_LORE.getStringList(), null), e -> {
|
||||
setButton(1, 5, ConfigurationItemHelper.createConfigurationItem(this.player, Settings.GUI_ITEM_ADMIN_ITEMS_DELETE_ITEM.getString(), Settings.GUI_ITEM_ADMIN_ITEMS_DELETE_NAME.getString(), Settings.GUI_ITEM_ADMIN_ITEMS_DELETE_LORE.getStringList(), null), e -> {
|
||||
if (!e.player.hasPermission("auctionhouse.admin.deleteitem")) return;
|
||||
AuctionAdminEvent event = new AuctionAdminEvent(createLog(e.player, AdminAction.DELETE_ITEM));
|
||||
Bukkit.getServer().getPluginManager().callEvent(event);
|
||||
@ -162,7 +162,7 @@ public class GUIAdminItem extends AbstractPlaceholderGui {
|
||||
});
|
||||
|
||||
if (Settings.ADMIN_OPTION_SHOW_COPY_ITEM.getBoolean())
|
||||
setButton(1, 7, ConfigurationItemHelper.createConfigurationItem(Settings.GUI_ITEM_ADMIN_ITEMS_COPY_ITEM.getString(), Settings.GUI_ITEM_ADMIN_ITEMS_COPY_NAME.getString(), Settings.GUI_ITEM_ADMIN_ITEMS_COPY_LORE.getStringList(), null), e -> {
|
||||
setButton(1, 7, ConfigurationItemHelper.createConfigurationItem(this.player, Settings.GUI_ITEM_ADMIN_ITEMS_COPY_ITEM.getString(), Settings.GUI_ITEM_ADMIN_ITEMS_COPY_NAME.getString(), Settings.GUI_ITEM_ADMIN_ITEMS_COPY_LORE.getStringList(), null), e -> {
|
||||
if (!e.player.hasPermission("auctionhouse.admin.copyitem")) return;
|
||||
if (Settings.ITEM_COPY_REQUIRES_GMC.getBoolean() && e.player.getGameMode() != GameMode.CREATIVE) {
|
||||
AuctionHouse.getInstance().getLocale().getMessage("general.requires creative").sendPrefixedMessage(e.player);
|
||||
|
@ -63,7 +63,7 @@ public final class GUIAdminLogs extends AbstractPlaceholderGui {
|
||||
List<AuctionAdminLog> data = this.logs.stream().sorted(Comparator.comparingLong(AuctionAdminLog::getTime).reversed()).skip((page - 1) * 45L).limit(45).collect(Collectors.toList());
|
||||
|
||||
for (AuctionAdminLog log : data) {
|
||||
setItem(slot++, ConfigurationItemHelper.createConfigurationItem(log.getItem(), AuctionAPI.getInstance().getItemName(log.getItem()), Settings.GUI_LOGS_LORE.getStringList(), new HashMap<String, Object>() {{
|
||||
setItem(slot++, ConfigurationItemHelper.createConfigurationItem(this.player, log.getItem(), AuctionAPI.getInstance().getItemName(log.getItem()), Settings.GUI_LOGS_LORE.getStringList(), new HashMap<String, Object>() {{
|
||||
put("%admin%", log.getAdminName());
|
||||
put("%target%", log.getTargetName());
|
||||
put("%admin_uuid%", log.getAdmin());
|
||||
|
@ -81,7 +81,7 @@ public class GUIConfirmPurchase extends AbstractPlaceholderGui {
|
||||
|
||||
if (this.buyingSpecificQuantity) {
|
||||
setUseLockedCells(Settings.GUI_CONFIRM_FILL_BG_ON_QUANTITY.getBoolean());
|
||||
setDefaultItem(ConfigurationItemHelper.createConfigurationItem(Settings.GUI_CONFIRM_BG_ITEM.getString()));
|
||||
setDefaultItem(ConfigurationItemHelper.createConfigurationItem(this.player, Settings.GUI_CONFIRM_BG_ITEM.getString()));
|
||||
this.purchaseQuantity = preAmount;
|
||||
this.maxStackSize = preAmount;
|
||||
this.pricePerItem = this.auctionItem.getBasePrice() / this.maxStackSize;
|
||||
@ -280,7 +280,7 @@ public class GUIConfirmPurchase extends AbstractPlaceholderGui {
|
||||
}
|
||||
|
||||
private ItemStack getPurchaseInfoItem(int qty) {
|
||||
ItemStack stack = ConfigurationItemHelper.createConfigurationItem(Settings.GUI_CONFIRM_QTY_INFO_ITEM.getString(), Settings.GUI_CONFIRM_QTY_INFO_NAME.getString(), Settings.GUI_CONFIRM_QTY_INFO_LORE.getStringList(), new HashMap<String, Object>() {{
|
||||
ItemStack stack = ConfigurationItemHelper.createConfigurationItem(this.player, Settings.GUI_CONFIRM_QTY_INFO_ITEM.getString(), Settings.GUI_CONFIRM_QTY_INFO_NAME.getString(), Settings.GUI_CONFIRM_QTY_INFO_LORE.getStringList(), new HashMap<String, Object>() {{
|
||||
put("%original_stack_size%", maxStackSize);
|
||||
put("%original_stack_price%", AuctionAPI.getInstance().formatNumber(auctionItem.getBasePrice()));
|
||||
put("%price_per_item%", AuctionAPI.getInstance().formatNumber(pricePerItem));
|
||||
|
@ -49,7 +49,7 @@ public class GUIFilterSelection extends AbstractPlaceholderGui {
|
||||
setTitle(TextUtils.formatText(Settings.GUI_FILTER_TITLE.getString()));
|
||||
setRows(4);
|
||||
setAcceptsItems(false);
|
||||
setDefaultItem(ConfigurationItemHelper.createConfigurationItem(Settings.GUI_FILTER_BG_ITEM.getString()));
|
||||
setDefaultItem(ConfigurationItemHelper.createConfigurationItem(this.player, Settings.GUI_FILTER_BG_ITEM.getString()));
|
||||
setUseLockedCells(true);
|
||||
draw();
|
||||
|
||||
@ -59,7 +59,7 @@ public class GUIFilterSelection extends AbstractPlaceholderGui {
|
||||
private void draw() {
|
||||
|
||||
if (AuctionItemCategory.ALL.isEnabled())
|
||||
setButton(1, 3, ConfigurationItemHelper.createConfigurationItem(Settings.GUI_FILTER_ITEMS_ALL_ITEM.getString(), Settings.GUI_FILTER_ITEMS_ALL_NAME.getString(), Settings.GUI_FILTER_ITEMS_ALL_LORE.getStringList(), null), e -> {
|
||||
setButton(1, 3, ConfigurationItemHelper.createConfigurationItem(this.player, Settings.GUI_FILTER_ITEMS_ALL_ITEM.getString(), Settings.GUI_FILTER_ITEMS_ALL_NAME.getString(), Settings.GUI_FILTER_ITEMS_ALL_LORE.getStringList(), null), e -> {
|
||||
this.auctionPlayer.setSelectedFilter(AuctionItemCategory.ALL);
|
||||
updatePlayerFilter(this.auctionPlayer);
|
||||
e.manager.showGUI(e.player, new GUIAuctionHouse(this.auctionPlayer));
|
||||
@ -73,7 +73,7 @@ public class GUIFilterSelection extends AbstractPlaceholderGui {
|
||||
});
|
||||
|
||||
if (AuctionItemCategory.SEARCH.isEnabled())
|
||||
setButton(1, 5, ConfigurationItemHelper.createConfigurationItem(Settings.GUI_FILTER_ITEMS_SEARCH_ITEM.getString(), Settings.GUI_FILTER_ITEMS_SEARCH_NAME.getString(), Settings.GUI_FILTER_ITEMS_SEARCH_LORE.getStringList(), new HashMap<String, Object>() {{
|
||||
setButton(1, 5, ConfigurationItemHelper.createConfigurationItem(this.player, Settings.GUI_FILTER_ITEMS_SEARCH_ITEM.getString(), Settings.GUI_FILTER_ITEMS_SEARCH_NAME.getString(), Settings.GUI_FILTER_ITEMS_SEARCH_LORE.getStringList(), new HashMap<String, Object>() {{
|
||||
put("%filter_search_phrase%", auctionPlayer.getCurrentSearchPhrase());
|
||||
}}), e -> {
|
||||
e.gui.exit();
|
||||
@ -88,49 +88,49 @@ public class GUIFilterSelection extends AbstractPlaceholderGui {
|
||||
});
|
||||
|
||||
if (AuctionItemCategory.MISC.isEnabled())
|
||||
setButton(2, 1, ConfigurationItemHelper.createConfigurationItem(Settings.GUI_FILTER_ITEMS_MISC_ITEM.getString(), Settings.GUI_FILTER_ITEMS_MISC_NAME.getString(), Settings.GUI_FILTER_ITEMS_MISC_LORE.getStringList(), null), e -> {
|
||||
setButton(2, 1, ConfigurationItemHelper.createConfigurationItem(this.player, Settings.GUI_FILTER_ITEMS_MISC_ITEM.getString(), Settings.GUI_FILTER_ITEMS_MISC_NAME.getString(), Settings.GUI_FILTER_ITEMS_MISC_LORE.getStringList(), null), e -> {
|
||||
this.auctionPlayer.setSelectedFilter(AuctionItemCategory.MISC);
|
||||
updatePlayerFilter(this.auctionPlayer);
|
||||
e.manager.showGUI(e.player, new GUIAuctionHouse(this.auctionPlayer));
|
||||
});
|
||||
|
||||
if (AuctionItemCategory.ENCHANTS.isEnabled())
|
||||
setButton(2, 2, ConfigurationItemHelper.createConfigurationItem(Settings.GUI_FILTER_ITEMS_ENCHANTS_ITEM.getString(), Settings.GUI_FILTER_ITEMS_ENCHANTS_NAME.getString(), Settings.GUI_FILTER_ITEMS_ENCHANTS_LORE.getStringList(), null), e -> {
|
||||
setButton(2, 2, ConfigurationItemHelper.createConfigurationItem(this.player, Settings.GUI_FILTER_ITEMS_ENCHANTS_ITEM.getString(), Settings.GUI_FILTER_ITEMS_ENCHANTS_NAME.getString(), Settings.GUI_FILTER_ITEMS_ENCHANTS_LORE.getStringList(), null), e -> {
|
||||
this.auctionPlayer.setSelectedFilter(AuctionItemCategory.ENCHANTS);
|
||||
updatePlayerFilter(this.auctionPlayer);
|
||||
e.manager.showGUI(e.player, new GUIAuctionHouse(this.auctionPlayer));
|
||||
});
|
||||
|
||||
if (AuctionItemCategory.ARMOR.isEnabled())
|
||||
setButton(2, 3, ConfigurationItemHelper.createConfigurationItem(Settings.GUI_FILTER_ITEMS_ARMOR_ITEM.getString(), Settings.GUI_FILTER_ITEMS_ARMOR_NAME.getString(), Settings.GUI_FILTER_ITEMS_ARMOR_LORE.getStringList(), null), e -> {
|
||||
setButton(2, 3, ConfigurationItemHelper.createConfigurationItem(this.player, Settings.GUI_FILTER_ITEMS_ARMOR_ITEM.getString(), Settings.GUI_FILTER_ITEMS_ARMOR_NAME.getString(), Settings.GUI_FILTER_ITEMS_ARMOR_LORE.getStringList(), null), e -> {
|
||||
this.auctionPlayer.setSelectedFilter(AuctionItemCategory.ARMOR);
|
||||
updatePlayerFilter(this.auctionPlayer);
|
||||
e.manager.showGUI(e.player, new GUIAuctionHouse(this.auctionPlayer));
|
||||
});
|
||||
|
||||
if (AuctionItemCategory.WEAPONS.isEnabled())
|
||||
setButton(2, 4, ConfigurationItemHelper.createConfigurationItem(Settings.GUI_FILTER_ITEMS_WEAPONS_ITEM.getString(), Settings.GUI_FILTER_ITEMS_WEAPONS_NAME.getString(), Settings.GUI_FILTER_ITEMS_WEAPONS_LORE.getStringList(), null), e -> {
|
||||
setButton(2, 4, ConfigurationItemHelper.createConfigurationItem(this.player, Settings.GUI_FILTER_ITEMS_WEAPONS_ITEM.getString(), Settings.GUI_FILTER_ITEMS_WEAPONS_NAME.getString(), Settings.GUI_FILTER_ITEMS_WEAPONS_LORE.getStringList(), null), e -> {
|
||||
this.auctionPlayer.setSelectedFilter(AuctionItemCategory.WEAPONS);
|
||||
updatePlayerFilter(this.auctionPlayer);
|
||||
e.manager.showGUI(e.player, new GUIAuctionHouse(this.auctionPlayer));
|
||||
});
|
||||
|
||||
if (AuctionItemCategory.TOOLS.isEnabled())
|
||||
setButton(2, 5, ConfigurationItemHelper.createConfigurationItem(Settings.GUI_FILTER_ITEMS_TOOLS_ITEM.getString(), Settings.GUI_FILTER_ITEMS_TOOLS_NAME.getString(), Settings.GUI_FILTER_ITEMS_TOOLS_LORE.getStringList(), null), e -> {
|
||||
setButton(2, 5, ConfigurationItemHelper.createConfigurationItem(this.player, Settings.GUI_FILTER_ITEMS_TOOLS_ITEM.getString(), Settings.GUI_FILTER_ITEMS_TOOLS_NAME.getString(), Settings.GUI_FILTER_ITEMS_TOOLS_LORE.getStringList(), null), e -> {
|
||||
this.auctionPlayer.setSelectedFilter(AuctionItemCategory.TOOLS);
|
||||
updatePlayerFilter(this.auctionPlayer);
|
||||
e.manager.showGUI(e.player, new GUIAuctionHouse(this.auctionPlayer));
|
||||
});
|
||||
|
||||
if (AuctionItemCategory.SPAWNERS.isEnabled())
|
||||
setButton(2, 6, ConfigurationItemHelper.createConfigurationItem(Settings.GUI_FILTER_ITEMS_SPAWNERS_ITEM.getString(), Settings.GUI_FILTER_ITEMS_SPAWNERS_NAME.getString(), Settings.GUI_FILTER_ITEMS_SPAWNERS_LORE.getStringList(), null), e -> {
|
||||
setButton(2, 6, ConfigurationItemHelper.createConfigurationItem(this.player, Settings.GUI_FILTER_ITEMS_SPAWNERS_ITEM.getString(), Settings.GUI_FILTER_ITEMS_SPAWNERS_NAME.getString(), Settings.GUI_FILTER_ITEMS_SPAWNERS_LORE.getStringList(), null), e -> {
|
||||
this.auctionPlayer.setSelectedFilter(AuctionItemCategory.SPAWNERS);
|
||||
updatePlayerFilter(this.auctionPlayer);
|
||||
e.manager.showGUI(e.player, new GUIAuctionHouse(this.auctionPlayer));
|
||||
});
|
||||
|
||||
if (AuctionItemCategory.BLOCKS.isEnabled())
|
||||
setButton(2, 7, ConfigurationItemHelper.createConfigurationItem(Settings.GUI_FILTER_ITEMS_BLOCKS_ITEM.getString(), Settings.GUI_FILTER_ITEMS_BLOCKS_NAME.getString(), Settings.GUI_FILTER_ITEMS_BLOCKS_LORE.getStringList(), null), e -> {
|
||||
setButton(2, 7, ConfigurationItemHelper.createConfigurationItem(this.player, Settings.GUI_FILTER_ITEMS_BLOCKS_ITEM.getString(), Settings.GUI_FILTER_ITEMS_BLOCKS_NAME.getString(), Settings.GUI_FILTER_ITEMS_BLOCKS_LORE.getStringList(), null), e -> {
|
||||
this.auctionPlayer.setSelectedFilter(AuctionItemCategory.BLOCKS);
|
||||
updatePlayerFilter(this.auctionPlayer);
|
||||
e.manager.showGUI(e.player, new GUIAuctionHouse(this.auctionPlayer));
|
||||
|
@ -38,43 +38,43 @@ public class GUIFilterWhitelist extends AbstractPlaceholderGui {
|
||||
setTitle(TextUtils.formatText(Settings.GUI_FILTER_WHITELIST_TITLE.getString()));
|
||||
setRows(6);
|
||||
setAcceptsItems(false);
|
||||
setDefaultItem(ConfigurationItemHelper.createConfigurationItem(Settings.GUI_FILTER_WHITELIST_BG_ITEM.getString()));
|
||||
setDefaultItem(ConfigurationItemHelper.createConfigurationItem(this.player, Settings.GUI_FILTER_WHITELIST_BG_ITEM.getString()));
|
||||
setUseLockedCells(true);
|
||||
draw();
|
||||
}
|
||||
|
||||
private void draw() {
|
||||
setButton(2, 1, ConfigurationItemHelper.createConfigurationItem(Settings.GUI_FILTER_WHITELIST_ITEMS_BLOCKS_ITEM.getString(), Settings.GUI_FILTER_WHITELIST_ITEMS_BLOCKS_NAME.getString(), Settings.GUI_FILTER_WHITELIST_ITEMS_BLOCKS_LORE.getStringList(), null), e -> {
|
||||
setButton(2, 1, ConfigurationItemHelper.createConfigurationItem(this.player, Settings.GUI_FILTER_WHITELIST_ITEMS_BLOCKS_ITEM.getString(), Settings.GUI_FILTER_WHITELIST_ITEMS_BLOCKS_NAME.getString(), Settings.GUI_FILTER_WHITELIST_ITEMS_BLOCKS_LORE.getStringList(), null), e -> {
|
||||
e.manager.showGUI(e.player, new GUIFilterWhitelistList(e.player, AuctionItemCategory.BLOCKS));
|
||||
});
|
||||
|
||||
setButton(2, 3, ConfigurationItemHelper.createConfigurationItem(Settings.GUI_FILTER_WHITELIST_ITEMS_FOOD_ITEM.getString(), Settings.GUI_FILTER_WHITELIST_ITEMS_FOOD_NAME.getString(), Settings.GUI_FILTER_WHITELIST_ITEMS_FOOD_LORE.getStringList(), null), e -> {
|
||||
setButton(2, 3, ConfigurationItemHelper.createConfigurationItem(this.player, Settings.GUI_FILTER_WHITELIST_ITEMS_FOOD_ITEM.getString(), Settings.GUI_FILTER_WHITELIST_ITEMS_FOOD_NAME.getString(), Settings.GUI_FILTER_WHITELIST_ITEMS_FOOD_LORE.getStringList(), null), e -> {
|
||||
e.manager.showGUI(e.player, new GUIFilterWhitelistList(e.player, AuctionItemCategory.FOOD));
|
||||
});
|
||||
|
||||
setButton(2, 5, ConfigurationItemHelper.createConfigurationItem(Settings.GUI_FILTER_WHITELIST_ITEMS_ARMOR_ITEM.getString(), Settings.GUI_FILTER_WHITELIST_ITEMS_ARMOR_NAME.getString(), Settings.GUI_FILTER_WHITELIST_ITEMS_ARMOR_LORE.getStringList(), null), e -> {
|
||||
setButton(2, 5, ConfigurationItemHelper.createConfigurationItem(this.player, Settings.GUI_FILTER_WHITELIST_ITEMS_ARMOR_ITEM.getString(), Settings.GUI_FILTER_WHITELIST_ITEMS_ARMOR_NAME.getString(), Settings.GUI_FILTER_WHITELIST_ITEMS_ARMOR_LORE.getStringList(), null), e -> {
|
||||
e.manager.showGUI(e.player, new GUIFilterWhitelistList(e.player, AuctionItemCategory.ARMOR));
|
||||
});
|
||||
|
||||
setButton(2, 7, ConfigurationItemHelper.createConfigurationItem(Settings.GUI_FILTER_WHITELIST_ITEMS_TOOLS_ITEM.getString(), Settings.GUI_FILTER_WHITELIST_ITEMS_TOOLS_NAME.getString(), Settings.GUI_FILTER_WHITELIST_ITEMS_TOOLS_LORE.getStringList(), null), e -> {
|
||||
setButton(2, 7, ConfigurationItemHelper.createConfigurationItem(this.player, Settings.GUI_FILTER_WHITELIST_ITEMS_TOOLS_ITEM.getString(), Settings.GUI_FILTER_WHITELIST_ITEMS_TOOLS_NAME.getString(), Settings.GUI_FILTER_WHITELIST_ITEMS_TOOLS_LORE.getStringList(), null), e -> {
|
||||
e.manager.showGUI(e.player, new GUIFilterWhitelistList(e.player, AuctionItemCategory.TOOLS));
|
||||
});
|
||||
|
||||
// 2ND ROW STARTS
|
||||
|
||||
setButton(3, 1, ConfigurationItemHelper.createConfigurationItem(Settings.GUI_FILTER_WHITELIST_ITEMS_SPAWNERS_ITEM.getString(), Settings.GUI_FILTER_WHITELIST_ITEMS_SPAWNERS_NAME.getString(), Settings.GUI_FILTER_WHITELIST_ITEMS_SPAWNERS_LORE.getStringList(), null), e -> {
|
||||
setButton(3, 1, ConfigurationItemHelper.createConfigurationItem(this.player, Settings.GUI_FILTER_WHITELIST_ITEMS_SPAWNERS_ITEM.getString(), Settings.GUI_FILTER_WHITELIST_ITEMS_SPAWNERS_NAME.getString(), Settings.GUI_FILTER_WHITELIST_ITEMS_SPAWNERS_LORE.getStringList(), null), e -> {
|
||||
e.manager.showGUI(e.player, new GUIFilterWhitelistList(e.player, AuctionItemCategory.SPAWNERS));
|
||||
});
|
||||
|
||||
setButton(3, 3, ConfigurationItemHelper.createConfigurationItem(Settings.GUI_FILTER_WHITELIST_ITEMS_ENCHANTS_ITEM.getString(), Settings.GUI_FILTER_WHITELIST_ITEMS_ENCHANTS_NAME.getString(), Settings.GUI_FILTER_WHITELIST_ITEMS_ENCHANTS_LORE.getStringList(), null), e -> {
|
||||
setButton(3, 3, ConfigurationItemHelper.createConfigurationItem(this.player, Settings.GUI_FILTER_WHITELIST_ITEMS_ENCHANTS_ITEM.getString(), Settings.GUI_FILTER_WHITELIST_ITEMS_ENCHANTS_NAME.getString(), Settings.GUI_FILTER_WHITELIST_ITEMS_ENCHANTS_LORE.getStringList(), null), e -> {
|
||||
e.manager.showGUI(e.player, new GUIFilterWhitelistList(e.player, AuctionItemCategory.ENCHANTS));
|
||||
});
|
||||
|
||||
setButton(3, 5, ConfigurationItemHelper.createConfigurationItem(Settings.GUI_FILTER_WHITELIST_ITEMS_WEAPONS_ITEM.getString(), Settings.GUI_FILTER_WHITELIST_ITEMS_WEAPONS_NAME.getString(), Settings.GUI_FILTER_WHITELIST_ITEMS_WEAPONS_LORE.getStringList(), null), e -> {
|
||||
setButton(3, 5, ConfigurationItemHelper.createConfigurationItem(this.player, Settings.GUI_FILTER_WHITELIST_ITEMS_WEAPONS_ITEM.getString(), Settings.GUI_FILTER_WHITELIST_ITEMS_WEAPONS_NAME.getString(), Settings.GUI_FILTER_WHITELIST_ITEMS_WEAPONS_LORE.getStringList(), null), e -> {
|
||||
e.manager.showGUI(e.player, new GUIFilterWhitelistList(e.player, AuctionItemCategory.WEAPONS));
|
||||
});
|
||||
|
||||
setButton(3, 7, ConfigurationItemHelper.createConfigurationItem(Settings.GUI_FILTER_WHITELIST_ITEMS_MISC_ITEM.getString(), Settings.GUI_FILTER_WHITELIST_ITEMS_MISC_NAME.getString(), Settings.GUI_FILTER_WHITELIST_ITEMS_MISC_LORE.getStringList(), null), e -> {
|
||||
setButton(3, 7, ConfigurationItemHelper.createConfigurationItem(this.player, Settings.GUI_FILTER_WHITELIST_ITEMS_MISC_ITEM.getString(), Settings.GUI_FILTER_WHITELIST_ITEMS_MISC_NAME.getString(), Settings.GUI_FILTER_WHITELIST_ITEMS_MISC_LORE.getStringList(), null), e -> {
|
||||
e.manager.showGUI(e.player, new GUIFilterWhitelistList(e.player, AuctionItemCategory.MISC));
|
||||
});
|
||||
}
|
||||
|
@ -49,7 +49,7 @@ public class GUIFilterWhitelistList extends AbstractPlaceholderGui {
|
||||
setTitle(TextUtils.formatText(Settings.GUI_FILTER_WHITELIST_LIST_TITLE.getString().replace("%filter_category%", filerCategory.getTranslatedType())));
|
||||
setRows(6);
|
||||
setAcceptsItems(false);
|
||||
setDefaultItem(ConfigurationItemHelper.createConfigurationItem(Settings.GUI_FILTER_WHITELIST_LIST_BG_ITEM.getString()));
|
||||
setDefaultItem(ConfigurationItemHelper.createConfigurationItem(this.player, Settings.GUI_FILTER_WHITELIST_LIST_BG_ITEM.getString()));
|
||||
setUseLockedCells(true);
|
||||
draw();
|
||||
|
||||
|
@ -66,7 +66,7 @@ public final class GUISellAuction extends AbstractPlaceholderGui {
|
||||
this.allowBuyNow = allowBuyNow;
|
||||
|
||||
setTitle(Settings.GUI_SELL_AUCTION_TITLE.getString());
|
||||
setDefaultItem(ConfigurationItemHelper.createConfigurationItem(Settings.GUI_SELL_AUCTION_BG_ITEM.getString()));
|
||||
setDefaultItem(ConfigurationItemHelper.createConfigurationItem(this.player, Settings.GUI_SELL_AUCTION_BG_ITEM.getString()));
|
||||
setRows(6);
|
||||
|
||||
setOnClose(close -> {
|
||||
@ -94,7 +94,7 @@ public final class GUISellAuction extends AbstractPlaceholderGui {
|
||||
|
||||
final long[] times = AuctionAPI.getInstance().getRemainingTimeValues(this.listingTime);
|
||||
|
||||
setButton(3, 1, ConfigurationItemHelper.createConfigurationItem(Settings.GUI_SELL_AUCTION_ITEM_ITEMS_TIME_ITEM.getString(), Settings.GUI_SELL_AUCTION_ITEM_ITEMS_TIME_NAME.getString(), Settings.GUI_SELL_AUCTION_ITEM_ITEMS_TIME_LORE.getStringList(), new HashMap<String, Object>() {{
|
||||
setButton(3, 1, ConfigurationItemHelper.createConfigurationItem(this.player, Settings.GUI_SELL_AUCTION_ITEM_ITEMS_TIME_ITEM.getString(), Settings.GUI_SELL_AUCTION_ITEM_ITEMS_TIME_NAME.getString(), Settings.GUI_SELL_AUCTION_ITEM_ITEMS_TIME_LORE.getStringList(), new HashMap<String, Object>() {{
|
||||
put("%remaining_days%", times[0]);
|
||||
put("%remaining_hours%", times[1]);
|
||||
put("%remaining_minutes%", times[2]);
|
||||
@ -143,7 +143,7 @@ public final class GUISellAuction extends AbstractPlaceholderGui {
|
||||
|
||||
if (this.allowBuyNow)
|
||||
if (Settings.ALLOW_USAGE_OF_BUY_NOW_SYSTEM.getBoolean())
|
||||
setButton(3, 4, ConfigurationItemHelper.createConfigurationItem(
|
||||
setButton(3, 4, ConfigurationItemHelper.createConfigurationItem(this.player,
|
||||
Settings.GUI_SELL_AUCTION_ITEM_ITEMS_BUYOUT_PRICE_ITEM.getString(),
|
||||
Settings.GUI_SELL_AUCTION_ITEM_ITEMS_BUYOUT_PRICE_NAME.getString(),
|
||||
Settings.GUI_SELL_AUCTION_ITEM_ITEMS_BUYOUT_PRICE_LORE.getStringList(),
|
||||
@ -192,7 +192,7 @@ public final class GUISellAuction extends AbstractPlaceholderGui {
|
||||
});
|
||||
|
||||
|
||||
setButton(3, 3, ConfigurationItemHelper.createConfigurationItem(
|
||||
setButton(3, 3, ConfigurationItemHelper.createConfigurationItem(this.player,
|
||||
Settings.GUI_SELL_AUCTION_ITEM_ITEMS_STARTING_PRICE_ITEM.getString(),
|
||||
Settings.GUI_SELL_AUCTION_ITEM_ITEMS_STARTING_PRICE_NAME.getString(),
|
||||
Settings.GUI_SELL_AUCTION_ITEM_ITEMS_STARTING_PRICE_LORE.getStringList(),
|
||||
@ -249,7 +249,7 @@ public final class GUISellAuction extends AbstractPlaceholderGui {
|
||||
};
|
||||
});
|
||||
|
||||
setButton(3, 5, ConfigurationItemHelper.createConfigurationItem(
|
||||
setButton(3, 5, ConfigurationItemHelper.createConfigurationItem(this.player,
|
||||
Settings.GUI_SELL_AUCTION_ITEM_ITEMS_INCREMENT_PRICE_ITEM.getString(),
|
||||
Settings.GUI_SELL_AUCTION_ITEM_ITEMS_INCREMENT_PRICE_NAME.getString(),
|
||||
Settings.GUI_SELL_AUCTION_ITEM_ITEMS_INCREMENT_PRICE_LORE.getStringList(),
|
||||
@ -300,7 +300,7 @@ public final class GUISellAuction extends AbstractPlaceholderGui {
|
||||
drawAuctionItem();
|
||||
drawBuyoutToggle();
|
||||
|
||||
setButton(getRows() - 1, 4, ConfigurationItemHelper.createConfigurationItem(
|
||||
setButton(getRows() - 1, 4, ConfigurationItemHelper.createConfigurationItem(this.player,
|
||||
Settings.GUI_SELL_AUCTION_ITEM_ITEMS_CONTINUE_ITEM.getString(),
|
||||
Settings.GUI_SELL_AUCTION_ITEM_ITEMS_CONTINUE_NAME.getString(),
|
||||
Settings.GUI_SELL_AUCTION_ITEM_ITEMS_CONTINUE_LORE.getStringList(),
|
||||
@ -331,7 +331,7 @@ public final class GUISellAuction extends AbstractPlaceholderGui {
|
||||
|
||||
private void drawBuyoutToggle() {
|
||||
if (Settings.ALLOW_USAGE_OF_BUY_NOW_SYSTEM.getBoolean()) {
|
||||
setButton(3, 7, ConfigurationItemHelper.createConfigurationItem(
|
||||
setButton(3, 7, ConfigurationItemHelper.createConfigurationItem(this.player,
|
||||
this.allowBuyNow ? Settings.GUI_SELL_AUCTION_ITEM_ITEMS_BUYOUT_ENABLED_ITEM.getString() : Settings.GUI_SELL_AUCTION_ITEM_ITEMS_BUYOUT_DISABLED_ITEM.getString(),
|
||||
this.allowBuyNow ? Settings.GUI_SELL_AUCTION_ITEM_ITEMS_BUYOUT_ENABLED_NAME.getString() : Settings.GUI_SELL_AUCTION_ITEM_ITEMS_BUYOUT_DISABLED_NAME.getString(),
|
||||
this.allowBuyNow ? Settings.GUI_SELL_AUCTION_ITEM_ITEMS_BUYOUT_ENABLED_LORE.getStringList() : Settings.GUI_SELL_AUCTION_ITEM_ITEMS_BUYOUT_DISABLED_LORE.getStringList(),
|
||||
|
@ -62,7 +62,7 @@ public final class GUISellBin extends AbstractPlaceholderGui {
|
||||
this.allowPartialBuy = allowPartialBuy;
|
||||
|
||||
setTitle(Settings.GUI_SELL_BIN_TITLE.getString());
|
||||
setDefaultItem(ConfigurationItemHelper.createConfigurationItem(Settings.GUI_SELL_BIN_BG_ITEM.getString()));
|
||||
setDefaultItem(ConfigurationItemHelper.createConfigurationItem(this.player, Settings.GUI_SELL_BIN_BG_ITEM.getString()));
|
||||
setRows(6);
|
||||
|
||||
setOnClose(close -> {
|
||||
@ -91,7 +91,7 @@ public final class GUISellBin extends AbstractPlaceholderGui {
|
||||
|
||||
final long[] times = AuctionAPI.getInstance().getRemainingTimeValues(this.listingTime);
|
||||
|
||||
setButton(3, 1, ConfigurationItemHelper.createConfigurationItem(Settings.GUI_SELL_BIN_ITEM_ITEMS_TIME_ITEM.getString(), Settings.GUI_SELL_BIN_ITEM_ITEMS_TIME_NAME.getString(), Settings.GUI_SELL_BIN_ITEM_ITEMS_TIME_LORE.getStringList(), new HashMap<String, Object>() {{
|
||||
setButton(3, 1, ConfigurationItemHelper.createConfigurationItem(this.player, Settings.GUI_SELL_BIN_ITEM_ITEMS_TIME_ITEM.getString(), Settings.GUI_SELL_BIN_ITEM_ITEMS_TIME_NAME.getString(), Settings.GUI_SELL_BIN_ITEM_ITEMS_TIME_LORE.getStringList(), new HashMap<String, Object>() {{
|
||||
put("%remaining_days%", times[0]);
|
||||
put("%remaining_hours%", times[1]);
|
||||
put("%remaining_minutes%", times[2]);
|
||||
@ -127,7 +127,7 @@ public final class GUISellBin extends AbstractPlaceholderGui {
|
||||
});
|
||||
|
||||
}
|
||||
setButton(3, 4, ConfigurationItemHelper.createConfigurationItem(Settings.GUI_SELL_BIN_ITEM_ITEMS_PRICE_ITEM.getString(), Settings.GUI_SELL_BIN_ITEM_ITEMS_PRICE_NAME.getString(), Settings.GUI_SELL_BIN_ITEM_ITEMS_PRICE_LORE.getStringList(), new HashMap<String, Object>() {{
|
||||
setButton(3, 4, ConfigurationItemHelper.createConfigurationItem(this.player, Settings.GUI_SELL_BIN_ITEM_ITEMS_PRICE_ITEM.getString(), Settings.GUI_SELL_BIN_ITEM_ITEMS_PRICE_NAME.getString(), Settings.GUI_SELL_BIN_ITEM_ITEMS_PRICE_LORE.getStringList(), new HashMap<String, Object>() {{
|
||||
put("%listing_bin_price%", AuctionAPI.getInstance().formatNumber(listingPrice));
|
||||
}}), click -> {
|
||||
|
||||
@ -166,7 +166,7 @@ public final class GUISellBin extends AbstractPlaceholderGui {
|
||||
setItem(1, 4, createListingItem().getDisplayStack(AuctionStackType.LISTING_PREVIEW));
|
||||
|
||||
|
||||
setButton(getRows() - 1, 4, ConfigurationItemHelper.createConfigurationItem(
|
||||
setButton(getRows() - 1, 4, ConfigurationItemHelper.createConfigurationItem(this.player,
|
||||
Settings.GUI_SELL_BIN_ITEM_ITEMS_CONTINUE_ITEM.getString(),
|
||||
Settings.GUI_SELL_BIN_ITEM_ITEMS_CONTINUE_NAME.getString(),
|
||||
Settings.GUI_SELL_BIN_ITEM_ITEMS_CONTINUE_LORE.getStringList(),
|
||||
@ -213,7 +213,7 @@ public final class GUISellBin extends AbstractPlaceholderGui {
|
||||
|
||||
private void drawQtyPurchase() {
|
||||
if (Settings.ALLOW_PURCHASE_OF_SPECIFIC_QUANTITIES.getBoolean()) {
|
||||
setButton(3, 7, ConfigurationItemHelper.createConfigurationItem(
|
||||
setButton(3, 7, ConfigurationItemHelper.createConfigurationItem(this.player,
|
||||
this.allowPartialBuy ? Settings.GUI_SELL_BIN_ITEM_ITEMS_PARTIAL_ENABLED_ITEM.getString() : Settings.GUI_SELL_BIN_ITEM_ITEMS_PARTIAL_DISABLED_ITEM.getString(),
|
||||
this.allowPartialBuy ? Settings.GUI_SELL_BIN_ITEM_ITEMS_PARTIAL_ENABLED_NAME.getString() : Settings.GUI_SELL_BIN_ITEM_ITEMS_PARTIAL_DISABLED_NAME.getString(),
|
||||
this.allowPartialBuy ? Settings.GUI_SELL_BIN_ITEM_ITEMS_PARTIAL_ENABLED_LORE.getStringList() : Settings.GUI_SELL_BIN_ITEM_ITEMS_PARTIAL_DISABLED_LORE.getStringList(),
|
||||
|
@ -38,7 +38,7 @@ public final class GUISellListingType extends AbstractPlaceholderGui {
|
||||
this.auctionPlayer = auctionPlayer;
|
||||
this.listingType = listingType;
|
||||
setTitle(Settings.GUI_SELL_LISTING_TYPE_TITLE.getString());
|
||||
setDefaultItem(ConfigurationItemHelper.createConfigurationItem(Settings.GUI_SELL_LISTING_TYPE_BG_ITEM.getString()));
|
||||
setDefaultItem(ConfigurationItemHelper.createConfigurationItem(this.player, Settings.GUI_SELL_LISTING_TYPE_BG_ITEM.getString()));
|
||||
setRows(3);
|
||||
draw();
|
||||
}
|
||||
@ -55,7 +55,7 @@ public final class GUISellListingType extends AbstractPlaceholderGui {
|
||||
drawBinButton(2);
|
||||
}
|
||||
|
||||
setButton(getRows() - 1, 0, ConfigurationItemHelper.createConfigurationItem(
|
||||
setButton(getRows() - 1, 0, ConfigurationItemHelper.createConfigurationItem(this.player,
|
||||
Settings.GUI_SELL_LISTING_TYPE_ITEMS_RETURN_ITEM.getString(),
|
||||
Settings.GUI_SELL_LISTING_TYPE_ITEMS_RETURN_NAME.getString(),
|
||||
Settings.GUI_SELL_LISTING_TYPE_ITEMS_RETURN_LORE.getStringList(),
|
||||
@ -65,7 +65,7 @@ public final class GUISellListingType extends AbstractPlaceholderGui {
|
||||
}
|
||||
|
||||
private void drawAuctionButton(int col) {
|
||||
setButton(1, col, ConfigurationItemHelper.createConfigurationItem(
|
||||
setButton(1, col, ConfigurationItemHelper.createConfigurationItem(this.player,
|
||||
Settings.GUI_SELL_LISTING_TYPE_ITEMS_AUCTION_ITEM.getString(),
|
||||
Settings.GUI_SELL_LISTING_TYPE_ITEMS_AUCTION_NAME.getString(),
|
||||
Settings.GUI_SELL_LISTING_TYPE_ITEMS_AUCTION_LORE.getStringList(),
|
||||
@ -78,7 +78,7 @@ public final class GUISellListingType extends AbstractPlaceholderGui {
|
||||
}
|
||||
|
||||
private void drawBinButton(int col) {
|
||||
setButton(1, col, ConfigurationItemHelper.createConfigurationItem(
|
||||
setButton(1, col, ConfigurationItemHelper.createConfigurationItem(this.player,
|
||||
Settings.GUI_SELL_LISTING_TYPE_ITEMS_BIN_ITEM.getString(),
|
||||
Settings.GUI_SELL_LISTING_TYPE_ITEMS_BIN_NAME.getString(),
|
||||
Settings.GUI_SELL_LISTING_TYPE_ITEMS_BIN_LORE.getStringList(),
|
||||
|
@ -53,7 +53,7 @@ public final class GUISellPlaceItem extends AbstractPlaceholderGui {
|
||||
this.viewMode = viewMode;
|
||||
this.listingType = listingType;
|
||||
setTitle(viewMode == ViewMode.SINGLE_ITEM ? Settings.GUI_SELL_PLACE_ITEM_TITLE.getString() : Settings.GUI_SELL_PLACE_ITEM_BUNDLE_TITLE.getString());
|
||||
setDefaultItem(ConfigurationItemHelper.createConfigurationItem(Settings.GUI_SELL_PLACE_ITEM_BG_ITEM.getString()));
|
||||
setDefaultItem(ConfigurationItemHelper.createConfigurationItem(this.player, Settings.GUI_SELL_PLACE_ITEM_BG_ITEM.getString()));
|
||||
setRows(viewMode == ViewMode.SINGLE_ITEM ? 4 : 6);
|
||||
|
||||
setAcceptsItems(true);
|
||||
@ -98,7 +98,7 @@ public final class GUISellPlaceItem extends AbstractPlaceholderGui {
|
||||
}
|
||||
});
|
||||
|
||||
setButton(getRows() - 1, 4, ConfigurationItemHelper.createConfigurationItem(
|
||||
setButton(getRows() - 1, 4, ConfigurationItemHelper.createConfigurationItem(this.player,
|
||||
Settings.GUI_SELL_PLACE_ITEM_ITEMS_CONTINUE_ITEM.getString(),
|
||||
Settings.GUI_SELL_PLACE_ITEM_ITEMS_CONTINUE_NAME.getString(),
|
||||
Settings.GUI_SELL_PLACE_ITEM_ITEMS_CONTINUE_LORE.getStringList(),
|
||||
@ -137,7 +137,7 @@ public final class GUISellPlaceItem extends AbstractPlaceholderGui {
|
||||
});
|
||||
|
||||
if (Settings.ALLOW_ITEM_BUNDLES.getBoolean()) {
|
||||
setButton(getRows() - 1, 8, ConfigurationItemHelper.createConfigurationItem(//todo update quick item to automatically apply model data
|
||||
setButton(getRows() - 1, 8, ConfigurationItemHelper.createConfigurationItem(this.player, //todo update quick item to automatically apply model data
|
||||
this.viewMode == ViewMode.SINGLE_ITEM ? Settings.GUI_SELL_PLACE_ITEM_ITEMS_SINGLE_ITEM.getString() : Settings.GUI_SELL_PLACE_ITEM_ITEMS_BUNDLE_ITEM.getString(),
|
||||
this.viewMode == ViewMode.SINGLE_ITEM ? Settings.GUI_SELL_PLACE_ITEM_ITEMS_SINGLE_NAME.getString() : Settings.GUI_SELL_PLACE_ITEM_ITEMS_BUNDLE_NAME.getString(),
|
||||
this.viewMode == ViewMode.SINGLE_ITEM ? Settings.GUI_SELL_PLACE_ITEM_ITEMS_SINGLE_LORE.getStringList() : Settings.GUI_SELL_PLACE_ITEM_ITEMS_BUNDLE_LORE.getStringList(),
|
||||
|
@ -48,7 +48,7 @@ public final class GUIStatisticLeaderboard extends AbstractPlaceholderGui {
|
||||
this.auctionPlayer = player;
|
||||
this.statisticType = statisticType;
|
||||
setTitle(Settings.GUI_STATS_LEADERBOARD_TITLE.getString());
|
||||
setDefaultItem(ConfigurationItemHelper.createConfigurationItem(Settings.GUI_STATS_LEADERBOARD_BG_ITEM.getString()));
|
||||
setDefaultItem(ConfigurationItemHelper.createConfigurationItem(this.player, Settings.GUI_STATS_LEADERBOARD_BG_ITEM.getString()));
|
||||
setUseLockedCells(true);
|
||||
setAcceptsItems(false);
|
||||
setAllowDrops(false);
|
||||
@ -78,7 +78,7 @@ public final class GUIStatisticLeaderboard extends AbstractPlaceholderGui {
|
||||
|
||||
final ItemStack head = AuctionAPI.getInstance().getPlayerHead(targetUser.getName());
|
||||
|
||||
setItem(slot++, ConfigurationItemHelper.createConfigurationItem(
|
||||
setItem(slot++, ConfigurationItemHelper.createConfigurationItem(this.player,
|
||||
head,
|
||||
Settings.GUI_STATS_LEADERBOARD_ITEMS_PLAYER_NAME.getString(),
|
||||
Settings.GUI_STATS_LEADERBOARD_ITEMS_PLAYER_LORE.getStringList(),
|
||||
@ -105,7 +105,7 @@ public final class GUIStatisticLeaderboard extends AbstractPlaceholderGui {
|
||||
}
|
||||
|
||||
private void drawStatisticTypeButton() {
|
||||
setButton(5, 4, ConfigurationItemHelper.createConfigurationItem(
|
||||
setButton(5, 4, ConfigurationItemHelper.createConfigurationItem(this.player,
|
||||
Settings.GUI_STATS_LEADERBOARD_ITEMS_STAT_ITEM.getString(),
|
||||
Settings.GUI_STATS_LEADERBOARD_ITEMS_STAT_NAME.getString(),
|
||||
Settings.GUI_STATS_LEADERBOARD_ITEMS_STAT_LORE.getStringList(), new HashMap<String, Object>() {{
|
||||
|
@ -36,7 +36,7 @@ public final class GUIStatisticSelf extends AbstractPlaceholderGui {
|
||||
super(player);
|
||||
this.auctionPlayer = player;
|
||||
setTitle(Settings.GUI_STATS_SELF_TITLE.getString());
|
||||
setDefaultItem(ConfigurationItemHelper.createConfigurationItem(Settings.GUI_STATS_SELF_BG_ITEM.getString()));
|
||||
setDefaultItem(ConfigurationItemHelper.createConfigurationItem(this.player, Settings.GUI_STATS_SELF_BG_ITEM.getString()));
|
||||
setUseLockedCells(true);
|
||||
setAcceptsItems(false);
|
||||
setAllowDrops(false);
|
||||
@ -48,32 +48,32 @@ public final class GUIStatisticSelf extends AbstractPlaceholderGui {
|
||||
final AuctionHouse instance = AuctionHouse.getInstance();
|
||||
|
||||
// created auction
|
||||
setItem(1, 1, ConfigurationItemHelper.createConfigurationItem(Settings.GUI_STATS_SELF_ITEMS_CREATED_AUCTION_ITEM.getString(), Settings.GUI_STATS_SELF_ITEMS_CREATED_AUCTION_NAME.getString(), Settings.GUI_STATS_SELF_ITEMS_CREATED_AUCTION_LORE.getStringList(), new HashMap<String, Object>() {{
|
||||
setItem(1, 1, ConfigurationItemHelper.createConfigurationItem(this.player, Settings.GUI_STATS_SELF_ITEMS_CREATED_AUCTION_ITEM.getString(), Settings.GUI_STATS_SELF_ITEMS_CREATED_AUCTION_NAME.getString(), Settings.GUI_STATS_SELF_ITEMS_CREATED_AUCTION_LORE.getStringList(), new HashMap<String, Object>() {{
|
||||
put("%created_auctions%", (int) instance.getAuctionStatisticManager().getStatisticByPlayer(player.getUniqueId(), AuctionStatisticType.CREATED_AUCTION));
|
||||
}}));
|
||||
|
||||
// sold auction
|
||||
setItem(3, 1, ConfigurationItemHelper.createConfigurationItem(Settings.GUI_STATS_SELF_ITEMS_SOLD_AUCTION_ITEM.getString(), Settings.GUI_STATS_SELF_ITEMS_SOLD_AUCTION_NAME.getString(), Settings.GUI_STATS_SELF_ITEMS_SOLD_AUCTION_LORE.getStringList(), new HashMap<String, Object>() {{
|
||||
setItem(3, 1, ConfigurationItemHelper.createConfigurationItem(this.player, Settings.GUI_STATS_SELF_ITEMS_SOLD_AUCTION_ITEM.getString(), Settings.GUI_STATS_SELF_ITEMS_SOLD_AUCTION_NAME.getString(), Settings.GUI_STATS_SELF_ITEMS_SOLD_AUCTION_LORE.getStringList(), new HashMap<String, Object>() {{
|
||||
put("%sold_auctions%", (int) instance.getAuctionStatisticManager().getStatisticByPlayer(player.getUniqueId(), AuctionStatisticType.SOLD_AUCTION));
|
||||
}}));
|
||||
|
||||
// created bin
|
||||
setItem(1, 4, ConfigurationItemHelper.createConfigurationItem(Settings.GUI_STATS_SELF_ITEMS_CREATED_BIN_ITEM.getString(), Settings.GUI_STATS_SELF_ITEMS_CREATED_BIN_NAME.getString(), Settings.GUI_STATS_SELF_ITEMS_CREATED_BIN_LORE.getStringList(), new HashMap<String, Object>() {{
|
||||
setItem(1, 4, ConfigurationItemHelper.createConfigurationItem(this.player, Settings.GUI_STATS_SELF_ITEMS_CREATED_BIN_ITEM.getString(), Settings.GUI_STATS_SELF_ITEMS_CREATED_BIN_NAME.getString(), Settings.GUI_STATS_SELF_ITEMS_CREATED_BIN_LORE.getStringList(), new HashMap<String, Object>() {{
|
||||
put("%created_bins%", (int) instance.getAuctionStatisticManager().getStatisticByPlayer(player.getUniqueId(), AuctionStatisticType.CREATED_BIN));
|
||||
}}));
|
||||
|
||||
// sold bin
|
||||
setItem(3, 4, ConfigurationItemHelper.createConfigurationItem(Settings.GUI_STATS_SELF_ITEMS_SOLD_BIN_ITEM.getString(), Settings.GUI_STATS_SELF_ITEMS_SOLD_BIN_NAME.getString(), Settings.GUI_STATS_SELF_ITEMS_SOLD_BIN_LORE.getStringList(), new HashMap<String, Object>() {{
|
||||
setItem(3, 4, ConfigurationItemHelper.createConfigurationItem(this.player, Settings.GUI_STATS_SELF_ITEMS_SOLD_BIN_ITEM.getString(), Settings.GUI_STATS_SELF_ITEMS_SOLD_BIN_NAME.getString(), Settings.GUI_STATS_SELF_ITEMS_SOLD_BIN_LORE.getStringList(), new HashMap<String, Object>() {{
|
||||
put("%sold_bins%", (int) instance.getAuctionStatisticManager().getStatisticByPlayer(player.getUniqueId(), AuctionStatisticType.SOLD_BIN));
|
||||
}}));
|
||||
|
||||
// money earned
|
||||
setItem(1, 7, ConfigurationItemHelper.createConfigurationItem(Settings.GUI_STATS_SELF_ITEMS_MONEY_EARNED_ITEM.getString(), Settings.GUI_STATS_SELF_ITEMS_MONEY_EARNED_NAME.getString(), Settings.GUI_STATS_SELF_ITEMS_MONEY_EARNED_LORE.getStringList(), new HashMap<String, Object>() {{
|
||||
setItem(1, 7, ConfigurationItemHelper.createConfigurationItem(this.player, Settings.GUI_STATS_SELF_ITEMS_MONEY_EARNED_ITEM.getString(), Settings.GUI_STATS_SELF_ITEMS_MONEY_EARNED_NAME.getString(), Settings.GUI_STATS_SELF_ITEMS_MONEY_EARNED_LORE.getStringList(), new HashMap<String, Object>() {{
|
||||
put("%money_earned%", AuctionAPI.getInstance().formatNumber(instance.getAuctionStatisticManager().getStatisticByPlayer(player.getUniqueId(), AuctionStatisticType.MONEY_EARNED)));
|
||||
}}));
|
||||
|
||||
// money spent
|
||||
setItem(3, 7, ConfigurationItemHelper.createConfigurationItem(Settings.GUI_STATS_SELF_ITEMS_MONEY_SPENT_ITEM.getString(), Settings.GUI_STATS_SELF_ITEMS_MONEY_SPENT_NAME.getString(), Settings.GUI_STATS_SELF_ITEMS_MONEY_SPENT_LORE.getStringList(), new HashMap<String, Object>() {{
|
||||
setItem(3, 7, ConfigurationItemHelper.createConfigurationItem(this.player, Settings.GUI_STATS_SELF_ITEMS_MONEY_SPENT_ITEM.getString(), Settings.GUI_STATS_SELF_ITEMS_MONEY_SPENT_NAME.getString(), Settings.GUI_STATS_SELF_ITEMS_MONEY_SPENT_LORE.getStringList(), new HashMap<String, Object>() {{
|
||||
put("%money_spent%", AuctionAPI.getInstance().formatNumber(instance.getAuctionStatisticManager().getStatisticByPlayer(player.getUniqueId(), AuctionStatisticType.MONEY_SPENT)));
|
||||
}}));
|
||||
|
||||
|
@ -38,7 +38,7 @@ public final class GUIStatisticTarget extends AbstractPlaceholderGui {
|
||||
this.auctionPlayer = player;
|
||||
this.targetPlayer = targetPlayer;
|
||||
setTitle(Settings.GUI_STATS_SEARCH_TITLE.getString().replace("%player_name%", targetPlayer.getPlayer().getName()));
|
||||
setDefaultItem(ConfigurationItemHelper.createConfigurationItem(Settings.GUI_STATS_SEARCH_BG_ITEM.getString()));
|
||||
setDefaultItem(ConfigurationItemHelper.createConfigurationItem(this.player, Settings.GUI_STATS_SEARCH_BG_ITEM.getString()));
|
||||
setUseLockedCells(true);
|
||||
setAcceptsItems(false);
|
||||
setAllowDrops(false);
|
||||
@ -49,36 +49,36 @@ public final class GUIStatisticTarget extends AbstractPlaceholderGui {
|
||||
private void draw() {
|
||||
|
||||
// created auction
|
||||
setItem(1, 1, ConfigurationItemHelper.createConfigurationItem(Settings.GUI_STATS_SEARCH_ITEMS_CREATED_AUCTION_ITEM.getString(), Settings.GUI_STATS_SEARCH_ITEMS_CREATED_AUCTION_NAME.getString(), Settings.GUI_STATS_SEARCH_ITEMS_CREATED_AUCTION_LORE.getStringList(), new HashMap<String, Object>() {{
|
||||
setItem(1, 1, ConfigurationItemHelper.createConfigurationItem(this.player, Settings.GUI_STATS_SEARCH_ITEMS_CREATED_AUCTION_ITEM.getString(), Settings.GUI_STATS_SEARCH_ITEMS_CREATED_AUCTION_NAME.getString(), Settings.GUI_STATS_SEARCH_ITEMS_CREATED_AUCTION_LORE.getStringList(), new HashMap<String, Object>() {{
|
||||
put("%created_auctions%", (int) AuctionHouse.getInstance().getAuctionStatisticManager().getStatisticByPlayer(targetPlayer.getUuid(), AuctionStatisticType.CREATED_AUCTION));
|
||||
}}));
|
||||
|
||||
// sold auction
|
||||
setItem(3, 1, ConfigurationItemHelper.createConfigurationItem(Settings.GUI_STATS_SEARCH_ITEMS_SOLD_AUCTION_ITEM.getString(), Settings.GUI_STATS_SEARCH_ITEMS_SOLD_AUCTION_NAME.getString(), Settings.GUI_STATS_SEARCH_ITEMS_SOLD_AUCTION_LORE.getStringList(), new HashMap<String, Object>() {{
|
||||
setItem(3, 1, ConfigurationItemHelper.createConfigurationItem(this.player, Settings.GUI_STATS_SEARCH_ITEMS_SOLD_AUCTION_ITEM.getString(), Settings.GUI_STATS_SEARCH_ITEMS_SOLD_AUCTION_NAME.getString(), Settings.GUI_STATS_SEARCH_ITEMS_SOLD_AUCTION_LORE.getStringList(), new HashMap<String, Object>() {{
|
||||
put("%sold_auctions%", (int) AuctionHouse.getInstance().getAuctionStatisticManager().getStatisticByPlayer(targetPlayer.getUuid(), AuctionStatisticType.SOLD_AUCTION));
|
||||
}}));
|
||||
|
||||
// created bin
|
||||
setItem(1, 4, ConfigurationItemHelper.createConfigurationItem(Settings.GUI_STATS_SEARCH_ITEMS_CREATED_BIN_ITEM.getString(), Settings.GUI_STATS_SEARCH_ITEMS_CREATED_BIN_NAME.getString(), Settings.GUI_STATS_SEARCH_ITEMS_CREATED_BIN_LORE.getStringList(), new HashMap<String, Object>() {{
|
||||
setItem(1, 4, ConfigurationItemHelper.createConfigurationItem(this.player, Settings.GUI_STATS_SEARCH_ITEMS_CREATED_BIN_ITEM.getString(), Settings.GUI_STATS_SEARCH_ITEMS_CREATED_BIN_NAME.getString(), Settings.GUI_STATS_SEARCH_ITEMS_CREATED_BIN_LORE.getStringList(), new HashMap<String, Object>() {{
|
||||
put("%created_bins%", (int) AuctionHouse.getInstance().getAuctionStatisticManager().getStatisticByPlayer(targetPlayer.getUuid(), AuctionStatisticType.CREATED_BIN));
|
||||
}}));
|
||||
|
||||
// sold bin
|
||||
setItem(3, 4, ConfigurationItemHelper.createConfigurationItem(Settings.GUI_STATS_SEARCH_ITEMS_SOLD_BIN_ITEM.getString(), Settings.GUI_STATS_SEARCH_ITEMS_SOLD_BIN_NAME.getString(), Settings.GUI_STATS_SEARCH_ITEMS_SOLD_BIN_LORE.getStringList(), new HashMap<String, Object>() {{
|
||||
setItem(3, 4, ConfigurationItemHelper.createConfigurationItem(this.player, Settings.GUI_STATS_SEARCH_ITEMS_SOLD_BIN_ITEM.getString(), Settings.GUI_STATS_SEARCH_ITEMS_SOLD_BIN_NAME.getString(), Settings.GUI_STATS_SEARCH_ITEMS_SOLD_BIN_LORE.getStringList(), new HashMap<String, Object>() {{
|
||||
put("%sold_bins%", (int) AuctionHouse.getInstance().getAuctionStatisticManager().getStatisticByPlayer(targetPlayer.getUuid(), AuctionStatisticType.SOLD_BIN));
|
||||
}}));
|
||||
|
||||
// money earned
|
||||
setItem(1, 7, ConfigurationItemHelper.createConfigurationItem(Settings.GUI_STATS_SEARCH_ITEMS_MONEY_EARNED_ITEM.getString(), Settings.GUI_STATS_SEARCH_ITEMS_MONEY_EARNED_NAME.getString(), Settings.GUI_STATS_SEARCH_ITEMS_MONEY_EARNED_LORE.getStringList(), new HashMap<String, Object>() {{
|
||||
setItem(1, 7, ConfigurationItemHelper.createConfigurationItem(this.player, Settings.GUI_STATS_SEARCH_ITEMS_MONEY_EARNED_ITEM.getString(), Settings.GUI_STATS_SEARCH_ITEMS_MONEY_EARNED_NAME.getString(), Settings.GUI_STATS_SEARCH_ITEMS_MONEY_EARNED_LORE.getStringList(), new HashMap<String, Object>() {{
|
||||
put("%money_earned%", AuctionAPI.getInstance().formatNumber(AuctionHouse.getInstance().getAuctionStatisticManager().getStatisticByPlayer(targetPlayer.getUuid(), AuctionStatisticType.MONEY_EARNED)));
|
||||
}}));
|
||||
|
||||
// money spent
|
||||
setItem(3, 7, ConfigurationItemHelper.createConfigurationItem(Settings.GUI_STATS_SEARCH_ITEMS_MONEY_SPENT_ITEM.getString(), Settings.GUI_STATS_SEARCH_ITEMS_MONEY_SPENT_NAME.getString(), Settings.GUI_STATS_SEARCH_ITEMS_MONEY_SPENT_LORE.getStringList(), new HashMap<String, Object>() {{
|
||||
setItem(3, 7, ConfigurationItemHelper.createConfigurationItem(this.player, Settings.GUI_STATS_SEARCH_ITEMS_MONEY_SPENT_ITEM.getString(), Settings.GUI_STATS_SEARCH_ITEMS_MONEY_SPENT_NAME.getString(), Settings.GUI_STATS_SEARCH_ITEMS_MONEY_SPENT_LORE.getStringList(), new HashMap<String, Object>() {{
|
||||
put("%money_spent%", AuctionAPI.getInstance().formatNumber(AuctionHouse.getInstance().getAuctionStatisticManager().getStatisticByPlayer(targetPlayer.getUuid(), AuctionStatisticType.MONEY_SPENT)));
|
||||
}}));
|
||||
|
||||
setButton(5, 4, ConfigurationItemHelper.createConfigurationItem(Settings.GUI_CLOSE_BTN_ITEM.getString(), Settings.GUI_CLOSE_BTN_NAME.getString(), Settings.GUI_CLOSE_BTN_LORE.getStringList(), null), e -> {
|
||||
setButton(5, 4, ConfigurationItemHelper.createConfigurationItem(this.player, Settings.GUI_CLOSE_BTN_ITEM.getString(), Settings.GUI_CLOSE_BTN_NAME.getString(), Settings.GUI_CLOSE_BTN_LORE.getStringList(), null), e -> {
|
||||
e.gui.close();
|
||||
});
|
||||
}
|
||||
|
@ -34,7 +34,7 @@ public final class GUIStatisticViewSelect extends AbstractPlaceholderGui {
|
||||
super(player);
|
||||
this.auctionPlayer = player;
|
||||
setTitle(Settings.GUI_STATS_VIEW_SELECT_TITLE.getString());
|
||||
setDefaultItem(ConfigurationItemHelper.createConfigurationItem(Settings.GUI_STATS_VIEW_SELECT_BG_ITEM.getString()));
|
||||
setDefaultItem(ConfigurationItemHelper.createConfigurationItem(this.player, Settings.GUI_STATS_VIEW_SELECT_BG_ITEM.getString()));
|
||||
setUseLockedCells(true);
|
||||
setAcceptsItems(false);
|
||||
setAllowDrops(false);
|
||||
@ -45,7 +45,7 @@ public final class GUIStatisticViewSelect extends AbstractPlaceholderGui {
|
||||
private void draw() {
|
||||
|
||||
// self
|
||||
setButton(1, 2, ConfigurationItemHelper.createConfigurationItem(
|
||||
setButton(1, 2, ConfigurationItemHelper.createConfigurationItem(this.player,
|
||||
Settings.GUI_STATS_VIEW_SELECT_ITEMS_PERSONAL_USE_HEAD.getBoolean() ?
|
||||
AuctionAPI.getInstance().getPlayerHead(this.player.getName()) : XMaterial.matchXMaterial(Settings.GUI_STATS_VIEW_SELECT_ITEMS_PERSONAL_ITEM.getString()).orElse(XMaterial.STONE).parseItem(),
|
||||
Settings.GUI_STATS_VIEW_SELECT_ITEMS_PERSONAL_NAME.getString(),
|
||||
@ -53,7 +53,7 @@ public final class GUIStatisticViewSelect extends AbstractPlaceholderGui {
|
||||
null
|
||||
), click -> click.manager.showGUI(click.player, new GUIStatisticSelf(this.auctionPlayer)));
|
||||
|
||||
setButton(1, 6, ConfigurationItemHelper.createConfigurationItem(
|
||||
setButton(1, 6, ConfigurationItemHelper.createConfigurationItem(this.player,
|
||||
XMaterial.matchXMaterial(Settings.GUI_STATS_VIEW_SELECT_ITEMS_LEADERBOARD_ITEM.getString()).orElse(XMaterial.STONE).parseItem(),
|
||||
Settings.GUI_STATS_VIEW_SELECT_ITEMS_LEADERBOARD_NAME.getString(),
|
||||
Settings.GUI_STATS_VIEW_SELECT_ITEMS_LEADERBOARD_LORE.getStringList(),
|
||||
|
@ -93,7 +93,7 @@ public class GUITransactionList extends AbstractPlaceholderGui {
|
||||
|
||||
for (Transaction transaction : data) {
|
||||
final ItemStack item = transaction.getItem().clone();
|
||||
setButton(slot++, ConfigurationItemHelper.createConfigurationItem(item, Settings.GUI_TRANSACTIONS_ITEM_TRANSACTION_NAME.getString(), Settings.GUI_TRANSACTIONS_ITEM_TRANSACTION_LORE.getStringList(), new HashMap<String, Object>() {{
|
||||
setButton(slot++, ConfigurationItemHelper.createConfigurationItem(this.player, item, Settings.GUI_TRANSACTIONS_ITEM_TRANSACTION_NAME.getString(), Settings.GUI_TRANSACTIONS_ITEM_TRANSACTION_LORE.getStringList(), new HashMap<String, Object>() {{
|
||||
put("%transaction_id%", transaction.getId().toString());
|
||||
put("%seller%", Bukkit.getOfflinePlayer(transaction.getSeller()).getName());
|
||||
put("%buyer%", Bukkit.getOfflinePlayer(transaction.getBuyer()).getName());
|
||||
|
@ -52,14 +52,14 @@ public final class GUITransactionType extends AbstractPlaceholderGui {
|
||||
setRows(4);
|
||||
setAcceptsItems(false);
|
||||
setUseLockedCells(true);
|
||||
setDefaultItem(ConfigurationItemHelper.createConfigurationItem(Settings.GUI_TRANSACTIONS_TYPE_BG_ITEM.getString()));
|
||||
setDefaultItem(ConfigurationItemHelper.createConfigurationItem(this.player, Settings.GUI_TRANSACTIONS_TYPE_BG_ITEM.getString()));
|
||||
draw();
|
||||
}
|
||||
|
||||
private void draw() {
|
||||
final AuctionHouse instance = AuctionHouse.getInstance();
|
||||
// (player.hasPermission("auctionhouse.admin") || player.isOp())
|
||||
setButton(11, ConfigurationItemHelper.createConfigurationItem(Settings.GUI_TRANSACTIONS_TYPE_ITEMS_ALL_TRANSACTIONS_ITEM.getString(), Settings.GUI_TRANSACTIONS_TYPE_ITEMS_ALL_TRANSACTIONS_NAME.getString(), Settings.GUI_TRANSACTIONS_TYPE_ITEMS_ALL_TRANSACTIONS_LORE.getStringList(), null), e -> {
|
||||
setButton(11, ConfigurationItemHelper.createConfigurationItem(this.player, Settings.GUI_TRANSACTIONS_TYPE_ITEMS_ALL_TRANSACTIONS_ITEM.getString(), Settings.GUI_TRANSACTIONS_TYPE_ITEMS_ALL_TRANSACTIONS_NAME.getString(), Settings.GUI_TRANSACTIONS_TYPE_ITEMS_ALL_TRANSACTIONS_LORE.getStringList(), null), e -> {
|
||||
if (Settings.RESTRICT_ALL_TRANSACTIONS_TO_PERM.getBoolean() && !e.player.hasPermission("auctionhouse.transactions.viewall")) {
|
||||
instance.getLocale().getMessage("commands.no_permission").sendPrefixedMessage(e.player);
|
||||
return;
|
||||
@ -68,12 +68,12 @@ public final class GUITransactionType extends AbstractPlaceholderGui {
|
||||
e.manager.showGUI(e.player, new GUITransactionList(e.player, true));
|
||||
});
|
||||
|
||||
setButton(15, ConfigurationItemHelper.createConfigurationItem(Settings.GUI_TRANSACTIONS_TYPE_ITEMS_SELF_TRANSACTIONS_ITEM.getString(), Settings.GUI_TRANSACTIONS_TYPE_ITEMS_SELF_TRANSACTIONS_NAME.getString(), Settings.GUI_TRANSACTIONS_TYPE_ITEMS_SELF_TRANSACTIONS_LORE.getStringList(), null), e -> {
|
||||
setButton(15, ConfigurationItemHelper.createConfigurationItem(this.player, Settings.GUI_TRANSACTIONS_TYPE_ITEMS_SELF_TRANSACTIONS_ITEM.getString(), Settings.GUI_TRANSACTIONS_TYPE_ITEMS_SELF_TRANSACTIONS_NAME.getString(), Settings.GUI_TRANSACTIONS_TYPE_ITEMS_SELF_TRANSACTIONS_LORE.getStringList(), null), e -> {
|
||||
e.manager.showGUI(e.player, new GUITransactionList(e.player, false));
|
||||
});
|
||||
|
||||
if (player.isOp() || player.hasPermission("auctionhouse.admin")) {
|
||||
setButton(3, 8, ConfigurationItemHelper.createConfigurationItem(Settings.GUI_TRANSACTIONS_TYPE_ITEMS_DELETE_ITEM.getString(), Settings.GUI_TRANSACTIONS_TYPE_ITEMS_DELETE_NAME.getString(), Settings.GUI_TRANSACTIONS_TYPE_ITEMS_DELETE_LORE.getStringList(), null), e -> {
|
||||
setButton(3, 8, ConfigurationItemHelper.createConfigurationItem(this.player, Settings.GUI_TRANSACTIONS_TYPE_ITEMS_DELETE_ITEM.getString(), Settings.GUI_TRANSACTIONS_TYPE_ITEMS_DELETE_NAME.getString(), Settings.GUI_TRANSACTIONS_TYPE_ITEMS_DELETE_LORE.getStringList(), null), e -> {
|
||||
e.gui.close();
|
||||
|
||||
new TitleInput(player, AuctionHouse.getInstance().getLocale().getMessage("titles.enter deletion range.title").getMessage(), AuctionHouse.getInstance().getLocale().getMessage("titles.enter deletion range.subtitle").getMessage()) {
|
||||
@ -126,6 +126,6 @@ public final class GUITransactionType extends AbstractPlaceholderGui {
|
||||
});
|
||||
}
|
||||
|
||||
setButton(3, 0, ConfigurationItemHelper.createConfigurationItem(Settings.GUI_PREV_PAGE_BTN_ITEM.getString(), Settings.GUI_PREV_PAGE_BTN_NAME.getString(), Settings.GUI_PREV_PAGE_BTN_LORE.getStringList(), null), e -> e.manager.showGUI(e.player, new GUIAuctionHouse(AuctionHouse.getInstance().getAuctionPlayerManager().getPlayer(e.player.getUniqueId()))));
|
||||
setButton(3, 0, ConfigurationItemHelper.createConfigurationItem(this.player, Settings.GUI_PREV_PAGE_BTN_ITEM.getString(), Settings.GUI_PREV_PAGE_BTN_NAME.getString(), Settings.GUI_PREV_PAGE_BTN_LORE.getStringList(), null), e -> e.manager.showGUI(e.player, new GUIAuctionHouse(AuctionHouse.getInstance().getAuctionPlayerManager().getPlayer(e.player.getUniqueId()))));
|
||||
}
|
||||
}
|
||||
|
@ -46,7 +46,7 @@ public class GUITransactionView extends AbstractPlaceholderGui {
|
||||
setTitle(TextUtils.formatText(Settings.GUI_TRANSACTION_VIEW_TITLE.getString()));
|
||||
setRows(6);
|
||||
setAcceptsItems(false);
|
||||
setDefaultItem(ConfigurationItemHelper.createConfigurationItem(Settings.GUI_TRANSACTION_VIEW_BACKGROUND_ITEM.getString()));
|
||||
setDefaultItem(ConfigurationItemHelper.createConfigurationItem(this.player, Settings.GUI_TRANSACTION_VIEW_BACKGROUND_ITEM.getString()));
|
||||
setUseLockedCells(Settings.GUI_TRANSACTION_VIEW_BACKGROUND_FILL.getBoolean());
|
||||
|
||||
setButton(5, 0, getBackButtonItem(), e -> e.manager.showGUI(e.player, new GUITransactionList(auctionPlayer.getPlayer(), showAll)));
|
||||
@ -58,7 +58,7 @@ public class GUITransactionView extends AbstractPlaceholderGui {
|
||||
setItem(3, 6, GuiUtils.createButtonItem(AuctionAPI.getInstance().getPlayerHead(Bukkit.getOfflinePlayer(transaction.getBuyer()).getName()), TextUtils.formatText(Settings.GUI_TRANSACTION_VIEW_ITEM_BUYER_NAME.getString().replace("%buyer_name%", Bukkit.getOfflinePlayer(transaction.getBuyer()).getName())),
|
||||
Settings.GUI_TRANSACTION_VIEW_ITEM_BUYER_LORE.getStringList().stream().map(line -> line.replace("%buyer_id%", transaction.getBuyer().toString())).map(TextUtils::formatText).collect(Collectors.toList())));
|
||||
|
||||
setItem(3, 4, ConfigurationItemHelper.createConfigurationItem(Settings.GUI_TRANSACTION_VIEW_ITEM_INFO_ITEM.getString(), Settings.GUI_TRANSACTION_VIEW_ITEM_INFO_NAME.getString(), Settings.GUI_TRANSACTION_VIEW_ITEM_INFO_LORE.getStringList(), new HashMap<String, Object>() {{
|
||||
setItem(3, 4, ConfigurationItemHelper.createConfigurationItem(this.player, Settings.GUI_TRANSACTION_VIEW_ITEM_INFO_ITEM.getString(), Settings.GUI_TRANSACTION_VIEW_ITEM_INFO_NAME.getString(), Settings.GUI_TRANSACTION_VIEW_ITEM_INFO_LORE.getStringList(), new HashMap<String, Object>() {{
|
||||
put("%transaction_id%", transaction.getId().toString());
|
||||
put("%sale_type%", transaction.getAuctionSaleType() == AuctionSaleType.USED_BIDDING_SYSTEM ? AuctionHouse.getInstance().getLocale().getMessage("transaction.sale_type.bid_won").getMessage() : AuctionHouse.getInstance().getLocale().getMessage("transaction.sale_type.immediate_buy").getMessage());
|
||||
put("%transaction_date%", AuctionAPI.getInstance().convertMillisToDate(transaction.getTransactionTime()));
|
||||
|
@ -18,12 +18,14 @@
|
||||
|
||||
package ca.tweetzy.auctionhouse.helpers;
|
||||
|
||||
import ca.tweetzy.auctionhouse.api.hook.PlaceholderAPIHook;
|
||||
import ca.tweetzy.core.compatibility.XMaterial;
|
||||
import ca.tweetzy.core.utils.NumberUtils;
|
||||
import ca.tweetzy.core.utils.TextUtils;
|
||||
import ca.tweetzy.core.utils.nms.NBTEditor;
|
||||
import ca.tweetzy.flight.comp.enums.ServerVersion;
|
||||
import ca.tweetzy.flight.utils.QuickItem;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.inventory.ItemFlag;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.inventory.meta.ItemMeta;
|
||||
@ -42,14 +44,14 @@ import java.util.stream.Collectors;
|
||||
*/
|
||||
public class ConfigurationItemHelper {
|
||||
|
||||
public static ItemStack createConfigurationItem(ItemStack stack, int model, String title, List<String> lore, HashMap<String, Object> replacements, String... nbtData) {
|
||||
public static ItemStack createConfigurationItem(Player player, ItemStack stack, int model, String title, List<String> lore, HashMap<String, Object> replacements, String... nbtData) {
|
||||
if (stack.getType() == XMaterial.AIR.parseMaterial())
|
||||
return stack;
|
||||
|
||||
|
||||
final ItemMeta meta = stack.getItemMeta();
|
||||
assert meta != null;
|
||||
meta.setDisplayName(TextUtils.formatText(title));
|
||||
meta.setDisplayName(TextUtils.formatText(PlaceholderAPIHook.PAPIReplacer.tryReplace(player, title)));
|
||||
|
||||
if (ServerVersion.isServerVersionAtLeast(ServerVersion.V1_14))
|
||||
meta.setCustomModelData(model);
|
||||
@ -68,9 +70,11 @@ public class ConfigurationItemHelper {
|
||||
}
|
||||
}
|
||||
|
||||
meta.setDisplayName(TextUtils.formatText(title));
|
||||
meta.setDisplayName(TextUtils.formatText(PlaceholderAPIHook.PAPIReplacer.tryReplace(player, title)));
|
||||
meta.addItemFlags(ItemFlag.HIDE_ATTRIBUTES, ItemFlag.HIDE_ENCHANTS, ItemFlag.HIDE_POTION_EFFECTS);
|
||||
meta.setLore(lore.stream().map(TextUtils::formatText).collect(Collectors.toList()));
|
||||
|
||||
meta.setLore(PlaceholderAPIHook.PAPIReplacer.tryReplace(player, lore).stream().map(TextUtils::formatText).collect(Collectors.toList()));
|
||||
|
||||
stack.setItemMeta(meta);
|
||||
if (nbtData != null) {
|
||||
for (String nbt : nbtData) {
|
||||
@ -80,22 +84,22 @@ public class ConfigurationItemHelper {
|
||||
return stack;
|
||||
}
|
||||
|
||||
public static ItemStack createConfigurationItem(String item) {
|
||||
return createConfigurationItem(item, " ", new ArrayList<>(), null);
|
||||
public static ItemStack createConfigurationItem(Player player, String item) {
|
||||
return createConfigurationItem(player, item, " ", new ArrayList<>(), null);
|
||||
}
|
||||
|
||||
public static ItemStack createConfigurationItem(String item, String title, List<String> lore, HashMap<String, Object> replacements) {
|
||||
public static ItemStack createConfigurationItem(Player player, String item, String title, List<String> lore, HashMap<String, Object> replacements) {
|
||||
String[] split = item.split(":");
|
||||
|
||||
if (split.length == 2 && NumberUtils.isInt(split[1])) {
|
||||
return createConfigurationItem(Objects.requireNonNull(XMaterial.matchXMaterial(split[0]).get().parseItem()), Integer.parseInt(split[1]), title, lore, replacements);
|
||||
return createConfigurationItem(player, Objects.requireNonNull(XMaterial.matchXMaterial(split[0]).get().parseItem()), Integer.parseInt(split[1]), title, lore, replacements);
|
||||
} else {
|
||||
return createConfigurationItem(Objects.requireNonNull(QuickItem.of(item).make()), -1, title, lore, replacements);
|
||||
return createConfigurationItem(player, Objects.requireNonNull(QuickItem.of(item).make()), -1, title, lore, replacements);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public static ItemStack createConfigurationItem(ItemStack item, String title, List<String> lore, HashMap<String, Object> replacements) {
|
||||
return createConfigurationItem(item, 0, title, lore, replacements);
|
||||
public static ItemStack createConfigurationItem(Player player, ItemStack item, String title, List<String> lore, HashMap<String, Object> replacements) {
|
||||
return createConfigurationItem(player, item, 0, title, lore, replacements);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user