move keys to own class

this took forever
This commit is contained in:
hyperdefined
2026-01-20 17:39:08 -05:00
parent 8a4da8ad56
commit 6a994e4a82
19 changed files with 675 additions and 594 deletions

View File

@@ -107,7 +107,7 @@ public class GenerateLoot implements Listener {
}
PersistentDataContainer container = meta.getPersistentDataContainer();
if (container.has(toolStats.timeCreated, PersistentDataType.LONG) || container.has(toolStats.itemOwner, PersistentDataType.LONG)) {
if (container.has(toolStats.toolStatsKeys.getTimeCreated(), PersistentDataType.LONG) || container.has(toolStats.toolStatsKeys.getItemOwner(), new UUIDDataType())) {
return null;
}
@@ -122,8 +122,8 @@ public class GenerateLoot implements Listener {
// if creation date is enabled, add it
Component creationDate = toolStats.itemLore.formatCreationTime(timeCreated, 2, newItem);
if (creationDate != null) {
container.set(toolStats.timeCreated, PersistentDataType.LONG, timeCreated);
container.set(toolStats.originType, PersistentDataType.INTEGER, 2);
container.set(toolStats.toolStatsKeys.getTimeCreated(), PersistentDataType.LONG, timeCreated);
container.set(toolStats.toolStatsKeys.getOriginType(), PersistentDataType.INTEGER, 2);
lore.add(creationDate);
meta.lore(lore);
}
@@ -131,8 +131,8 @@ public class GenerateLoot implements Listener {
// if ownership is enabled, add it
Component itemOwner = toolStats.itemLore.formatOwner(owner.getName(), 2, newItem);
if (itemOwner != null) {
container.set(toolStats.itemOwner, new UUIDDataType(), owner.getUniqueId());
container.set(toolStats.originType, PersistentDataType.INTEGER, 2);
container.set(toolStats.toolStatsKeys.getItemOwner(), new UUIDDataType(), owner.getUniqueId());
container.set(toolStats.toolStatsKeys.getOriginType(), PersistentDataType.INTEGER, 2);
lore.add(itemOwner);
meta.lore(lore);
}
@@ -140,7 +140,7 @@ public class GenerateLoot implements Listener {
// if hash is enabled, add it
if (toolStats.config.getBoolean("generate-hash-for-items")) {
String hash = toolStats.hashMaker.makeHash(newItem.getType(), owner.getUniqueId(), timeCreated);
container.set(toolStats.hash, PersistentDataType.STRING, hash);
container.set(toolStats.toolStatsKeys.getHash(), PersistentDataType.STRING, hash);
}
newItem.setItemMeta(meta);