mirror of
https://github.com/hyperdefined/ToolStats.git
synced 2025-12-09 06:04:59 +00:00
@@ -60,7 +60,7 @@ public final class ToolStats extends JavaPlugin {
|
|||||||
// used for tracking new elytras
|
// used for tracking new elytras
|
||||||
public final NamespacedKey newElytra = new NamespacedKey(this, "new");
|
public final NamespacedKey newElytra = new NamespacedKey(this, "new");
|
||||||
|
|
||||||
public final SimpleDateFormat dateFormat = new SimpleDateFormat("M/dd/yyyy", Locale.ENGLISH);
|
public SimpleDateFormat dateFormat;
|
||||||
public final DecimalFormat decimalFormat = new DecimalFormat("#,###.00", new DecimalFormatSymbols(Locale.getDefault()));
|
public final DecimalFormat decimalFormat = new DecimalFormat("#,###.00", new DecimalFormatSymbols(Locale.getDefault()));
|
||||||
public final DecimalFormat commaFormat = new DecimalFormat("#,###", new DecimalFormatSymbols(Locale.getDefault()));
|
public final DecimalFormat commaFormat = new DecimalFormat("#,###", new DecimalFormatSymbols(Locale.getDefault()));
|
||||||
public BlocksMined blocksMined;
|
public BlocksMined blocksMined;
|
||||||
@@ -130,6 +130,20 @@ public final class ToolStats extends JavaPlugin {
|
|||||||
if (config.getInt("config-version") != CONFIG_VERSION) {
|
if (config.getInt("config-version") != CONFIG_VERSION) {
|
||||||
logger.warning("Your config file is outdated! Please regenerate the config.");
|
logger.warning("Your config file is outdated! Please regenerate the config.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
String dateFormatConfig = config.getString("date-format");
|
||||||
|
if (dateFormatConfig != null) {
|
||||||
|
try {
|
||||||
|
dateFormat = new SimpleDateFormat(dateFormatConfig, Locale.getDefault());
|
||||||
|
} catch (IllegalArgumentException exception) {
|
||||||
|
logger.severe("date-format is NOT a valid format! Using default American English format.");
|
||||||
|
exception.printStackTrace();
|
||||||
|
dateFormat = new SimpleDateFormat("M/dd/yyyy", Locale.ENGLISH);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
logger.warning("date-format is missing from your config! Using default American English format.");
|
||||||
|
dateFormat = new SimpleDateFormat("M/dd/yyyy", Locale.ENGLISH);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void checkForUpdates() {
|
public void checkForUpdates() {
|
||||||
|
|||||||
@@ -98,4 +98,9 @@ messages:
|
|||||||
crafting: "&cCrafting items via shift clicking does not fully apply tags to each item. This is a limitation with the Bukkit API."
|
crafting: "&cCrafting items via shift clicking does not fully apply tags to each item. This is a limitation with the Bukkit API."
|
||||||
trading: "&cTrading items via shift clicking does not fully apply tags to each item. This is a limitation with the Bukkit API."
|
trading: "&cTrading items via shift clicking does not fully apply tags to each item. This is a limitation with the Bukkit API."
|
||||||
|
|
||||||
|
# Change the default formatting for dates.
|
||||||
|
# See: https://www.digitalocean.com/community/tutorials/java-simpledateformat-java-date-format
|
||||||
|
# Example: "dd/mm/yyyy"
|
||||||
|
date-format: "M/dd/yyyy"
|
||||||
|
|
||||||
config-version: 3
|
config-version: 3
|
||||||
Reference in New Issue
Block a user