diff --git a/eco-core/core-plugin/src/main/java/com/willfp/ecoarmor/upgrades/Tier.java b/eco-core/core-plugin/src/main/java/com/willfp/ecoarmor/upgrades/Tier.java index b75a3f7..aaa3cd5 100644 --- a/eco-core/core-plugin/src/main/java/com/willfp/ecoarmor/upgrades/Tier.java +++ b/eco-core/core-plugin/src/main/java/com/willfp/ecoarmor/upgrades/Tier.java @@ -57,7 +57,7 @@ public class Tier extends PluginDependent { * If the crafting recipe is enabled. */ @Getter - private boolean enabled; + private boolean craftable; /** * The ItemStack of the crystal. @@ -96,7 +96,7 @@ public class Tier extends PluginDependent { * Update the tracker's crafting recipe. */ public void update() { - this.enabled = this.getConfig().getBool("crystalCraftable"); + this.craftable = this.getConfig().getBool("crystal.craftable"); this.displayName = this.getConfig().getString("display"); this.requiredTiersForApplication = this.getConfig().getStrings("requiresTiers"); NamespacedKey key = this.getPlugin().getNamespacedKeyFactory().create("upgrade_crystal"); @@ -107,10 +107,10 @@ public class Tier extends PluginDependent { PersistentDataContainer container = outMeta.getPersistentDataContainer(); container.set(key, PersistentDataType.STRING, name); - outMeta.setDisplayName(this.getConfig().getString("crystalName")); + outMeta.setDisplayName(this.getConfig().getString("crystal.name")); List lore = new ArrayList<>(); - for (String loreLine : this.getConfig().getStrings("crystalLore")) { + for (String loreLine : this.getConfig().getStrings("crystal.lore")) { lore.add(Display.PREFIX + StringUtils.translate(loreLine)); } outMeta.setLore(lore); @@ -131,13 +131,13 @@ public class Tier extends PluginDependent { )); } - if (this.isEnabled()) { + if (this.isCraftable()) { ItemStack recipeOut = out.clone(); - recipeOut.setAmount(this.getConfig().getInt("recipeGiveAmount")); + recipeOut.setAmount(this.getConfig().getInt("crystal.giveAmount")); ShapedCraftingRecipe.Builder builder = ShapedCraftingRecipe.builder(this.getPlugin(), "upgrade_crystal_" + name) .setOutput(recipeOut); - List recipeStrings = this.getConfig().getStrings("crystalRecipe"); + List recipeStrings = this.getConfig().getStrings("crystal.recipe"); new CustomItem(this.getPlugin().getNamespacedKeyFactory().create("upgrade_crystal_" + name), test -> { if (test == null) { diff --git a/eco-core/core-plugin/src/main/resources/ecoarmor.json b/eco-core/core-plugin/src/main/resources/ecoarmor.json index 42cdb55..8fac11b 100644 --- a/eco-core/core-plugin/src/main/resources/ecoarmor.json +++ b/eco-core/core-plugin/src/main/resources/ecoarmor.json @@ -4,25 +4,27 @@ "name": "default", "display": "&8&lDEFAULT", "requiresTiers": [], - "crystalCraftable": false, - "crystalName": "&8Default Upgrade Crystal", - "crystalRecipe": [ - "air", - "leather", - "air", - "leather", - "leather_chestplate", - "leather", - "air", - "leather", - "air" - ], - "recipeGiveAmount": 1, - "crystalLore": [ - "&8Drop this onto an armor piece", - "&8to set its tier to:", - "&8&lDEFAULT" - ], + "crystal": { + "craftable": false, + "name": "&8Default Upgrade Crystal", + "recipe": [ + "air", + "leather", + "air", + "leather", + "leather_chestplate", + "leather", + "air", + "leather", + "air" + ], + "giveAmount": 1, + "lore": [ + "&8Drop this onto an armor piece", + "&8to set its tier to:", + "&8&lDEFAULT" + ] + }, "properties": { "helmet": { "armor": 1, @@ -77,27 +79,29 @@ "requiresTiers": [ "default" ], - "crystalCraftable": true, - "crystalName": "&7Iron Upgrade Crystal", - "crystalRecipe": [ - "air", - "iron_block", - "air", - "iron_block", - "leather_chestplate", - "iron_block", - "air", - "iron_block", - "air" - ], - "recipeGiveAmount": 1, - "crystalLore": [ - "&8Drop this onto an armor piece", - "&8to set its tier to:", - "&7&lIRON", - "", - "&8&oRequires the armor to already have default tier" - ], + "crystal": { + "craftable": true, + "name": "&7Iron Upgrade Crystal", + "recipe": [ + "air", + "iron_block", + "air", + "iron_block", + "leather_chestplate", + "iron_block", + "air", + "iron_block", + "air" + ], + "giveAmount": 1, + "lore": [ + "&8Drop this onto an armor piece", + "&8to set its tier to:", + "&7&lIRON", + "", + "&8&oRequires the armor to already have default tier" + ] + }, "properties": { "helmet": { "armor": 2, @@ -152,27 +156,29 @@ "requiresTiers": [ "iron" ], - "crystalCraftable": true, - "crystalName": "&bDiamond Upgrade Crystal", - "crystalRecipe": [ - "air", - "diamond_block", - "air", - "diamond_block", - "ecoarmor:upgrade_crystal_iron", - "diamond_block", - "air", - "diamond_block", - "air" - ], - "recipeGiveAmount": 1, - "crystalLore": [ - "&8Drop this onto an armor piece", - "&8to set its tier to:", - "&b&lDIAMOND", - "", - "&8&oRequires the armor to already have Iron tier" - ], + "crystal": { + "craftable": true, + "name": "&bDiamond Upgrade Crystal", + "recipe": [ + "air", + "diamond_block", + "air", + "diamond_block", + "ecoarmor:upgrade_crystal_iron", + "diamond_block", + "air", + "diamond_block", + "air" + ], + "giveAmount": 1, + "lore": [ + "&8Drop this onto an armor piece", + "&8to set its tier to:", + "&b&lDIAMOND", + "", + "&8&oRequires the armor to already have Iron tier" + ] + }, "properties": { "helmet": { "armor": 3, @@ -227,27 +233,29 @@ "requiresTiers": [ "diamond" ], - "crystalCraftable": true, - "crystalName": "&cNetherite Upgrade Crystal", - "crystalRecipe": [ - "air", - "netherite_ingot", - "air", - "netherite_ingot", - "ecoarmor:upgrade_crystal_diamond", - "netherite_ingot", - "air", - "netherite_ingot", - "air" - ], - "recipeGiveAmount": 1, - "crystalLore": [ - "&8Drop this onto an armor piece", - "&8to set its tier to:", - "&c&lNETHERITE", - "", - "&8&oRequires the armor to already have Diamond tier" - ], + "crystal": { + "craftable": true, + "name": "&cNetherite Upgrade Crystal", + "recipe": [ + "air", + "netherite_ingot", + "air", + "netherite_ingot", + "ecoarmor:upgrade_crystal_diamond", + "netherite_ingot", + "air", + "netherite_ingot", + "air" + ], + "giveAmount": 1, + "lore": [ + "&8Drop this onto an armor piece", + "&8to set its tier to:", + "&c&lNETHERITE", + "", + "&8&oRequires the armor to already have Diamond tier" + ] + }, "properties": { "helmet": { "armor": 3, @@ -303,27 +311,29 @@ "requiresTiers": [ "netherite" ], - "crystalCraftable": true, - "crystalName": "Manyullyn Upgrade Crystal", - "crystalRecipe": [ - "ecoarmor:upgrade_crystal_netherite", - "enchanted_golden_apple", - "ecoarmor:upgrade_crystal_netherite", - "enchanted_golden_apple", - "ecoarmor:upgrade_crystal_netherite", - "enchanted_golden_apple", - "ecoarmor:upgrade_crystal_netherite", - "enchanted_golden_apple", - "ecoarmor:upgrade_crystal_netherite" - ], - "recipeGiveAmount": 1, - "crystalLore": [ - "&8Drop this onto an armor piece", - "&8to set its tier to:", - "&d&k!!&r &lMANYULLYN&r &d&k!!&r", - "", - "&8&oRequires the armor to already have Netherite tier" - ], + "crystal": { + "craftable": true, + "name": "Manyullyn Upgrade Crystal", + "recipe": [ + "ecoarmor:upgrade_crystal_netherite", + "enchanted_golden_apple", + "ecoarmor:upgrade_crystal_netherite", + "enchanted_golden_apple", + "ecoarmor:upgrade_crystal_netherite", + "enchanted_golden_apple", + "ecoarmor:upgrade_crystal_netherite", + "enchanted_golden_apple", + "ecoarmor:upgrade_crystal_netherite" + ], + "giveAmount": 1, + "lore": [ + "&8Drop this onto an armor piece", + "&8to set its tier to:", + "&d&k!!&r &lMANYULLYN&r &d&k!!&r", + "", + "&8&oRequires the armor to already have Netherite tier" + ] + }, "properties": { "helmet": { "armor": 3, @@ -378,27 +388,29 @@ "requiresTiers": [ "iron" ], - "crystalCraftable": true, - "crystalName": "/abCobalt Upgrade Crystal", - "crystalRecipe": [ - "air", - "obsidian", - "air", - "obsidian", - "ecoarmor:upgrade_crystal_iron", - "obsidian", - "air", - "obsidian", - "air" - ], - "recipeGiveAmount": 1, - "crystalLore": [ - "&8Drop this onto an armor piece", - "&8to set its tier to:", - "/ab&lCOBALT", - "", - "&8&oRequires the armor to already have Iron tier" - ], + "crystal": { + "craftable": true, + "name": "/abCobalt Upgrade Crystal", + "recipe": [ + "air", + "obsidian", + "air", + "obsidian", + "ecoarmor:upgrade_crystal_iron", + "obsidian", + "air", + "obsidian", + "air" + ], + "giveAmount": 1, + "lore": [ + "&8Drop this onto an armor piece", + "&8to set its tier to:", + "/ab&lCOBALT", + "", + "&8&oRequires the armor to already have Iron tier" + ] + }, "properties": { "helmet": { "armor": 3, @@ -453,27 +465,29 @@ "requiresTiers": [ "cobalt" ], - "crystalCraftable": true, - "crystalName": "Osmium upgrade crystal", - "crystalRecipe": [ - "air", - "netherite_block", - "air", - "netherite_block", - "ecoarmor:upgrade_crystal_cobalt", - "netherite_block", - "air", - "netherite_block", - "air" - ], - "recipeGiveAmount": 1, - "crystalLore": [ - "&8Drop this onto an armor piece", - "&8to set its tier to:", - "&b&k!!&r &lOSMIUM&r &b&k!!", - "", - "&8&oRequires the armor to already have Cobalt tier" - ], + "crystal": { + "craftable": true, + "name": "Osmium upgrade crystal", + "recipe": [ + "air", + "netherite_block", + "air", + "netherite_block", + "ecoarmor:upgrade_crystal_cobalt", + "netherite_block", + "air", + "netherite_block", + "air" + ], + "giveAmount": 1, + "lore": [ + "&8Drop this onto an armor piece", + "&8to set its tier to:", + "&b&k!!&r &lOSMIUM&r &b&k!!", + "", + "&8&oRequires the armor to already have Cobalt tier" + ] + }, "properties": { "helmet": { "armor": 3, @@ -528,27 +542,29 @@ "requiresTiers": [ "netherite" ], - "crystalCraftable": true, - "crystalName": "Exotic Upgrade Crystal", - "crystalRecipe": [ - "ecoarmor:upgrade_crystal_netherite", - "turtle_egg", - "ecoarmor:upgrade_crystal_netherite", - "turtle_egg", - "ecoarmor:upgrade_crystal_cobalt", - "turtle_egg", - "ecoarmor:upgrade_crystal_netherite", - "turtle_egg", - "ecoarmor:upgrade_crystal_netherite" - ], - "recipeGiveAmount": 1, - "crystalLore": [ - "&8Drop this onto an armor piece", - "&8to set its tier to:", - "&6&k!!&r &lEXOTIC&r &6&k!!&r", - "", - "&8&oRequires the armor to already have Netherite tier" - ], + "crystal": { + "craftable": true, + "name": "Exotic Upgrade Crystal", + "recipe": [ + "ecoarmor:upgrade_crystal_netherite", + "turtle_egg", + "ecoarmor:upgrade_crystal_netherite", + "turtle_egg", + "ecoarmor:upgrade_crystal_cobalt", + "turtle_egg", + "ecoarmor:upgrade_crystal_netherite", + "turtle_egg", + "ecoarmor:upgrade_crystal_netherite" + ], + "giveAmount": 1, + "lore": [ + "&8Drop this onto an armor piece", + "&8to set its tier to:", + "&6&k!!&r &lEXOTIC&r &6&k!!&r", + "", + "&8&oRequires the armor to already have Netherite tier" + ] + }, "properties": { "helmet": { "armor": 3,