remove all "config" things into it's own thing

This commit is contained in:
hyperdefined
2023-10-22 19:43:22 -04:00
parent ee1c197d72
commit c3f47707c4
11 changed files with 228 additions and 182 deletions

View File

@@ -108,7 +108,7 @@ public class BlocksMined implements Listener {
container.set(toolStats.genericMined, PersistentDataType.INTEGER, blocksMined);
// do we add the lore based on the config?
if (toolStats.checkConfig(playerTool.getType(), "blocks-mined")) {
if (toolStats.configTools.checkConfig(playerTool.getType(), "blocks-mined")) {
String blocksMinedFormatted = toolStats.numberFormat.formatInt(blocksMined);
List<String> newLore = toolStats.itemLore.addItemLore(meta, "{blocks}", blocksMinedFormatted, "blocks-mined");
meta.setLore(newLore);
@@ -144,7 +144,7 @@ public class BlocksMined implements Listener {
container.set(toolStats.cropsHarvested, PersistentDataType.INTEGER, cropsMined);
// do we add the lore based on the config?
if (toolStats.checkConfig(playerTool.getType(), "blocks-mined")) {
if (toolStats.configTools.checkConfig(playerTool.getType(), "blocks-mined")) {
String cropsMinedFormatted = toolStats.numberFormat.formatInt(cropsMined);
List<String> newLore = toolStats.itemLore.addItemLore(meta, "{crops}", cropsMinedFormatted, "crops-harvested");
meta.setLore(newLore);

View File

@@ -121,8 +121,8 @@ public class CraftItem implements Listener {
lore = new ArrayList<>();
}
// do we add the lore based on the config?
if (toolStats.checkConfig(itemStack.getType(), "created-date")) {
String createdOnRaw = toolStats.getLoreFromConfig("created.created-on", true);
if (toolStats.configTools.checkConfig(itemStack.getType(), "created-date")) {
String createdOnRaw = toolStats.configTools.getLoreFromConfig("created.created-on", true);
if (createdOnRaw == null) {
toolStats.logger.warning("There is no lore message for messages.created.created-on!");
return null;
@@ -130,8 +130,8 @@ public class CraftItem implements Listener {
lore.add(createdOnRaw.replace("{date}", toolStats.numberFormat.formatDate(finalDate)));
meta.setLore(lore);
}
if (toolStats.checkConfig(itemStack.getType(), "created-by")) {
String createdByRaw = toolStats.getLoreFromConfig("created.created-by", true);
if (toolStats.configTools.checkConfig(itemStack.getType(), "created-by")) {
String createdByRaw = toolStats.configTools.getLoreFromConfig("created.created-by", true);
if (createdByRaw == null) {
toolStats.logger.warning("There is no lore message for messages.created.created-by!");
return null;

View File

@@ -97,7 +97,7 @@ public class CreativeEvent implements Listener {
container.set(toolStats.genericOwner, new UUIDDataType(), owner.getUniqueId());
container.set(toolStats.originType, PersistentDataType.INTEGER, 6);
if (toolStats.checkConfig(newSpawnedItem.getType(), "spawned-in")) {
if (toolStats.configTools.checkConfig(newSpawnedItem.getType(), "spawned-in")) {
String formattedDate = toolStats.numberFormat.formatDate(finalDate);
List<String> newLore = toolStats.itemLore.addNewOwner(meta, owner.getName(), formattedDate);
meta.setLore(newLore);

View File

@@ -245,7 +245,7 @@ public class EntityDamage implements Listener {
container.set(toolStats.swordPlayerKills, PersistentDataType.INTEGER, playerKills);
// do we add the lore based on the config?
if (toolStats.checkConfig(itemStack.getType(), "player-kills")) {
if (toolStats.configTools.checkConfig(itemStack.getType(), "player-kills")) {
String playerKillsFormatted = toolStats.numberFormat.formatInt(playerKills);
List<String> newLore = toolStats.itemLore.addItemLore(meta, "{kills}", playerKillsFormatted, "kills.player");
meta.setLore(newLore);
@@ -279,7 +279,7 @@ public class EntityDamage implements Listener {
container.set(toolStats.swordMobKills, PersistentDataType.INTEGER, mobKills);
// do we add the lore based on the config?
if (toolStats.checkConfig(itemStack.getType(), "mob-kills")) {
if (toolStats.configTools.checkConfig(itemStack.getType(), "mob-kills")) {
String mobKillsFormatted = toolStats.numberFormat.formatInt(mobKills);
List<String> newLore = toolStats.itemLore.addItemLore(meta, "{kills}", mobKillsFormatted, "kills.mob");
meta.setLore(newLore);
@@ -349,7 +349,7 @@ public class EntityDamage implements Listener {
container.set(toolStats.swordMobKills, PersistentDataType.INTEGER, mobKills);
// do we add the lore based on the config?
if (toolStats.checkConfig(newTrident.getType(), "mob-kills")) {
if (toolStats.configTools.checkConfig(newTrident.getType(), "mob-kills")) {
String mobKillsFormatted = toolStats.numberFormat.formatInt(mobKills);
List<String> newLore = toolStats.itemLore.addItemLore(meta, "{kills}", mobKillsFormatted, "kills.mob");
meta.setLore(newLore);
@@ -385,7 +385,7 @@ public class EntityDamage implements Listener {
container.set(toolStats.swordPlayerKills, PersistentDataType.INTEGER, playerKills);
// do we add the lore based on the config?
if (toolStats.checkConfig(newTrident.getType(), "player-kills")) {
if (toolStats.configTools.checkConfig(newTrident.getType(), "player-kills")) {
String playerKillsFormatted = toolStats.numberFormat.formatInt(playerKills);
List<String> newLore = toolStats.itemLore.addItemLore(meta, "{kills}", playerKillsFormatted, "kills.player");
meta.setLore(newLore);

View File

@@ -116,7 +116,7 @@ public class GenerateLoot implements Listener {
container.set(toolStats.genericOwner, new UUIDDataType(), owner.getUniqueId());
container.set(toolStats.originType, PersistentDataType.INTEGER, 2);
if (toolStats.checkConfig(newItem.getType(), "looted-tag")) {
if (toolStats.configTools.checkConfig(newItem.getType(), "looted-tag")) {
String formattedDate = toolStats.numberFormat.formatDate(finalDate);
List<String> newLore = toolStats.itemLore.addNewOwner(meta, owner.getName(), formattedDate);
meta.setLore(newLore);

View File

@@ -160,7 +160,7 @@ public class PlayerFish implements Listener {
container.set(toolStats.genericOwner, new UUIDDataType(), owner.getUniqueId());
container.set(toolStats.originType, PersistentDataType.INTEGER, 5);
if (toolStats.checkConfig(newItem.getType(), "fished-tag")) {
if (toolStats.configTools.checkConfig(newItem.getType(), "fished-tag")) {
String formattedDate = toolStats.numberFormat.formatDate(finalDate);
List<String> newLore = toolStats.itemLore.addNewOwner(meta, owner.getName(), formattedDate);
meta.setLore(newLore);

View File

@@ -115,7 +115,7 @@ public class VillagerTrade implements Listener {
container.set(toolStats.genericOwner, new UUIDDataType(), owner.getUniqueId());
container.set(toolStats.originType, PersistentDataType.INTEGER, 3);
if (toolStats.checkConfig(newItem.getType(), "traded-tag")) {
if (toolStats.configTools.checkConfig(newItem.getType(), "traded-tag")) {
String formattedDate = toolStats.numberFormat.formatDate(finalDate);
List<String> newLore = toolStats.itemLore.addNewOwner(meta, owner.getName(), formattedDate);
meta.setLore(newLore);