mirror of
https://github.com/Auxilor/EcoEnchants.git
synced 2025-01-07 22:27:34 +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.BaseEnchantmentConfig;
|
||||||
import com.willfp.ecoenchants.config.configs.EnchantmentConfig;
|
import com.willfp.ecoenchants.config.configs.EnchantmentConfig;
|
||||||
import com.willfp.ecoenchants.display.EnchantmentCache;
|
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.EnchantmentRarity;
|
||||||
import com.willfp.ecoenchants.enchantments.meta.EnchantmentTarget;
|
import com.willfp.ecoenchants.enchantments.meta.EnchantmentTarget;
|
||||||
import com.willfp.ecoenchants.enchantments.meta.EnchantmentType;
|
import com.willfp.ecoenchants.enchantments.meta.EnchantmentType;
|
||||||
@ -205,7 +206,7 @@ public abstract class EcoEnchant extends Enchantment implements Listener, Watche
|
|||||||
Bukkit.getPluginManager().addPermission(permission);
|
Bukkit.getPluginManager().addPermission(permission);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (type.getRequiredToExtend() != null && !type.getRequiredToExtend().isInstance(this)) {
|
if (type.getRequiredToExtend() != null && !type.getRequiredToExtend().isInstance(this) && !(this instanceof CustomEcoEnchant)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,8 +1,6 @@
|
|||||||
package com.willfp.ecoenchants.sprintartifacts;
|
package com.willfp.ecoenchants.sprintartifacts;
|
||||||
|
|
||||||
import com.willfp.ecoenchants.enchantments.EcoEnchant;
|
|
||||||
import com.willfp.ecoenchants.enchantments.itemtypes.Artifact;
|
import com.willfp.ecoenchants.enchantments.itemtypes.Artifact;
|
||||||
import com.willfp.ecoenchants.enchantments.meta.EnchantmentType;
|
|
||||||
import com.willfp.ecoenchants.enchantments.util.EnchantChecks;
|
import com.willfp.ecoenchants.enchantments.util.EnchantChecks;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.event.EventHandler;
|
import org.bukkit.event.EventHandler;
|
||||||
@ -37,15 +35,14 @@ public class SprintArtifactsListener implements Listener {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Optional<EcoEnchant> matching = bootsMeta.getEnchants().keySet().stream()
|
Optional<Artifact> matching = bootsMeta.getEnchants().keySet().stream()
|
||||||
.filter(enchantment -> enchantment instanceof EcoEnchant)
|
.filter(enchantment -> enchantment instanceof Artifact)
|
||||||
.map(enchant -> (EcoEnchant) enchant)
|
.map(enchant -> (Artifact) enchant)
|
||||||
.filter(enchantment -> enchantment.getType().equals(EnchantmentType.ARTIFACT))
|
|
||||||
.findFirst();
|
.findFirst();
|
||||||
if (matching.isEmpty()) {
|
if (matching.isEmpty()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Artifact artifact = (Artifact) matching.get();
|
Artifact artifact = matching.get();
|
||||||
|
|
||||||
if (!artifact.areRequirementsMet(player)) {
|
if (!artifact.areRequirementsMet(player)) {
|
||||||
return;
|
return;
|
||||||
|
Loading…
Reference in New Issue
Block a user