add dropped-by

This commit is contained in:
hyperdefined
2025-05-07 17:51:54 -04:00
parent bc8f4948fe
commit b2ef154cc6
5 changed files with 64 additions and 7 deletions

View File

@@ -266,6 +266,17 @@ public class CommandToolStats implements TabExecutor {
player.getInventory().setItem(slot, finalItem);
}
if (container.has(toolStats.droppedBy, PersistentDataType.STRING)) {
if (toolStats.config.getBoolean("enabled.dropped-by")) {
if (container.has(toolStats.droppedBy)) {
String droppedBy = container.get(toolStats.droppedBy, PersistentDataType.STRING);
lore.add(toolStats.configTools.formatLore("dropped-by", "{name}", droppedBy));
} else {
player.sendMessage(Component.text("Unable to set 'dropped-by', as this item has no record of it."));
}
}
}
if (container.has(toolStats.itemOwner, new UUIDDataType())) {
UUID owner = container.get(toolStats.itemOwner, new UUIDDataType());
String ownerName = null;
@@ -329,6 +340,12 @@ public class CommandToolStats implements TabExecutor {
}
break;
}
case 1: {
if (toolStats.config.getBoolean("enabled.dropped-on")) {
lore.add(toolStats.configTools.formatLore("dropped-on", "{date}", date));
}
break;
}
case 2: {
if (toolStats.configTools.checkConfig(original.getType(), "looted-on")) {
lore.add(toolStats.configTools.formatLore("looted.looted-on", "{date}", date));