mirror of
https://github.com/PaperMC/Paper.git
synced 2025-07-31 12:12:08 -07:00
@@ -1,5 +1,6 @@
|
||||
package org.bukkit.craftbukkit.tag;
|
||||
|
||||
import java.util.Objects;
|
||||
import net.minecraft.core.HolderSet;
|
||||
import net.minecraft.core.IRegistry;
|
||||
import net.minecraft.tags.TagKey;
|
||||
@@ -29,4 +30,30 @@ public abstract class CraftTag<N, B extends Keyed> implements Tag<B> {
|
||||
public NamespacedKey getKey() {
|
||||
return CraftNamespacedKey.fromMinecraft(tag.location());
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
int hash = 3;
|
||||
hash = 59 * hash + Objects.hashCode(this.registry);
|
||||
hash = 59 * hash + Objects.hashCode(this.tag);
|
||||
return hash;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (obj == this) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!(obj instanceof CraftTag<?, ?> other)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return Objects.equals(this.registry, other.registry) && Objects.equals(this.tag, other.tag);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "CraftTag{" + this.tag + '}';
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user