Skip to content

Commit

Permalink
Include missing equality fields
Browse files Browse the repository at this point in the history
  • Loading branch information
oh-noey committed Aug 26, 2024
1 parent ee4906f commit 3d51c2e
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import net.countercraft.movecraft.util.Pair;
import org.bukkit.Material;
import org.jetbrains.annotations.Contract;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

Expand Down Expand Up @@ -36,6 +37,8 @@ public RequiredBlockEntry(@NotNull EnumSet<Material> materials, @NotNull Pair<Bo
hash = Objects.hash(
this.materials,
this.min,
this.max,
this.min,
this.numericMin,
this.numericMax,
this.name);
Expand Down Expand Up @@ -188,10 +191,11 @@ public int hashCode() {
return hash;
}

@Contract(value = "null -> false", pure = true)
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (!(o instanceof RequiredBlockEntry that)) return false;
return numericMax == that.numericMax && numericMin == that.numericMin && Objects.equals(materials, that.materials) && Objects.equals(name, that.name);
return max == that.max && min == that.min && numericMax == that.numericMax && numericMin == that.numericMin && Objects.equals(materials, that.materials) && Objects.equals(name, that.name);
}
}

0 comments on commit 3d51c2e

Please sign in to comment.