Skip to content

Commit

Permalink
Fix ItemData#equals check (#6888)
Browse files Browse the repository at this point in the history
  • Loading branch information
APickledWalrus committed Jul 12, 2024
1 parent ee8d8c8 commit accb30d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/java/ch/njol/skript/aliases/ItemData.java
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ public boolean equals(final @Nullable Object obj) {
return false;

ItemData other = (ItemData) obj;
if (isAlias) { // This is alias, other item might not be
if (isAlias()) { // This is alias, other item might not be
return other.matchAlias(this).isAtLeast(MatchQuality.SAME_ITEM);
} else { // This is not alias, but other might be
return matchAlias(other).isAtLeast(MatchQuality.SAME_ITEM);
Expand Down
12 changes: 12 additions & 0 deletions src/test/skript/tests/syntaxes/effects/EffEquip.sk
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
test "equip effect":
spawn a zombie at spawn of "world":
set {_entity} to event-entity

equip {_entity} with a diamond chestplate
assert chestplate of {_entity} is a diamond chestplate with "entity was not wearing a diamond chestplate"
set chestplate of {_entity} to air

equip {_entity} with a diamond chestplate named "Test"
assert chestplate of {_entity} is a diamond chestplate named "Test" with "entity was not wearing a named diamond chestplate"

delete the entity within {_entity}

0 comments on commit accb30d

Please sign in to comment.