mirror of
https://github.com/alexcrea/CustomAnvil.git
synced 2026-06-23 16:16:17 +02:00
Remove getConflictsWithEverything for legacy Eco Enchant
This commit is contained in:
parent
1e3b193d46
commit
0c223dd411
3 changed files with 15 additions and 23 deletions
|
|
@ -11,10 +11,6 @@ import java.util.Set;
|
|||
*/
|
||||
public class EcoEnchant {
|
||||
|
||||
public boolean getConflictsWithEverything() {
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean conflictsWith(@NotNull Enchantment enchant) {
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -22,19 +22,19 @@ public class CAEcoEnchant extends CABukkitEnchantment implements AdditionalTestE
|
|||
|
||||
@Override
|
||||
public boolean isEnchantConflict(@NotNull Map<CAEnchantment, Integer> enchantments, @NotNull Material itemMat) {
|
||||
if(!enchantments.isEmpty()) {
|
||||
if (this.ecoEnchant.getConflictsWithEverything()) {
|
||||
if(enchantments.isEmpty()) return false;
|
||||
|
||||
if (this.ecoEnchant.getConflictsWithEverything()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
for (CAEnchantment other : enchantments.keySet()) {
|
||||
if(other instanceof CABukkitEnchantment otherVanilla
|
||||
&& this.ecoEnchant.conflictsWith(otherVanilla.getEnchant())){
|
||||
return true;
|
||||
}
|
||||
|
||||
for (CAEnchantment other : enchantments.keySet()) {
|
||||
if(other instanceof CABukkitEnchantment otherVanilla
|
||||
&& this.ecoEnchant.conflictsWith(otherVanilla.getEnchant())){
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -23,16 +23,12 @@ 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
|
||||
&& this.ecoEnchant.conflictsWith(otherVanilla.getEnchant())) {
|
||||
return true;
|
||||
}
|
||||
for (CAEnchantment other : enchantments.keySet()) {
|
||||
if (other instanceof CABukkitEnchantment otherVanilla
|
||||
&& this.ecoEnchant.conflictsWith(otherVanilla.getEnchant())) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue