diff --git a/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/EcoEnchant.java b/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/EcoEnchant.java index 7a114703..5c00d17f 100644 --- a/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/EcoEnchant.java +++ b/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/EcoEnchant.java @@ -8,6 +8,7 @@ import com.willfp.ecoenchants.EcoEnchantsPlugin; import com.willfp.ecoenchants.config.configs.BaseEnchantmentConfig; import com.willfp.ecoenchants.config.configs.EnchantmentConfig; import com.willfp.ecoenchants.display.EnchantmentCache; +import com.willfp.ecoenchants.enchantments.custom.CustomEcoEnchant; import com.willfp.ecoenchants.enchantments.meta.EnchantmentRarity; import com.willfp.ecoenchants.enchantments.meta.EnchantmentTarget; import com.willfp.ecoenchants.enchantments.meta.EnchantmentType; @@ -205,7 +206,7 @@ public abstract class EcoEnchant extends Enchantment implements Listener, Watche Bukkit.getPluginManager().addPermission(permission); } - if (type.getRequiredToExtend() != null && !type.getRequiredToExtend().isInstance(this)) { + if (type.getRequiredToExtend() != null && !type.getRequiredToExtend().isInstance(this) && !(this instanceof CustomEcoEnchant)) { return; } diff --git a/eco-extensions/sprint-artifacts/src/main/java/com/willfp/ecoenchants/sprintartifacts/SprintArtifactsListener.java b/eco-extensions/sprint-artifacts/src/main/java/com/willfp/ecoenchants/sprintartifacts/SprintArtifactsListener.java index d9e0877d..13e9275d 100644 --- a/eco-extensions/sprint-artifacts/src/main/java/com/willfp/ecoenchants/sprintartifacts/SprintArtifactsListener.java +++ b/eco-extensions/sprint-artifacts/src/main/java/com/willfp/ecoenchants/sprintartifacts/SprintArtifactsListener.java @@ -1,8 +1,6 @@ package com.willfp.ecoenchants.sprintartifacts; -import com.willfp.ecoenchants.enchantments.EcoEnchant; import com.willfp.ecoenchants.enchantments.itemtypes.Artifact; -import com.willfp.ecoenchants.enchantments.meta.EnchantmentType; import com.willfp.ecoenchants.enchantments.util.EnchantChecks; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; @@ -37,15 +35,14 @@ public class SprintArtifactsListener implements Listener { return; } - Optional matching = bootsMeta.getEnchants().keySet().stream() - .filter(enchantment -> enchantment instanceof EcoEnchant) - .map(enchant -> (EcoEnchant) enchant) - .filter(enchantment -> enchantment.getType().equals(EnchantmentType.ARTIFACT)) + Optional matching = bootsMeta.getEnchants().keySet().stream() + .filter(enchantment -> enchantment instanceof Artifact) + .map(enchant -> (Artifact) enchant) .findFirst(); if (matching.isEmpty()) { return; } - Artifact artifact = (Artifact) matching.get(); + Artifact artifact = matching.get(); if (!artifact.areRequirementsMet(player)) { return;