mirror of
https://github.com/alexcrea/CustomAnvil.git
synced 2026-06-23 16:16:17 +02:00
fix inverted equal logic
This commit is contained in:
parent
ee5c31ad40
commit
b67d956e39
2 changed files with 4 additions and 3 deletions
|
|
@ -76,7 +76,7 @@ public class CAEnchantmentRegistry {
|
|||
*/
|
||||
public boolean register(@NotNull CAEnchantment enchantment) {
|
||||
if (byKeyMap.containsKey(enchantment.getKey())) {
|
||||
if (!enchantment.equals(byKeyMap.get(enchantment.getKey()))) {
|
||||
if (Objects.equals(enchantment, byKeyMap.get(enchantment.getKey()))) {
|
||||
// We are trying to register the exact same enchantment. so we just skip it.
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,6 +18,7 @@ import java.lang.reflect.Method;
|
|||
import java.util.HashMap;
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.logging.Level;
|
||||
|
||||
/**
|
||||
|
|
@ -163,7 +164,7 @@ public class CABukkitEnchantment extends CAEnchantmentBase {
|
|||
return false;
|
||||
}
|
||||
|
||||
return this.bukkit.equals(other.getEnchant());
|
||||
return Objects.equals(this.bukkit, other.getEnchant());
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue