adjust origins to listen to config

This commit is contained in:
hyperdefined
2025-01-28 22:51:49 -05:00
parent 8a1759b6b1
commit 3e1c2dcbc3
9 changed files with 107 additions and 88 deletions

View File

@@ -84,18 +84,19 @@ public class EntityDeath implements Listener {
return null;
}
if (!toolStats.config.getBoolean("enabled.dropped-by")) {
return null;
}
PersistentDataContainer container = meta.getPersistentDataContainer();
container.set(toolStats.originType, PersistentDataType.INTEGER, 1);
if (toolStats.config.getBoolean("enabled.dropped-by")) {
String mobName = toolStats.config.getString("messages.mob." + entity.getType());
if (mobName == null) {
mobName = entity.getName();
}
Component newLine = toolStats.configTools.formatLore("dropped-by", "{name}", mobName);
List<Component> newLore = toolStats.itemLore.addItemLore(meta, newLine);
meta.lore(newLore);
String mobName = toolStats.config.getString("messages.mob." + entity.getType());
if (mobName == null) {
mobName = entity.getName();
}
Component newLine = toolStats.configTools.formatLore("dropped-by", "{name}", mobName);
List<Component> newLore = toolStats.itemLore.addItemLore(meta, newLine);
meta.lore(newLore);
newItem.setItemMeta(meta);
return newItem;
}