lots of updates

- add hash to items when created
- added "crops harvested" for hoes
This commit is contained in:
hyperdefined
2023-09-30 20:05:31 -04:00
parent 0a3f46fc6e
commit 5551c24202
14 changed files with 238 additions and 57 deletions

View File

@@ -104,6 +104,9 @@ public class CraftItem implements Listener {
return null;
}
String hash = toolStats.hashMaker.makeHash(newItem.getType(), owner.getUniqueId(), timeCreated);
container.set(toolStats.hash, PersistentDataType.STRING, hash);
container.set(toolStats.timeCreated, PersistentDataType.LONG, timeCreated);
container.set(toolStats.genericOwner, new UUIDDataType(), owner.getUniqueId());
container.set(toolStats.originType, PersistentDataType.INTEGER, 0);
@@ -128,10 +131,10 @@ public class CraftItem implements Listener {
lore = new ArrayList<>();
}
// do we add the lore based on the config?
if (toolStats.checkConfig(itemStack, "created-date")) {
if (toolStats.checkConfig(itemStack.getType(), "created-date")) {
lore.add(createdOnRaw.replace("{date}", toolStats.numberFormat.formatDate(finalDate)));
}
if (toolStats.checkConfig(itemStack, "created-by")) {
if (toolStats.checkConfig(itemStack.getType(), "created-by")) {
lore.add(createdByRaw.replace("{player}", owner.getName()));
}
meta.setLore(lore);