From 4e14bf5a15a25004eeb5befa208d1a8aaeece44c Mon Sep 17 00:00:00 2001 From: APickledWalrus Date: Wed, 10 Jul 2024 15:31:08 -0400 Subject: [PATCH 1/2] Use proper isAlias check in ItemData#equals --- src/main/java/ch/njol/skript/aliases/ItemData.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/ch/njol/skript/aliases/ItemData.java b/src/main/java/ch/njol/skript/aliases/ItemData.java index 0f68279f43a..f18812aabb8 100644 --- a/src/main/java/ch/njol/skript/aliases/ItemData.java +++ b/src/main/java/ch/njol/skript/aliases/ItemData.java @@ -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); From ca4d61e20628a4f8ee284b7fde2543ba76aa129e Mon Sep 17 00:00:00 2001 From: APickledWalrus Date: Fri, 12 Jul 2024 14:08:26 -0400 Subject: [PATCH 2/2] Add a simple EffEquip test --- src/test/skript/tests/syntaxes/effects/EffEquip.sk | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 src/test/skript/tests/syntaxes/effects/EffEquip.sk diff --git a/src/test/skript/tests/syntaxes/effects/EffEquip.sk b/src/test/skript/tests/syntaxes/effects/EffEquip.sk new file mode 100644 index 00000000000..a4a88a94f28 --- /dev/null +++ b/src/test/skript/tests/syntaxes/effects/EffEquip.sk @@ -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}