From fba273f62091edda9e98b88abe900381a9ea61c7 Mon Sep 17 00:00:00 2001 From: "Lukas Rieger (Blue)" Date: Mon, 1 Aug 2022 11:12:50 +0200 Subject: [PATCH] Fix Key equals() --- .../main/java/de/bluecolored/bluemap/core/util/Key.java | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/util/Key.java b/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/util/Key.java index 797b3027..6704ebfc 100644 --- a/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/util/Key.java +++ b/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/util/Key.java @@ -1,7 +1,6 @@ package de.bluecolored.bluemap.core.util; import de.bluecolored.bluemap.api.debug.DebugDump; -import de.bluecolored.bluemap.core.resources.ResourcePath; @DebugDump public class Key { @@ -14,15 +13,15 @@ public class Key { public Key(String formatted) { String namespace = MINECRAFT_NAMESPACE; - String path = formatted; + String value = formatted; int namespaceSeparator = formatted.indexOf(':'); if (namespaceSeparator > 0) { namespace = formatted.substring(0, namespaceSeparator); - path = formatted.substring(namespaceSeparator + 1); + value = formatted.substring(namespaceSeparator + 1); } this.namespace = namespace.intern(); - this.value = path.intern(); + this.value = value.intern(); this.formatted = (this.namespace + ":" + this.value).intern(); } @@ -49,7 +48,7 @@ public String getFormatted() { public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; - ResourcePath that = (ResourcePath) o; + Key that = (Key) o; return getFormatted() == that.getFormatted(); }