mirror of
https://github.com/kiranhart/Auction-House.git
synced 2025-01-23 15:21:20 +01:00
#21 add option to use %remaining_days/hours/minutes/seconds% within clock (listing time) lore in sell menus
This commit is contained in:
parent
a63067ce85
commit
6748cf3090
@ -77,10 +77,19 @@ public final class GUISellAuction extends AbstractPlaceholderGui {
|
||||
reset();
|
||||
|
||||
if (Settings.ALLOW_PLAYERS_TO_DEFINE_AUCTION_TIME.getBoolean()) {
|
||||
|
||||
final long[] times = AuctionAPI.getInstance().getRemainingTimeValues(this.listingTime);
|
||||
|
||||
setButton(3, 1, QuickItem
|
||||
.of(Objects.requireNonNull(Settings.GUI_SELL_AUCTION_ITEM_ITEMS_TIME_ITEM.getMaterial().parseItem()))
|
||||
.name(Settings.GUI_SELL_AUCTION_ITEM_ITEMS_TIME_NAME.getString())
|
||||
.lore(Settings.GUI_SELL_AUCTION_ITEM_ITEMS_TIME_LORE.getStringList()).make(), click -> {
|
||||
.lore(Replacer.replaceVariables(
|
||||
Settings.GUI_SELL_AUCTION_ITEM_ITEMS_TIME_LORE.getStringList(),
|
||||
"remaining_days", times[0],
|
||||
"remaining_hours", times[1],
|
||||
"remaining_minutes", times[2],
|
||||
"remaining_seconds", times[3]
|
||||
)).make(), click -> {
|
||||
|
||||
click.gui.exit();
|
||||
new TitleInput(click.player, AuctionHouse.getInstance().getLocale().getMessage("titles.listing time.title").getMessage(), AuctionHouse.getInstance().getLocale().getMessage("titles.listing time.subtitle").getMessage()) {
|
||||
|
@ -73,10 +73,19 @@ public final class GUISellBin extends AbstractPlaceholderGui {
|
||||
reset();
|
||||
|
||||
if (Settings.ALLOW_PLAYERS_TO_DEFINE_AUCTION_TIME.getBoolean()) {
|
||||
|
||||
final long[] times = AuctionAPI.getInstance().getRemainingTimeValues(this.listingTime);
|
||||
|
||||
setButton(3, 1, QuickItem
|
||||
.of(Objects.requireNonNull(Settings.GUI_SELL_BIN_ITEM_ITEMS_TIME_ITEM.getMaterial().parseItem()))
|
||||
.name(Settings.GUI_SELL_BIN_ITEM_ITEMS_TIME_NAME.getString())
|
||||
.lore(Settings.GUI_SELL_BIN_ITEM_ITEMS_TIME_LORE.getStringList()).make(), click -> {
|
||||
.lore(Replacer.replaceVariables(
|
||||
Settings.GUI_SELL_BIN_ITEM_ITEMS_TIME_LORE.getStringList(),
|
||||
"remaining_days", times[0],
|
||||
"remaining_hours", times[1],
|
||||
"remaining_minutes", times[2],
|
||||
"remaining_seconds", times[3]
|
||||
)).make(), click -> {
|
||||
|
||||
click.gui.exit();
|
||||
new TitleInput(click.player, AuctionHouse.getInstance().getLocale().getMessage("titles.listing time.title").getMessage(), AuctionHouse.getInstance().getLocale().getMessage("titles.listing time.subtitle").getMessage()) {
|
||||
|
@ -80,6 +80,7 @@ public abstract class Input implements Listener, Runnable {
|
||||
)
|
||||
public void onChat(AsyncPlayerChatEvent e) {
|
||||
if (e.getPlayer().equals(this.player)) {
|
||||
|
||||
this.onInput(e.getMessage());
|
||||
e.setCancelled(true);
|
||||
}
|
||||
|
@ -930,6 +930,8 @@ public class Settings {
|
||||
public static final ConfigSetting GUI_SELL_BIN_ITEM_ITEMS_TIME_ITEM = new ConfigSetting(config, "gui.sell bin item.items.time.item", XMaterial.CLOCK.name());
|
||||
public static final ConfigSetting GUI_SELL_BIN_ITEM_ITEMS_TIME_NAME = new ConfigSetting(config, "gui.sell bin item.items.time.name", "&e&lListing Time");
|
||||
public static final ConfigSetting GUI_SELL_BIN_ITEM_ITEMS_TIME_LORE = new ConfigSetting(config, "gui.sell bin item.items.time.lore", Arrays.asList(
|
||||
"",
|
||||
"&eCurrent Time: &b%remaining_days%&fd &b%remaining_hours%&fh &b%remaining_minutes%&fm &b%remaining_seconds%&Fs",
|
||||
"",
|
||||
"&7Click to edit the listing time"
|
||||
));
|
||||
@ -972,6 +974,8 @@ public class Settings {
|
||||
public static final ConfigSetting GUI_SELL_AUCTION_ITEM_ITEMS_TIME_ITEM = new ConfigSetting(config, "gui.sell auction item.items.time.item", XMaterial.CLOCK.name());
|
||||
public static final ConfigSetting GUI_SELL_AUCTION_ITEM_ITEMS_TIME_NAME = new ConfigSetting(config, "gui.sell auction item.items.time.name", "&e&lListing Time");
|
||||
public static final ConfigSetting GUI_SELL_AUCTION_ITEM_ITEMS_TIME_LORE = new ConfigSetting(config, "gui.sell auction item.items.time.lore", Arrays.asList(
|
||||
"",
|
||||
"&eCurrent Time: &b%remaining_days%&fd &b%remaining_hours%&fh &b%remaining_minutes%&fm &b%remaining_seconds%&Fs",
|
||||
"",
|
||||
"&7Click to edit the listing time"
|
||||
));
|
||||
|
Loading…
Reference in New Issue
Block a user