added more trackers

* when opening a loot chest
* when trading items
* when fishing for items
This commit is contained in:
hyperdefined
2022-01-30 15:36:33 -05:00
parent 3cf6554984
commit 8736519d34
6 changed files with 318 additions and 17 deletions

View File

@@ -71,8 +71,8 @@ public class CraftItem implements Listener {
long timeCreated = System.currentTimeMillis();
Date finalDate = new Date(timeCreated);
PersistentDataContainer container = meta.getPersistentDataContainer();
container.set(toolStats.craftedTime, PersistentDataType.LONG, timeCreated);
container.set(toolStats.craftedOwner, new UUIDDataType(), owner.getUniqueId());
container.set(toolStats.timeCreated, PersistentDataType.LONG, timeCreated);
container.set(toolStats.genericOwner, new UUIDDataType(), owner.getUniqueId());
List<String> lore;
if (meta.hasLore()) {
lore = meta.getLore();
@@ -80,10 +80,10 @@ public class CraftItem implements Listener {
} else {
lore = new ArrayList<>();
}
if (toolStats.checkConfig(itemStack, "crafted-date")) {
if (toolStats.checkConfig(itemStack, "created-date")) {
lore.add(timeCreatedLore.replace("X", format.format(finalDate)));
}
if (toolStats.checkConfig(itemStack, "crafted-by")) {
if (toolStats.checkConfig(itemStack, "created-by")) {
lore.add(ownerLore.replace("X", owner.getName()));
}
meta.setLore(lore);