From 925c2d60907bf11f5dad397a7b546d2f5eb2ebd3 Mon Sep 17 00:00:00 2001 From: Articdive <13535885+Articdive@users.noreply.github.com> Date: Wed, 16 Jun 2021 09:53:01 +0200 Subject: [PATCH] NamespaceID should be compatible with other Key Implementations. --- src/main/java/net/minestom/server/utils/NamespaceID.java | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/main/java/net/minestom/server/utils/NamespaceID.java b/src/main/java/net/minestom/server/utils/NamespaceID.java index 8cad56e8f..a1d3a21d8 100644 --- a/src/main/java/net/minestom/server/utils/NamespaceID.java +++ b/src/main/java/net/minestom/server/utils/NamespaceID.java @@ -103,11 +103,10 @@ public class NamespaceID implements CharSequence, Key { @Override public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; - NamespaceID that = (NamespaceID) o; - return Objects.equals(domain, that.domain) && - Objects.equals(path, that.path); + if(this == o) return true; + if(!(o instanceof Key)) return false; + final Key that = (Key) o; + return Objects.equals(this.domain, that.namespace()) && Objects.equals(this.path, that.value()); } @Override