diff --git a/.idea/workspace.xml b/.idea/workspace.xml index caa4bbc..352103b 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -4,11 +4,11 @@ - @@ -522,6 +521,7 @@ - \ No newline at end of file diff --git a/pom.xml b/pom.xml index 7497f15..97c26db 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ cn.superiormc UltimateShop - 2.7.0 + 2.7.1 jar UltimateShop diff --git a/src/main/java/cn/superiormc/ultimateshop/methods/Items/BuildItem.java b/src/main/java/cn/superiormc/ultimateshop/methods/Items/BuildItem.java index 16ed3c9..0f5fe7b 100644 --- a/src/main/java/cn/superiormc/ultimateshop/methods/Items/BuildItem.java +++ b/src/main/java/cn/superiormc/ultimateshop/methods/Items/BuildItem.java @@ -1,5 +1,7 @@ package cn.superiormc.ultimateshop.methods.Items; +import cn.superiormc.mythicchanger.manager.ChangesManager; +import cn.superiormc.mythicchanger.objects.ObjectAction; import cn.superiormc.ultimateshop.UltimateShop; import cn.superiormc.ultimateshop.hooks.ItemsHook; import cn.superiormc.ultimateshop.managers.ConfigManager; @@ -801,14 +803,17 @@ public static ItemStack editItemStack(ItemStack item, // Plugin Enchantments ConfigurationSection pluginEnchantsKey = section.getConfigurationSection("plugin-enchants"); - if (!UltimateShop.freeVersion && pluginEnchantsKey != null) { - if (CommonUtil.checkPluginLoad("AdvancedEnchantments")) { - for (String enchantName : pluginEnchantsKey.getKeys(false)) { - item = AEAPI.applyEnchant(enchantName, pluginEnchantsKey.getInt(enchantName), item); - } + if (!UltimateShop.freeVersion && pluginEnchantsKey != null && CommonUtil.checkPluginLoad("AdvancedEnchantments")) { + for (String enchantName : pluginEnchantsKey.getKeys(false)) { + item = AEAPI.applyEnchant(enchantName, pluginEnchantsKey.getInt(enchantName), item); } } + // MythicChanger Changes + ConfigurationSection changeSection = section.getConfigurationSection("change-item"); + if (changeSection != null && CommonUtil.checkPluginLoad("MythicChanger")) { + ChangesManager.changesManager.setRealChange(new ObjectAction(), changeSection, item.clone(), item, player); + } return item; } } diff --git a/src/main/java/cn/superiormc/ultimateshop/objects/items/prices/ObjectSinglePrice.java b/src/main/java/cn/superiormc/ultimateshop/objects/items/prices/ObjectSinglePrice.java index ac8a54e..c510179 100644 --- a/src/main/java/cn/superiormc/ultimateshop/objects/items/prices/ObjectSinglePrice.java +++ b/src/main/java/cn/superiormc/ultimateshop/objects/items/prices/ObjectSinglePrice.java @@ -197,7 +197,7 @@ public String getDisplayName(int multi, BigDecimal amount, boolean alwaysStatic) } else { tempVal2 = singleSection.getString("placeholder", tempVal1); } - if (!alwaysStatic && !tempVal2.contains("{status}") && !isStatic && !UltimateShop.freeVersion && + if (!alwaysStatic && !tempVal2.contains("{status}") && !isStatic && baseAmount != null && !UltimateShop.freeVersion && ConfigManager.configManager.getBoolean("placeholder.auto-settings.add-status-in-dynamic-price-placeholder.enabled")) { tempVal2 = tempVal2 + " " + StaticPlaceholder.getCompareValue(baseAmount.multiply(new BigDecimal(multi)), amount); } @@ -208,7 +208,7 @@ public String getDisplayName(int multi, BigDecimal amount, boolean alwaysStatic) "amount", String.valueOf(amount), "status", - alwaysStatic ? "" : StaticPlaceholder.getCompareValue(baseAmount.multiply(new BigDecimal(multi)), amount)); + alwaysStatic || baseAmount == null ? "" : StaticPlaceholder.getCompareValue(baseAmount.multiply(new BigDecimal(multi)), amount)); } public int getStartApply() {