Adds optional ability to reforge anvils #15
All checks were successful
EpicKnarvik97/Blacksmith/pipeline/head This commit looks good

This commit is contained in:
2023-01-09 23:47:17 +01:00
parent a856aa03e0
commit 753c7c6275
10 changed files with 95 additions and 14 deletions

View File

@ -91,6 +91,7 @@ public class EconomyManager {
private static double getCost(ItemStack item) {
GlobalSettings globalSettings = BlacksmithPlugin.getInstance().getSettings();
Material material = item.getType();
//Calculate the base price
double price = globalSettings.getBasePrice(material);
@ -106,6 +107,11 @@ public class EconomyManager {
//Increase price for any enchantments
price += getEnchantmentCost(item);
//Override the cost for anvils
if (ItemHelper.isAnvil(material, true)) {
price = globalSettings.getAnvilCost(material);
}
return price;
}