mirror of
https://github.com/kiranhart/Auction-House.git
synced 2025-02-28 21:41:02 +01:00
🧹 removed some configurationitemhelper stuff and move active auctions gui to new layout
Took 4 seconds
This commit is contained in:
parent
53d099a94d
commit
a1536e196b
@ -25,20 +25,20 @@ import ca.tweetzy.auctionhouse.auction.AuctionPlayer;
|
||||
import ca.tweetzy.auctionhouse.auction.AuctionedItem;
|
||||
import ca.tweetzy.auctionhouse.auction.enums.AuctionStackType;
|
||||
import ca.tweetzy.auctionhouse.auction.enums.PaymentReason;
|
||||
import ca.tweetzy.auctionhouse.guis.abstraction.AuctionUpdatingPagedGUI;
|
||||
import ca.tweetzy.auctionhouse.guis.confirmation.GUIConfirmCancel;
|
||||
import ca.tweetzy.auctionhouse.helpers.ConfigurationItemHelper;
|
||||
import ca.tweetzy.auctionhouse.settings.Settings;
|
||||
import ca.tweetzy.core.compatibility.XSound;
|
||||
import ca.tweetzy.core.gui.events.GuiClickEvent;
|
||||
import ca.tweetzy.core.hooks.EconomyManager;
|
||||
import ca.tweetzy.core.utils.TextUtils;
|
||||
import ca.tweetzy.flight.utils.Common;
|
||||
import ca.tweetzy.flight.utils.QuickItem;
|
||||
import ca.tweetzy.flight.utils.messages.Titles;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.OfflinePlayer;
|
||||
import org.bukkit.scheduler.BukkitTask;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
@ -47,123 +47,121 @@ import java.util.stream.Collectors;
|
||||
* Time Created: 10:33 p.m.
|
||||
* Usage of any code found within this class is prohibited unless given explicit permission otherwise
|
||||
*/
|
||||
public class GUIActiveAuctions extends AbstractPlaceholderGui {
|
||||
public class GUIActiveAuctions extends AuctionUpdatingPagedGUI<AuctionedItem> {
|
||||
|
||||
private final AuctionPlayer auctionPlayer;
|
||||
private BukkitTask task;
|
||||
|
||||
private List<AuctionedItem> items;
|
||||
|
||||
public GUIActiveAuctions(AuctionPlayer auctionPlayer) {
|
||||
super(auctionPlayer);
|
||||
super(new GUIAuctionHouse(auctionPlayer), auctionPlayer.getPlayer(), Settings.GUI_ACTIVE_AUCTIONS_TITLE.getString(), 6, 20 * Settings.TICK_UPDATE_GUI_TIME.getInt(), new ArrayList<>());
|
||||
this.auctionPlayer = auctionPlayer;
|
||||
setTitle(TextUtils.formatText(Settings.GUI_ACTIVE_AUCTIONS_TITLE.getString()));
|
||||
setRows(6);
|
||||
setAcceptsItems(false);
|
||||
setNavigateSound(XSound.matchXSound(Settings.SOUNDS_NAVIGATE_GUI_PAGES.getString()).orElse(XSound.ENTITY_BAT_TAKEOFF).parseSound());
|
||||
draw();
|
||||
|
||||
if (Settings.AUTO_REFRESH_AUCTION_PAGES.getBoolean()) {
|
||||
setOnOpen(e -> makeMess());
|
||||
setOnClose(e -> cleanup());
|
||||
if (Settings.AUTO_REFRESH_ACTIVE_AUCTION_PAGES.getBoolean()) {
|
||||
startTask();
|
||||
}
|
||||
|
||||
applyClose();
|
||||
draw();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void prePopulate() {
|
||||
this.items = this.auctionPlayer.getItems(false);
|
||||
|
||||
if (Settings.PER_WORLD_ITEMS.getBoolean()) {
|
||||
this.items = this.items.stream().filter(item -> item.getListedWorld() == null || this.auctionPlayer.getPlayer().getWorld().getName().equals(item.getListedWorld())).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
this.items.sort(Comparator.comparingLong(AuctionedItem::getExpiresAt).reversed());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected ItemStack makeDisplayItem(AuctionedItem auctionedItem) {
|
||||
return auctionedItem.isRequest() ? auctionedItem.getDisplayRequestStack(AuctionStackType.ACTIVE_AUCTIONS_LIST) : auctionedItem.getDisplayStack(AuctionStackType.ACTIVE_AUCTIONS_LIST);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onClick(AuctionedItem item, GuiClickEvent click) {
|
||||
switch (click.clickType) {
|
||||
case LEFT:
|
||||
if (item.isRequest()) {
|
||||
AuctionHouse.getInstance().getAuctionItemManager().sendToGarbage(item);
|
||||
cancelTask();
|
||||
click.manager.showGUI(click.player, new GUIActiveAuctions(this.auctionPlayer));
|
||||
return;
|
||||
}
|
||||
|
||||
if (Settings.SELLERS_MUST_WAIT_FOR_TIME_LIMIT_AFTER_BID.getBoolean() && item.containsValidBid()) {
|
||||
AuctionHouse.getInstance().getLocale().getMessage("general.cannot cancel item with bid").sendPrefixedMessage(click.player);
|
||||
return;
|
||||
}
|
||||
|
||||
if (((item.getBidStartingPrice() > 0 || item.getBidIncrementPrice() > 0) && Settings.ASK_FOR_CANCEL_CONFIRM_ON_BID_ITEMS.getBoolean()) || Settings.ASK_FOR_CANCEL_CONFIRM_ON_NON_BID_ITEMS.getBoolean()) {
|
||||
if (item.getHighestBidder().equals(click.player.getUniqueId()) && item.isBidItem()) {
|
||||
item.setExpired(true);
|
||||
item.setExpiresAt(System.currentTimeMillis());
|
||||
if (Settings.BIDDING_TAKES_MONEY.getBoolean() && !item.getHighestBidder().equals(item.getOwner())) {
|
||||
final OfflinePlayer oldBidder = Bukkit.getOfflinePlayer(item.getHighestBidder());
|
||||
|
||||
if (Settings.STORE_PAYMENTS_FOR_MANUAL_COLLECTION.getBoolean())
|
||||
AuctionHouse.getInstance().getDataManager().insertAuctionPayment(new AuctionPayment(
|
||||
oldBidder.getUniqueId(),
|
||||
item.getCurrentPrice(),
|
||||
item.getItem(),
|
||||
AuctionHouse.getInstance().getLocale().getMessage("general.prefix").getMessage(),
|
||||
PaymentReason.BID_RETURNED
|
||||
), null);
|
||||
else
|
||||
EconomyManager.deposit(oldBidder, item.getCurrentPrice());
|
||||
|
||||
if (oldBidder.isOnline())
|
||||
AuctionHouse.getInstance().getLocale().getMessage("pricing.moneyadd").processPlaceholder("player_balance", AuctionAPI.getInstance().formatNumber(EconomyManager.getBalance(oldBidder))).processPlaceholder("price", AuctionAPI.getInstance().formatNumber(item.getCurrentPrice())).sendPrefixedMessage(oldBidder.getPlayer());
|
||||
|
||||
}
|
||||
|
||||
draw();
|
||||
return;
|
||||
}
|
||||
cancelTask();
|
||||
click.manager.showGUI(click.player, new GUIConfirmCancel(this.auctionPlayer, item));
|
||||
return;
|
||||
}
|
||||
|
||||
item.setExpired(true);
|
||||
draw();
|
||||
break;
|
||||
case RIGHT:
|
||||
if (Settings.ALLOW_PLAYERS_TO_ACCEPT_BID.getBoolean() && item.getBidStartingPrice() != 0 && !item.getHighestBidder().equals(click.player.getUniqueId())) {
|
||||
item.setExpiresAt(System.currentTimeMillis());
|
||||
draw();
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private void draw() {
|
||||
reset();
|
||||
drawFixedButtons();
|
||||
drawItems();
|
||||
}
|
||||
@Override
|
||||
protected void drawFixed() {
|
||||
if (this.parent == null) {
|
||||
setButton(getBackExitButtonSlot(), getExitButton(), click -> click.gui.close());
|
||||
} else {
|
||||
setButton(getBackExitButtonSlot(), getBackButton(), click -> {
|
||||
cancelTask();
|
||||
click.manager.showGUI(click.player, this.parent);
|
||||
});
|
||||
}
|
||||
|
||||
private void drawItems() {
|
||||
AuctionHouse.newChain().asyncFirst(() -> {
|
||||
this.items = this.auctionPlayer.getItems(false);
|
||||
|
||||
// per world check
|
||||
if (Settings.PER_WORLD_ITEMS.getBoolean()) {
|
||||
this.items = this.items.stream().filter(item -> item.getListedWorld() == null || this.auctionPlayer.getPlayer().getWorld().getName().equals(item.getListedWorld())).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
return 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) 45L));
|
||||
drawPaginationButtons();
|
||||
|
||||
int slot = 0;
|
||||
for (AuctionedItem item : data) {
|
||||
setButton(slot++, item.isRequest() ? item.getDisplayRequestStack(AuctionStackType.ACTIVE_AUCTIONS_LIST) : item.getDisplayStack(AuctionStackType.ACTIVE_AUCTIONS_LIST), e -> {
|
||||
switch (e.clickType) {
|
||||
case LEFT:
|
||||
if (item.isRequest()) {
|
||||
AuctionHouse.getInstance().getAuctionItemManager().sendToGarbage(item);
|
||||
cleanup();
|
||||
e.manager.showGUI(e.player, new GUIActiveAuctions(this.auctionPlayer));
|
||||
return;
|
||||
}
|
||||
|
||||
if (Settings.SELLERS_MUST_WAIT_FOR_TIME_LIMIT_AFTER_BID.getBoolean() && item.containsValidBid()) {
|
||||
AuctionHouse.getInstance().getLocale().getMessage("general.cannot cancel item with bid").sendPrefixedMessage(e.player);
|
||||
return;
|
||||
}
|
||||
|
||||
if (((item.getBidStartingPrice() > 0 || item.getBidIncrementPrice() > 0) && Settings.ASK_FOR_CANCEL_CONFIRM_ON_BID_ITEMS.getBoolean()) || Settings.ASK_FOR_CANCEL_CONFIRM_ON_NON_BID_ITEMS.getBoolean()) {
|
||||
if (item.getHighestBidder().equals(e.player.getUniqueId()) && item.isBidItem()) {
|
||||
item.setExpired(true);
|
||||
item.setExpiresAt(System.currentTimeMillis());
|
||||
if (Settings.BIDDING_TAKES_MONEY.getBoolean() && !item.getHighestBidder().equals(item.getOwner())) {
|
||||
final OfflinePlayer oldBidder = Bukkit.getOfflinePlayer(item.getHighestBidder());
|
||||
|
||||
if (Settings.STORE_PAYMENTS_FOR_MANUAL_COLLECTION.getBoolean())
|
||||
AuctionHouse.getInstance().getDataManager().insertAuctionPayment(new AuctionPayment(
|
||||
oldBidder.getUniqueId(),
|
||||
item.getCurrentPrice(),
|
||||
item.getItem(),
|
||||
AuctionHouse.getInstance().getLocale().getMessage("general.prefix").getMessage(),
|
||||
PaymentReason.BID_RETURNED
|
||||
), null);
|
||||
else
|
||||
EconomyManager.deposit(oldBidder, item.getCurrentPrice());
|
||||
|
||||
if (oldBidder.isOnline())
|
||||
AuctionHouse.getInstance().getLocale().getMessage("pricing.moneyadd").processPlaceholder("player_balance", AuctionAPI.getInstance().formatNumber(EconomyManager.getBalance(oldBidder))).processPlaceholder("price", AuctionAPI.getInstance().formatNumber(item.getCurrentPrice())).sendPrefixedMessage(oldBidder.getPlayer());
|
||||
|
||||
}
|
||||
|
||||
draw();
|
||||
return;
|
||||
}
|
||||
cleanup();
|
||||
e.manager.showGUI(e.player, new GUIConfirmCancel(this.auctionPlayer, item));
|
||||
return;
|
||||
}
|
||||
|
||||
item.setExpired(true);
|
||||
draw();
|
||||
break;
|
||||
case RIGHT:
|
||||
if (Settings.ALLOW_PLAYERS_TO_ACCEPT_BID.getBoolean() && item.getBidStartingPrice() != 0 && !item.getHighestBidder().equals(e.player.getUniqueId())) {
|
||||
item.setExpiresAt(System.currentTimeMillis());
|
||||
draw();
|
||||
}
|
||||
break;
|
||||
}
|
||||
});
|
||||
}
|
||||
}).execute();
|
||||
}
|
||||
|
||||
private void drawFixedButtons() {
|
||||
setButton(5, 0, getBackButtonItem(), e -> {
|
||||
cleanup();
|
||||
e.manager.showGUI(e.player, new GUIAuctionHouse(this.auctionPlayer));
|
||||
setButton(5, 4, getRefreshButton(), e -> {
|
||||
cancelTask();
|
||||
e.manager.showGUI(e.player, new GUIActiveAuctions(this.auctionPlayer));
|
||||
});
|
||||
|
||||
setButton(5, 4, getRefreshButtonItem(), e -> e.manager.showGUI(e.player, new GUIActiveAuctions(this.auctionPlayer)));
|
||||
|
||||
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 -> {
|
||||
setButton(5, 1, QuickItem
|
||||
.of(Settings.GUI_ACTIVE_AUCTIONS_ITEM.getString())
|
||||
.name(Settings.GUI_ACTIVE_AUCTIONS_NAME.getString())
|
||||
.lore(Settings.GUI_ACTIVE_AUCTIONS_LORE.getStringList())
|
||||
.make(), e -> {
|
||||
|
||||
if (Settings.ASK_FOR_CANCEL_CONFIRM_ON_ALL_ITEMS.getBoolean()) {
|
||||
cleanup();
|
||||
cancelTask();
|
||||
e.gui.exit();
|
||||
|
||||
Titles.sendTitle(e.player,
|
||||
@ -176,7 +174,6 @@ public class GUIActiveAuctions extends AbstractPlaceholderGui {
|
||||
|
||||
// reset the request time for cancel
|
||||
this.auctionPlayer.setEndAllRequestTime(System.currentTimeMillis() + (1000 * 30));
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
@ -194,21 +191,4 @@ public class GUIActiveAuctions extends AbstractPlaceholderGui {
|
||||
draw();
|
||||
});
|
||||
}
|
||||
|
||||
private void drawPaginationButtons() {
|
||||
setPrevPage(5, 3, getPreviousPageItem());
|
||||
setNextPage(5, 5, getNextPageItem());
|
||||
setOnPage(e -> draw());
|
||||
}
|
||||
|
||||
/*
|
||||
====================== AUTO REFRESH ======================
|
||||
*/
|
||||
private void makeMess() {
|
||||
task = Bukkit.getServer().getScheduler().runTaskTimerAsynchronously(AuctionHouse.getInstance(), this::drawItems, 0L, (long) 20 * Settings.TICK_UPDATE_GUI_TIME.getInt());
|
||||
}
|
||||
|
||||
private void cleanup() {
|
||||
if (task != null) task.cancel();
|
||||
}
|
||||
}
|
||||
|
@ -18,7 +18,6 @@
|
||||
|
||||
package ca.tweetzy.auctionhouse.guis.abstraction;
|
||||
|
||||
import ca.tweetzy.auctionhouse.helpers.ConfigurationItemHelper;
|
||||
import ca.tweetzy.auctionhouse.settings.Settings;
|
||||
import ca.tweetzy.core.gui.BaseGUI;
|
||||
import ca.tweetzy.core.gui.Gui;
|
||||
@ -56,7 +55,7 @@ public abstract class AuctionBaseGUI extends BaseGUI {
|
||||
}
|
||||
|
||||
private void applyDefaults() {
|
||||
setDefaultItem(ConfigurationItemHelper.createConfigurationItem(this.player, Settings.GUI_FILLER.getString()));
|
||||
setDefaultItem(QuickItem.bg(QuickItem.of(Settings.GUI_FILLER.getString()).make()));
|
||||
setNavigateSound(CompSound.matchCompSound(Settings.SOUNDS_NAVIGATE_GUI_PAGES.getString()).orElse(CompSound.ENTITY_BAT_TAKEOFF).parseSound());
|
||||
}
|
||||
|
||||
|
@ -151,6 +151,14 @@ public abstract class AuctionUpdatingPagedGUI<T> extends BaseGUI {
|
||||
.make();
|
||||
}
|
||||
|
||||
protected ItemStack getRefreshButton() {
|
||||
return QuickItem
|
||||
.of(Settings.GUI_REFRESH_BTN_ITEM.getString())
|
||||
.name(Settings.GUI_REFRESH_BTN_NAME.getString())
|
||||
.lore(Settings.GUI_REFRESH_BTN_LORE.getStringList())
|
||||
.make();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getPreviousButtonSlot() {
|
||||
return 48;
|
||||
|
@ -31,7 +31,6 @@ import ca.tweetzy.auctionhouse.exception.ItemNotFoundException;
|
||||
import ca.tweetzy.auctionhouse.guis.GUIAuctionHouse;
|
||||
import ca.tweetzy.auctionhouse.guis.GUIContainerInspect;
|
||||
import ca.tweetzy.auctionhouse.guis.abstraction.AuctionBaseGUI;
|
||||
import ca.tweetzy.auctionhouse.helpers.ConfigurationItemHelper;
|
||||
import ca.tweetzy.auctionhouse.managers.SoundManager;
|
||||
import ca.tweetzy.auctionhouse.settings.Settings;
|
||||
import ca.tweetzy.core.gui.events.GuiClickEvent;
|
||||
@ -39,6 +38,7 @@ import ca.tweetzy.core.hooks.EconomyManager;
|
||||
import ca.tweetzy.core.utils.PlayerUtils;
|
||||
import ca.tweetzy.flight.nbtapi.NBT;
|
||||
import ca.tweetzy.flight.utils.QuickItem;
|
||||
import ca.tweetzy.flight.utils.Replacer;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.OfflinePlayer;
|
||||
import org.bukkit.block.ShulkerBox;
|
||||
@ -47,7 +47,6 @@ import org.bukkit.event.inventory.ClickType;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.inventory.meta.BlockStateMeta;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
@ -358,15 +357,18 @@ public class GUIConfirmPurchase extends AuctionBaseGUI {
|
||||
}
|
||||
|
||||
private ItemStack getPurchaseInfoItem(int qty) {
|
||||
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));
|
||||
put("%purchase_quantity%", purchaseQuantity);
|
||||
put("%purchase_price%", AuctionAPI.getInstance().formatNumber(pricePerItem * purchaseQuantity));
|
||||
}});
|
||||
stack.setAmount(qty);
|
||||
return stack;
|
||||
return QuickItem
|
||||
.of(Settings.GUI_CONFIRM_QTY_INFO_ITEM.getString())
|
||||
.amount(qty)
|
||||
.name(Settings.GUI_CONFIRM_QTY_INFO_NAME.getString())
|
||||
.lore(Replacer.replaceVariables(Settings.GUI_CONFIRM_QTY_INFO_LORE.getStringList(),
|
||||
"original_stack_size", maxStackSize,
|
||||
"original_stack_price", AuctionAPI.getInstance().formatNumber(auctionItem.getBasePrice()),
|
||||
"price_per_item", AuctionAPI.getInstance().formatNumber(pricePerItem),
|
||||
"purchase_quantity", purchaseQuantity,
|
||||
"purchase_price", AuctionAPI.getInstance().formatNumber(pricePerItem * purchaseQuantity)
|
||||
))
|
||||
.make();
|
||||
}
|
||||
|
||||
private ItemStack getIncreaseQtyButtonItem() {
|
||||
|
@ -26,7 +26,6 @@ import ca.tweetzy.auctionhouse.auction.enums.AuctionSaleType;
|
||||
import ca.tweetzy.auctionhouse.auction.enums.AuctionSortType;
|
||||
import ca.tweetzy.auctionhouse.guis.GUIAuctionHouse;
|
||||
import ca.tweetzy.auctionhouse.guis.abstraction.AuctionPagedGUI;
|
||||
import ca.tweetzy.auctionhouse.helpers.ConfigurationItemHelper;
|
||||
import ca.tweetzy.auctionhouse.model.MaterialCategorizer;
|
||||
import ca.tweetzy.auctionhouse.settings.Settings;
|
||||
import ca.tweetzy.auctionhouse.transaction.Transaction;
|
||||
@ -40,7 +39,10 @@ import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.inventory.ClickType;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.Comparator;
|
||||
import java.util.UUID;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
@ -118,18 +120,15 @@ public class GUITransactionList extends AuctionPagedGUI<Transaction> {
|
||||
}
|
||||
});
|
||||
|
||||
setButton(Settings.GUI_TRANSACTIONS_ITEMS_FILTER_SLOT.getInt(), ConfigurationItemHelper.createConfigurationItem(
|
||||
this.player,
|
||||
Settings.GUI_TRANSACTIONS_ITEMS_FILTER_ITEM.getString(),
|
||||
Settings.GUI_TRANSACTIONS_ITEMS_FILTER_NAME.getString(),
|
||||
Settings.GUI_TRANSACTIONS_ITEMS_FILTER_LORE.getStringList(),
|
||||
new HashMap<String, Object>() {{
|
||||
put("%filter_category%", auctionPlayer.getSelectedTransactionFilter().getTranslatedType());
|
||||
put("%filter_auction_type%", auctionPlayer.getSelectedTransactionSaleType().getTranslatedType());
|
||||
put("%filter_sort_order%", auctionPlayer.getTransactionSortType().getTranslatedType());
|
||||
put("%filter_buy_type%", auctionPlayer.getTransactionViewFilter().getTranslatedType());
|
||||
}}
|
||||
), click -> {
|
||||
setButton(Settings.GUI_TRANSACTIONS_ITEMS_FILTER_SLOT.getInt(), QuickItem
|
||||
.of(Settings.GUI_TRANSACTIONS_ITEMS_FILTER_ITEM.getString())
|
||||
.name(Settings.GUI_TRANSACTIONS_ITEMS_FILTER_NAME.getString())
|
||||
.lore(Replacer.replaceVariables(Settings.GUI_TRANSACTIONS_ITEMS_FILTER_LORE.getStringList(),
|
||||
"filter_category", auctionPlayer.getSelectedTransactionFilter().getTranslatedType(),
|
||||
"filter_auction_type", auctionPlayer.getSelectedTransactionSaleType().getTranslatedType(),
|
||||
"filter_sort_order", auctionPlayer.getTransactionSortType().getTranslatedType(),
|
||||
"filter_buy_type", auctionPlayer.getTransactionViewFilter().getTranslatedType()
|
||||
)).make(), click -> {
|
||||
|
||||
if (click.clickType == ClickType.valueOf(Settings.CLICKS_FILTER_CATEGORY.getString().toUpperCase())) {
|
||||
this.auctionPlayer.setSelectedTransactionFilter(this.auctionPlayer.getSelectedTransactionFilter().next());
|
||||
|
@ -83,6 +83,7 @@ public class Settings {
|
||||
public static final ConfigSetting OWNER_CAN_FULFILL_OWN_REQUEST = new ConfigSetting(config, "auction setting.purchase.owner can fulfill own request", false, "Should the owner of a request be able to fulfill it", "This probably should be set to false...");
|
||||
public static final ConfigSetting MAX_REQUEST_AMOUNT = new ConfigSetting(config, "auction setting.max request amount", 64, "How much of an item should a player be able to ask for in a single request?");
|
||||
public static final ConfigSetting AUTO_REFRESH_AUCTION_PAGES = new ConfigSetting(config, "auction setting.auto refresh auction pages", true, "Should auction pages auto refresh?");
|
||||
public static final ConfigSetting AUTO_REFRESH_ACTIVE_AUCTION_PAGES = new ConfigSetting(config, "auction setting.auto refresh active auction pages", false, "Should the /ah active pages be auto refreshed?");
|
||||
public static final ConfigSetting AUTO_REFRESH_AUCTION_PAGE_SYNC = new ConfigSetting(config, "auction setting.auto refresh auction pages synchronously", false, "Should auction pages auto refresh use a synchronous?");
|
||||
public static final ConfigSetting AUTO_REFRESH_DOES_SLOT_CLEAR = new ConfigSetting(config, "auction setting.auto refresh does slot clear", true, "If true, on every refresh, the slots will be cleared (replaced by default item) then the actual listings will be placed.");
|
||||
public static final ConfigSetting USE_SHORT_NUMBERS_ON_ITEMS = new ConfigSetting(config, "auction setting.use short numbers", false, "Should numbers be shortened into a prefixed form?");
|
||||
@ -504,7 +505,7 @@ public class Settings {
|
||||
public static final ConfigSetting GUI_REFRESH_BTN_SLOT = new ConfigSetting(config, "gui.global items.refresh button.slot", 49, "Valid Slots: 45 - 53");
|
||||
public static final ConfigSetting GUI_REFRESH_BTN_ITEM = new ConfigSetting(config, "gui.global items.refresh button.item", "CHEST", "Settings for the refresh page");
|
||||
public static final ConfigSetting GUI_REFRESH_BTN_NAME = new ConfigSetting(config, "gui.global items.refresh button.name", "&6&LRefresh Page");
|
||||
public static final ConfigSetting GUI_REFRESH_BTN_LORE = new ConfigSetting(config, "gui.global items.refresh button.lore", Arrays.asList("&7Click to refresh the currently", "&7available auction listings."));
|
||||
public static final ConfigSetting GUI_REFRESH_BTN_LORE = new ConfigSetting(config, "gui.global items.refresh button.lore", Collections.singletonList("&7Click to refresh the page"));
|
||||
|
||||
|
||||
/* ===============================
|
||||
|
Loading…
Reference in New Issue
Block a user