mirror of
https://github.com/Auxilor/EcoEnchants.git
synced 2025-01-06 22:17:40 +01:00
Fixed artifact/spell required to extend bug
This commit is contained in:
parent
cc96b9d6ba
commit
b861ab40c0
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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<EcoEnchant> matching = bootsMeta.getEnchants().keySet().stream()
|
||||
.filter(enchantment -> enchantment instanceof EcoEnchant)
|
||||
.map(enchant -> (EcoEnchant) enchant)
|
||||
.filter(enchantment -> enchantment.getType().equals(EnchantmentType.ARTIFACT))
|
||||
Optional<Artifact> 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;
|
||||
|
Loading…
Reference in New Issue
Block a user