mirror of
https://github.com/hyperdefined/ToolStats.git
synced 2025-12-08 13:44:59 +00:00
@@ -60,7 +60,7 @@ public final class ToolStats extends JavaPlugin {
|
||||
// used for tracking new elytras
|
||||
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 commaFormat = new DecimalFormat("#,###", new DecimalFormatSymbols(Locale.getDefault()));
|
||||
public BlocksMined blocksMined;
|
||||
@@ -130,6 +130,20 @@ public final class ToolStats extends JavaPlugin {
|
||||
if (config.getInt("config-version") != CONFIG_VERSION) {
|
||||
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() {
|
||||
|
||||
Reference in New Issue
Block a user