mirror of
https://github.com/kiranhart/Auction-House.git
synced 2025-01-23 15:21:20 +01:00
💎 customizable time unit names, use new time format option for time select in sell menus
This commit is contained in:
parent
7b303506a7
commit
7baca727ee
@ -292,7 +292,7 @@ public final class GUIAuctionHouse extends AuctionUpdatingPagedGUI<AuctionedItem
|
||||
|
||||
double newBiddingAmount = 0;
|
||||
if (Settings.USE_REALISTIC_BIDDING.getBoolean()) {
|
||||
if (value > auctionItem.getCurrentPrice() + auctionItem.getBidIncrementPrice()) {
|
||||
if (value >= auctionItem.getCurrentPrice() + auctionItem.getBidIncrementPrice()) {
|
||||
newBiddingAmount = value;
|
||||
} else {
|
||||
if (Settings.BID_MUST_BE_HIGHER_THAN_PREVIOUS.getBoolean()) {
|
||||
|
@ -31,12 +31,14 @@ import ca.tweetzy.auctionhouse.guis.core.GUIAuctionHouse;
|
||||
import ca.tweetzy.auctionhouse.guis.selector.GUICurrencyPicker;
|
||||
import ca.tweetzy.auctionhouse.helpers.AuctionCreator;
|
||||
import ca.tweetzy.auctionhouse.helpers.BundleUtil;
|
||||
import ca.tweetzy.auctionhouse.helpers.TimeConverter;
|
||||
import ca.tweetzy.auctionhouse.helpers.input.TitleInput;
|
||||
import ca.tweetzy.auctionhouse.model.MaterialCategorizer;
|
||||
import ca.tweetzy.auctionhouse.settings.Settings;
|
||||
import ca.tweetzy.core.gui.events.GuiClickEvent;
|
||||
import ca.tweetzy.core.utils.NumberUtils;
|
||||
import ca.tweetzy.core.utils.PlayerUtils;
|
||||
import ca.tweetzy.flight.utils.Common;
|
||||
import ca.tweetzy.flight.utils.QuickItem;
|
||||
import ca.tweetzy.flight.utils.Replacer;
|
||||
import lombok.NonNull;
|
||||
@ -121,7 +123,7 @@ public final class GUISellAuction extends AuctionBaseGUI {
|
||||
|
||||
if (Settings.ALLOW_PLAYERS_TO_DEFINE_AUCTION_TIME.getBoolean()) {
|
||||
|
||||
final long[] times = AuctionAPI.getInstance().getRemainingTimeValues(this.listingTime);
|
||||
final long[] times = AuctionAPI.getInstance().getRemainingTimeValues(this.listingTime/1000);
|
||||
|
||||
setButton(3, 1, QuickItem
|
||||
.of(Settings.GUI_SELL_AUCTION_ITEM_ITEMS_TIME_ITEM.getString())
|
||||
@ -135,10 +137,7 @@ public final class GUISellAuction extends AuctionBaseGUI {
|
||||
|
||||
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(),
|
||||
AuctionHouse.getInstance().getLocale().getMessage("titles.listing time.actionbar").getMessage()
|
||||
click.player, Common.colorize(AuctionHouse.getInstance().getLocale().getMessage("titles.listing time.title").getMessage()), Common.colorize(AuctionHouse.getInstance().getLocale().getMessage("titles.listing time.subtitle").getMessage()), Common.colorize(AuctionHouse.getInstance().getLocale().getMessage("titles.listing time.actionbar").getMessage())
|
||||
) {
|
||||
|
||||
@Override
|
||||
@ -149,24 +148,24 @@ public final class GUISellAuction extends AuctionBaseGUI {
|
||||
@Override
|
||||
public boolean onResult(String string) {
|
||||
string = ChatColor.stripColor(string);
|
||||
long time = 0;
|
||||
try {
|
||||
time = TimeConverter.convertHumanReadableTime(string);
|
||||
} catch (IllegalArgumentException e) {
|
||||
}
|
||||
|
||||
String[] parts = ChatColor.stripColor(string).split(" ");
|
||||
if (parts.length == 2) {
|
||||
if (NumberUtils.isInt(parts[0]) && Arrays.asList("second", "minute", "hour", "day", "week", "month", "year").contains(parts[1].toLowerCase())) {
|
||||
if (AuctionAPI.toTicks(string) <= Settings.MAX_CUSTOM_DEFINED_TIME.getInt()) {
|
||||
click.manager.showGUI(click.player, new GUISellAuction(
|
||||
GUISellAuction.this.auctionPlayer,
|
||||
GUISellAuction.this.binPrice,
|
||||
GUISellAuction.this.startingBid,
|
||||
GUISellAuction.this.bidIncrement,
|
||||
AuctionAPI.toTicks(string),
|
||||
GUISellAuction.this.allowBuyNow,
|
||||
GUISellAuction.this.currency,
|
||||
GUISellAuction.this.currencyItem
|
||||
));
|
||||
return true;
|
||||
}
|
||||
}
|
||||
if ((time/1000) <= Settings.MAX_CUSTOM_DEFINED_TIME.getInt()) {
|
||||
click.manager.showGUI(click.player, new GUISellAuction(
|
||||
GUISellAuction.this.auctionPlayer,
|
||||
GUISellAuction.this.binPrice,
|
||||
GUISellAuction.this.startingBid,
|
||||
GUISellAuction.this.bidIncrement,
|
||||
time,
|
||||
GUISellAuction.this.allowBuyNow,
|
||||
GUISellAuction.this.currency,
|
||||
GUISellAuction.this.currencyItem
|
||||
));
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
@ -288,56 +287,58 @@ public final class GUISellAuction extends AuctionBaseGUI {
|
||||
};
|
||||
});
|
||||
|
||||
setButton(3, 5, QuickItem
|
||||
.of(Settings.GUI_SELL_AUCTION_ITEM_ITEMS_INCREMENT_PRICE_ITEM.getString())
|
||||
.name(Settings.GUI_SELL_AUCTION_ITEM_ITEMS_INCREMENT_PRICE_NAME.getString())
|
||||
.lore(this.player, Replacer.replaceVariables(Settings.GUI_SELL_AUCTION_ITEM_ITEMS_INCREMENT_PRICE_LORE.getStringList(), "listing_increment_price", AuctionHouse.getAPI().getFinalizedCurrencyNumber(bidIncrement, this.currency, this.currencyItem)))
|
||||
.make(), click -> {
|
||||
if (!Settings.FORCE_CUSTOM_BID_AMOUNT.getBoolean()) {
|
||||
setButton(3, 5, QuickItem
|
||||
.of(Settings.GUI_SELL_AUCTION_ITEM_ITEMS_INCREMENT_PRICE_ITEM.getString())
|
||||
.name(Settings.GUI_SELL_AUCTION_ITEM_ITEMS_INCREMENT_PRICE_NAME.getString())
|
||||
.lore(this.player, Replacer.replaceVariables(Settings.GUI_SELL_AUCTION_ITEM_ITEMS_INCREMENT_PRICE_LORE.getStringList(), "listing_increment_price", AuctionHouse.getAPI().getFinalizedCurrencyNumber(bidIncrement, this.currency, this.currencyItem)))
|
||||
.make(), click -> {
|
||||
|
||||
click.gui.exit();
|
||||
new TitleInput(click.player, AuctionHouse.getInstance().getLocale().getMessage("titles.bid increment price.title").getMessage(), AuctionHouse.getInstance().getLocale().getMessage("titles.bid increment price.subtitle").getMessage()) {
|
||||
click.gui.exit();
|
||||
new TitleInput(click.player, AuctionHouse.getInstance().getLocale().getMessage("titles.bid increment price.title").getMessage(), AuctionHouse.getInstance().getLocale().getMessage("titles.bid increment price.subtitle").getMessage()) {
|
||||
|
||||
@Override
|
||||
public void onExit(Player player) {
|
||||
click.manager.showGUI(player, GUISellAuction.this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onResult(String string) {
|
||||
string = ChatColor.stripColor(string);
|
||||
|
||||
if (!NumberUtils.isDouble(string)) {
|
||||
AuctionHouse.getInstance().getLocale().getMessage("general.notanumber").processPlaceholder("value", string).sendPrefixedMessage(player);
|
||||
return false;
|
||||
@Override
|
||||
public void onExit(Player player) {
|
||||
click.manager.showGUI(player, GUISellAuction.this);
|
||||
}
|
||||
|
||||
double listingAmount = Double.parseDouble(string);
|
||||
if (Double.isNaN(listingAmount)) {
|
||||
AuctionHouse.getInstance().getLocale().getMessage("general.notanumber").processPlaceholder("value", string).sendPrefixedMessage(player);
|
||||
return false;
|
||||
@Override
|
||||
public boolean onResult(String string) {
|
||||
string = ChatColor.stripColor(string);
|
||||
|
||||
if (!NumberUtils.isDouble(string)) {
|
||||
AuctionHouse.getInstance().getLocale().getMessage("general.notanumber").processPlaceholder("value", string).sendPrefixedMessage(player);
|
||||
return false;
|
||||
}
|
||||
|
||||
double listingAmount = Double.parseDouble(string);
|
||||
if (Double.isNaN(listingAmount)) {
|
||||
AuctionHouse.getInstance().getLocale().getMessage("general.notanumber").processPlaceholder("value", string).sendPrefixedMessage(player);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (listingAmount < Settings.MIN_AUCTION_INCREMENT_PRICE.getDouble())
|
||||
listingAmount = Settings.MIN_AUCTION_INCREMENT_PRICE.getDouble();
|
||||
|
||||
if (listingAmount > Settings.MAX_AUCTION_INCREMENT_PRICE.getDouble())
|
||||
listingAmount = Settings.MAX_AUCTION_INCREMENT_PRICE.getDouble();
|
||||
|
||||
click.manager.showGUI(click.player, new GUISellAuction(
|
||||
GUISellAuction.this.auctionPlayer,
|
||||
GUISellAuction.this.binPrice,
|
||||
GUISellAuction.this.startingBid,
|
||||
listingAmount,
|
||||
GUISellAuction.this.listingTime,
|
||||
GUISellAuction.this.allowBuyNow,
|
||||
GUISellAuction.this.currency,
|
||||
GUISellAuction.this.currencyItem
|
||||
));
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
if (listingAmount < Settings.MIN_AUCTION_INCREMENT_PRICE.getDouble())
|
||||
listingAmount = Settings.MIN_AUCTION_INCREMENT_PRICE.getDouble();
|
||||
|
||||
if (listingAmount > Settings.MAX_AUCTION_INCREMENT_PRICE.getDouble())
|
||||
listingAmount = Settings.MAX_AUCTION_INCREMENT_PRICE.getDouble();
|
||||
|
||||
click.manager.showGUI(click.player, new GUISellAuction(
|
||||
GUISellAuction.this.auctionPlayer,
|
||||
GUISellAuction.this.binPrice,
|
||||
GUISellAuction.this.startingBid,
|
||||
listingAmount,
|
||||
GUISellAuction.this.listingTime,
|
||||
GUISellAuction.this.allowBuyNow,
|
||||
GUISellAuction.this.currency,
|
||||
GUISellAuction.this.currencyItem
|
||||
));
|
||||
|
||||
return true;
|
||||
}
|
||||
};
|
||||
});
|
||||
};
|
||||
});
|
||||
}
|
||||
|
||||
drawAuctionItem();
|
||||
drawBuyoutToggle();
|
||||
@ -425,7 +426,7 @@ public final class GUISellAuction extends AuctionBaseGUI {
|
||||
this.bidIncrement,
|
||||
this.startingBid,
|
||||
true, false,
|
||||
System.currentTimeMillis() + (this.listingTime * 1000L)
|
||||
System.currentTimeMillis() + this.listingTime
|
||||
);
|
||||
|
||||
if (this.currency != null)
|
||||
|
@ -31,12 +31,14 @@ import ca.tweetzy.auctionhouse.guis.core.GUIAuctionHouse;
|
||||
import ca.tweetzy.auctionhouse.guis.selector.GUICurrencyPicker;
|
||||
import ca.tweetzy.auctionhouse.helpers.AuctionCreator;
|
||||
import ca.tweetzy.auctionhouse.helpers.BundleUtil;
|
||||
import ca.tweetzy.auctionhouse.helpers.TimeConverter;
|
||||
import ca.tweetzy.auctionhouse.helpers.input.TitleInput;
|
||||
import ca.tweetzy.auctionhouse.model.MaterialCategorizer;
|
||||
import ca.tweetzy.auctionhouse.settings.Settings;
|
||||
import ca.tweetzy.core.gui.events.GuiClickEvent;
|
||||
import ca.tweetzy.core.utils.NumberUtils;
|
||||
import ca.tweetzy.core.utils.PlayerUtils;
|
||||
import ca.tweetzy.flight.utils.Common;
|
||||
import ca.tweetzy.flight.utils.QuickItem;
|
||||
import ca.tweetzy.flight.utils.Replacer;
|
||||
import lombok.NonNull;
|
||||
@ -116,7 +118,7 @@ public final class GUISellBin extends AuctionBaseGUI {
|
||||
|
||||
if (Settings.ALLOW_PLAYERS_TO_DEFINE_AUCTION_TIME.getBoolean()) {
|
||||
|
||||
final long[] times = AuctionAPI.getInstance().getRemainingTimeValues(this.listingTime);
|
||||
final long[] times = AuctionAPI.getInstance().getRemainingTimeValues(this.listingTime/1000);
|
||||
|
||||
setButton(3, 1, QuickItem
|
||||
.of(Settings.GUI_SELL_BIN_ITEM_ITEMS_TIME_ITEM.getString())
|
||||
@ -129,7 +131,7 @@ public final class GUISellBin extends AuctionBaseGUI {
|
||||
)).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(), AuctionHouse.getInstance().getLocale().getMessage("titles.listing time.actionbar").getMessage()) {
|
||||
new TitleInput(click.player, Common.colorize(AuctionHouse.getInstance().getLocale().getMessage("titles.listing time.title").getMessage()), Common.colorize(AuctionHouse.getInstance().getLocale().getMessage("titles.listing time.subtitle").getMessage()), Common.colorize(AuctionHouse.getInstance().getLocale().getMessage("titles.listing time.actionbar").getMessage())) {
|
||||
|
||||
|
||||
@Override
|
||||
@ -141,14 +143,15 @@ public final class GUISellBin extends AuctionBaseGUI {
|
||||
public boolean onResult(String string) {
|
||||
string = ChatColor.stripColor(string);
|
||||
|
||||
String[] parts = ChatColor.stripColor(string).split(" ");
|
||||
if (parts.length == 2) {
|
||||
if (NumberUtils.isInt(parts[0]) && Arrays.asList("second", "minute", "hour", "day", "week", "month", "year").contains(parts[1].toLowerCase())) {
|
||||
if (AuctionAPI.toTicks(string) <= Settings.MAX_CUSTOM_DEFINED_TIME.getInt()) {
|
||||
click.manager.showGUI(click.player, new GUISellBin(GUISellBin.this.auctionPlayer, GUISellBin.this.listingPrice, AuctionAPI.toTicks(string), GUISellBin.this.allowPartialBuy));
|
||||
return true;
|
||||
}
|
||||
}
|
||||
long time = 0;
|
||||
try {
|
||||
time = TimeConverter.convertHumanReadableTime(string);
|
||||
} catch (IllegalArgumentException e) {
|
||||
}
|
||||
|
||||
if ((time/1000) <= Settings.MAX_CUSTOM_DEFINED_TIME.getInt()) {
|
||||
click.manager.showGUI(click.player, new GUISellBin(GUISellBin.this.auctionPlayer, GUISellBin.this.listingPrice, time, GUISellBin.this.allowPartialBuy));
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
@ -260,7 +263,7 @@ public final class GUISellBin extends AuctionBaseGUI {
|
||||
}
|
||||
|
||||
private AuctionedItem createListingItem() {
|
||||
final AuctionedItem item = new AuctionedItem(UUID.randomUUID(), auctionPlayer.getUuid(), auctionPlayer.getUuid(), auctionPlayer.getPlayer().getName(), auctionPlayer.getPlayer().getName(), MaterialCategorizer.getMaterialCategory(this.auctionPlayer.getItemBeingListed()), this.auctionPlayer.getItemBeingListed(), this.listingPrice, 0, 0, this.listingPrice, false, false, System.currentTimeMillis() + (this.listingTime * 1000L));
|
||||
final AuctionedItem item = new AuctionedItem(UUID.randomUUID(), auctionPlayer.getUuid(), auctionPlayer.getUuid(), auctionPlayer.getPlayer().getName(), auctionPlayer.getPlayer().getName(), MaterialCategorizer.getMaterialCategory(this.auctionPlayer.getItemBeingListed()), this.auctionPlayer.getItemBeingListed(), this.listingPrice, 0, 0, this.listingPrice, false, false, System.currentTimeMillis() + this.listingTime);
|
||||
|
||||
item.setAllowPartialBuy(this.allowPartialBuy);
|
||||
|
||||
|
@ -110,7 +110,7 @@ public final class GUISellPlaceItem extends AuctionBaseGUI {
|
||||
click.gui.exit();
|
||||
|
||||
if (this.listingType == ListingType.BIN)
|
||||
click.manager.showGUI(click.player, new GUISellBin(this.auctionPlayer, Settings.MIN_AUCTION_PRICE.getDouble(), this.auctionPlayer.getAllowedSellTime(AuctionSaleType.WITHOUT_BIDDING_SYSTEM), false));
|
||||
click.manager.showGUI(click.player, new GUISellBin(this.auctionPlayer, Settings.MIN_AUCTION_PRICE.getDouble(), this.auctionPlayer.getAllowedSellTime(AuctionSaleType.WITHOUT_BIDDING_SYSTEM) * 1000L, false));
|
||||
else {
|
||||
boolean buyOutOnByDefault = Settings.ALLOW_USAGE_OF_BUY_NOW_SYSTEM.getBoolean();
|
||||
if (Settings.BUY_NOW_DISABLED_BY_DEFAULT_IN_SELL_MENU.getBoolean()) {
|
||||
@ -122,7 +122,7 @@ public final class GUISellPlaceItem extends AuctionBaseGUI {
|
||||
Settings.MIN_AUCTION_PRICE.getDouble(),
|
||||
Settings.MIN_AUCTION_START_PRICE.getDouble(),
|
||||
Settings.MIN_AUCTION_INCREMENT_PRICE.getDouble(),
|
||||
this.auctionPlayer.getAllowedSellTime(AuctionSaleType.USED_BIDDING_SYSTEM),
|
||||
this.auctionPlayer.getAllowedSellTime(AuctionSaleType.USED_BIDDING_SYSTEM) * 1000L,
|
||||
buyOutOnByDefault
|
||||
));
|
||||
}
|
||||
|
@ -1,63 +1,71 @@
|
||||
package ca.tweetzy.auctionhouse.helpers;
|
||||
|
||||
import ca.tweetzy.auctionhouse.settings.Settings;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
public class TimeConverter {
|
||||
|
||||
private static final Pattern TIME_PATTERN = Pattern.compile("(\\d+)\\s*(years?|months?|weeks?|days?|hours?|minutes?|seconds?)");
|
||||
private static Pattern TIME_PATTERN;
|
||||
|
||||
static {
|
||||
updateTimePattern();
|
||||
}
|
||||
|
||||
public static void updateTimePattern() {
|
||||
List<String> allTimeUnits = new ArrayList<>();
|
||||
allTimeUnits.addAll(Settings.TIME_ALIAS_YEAR.getStringList());
|
||||
allTimeUnits.addAll(Settings.TIME_ALIAS_MONTH.getStringList());
|
||||
allTimeUnits.addAll(Settings.TIME_ALIAS_WEEK.getStringList());
|
||||
allTimeUnits.addAll(Settings.TIME_ALIAS_DAY.getStringList());
|
||||
allTimeUnits.addAll(Settings.TIME_ALIAS_HOUR.getStringList());
|
||||
allTimeUnits.addAll(Settings.TIME_ALIAS_MINUTE.getStringList());
|
||||
allTimeUnits.addAll(Settings.TIME_ALIAS_SECOND.getStringList());
|
||||
|
||||
String timeUnitsRegex = String.join("|", allTimeUnits);
|
||||
TIME_PATTERN = Pattern.compile("(\\d+)\\s*(" + timeUnitsRegex + "s?)(?:\\s|$)");
|
||||
}
|
||||
|
||||
public static long convertHumanReadableTime(String time) {
|
||||
Matcher matcher = TIME_PATTERN.matcher(time);
|
||||
Matcher matcher = TIME_PATTERN.matcher(time.toLowerCase());
|
||||
long totalMilliseconds = 0;
|
||||
|
||||
while (matcher.find()) {
|
||||
String group = matcher.group();
|
||||
String[] parts = group.split(" ");
|
||||
int amount = Integer.parseInt(parts[0]);
|
||||
String unit = parts[1].toLowerCase();
|
||||
int amount = Integer.parseInt(matcher.group(1));
|
||||
String unit = matcher.group(2).toLowerCase();
|
||||
|
||||
switch (unit) {
|
||||
case "y":
|
||||
case "year":
|
||||
case "years":
|
||||
totalMilliseconds += amount * 365 * 24 * 60 * 60 * 1000;
|
||||
break;
|
||||
case "m":
|
||||
case "month":
|
||||
case "months":
|
||||
totalMilliseconds += amount * 30 * 24 * 60 * 60 * 1000;
|
||||
break;
|
||||
case "w":
|
||||
case "week":
|
||||
case "weeks":
|
||||
totalMilliseconds += amount * 7 * 24 * 60 * 60 * 1000;
|
||||
break;
|
||||
case "d":
|
||||
case "day":
|
||||
case "days":
|
||||
totalMilliseconds += amount * 24 * 60 * 60 * 1000;
|
||||
break;
|
||||
case "h":
|
||||
case "hour":
|
||||
case "hours":
|
||||
totalMilliseconds += amount * 60 * 60 * 1000;
|
||||
break;
|
||||
case "min":
|
||||
case "minute":
|
||||
case "minutes":
|
||||
totalMilliseconds += amount * 60 * 1000;
|
||||
break;
|
||||
case "s":
|
||||
case "second":
|
||||
case "seconds":
|
||||
totalMilliseconds += amount * 1000;
|
||||
break;
|
||||
default:
|
||||
throw new IllegalArgumentException("Invalid unit: " + unit);
|
||||
// Remove trailing 's' if present
|
||||
if (unit.endsWith("s") && unit.length() > 1) {
|
||||
unit = unit.substring(0, unit.length() - 1);
|
||||
}
|
||||
}
|
||||
|
||||
long multiplier = getMultiplierForUnit(unit);
|
||||
totalMilliseconds += amount * multiplier;
|
||||
}
|
||||
return totalMilliseconds;
|
||||
}
|
||||
|
||||
private static long getMultiplierForUnit(String unit) {
|
||||
// Check for more specific aliases first
|
||||
if (Settings.TIME_ALIAS_MINUTE.getStringList().contains(unit)) {
|
||||
return 60 * 1000L;
|
||||
} else if (Settings.TIME_ALIAS_MONTH.getStringList().contains(unit)) {
|
||||
return 30 * 24 * 60 * 60 * 1000L;
|
||||
} else if (Settings.TIME_ALIAS_YEAR.getStringList().contains(unit)) {
|
||||
return 365 * 24 * 60 * 60 * 1000L;
|
||||
} else if (Settings.TIME_ALIAS_WEEK.getStringList().contains(unit)) {
|
||||
return 7 * 24 * 60 * 60 * 1000L;
|
||||
} else if (Settings.TIME_ALIAS_DAY.getStringList().contains(unit)) {
|
||||
return 24 * 60 * 60 * 1000L;
|
||||
} else if (Settings.TIME_ALIAS_HOUR.getStringList().contains(unit)) {
|
||||
return 60 * 60 * 1000L;
|
||||
} else if (Settings.TIME_ALIAS_SECOND.getStringList().contains(unit)) {
|
||||
return 1000L;
|
||||
} else {
|
||||
return 0L;
|
||||
}
|
||||
}
|
||||
}
|
@ -74,6 +74,14 @@ public class Settings {
|
||||
public static final ConfigSetting CMD_ALIAS_SUB_TOGGLELISTINFO = new ConfigSetting(config, "command aliases.subcommands.togglelistinfo", Collections.singletonList("togglelistinfo"), "Command aliases for the toggle list info command");
|
||||
public static final ConfigSetting CMD_ALIAS_SUB_TRANSACTIONS = new ConfigSetting(config, "command aliases.subcommands.transactions", Collections.singletonList("transactions"), "Command aliases for the transactions command");
|
||||
public static final ConfigSetting CMD_ALIAS_SUB_UNBAN = new ConfigSetting(config, "command aliases.subcommands.unban", Collections.singletonList("unban"), "Command aliases for the unban command");
|
||||
|
||||
public static final ConfigSetting TIME_ALIAS_YEAR = new ConfigSetting(config, "time aliases.year", Arrays.asList("y", "year", "years"), "Time aliases for year, Must be in lowercase.");
|
||||
public static final ConfigSetting TIME_ALIAS_MONTH = new ConfigSetting(config, "time aliases.month", Arrays.asList("mo", "month", "months"), "Time aliases for month, Must be in lowercase.");
|
||||
public static final ConfigSetting TIME_ALIAS_WEEK = new ConfigSetting(config, "time aliases.week", Arrays.asList("w", "week", "weeks"), "Time aliases for week, Must be in lowercase.");
|
||||
public static final ConfigSetting TIME_ALIAS_DAY = new ConfigSetting(config, "time aliases.day", Arrays.asList("d", "day", "days"), "Time aliases for day, Must be in lowercase.");
|
||||
public static final ConfigSetting TIME_ALIAS_HOUR = new ConfigSetting(config, "time aliases.hour", Arrays.asList("h", "hour", "hours"), "Time aliases for hour, Must be in lowercase.");
|
||||
public static final ConfigSetting TIME_ALIAS_MINUTE = new ConfigSetting(config, "time aliases.minute", Arrays.asList("min", "minute", "minutes"), "Time aliases for minute, Must be in lowercase.");
|
||||
public static final ConfigSetting TIME_ALIAS_SECOND = new ConfigSetting(config, "time aliases.second", Arrays.asList("s", "second", "seconds"), "Time aliases for second, Must be in lowercase.");
|
||||
|
||||
public static final ConfigSetting ALLOW_USAGE_OF_IN_GAME_EDITOR = new ConfigSetting(config, "Allow Usage Of This Menu In Game", true, "Once you set this to true, you will no longer be able to access it unless you enable it within the actual config.yml");
|
||||
public static final ConfigSetting UPDATE_CHECKER = new ConfigSetting(config, "update checker", true, "If true, auction house will check for updates periodically");
|
||||
|
Loading…
Reference in New Issue
Block a user