mirror of
https://github.com/alexcrea/CustomAnvil.git
synced 2026-06-24 00:26:16 +02:00
EEE item not checked fix (#74)
fix not checking excellent enchant enchantments primary and supported items
This commit is contained in:
commit
6930867e74
1 changed files with 11 additions and 1 deletions
|
|
@ -4,6 +4,7 @@ import org.bukkit.Material;
|
||||||
import org.bukkit.inventory.ItemStack;
|
import org.bukkit.inventory.ItemStack;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
import su.nightexpress.excellentenchants.api.enchantment.CustomEnchantment;
|
import su.nightexpress.excellentenchants.api.enchantment.CustomEnchantment;
|
||||||
|
import su.nightexpress.excellentenchants.api.item.ItemSet;
|
||||||
import su.nightexpress.excellentenchants.api.wrapper.EnchantDefinition;
|
import su.nightexpress.excellentenchants.api.wrapper.EnchantDefinition;
|
||||||
import xyz.alexcrea.cuanvil.enchant.AdditionalTestEnchantment;
|
import xyz.alexcrea.cuanvil.enchant.AdditionalTestEnchantment;
|
||||||
import xyz.alexcrea.cuanvil.enchant.CAEnchantment;
|
import xyz.alexcrea.cuanvil.enchant.CAEnchantment;
|
||||||
|
|
@ -39,7 +40,16 @@ public class CAEEV5Enchantment extends CABukkitEnchantment implements Additional
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isItemConflict(@NotNull Map<CAEnchantment, Integer> enchantments, @NotNull Material itemMat, @NotNull ItemStack item) {
|
public boolean isItemConflict(@NotNull Map<CAEnchantment, Integer> enchantments, @NotNull Material itemMat, @NotNull ItemStack item) {
|
||||||
return false;
|
if (Material.ENCHANTED_BOOK.equals(itemMat)) return false;
|
||||||
|
|
||||||
|
String key = itemMat.getKey().getKey();
|
||||||
|
ItemSet primary = eeenchantment.getPrimaryItems();
|
||||||
|
if (primary.getMaterials().contains(key)) return false;
|
||||||
|
|
||||||
|
ItemSet supported = eeenchantment.getSupportedItems();
|
||||||
|
if (supported.getMaterials().contains(key)) return false;
|
||||||
|
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue