add normalize-time-creation

This commit is contained in:
hyperdefined
2025-05-06 20:29:27 -04:00
parent 70e19269ee
commit bc8f4948fe
9 changed files with 69 additions and 11 deletions

View File

@@ -100,7 +100,13 @@ public class GenerateLoot implements Listener {
return null;
}
long timeCreated = System.currentTimeMillis();
Date finalDate = new Date(timeCreated);
Date finalDate;
if (toolStats.config.getBoolean("normalize-time-creation")) {
finalDate = toolStats.numberFormat.normalizeTime(timeCreated);
timeCreated = finalDate.getTime();
} else {
finalDate = new Date(timeCreated);
}
PersistentDataContainer container = meta.getPersistentDataContainer();
if (container.has(toolStats.timeCreated, PersistentDataType.LONG) || container.has(toolStats.itemOwner, PersistentDataType.LONG)) {