add equals
and hashCode
to ComplexMaterialEntry
This commit is contained in:
parent
37348ccb0e
commit
0e2f876cd4
1 changed files with 17 additions and 0 deletions
|
@ -1,8 +1,12 @@
|
||||||
package ru.bclib.complexmaterials.entry;
|
package ru.bclib.complexmaterials.entry;
|
||||||
|
|
||||||
import net.minecraft.resources.ResourceLocation;
|
import net.minecraft.resources.ResourceLocation;
|
||||||
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
public abstract class ComplexMaterialEntry {
|
public abstract class ComplexMaterialEntry {
|
||||||
|
@NotNull
|
||||||
private final String suffix;
|
private final String suffix;
|
||||||
|
|
||||||
protected ComplexMaterialEntry(String suffix) {
|
protected ComplexMaterialEntry(String suffix) {
|
||||||
|
@ -20,4 +24,17 @@ public abstract class ComplexMaterialEntry {
|
||||||
public String getSuffix() {
|
public String getSuffix() {
|
||||||
return suffix;
|
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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue