Remove getConflictsWithEverything for legacy Eco Enchant

This commit is contained in:
alexcrea 2024-12-21 21:14:37 +01:00
parent 1e3b193d46
commit 0c223dd411
No known key found for this signature in database
GPG key ID: 43FD265DB0DBF91F
3 changed files with 15 additions and 23 deletions

View file

@ -11,10 +11,6 @@ import java.util.Set;
*/
public class EcoEnchant {
public boolean getConflictsWithEverything() {
return false;
}
public boolean conflictsWith(@NotNull Enchantment enchant) {
return false;
}

View file

@ -22,7 +22,8 @@ public class CAEcoEnchant extends CABukkitEnchantment implements AdditionalTestE
@Override
public boolean isEnchantConflict(@NotNull Map<CAEnchantment, Integer> enchantments, @NotNull Material itemMat) {
if(!enchantments.isEmpty()) {
if(enchantments.isEmpty()) return false;
if (this.ecoEnchant.getConflictsWithEverything()) {
return true;
}
@ -34,7 +35,6 @@ public class CAEcoEnchant extends CABukkitEnchantment implements AdditionalTestE
}
}
}
return false;
}

View file

@ -23,10 +23,7 @@ public class CALegacyEcoEnchant extends CABukkitEnchantment implements Additiona
@Override
public boolean isEnchantConflict(@NotNull Map<CAEnchantment, Integer> enchantments, @NotNull Material itemMat) {
if (!enchantments.isEmpty()) {
if (this.ecoEnchant.getConflictsWithEverything()) {
return true;
}
if (enchantments.isEmpty()) return false;
for (CAEnchantment other : enchantments.keySet()) {
if (other instanceof CABukkitEnchantment otherVanilla
@ -34,7 +31,6 @@ public class CALegacyEcoEnchant extends CABukkitEnchantment implements Additiona
return true;
}
}
}
return false;
}