From 74c0ce96665fee928871839f4495419e1aa44895 Mon Sep 17 00:00:00 2001 From: nulli0n Date: Fri, 16 Jun 2023 15:56:33 +0500 Subject: [PATCH] v3.4.4 Engine API Update --- .../enchantment/impl/tool/EnchantDivineTouch.java | 2 +- .../enchantment/menu/EnchantmentsListMenu.java | 6 ------ .../excellentenchants/enchantment/type/FitItemType.java | 2 +- .../su/nightexpress/excellentenchants/tier/TierManager.java | 5 ----- Core/src/main/resources/plugin.yml | 2 +- 5 files changed, 3 insertions(+), 14 deletions(-) diff --git a/Core/src/main/java/su/nightexpress/excellentenchants/enchantment/impl/tool/EnchantDivineTouch.java b/Core/src/main/java/su/nightexpress/excellentenchants/enchantment/impl/tool/EnchantDivineTouch.java index 06735f6..bbf68e6 100644 --- a/Core/src/main/java/su/nightexpress/excellentenchants/enchantment/impl/tool/EnchantDivineTouch.java +++ b/Core/src/main/java/su/nightexpress/excellentenchants/enchantment/impl/tool/EnchantDivineTouch.java @@ -82,7 +82,7 @@ public class EnchantDivineTouch extends ExcellentEnchant implements Chanced, Blo public ItemStack getSpawner(@NotNull CreatureSpawner spawnerBlock) { ItemStack itemSpawner = new ItemStack(Material.SPAWNER); BlockStateMeta stateItem = (BlockStateMeta) itemSpawner.getItemMeta(); - if (stateItem == null) return itemSpawner; + if (stateItem == null || spawnerBlock.getSpawnedType() == null) return itemSpawner; CreatureSpawner spawnerItem = (CreatureSpawner) stateItem.getBlockState(); spawnerItem.setSpawnedType(spawnerBlock.getSpawnedType()); diff --git a/Core/src/main/java/su/nightexpress/excellentenchants/enchantment/menu/EnchantmentsListMenu.java b/Core/src/main/java/su/nightexpress/excellentenchants/enchantment/menu/EnchantmentsListMenu.java index 82493f1..da3dc15 100644 --- a/Core/src/main/java/su/nightexpress/excellentenchants/enchantment/menu/EnchantmentsListMenu.java +++ b/Core/src/main/java/su/nightexpress/excellentenchants/enchantment/menu/EnchantmentsListMenu.java @@ -78,12 +78,6 @@ public class EnchantmentsListMenu extends ConfigMenu implemen return this.enchantSlots; } - @Override - @NotNull - public Comparator getObjectSorter() { - return (o1, o2) -> 0; - } - @Override @NotNull public List getObjects(@NotNull Player player) { diff --git a/Core/src/main/java/su/nightexpress/excellentenchants/enchantment/type/FitItemType.java b/Core/src/main/java/su/nightexpress/excellentenchants/enchantment/type/FitItemType.java index f964989..ef32ade 100644 --- a/Core/src/main/java/su/nightexpress/excellentenchants/enchantment/type/FitItemType.java +++ b/Core/src/main/java/su/nightexpress/excellentenchants/enchantment/type/FitItemType.java @@ -42,7 +42,7 @@ public enum FitItemType { case LEGGINGS -> ItemUtil.isLeggings(item); case BOOTS -> ItemUtil.isBoots(item); case ELYTRA -> item.getType() == Material.ELYTRA; - case WEAPON -> ItemUtil.isWeapon(item); + case WEAPON -> SWORD.isIncluded(item) || ItemUtil.isTrident(item); case TOOL -> ItemUtil.isTool(item); case ARMOR -> ItemUtil.isArmor(item); case SWORD -> ItemUtil.isSword(item) || (Config.ENCHANTMENTS_ITEM_SWORD_ENCHANTS_TO_AXES.get() && AXE.isIncluded(item)); diff --git a/Core/src/main/java/su/nightexpress/excellentenchants/tier/TierManager.java b/Core/src/main/java/su/nightexpress/excellentenchants/tier/TierManager.java index 94a9630..98d8b23 100644 --- a/Core/src/main/java/su/nightexpress/excellentenchants/tier/TierManager.java +++ b/Core/src/main/java/su/nightexpress/excellentenchants/tier/TierManager.java @@ -28,11 +28,6 @@ public class TierManager extends AbstractManager { @Override protected void onLoad() { - /*if (ExcellentEnchants.isLoaded) { - this.getTiers().forEach(tier -> tier.getEnchants().clear()); - return; - }*/ - this.config = JYML.loadOrExtract(plugin, FILE_NAME); for (String sId : config.getSection("")) { diff --git a/Core/src/main/resources/plugin.yml b/Core/src/main/resources/plugin.yml index d51072f..ae3c11b 100644 --- a/Core/src/main/resources/plugin.yml +++ b/Core/src/main/resources/plugin.yml @@ -4,6 +4,6 @@ name: ExcellentEnchants author: NightExpress desciption: Vanilla-like enchants for your server. depend: [ NexEngine ] -softdepend: [ ProtocolLib, NoCheatPlus, PlaceholderAPI ] +softdepend: [ ProtocolLib, NoCheatPlus, PlaceholderAPI, MythicMobs ] api-version: 1.17 load: STARTUP \ No newline at end of file