fix eco enchant conflict with everything

This commit is contained in:
alexcrea 2026-02-10 12:14:35 +01:00
parent 8e3f190bb3
commit 9ed43f3def
Signed by: alexcrea
GPG key ID: E346CD16413450E3

View file

@ -26,6 +26,10 @@ public class CAEcoEnchant extends CABukkitEnchantment implements AdditionalTestE
public boolean isEnchantConflict(@NotNull Map<CAEnchantment, Integer> enchantments, @NotNull Material itemMat) { public boolean isEnchantConflict(@NotNull Map<CAEnchantment, Integer> enchantments, @NotNull Material itemMat) {
if (enchantments.isEmpty()) return false; if (enchantments.isEmpty()) return false;
// Check if there is only self
if (enchantments.size() == 1 && this.equals(enchantments.keySet().stream().findFirst().get()))
return false;
if (this.ecoEnchant.getConflictsWithEverything()) { if (this.ecoEnchant.getConflictsWithEverything()) {
return true; return true;
} }