mirror of
https://github.com/BlueMap-Minecraft/BlueMap.git
synced 2024-11-25 12:05:13 +01:00
Fix Key equals()
This commit is contained in:
parent
ffc472ce84
commit
fba273f620
@ -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();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user