add equals and hashCode to ComplexMaterialEntry

This commit is contained in:
Frank Bauer 2021-07-30 14:52:33 +02:00
parent 37348ccb0e
commit 0e2f876cd4

View file

@ -1,8 +1,12 @@
package ru.bclib.complexmaterials.entry;
import net.minecraft.resources.ResourceLocation;
import org.jetbrains.annotations.NotNull;
import java.util.Objects;
public abstract class ComplexMaterialEntry {
@NotNull
private final String suffix;
protected ComplexMaterialEntry(String suffix) {
@ -20,4 +24,17 @@ public abstract class ComplexMaterialEntry {
public String getSuffix() {
return suffix;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
ComplexMaterialEntry that = (ComplexMaterialEntry) o;
return suffix.equals(that.suffix);
}
@Override
public int hashCode() {
return Objects.hash(suffix);
}
}