Skip to content

Commit

Permalink
Add hashCode to DataResource and correct hashCode of PartInstance (#753)
Browse files Browse the repository at this point in the history
  • Loading branch information
SilentChaos512 committed Dec 20, 2024
1 parent 0d90892 commit c28a2d2
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Keybindings not being present in the Controls menu. They can now be reassigned again. [#761]
- Changed `c:ores_in_ground/endstone` tags to `c:ores_in_ground/end_stone` [#760]
- Rework enchantable tags so more items can be enchanted [#754]
- Possible fix for gear items not being extractable from Refined Storage networks [#753]
- Arrows now behave more or less as intended. They now stack and no longer have a damage value. They can no longer be "repaired," you must craft more instead. [#730]

## [1.21.1-4.0.9] - 2024-11-24
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,11 @@ public boolean equals(Object obj) {
return this.getId().equals(other.getId());
}

@Override
public int hashCode() {
return this.getId().hashCode();
}

public static final Codec<DataResource<Material>> MATERIAL_CODEC = ResourceLocation.CODEC.xmap(
DataResource::material,
DataResource::getId
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,6 @@ public boolean equals(Object o) {

@Override
public int hashCode() {
return Objects.hash(part, craftingItem);
return Objects.hash(part, ItemStack.hashItemAndComponents(craftingItem));
}
}

0 comments on commit c28a2d2

Please sign in to comment.