diff --git a/skript-aliases b/skript-aliases index 809c9e1ad95..97212b5b809 160000 --- a/skript-aliases +++ b/skript-aliases @@ -1 +1 @@ -Subproject commit 809c9e1ad95f26f9d62327f8447301a9e7db5379 +Subproject commit 97212b5b809147e16eef5c5a80dd55324662d572 diff --git a/src/main/java/ch/njol/skript/Skript.java b/src/main/java/ch/njol/skript/Skript.java index 5aaf2483c6e..9906c2461ee 100644 --- a/src/main/java/ch/njol/skript/Skript.java +++ b/src/main/java/ch/njol/skript/Skript.java @@ -59,24 +59,24 @@ import org.bukkit.plugin.PluginDescriptionFile; import org.bukkit.plugin.java.JavaPlugin; import org.jetbrains.annotations.ApiStatus; -import org.jetbrains.annotations.Unmodifiable; import org.jetbrains.annotations.Nullable; import org.jetbrains.annotations.UnknownNullability; +import org.jetbrains.annotations.Unmodifiable; import org.junit.After; import org.junit.runner.JUnitCore; import org.junit.runner.Result; -import org.skriptlang.skript.bukkit.registration.BukkitRegistryKeys; -import org.skriptlang.skript.bukkit.registration.BukkitSyntaxInfos; import org.junit.runner.notification.Failure; import org.skriptlang.skript.bukkit.SkriptMetrics; import org.skriptlang.skript.bukkit.tags.TagModule; import org.skriptlang.skript.bukkit.breeding.BreedingModule; import org.skriptlang.skript.bukkit.displays.DisplayModule; -import org.skriptlang.skript.bukkit.furnace.FurnaceModule; import org.skriptlang.skript.bukkit.fishing.FishingModule; +import org.skriptlang.skript.bukkit.furnace.FurnaceModule; import org.skriptlang.skript.bukkit.input.InputModule; import org.skriptlang.skript.bukkit.log.runtime.BukkitRuntimeErrorConsumer; import org.skriptlang.skript.bukkit.loottables.LootTableModule; +import org.skriptlang.skript.bukkit.registration.BukkitRegistryKeys; +import org.skriptlang.skript.bukkit.registration.BukkitSyntaxInfos; import org.skriptlang.skript.lang.comparator.Comparator; import org.skriptlang.skript.lang.comparator.Comparators; import org.skriptlang.skript.lang.converter.Converter; @@ -87,9 +87,9 @@ import org.skriptlang.skript.lang.script.Script; import org.skriptlang.skript.lang.structure.Structure; import org.skriptlang.skript.lang.structure.StructureInfo; +import org.skriptlang.skript.registration.SyntaxInfo; import org.skriptlang.skript.registration.SyntaxOrigin; import org.skriptlang.skript.registration.SyntaxRegistry; -import org.skriptlang.skript.registration.SyntaxInfo; import java.io.File; import java.io.IOException; @@ -116,7 +116,6 @@ import java.util.regex.Matcher; import java.util.regex.Pattern; import java.util.stream.Collectors; -import java.util.stream.Stream; import java.util.zip.ZipEntry; import java.util.zip.ZipException; import java.util.zip.ZipFile; @@ -510,8 +509,6 @@ public void onEnable() { RuntimeErrorManager.refresh(); getRuntimeErrorManager().addConsumer(new BukkitRuntimeErrorConsumer()); - CompletableFuture aliases = Aliases.loadAsync(); - // Now override the verbosity if test mode is enabled if (TestMode.VERBOSITY != null) SkriptLogger.setVerbosity(Verbosity.valueOf(TestMode.VERBOSITY)); @@ -564,6 +561,9 @@ public void onEnable() { return; } + // todo: remove completely 2.11 or 2.12 + CompletableFuture aliases = Aliases.loadAsync(); + Commands.registerListeners(); if (logNormal()) @@ -790,7 +790,7 @@ protected void afterErrors() { Bukkit.getServer().shutdown(); }, shutdownDelay.get()); }); - }, 5); + }, 20); // 20 ticks is necessary on 1.19.4 to allow the server time to properly load/start ticking, for some reason } Skript.metrics = new Metrics(Skript.getInstance(), 722); // 722 is our bStats plugin ID diff --git a/src/main/java/ch/njol/skript/aliases/Aliases.java b/src/main/java/ch/njol/skript/aliases/Aliases.java index de3562c787c..c89775bae36 100644 --- a/src/main/java/ch/njol/skript/aliases/Aliases.java +++ b/src/main/java/ch/njol/skript/aliases/Aliases.java @@ -59,12 +59,8 @@ public abstract class Aliases { private static final boolean noHardExceptions = SkriptConfig.apiSoftExceptions.value(); static String itemSingular = "item"; static String itemPlural = "items"; - @Nullable - static String itemGender = null; static String blockSingular = "block"; static String blockPlural = "blocks"; - @Nullable - static String blockGender = null; static { everything.setAll(true); @@ -310,47 +306,53 @@ private static ItemType parseType(final String s, final ItemType t, final boolea /** * Gets an alias from the aliases defined in the config. * - * @param s The alias to get, case does not matter + * @param rawInput The alias to get, case does not matter * @return A copy of the ItemType represented by the given alias or null if no such alias exists. */ @Nullable - private static ItemType getAlias(final String s) { - ItemType i; - String lc = "" + s.toLowerCase(Locale.ENGLISH); - final Matcher m = p_any.matcher(lc); - if (m.matches()) { - lc = "" + m.group(m.groupCount()); - } - if ((i = getAlias_i(lc)) != null) - return i.clone(); - boolean b; - if ((b = lc.endsWith(" " + blockSingular)) || lc.endsWith(" " + blockPlural)) { - if ((i = getAlias_i("" + s.substring(0, s.length() - (b ? blockSingular.length() : blockPlural.length()) - 1))) != null) { - i = i.clone(); - for (int j = 0; j < i.numTypes(); j++) { - final ItemData d = i.getTypes().get(j); - if (d.getType().isBlock()) { - i.remove(d); + private static ItemType getAlias(final String rawInput) { + String input = rawInput.toLowerCase(Locale.ENGLISH).trim(); + ItemType itemType = getAlias_i(input); + if (itemType != null) + return itemType.clone(); + + // try to parse `ACTUALNAME block` as ACTUALNAME + if (input.endsWith(" " + blockSingular) || input.endsWith(" " + blockPlural)) { + String stripped = input.substring(0, input.lastIndexOf(" ")); + itemType = getAlias_i(stripped); + if (itemType != null) { + itemType = itemType.clone(); + // remove all non-block datas and types that already end with "block" + for (int j = 0; j < itemType.numTypes(); j++) { + ItemData d = itemType.getTypes().get(j); + if (!d.getType().isBlock() || d.getType().getKey().getKey().endsWith(blockSingular)) { + itemType.remove(d); j--; } } - if (i.getTypes().isEmpty()) + // if no block itemdatas were found, return null + if (itemType.getTypes().isEmpty()) return null; - return i; + return itemType; } - } else if ((b = lc.endsWith(" " + itemSingular)) || lc.endsWith(" " + itemPlural)) { - if ((i = getAlias_i("" + s.substring(0, s.length() - (b ? itemSingular.length() : itemPlural.length()) - 1))) != null) { - i = i.clone(); - for (int j = 0; j < i.numTypes(); j++) { - final ItemData d = i.getTypes().get(j); - if (!d.isAnything && d.getType().isBlock()) { - i.remove(d); - j--; + // do the same for items + } else if (input.endsWith(" " + itemSingular) || input.endsWith(" " + itemPlural)) { + String stripped = input.substring(0, input.lastIndexOf(" ")); + itemType = getAlias_i(stripped); + if (itemType != null) { + itemType = itemType.clone(); + // remove all non-item datas + for (int j = 0; j < itemType.numTypes(); j++) { + ItemData data = itemType.getTypes().get(j); + if (!data.isAnything && !data.getType().isItem()) { + itemType.remove(data); + --j; } } - if (i.getTypes().isEmpty()) + // if no item itemdatas were found, return null + if (itemType.getTypes().isEmpty()) return null; - return i; + return itemType; } } return null; diff --git a/src/main/java/ch/njol/skript/classes/data/BukkitEventValues.java b/src/main/java/ch/njol/skript/classes/data/BukkitEventValues.java index 547243d0d3e..503baf87877 100644 --- a/src/main/java/ch/njol/skript/classes/data/BukkitEventValues.java +++ b/src/main/java/ch/njol/skript/classes/data/BukkitEventValues.java @@ -4,7 +4,6 @@ import ch.njol.skript.aliases.ItemType; import ch.njol.skript.bukkitutil.InventoryUtils; import ch.njol.skript.command.CommandEvent; -import ch.njol.skript.command.ScriptCommandEvent; import ch.njol.skript.events.bukkit.ScriptEvent; import ch.njol.skript.events.bukkit.SkriptStartEvent; import ch.njol.skript.events.bukkit.SkriptStopEvent; @@ -445,7 +444,8 @@ else if (hand == EquipmentSlot.OFF_HAND) return inventories.toArray(new Inventory[0]); }); // PrepareAnvilEvent - EventValues.registerEventValue(PrepareAnvilEvent.class, ItemStack.class, PrepareResultEvent::getResult); + if (Skript.classExists("com.destroystokyo.paper.event.inventory.PrepareResultEvent")) + EventValues.registerEventValue(PrepareAnvilEvent.class, ItemStack.class, PrepareResultEvent::getResult); EventValues.registerEventValue(PrepareAnvilEvent.class, Inventory.class, PrepareAnvilEvent::getInventory); // AnvilDamagedEvent if (Skript.classExists("com.destroystokyo.paper.event.block.AnvilDamagedEvent")) { diff --git a/src/main/java/ch/njol/skript/expressions/ExprSourceBlock.java b/src/main/java/ch/njol/skript/expressions/ExprSourceBlock.java index 5d71744f476..3533bb283cb 100644 --- a/src/main/java/ch/njol/skript/expressions/ExprSourceBlock.java +++ b/src/main/java/ch/njol/skript/expressions/ExprSourceBlock.java @@ -23,7 +23,7 @@ @Examples({ "on spread:", "\tif the source block is a grass block:", - "\t\tset the source block to a dirt block" + "\t\tset the source block to dirt" }) @Since("2.7") public class ExprSourceBlock extends SimpleExpression { diff --git a/src/main/java/ch/njol/skript/sections/EffSecShoot.java b/src/main/java/ch/njol/skript/sections/EffSecShoot.java index ae023fa6267..01df1437cc5 100644 --- a/src/main/java/ch/njol/skript/sections/EffSecShoot.java +++ b/src/main/java/ch/njol/skript/sections/EffSecShoot.java @@ -61,7 +61,7 @@ private enum CaseUsage { }, PROJECTILE_NO_WORLD_NO_TRIGGER { @Override - public @Nullable Entity shootHandler(EntityData entityData, LivingEntity shooter, Location location, Class type, Vector vector, Consumer consumer) { + public @NotNull Entity shootHandler(EntityData entityData, LivingEntity shooter, Location location, Class type, Vector vector, Consumer consumer) { //noinspection unchecked Projectile projectile = shooter.launchProjectile((Class) type); set(projectile, entityData); @@ -84,7 +84,7 @@ private enum CaseUsage { }, PROJECTILE_WORLD_NO_TRIGGER { @Override - public @Nullable Entity shootHandler(EntityData entityData, LivingEntity shooter, Location location, Class type, Vector vector, Consumer consumer) { + public @NotNull Entity shootHandler(EntityData entityData, LivingEntity shooter, Location location, Class type, Vector vector, Consumer consumer) { Projectile projectile = (Projectile) shooter.getWorld().spawn(location, type); projectile.setShooter(shooter); return projectile; @@ -152,9 +152,7 @@ public Entity getProjectile() { if (!Skript.isRunningMinecraft(1, 20, 3)) { try { launchWithBukkitConsumer = LivingEntity.class.getMethod("launchProjectile", Class.class, Vector.class, org.bukkit.util.Consumer.class); - } catch (NoSuchMethodException e) { - throw new RuntimeException(e); - } + } catch (NoSuchMethodException ignored) {} } boolean launchHasJavaConsumer = Skript.methodExists(LivingEntity.class, "launchProjectile", Class.class, Vector.class, Consumer.class); RUNNING_PAPER = launchWithBukkitConsumer != null || launchHasJavaConsumer; diff --git a/src/main/java/ch/njol/skript/structures/StructAliases.java b/src/main/java/ch/njol/skript/structures/StructAliases.java index 861b24bcc40..003734678e5 100644 --- a/src/main/java/ch/njol/skript/structures/StructAliases.java +++ b/src/main/java/ch/njol/skript/structures/StructAliases.java @@ -21,7 +21,7 @@ @Examples({ "aliases:", "\tblacklisted items = TNT, bedrock, obsidian, mob spawner, lava, lava bucket", - "\tshiny swords = gold sword, iron sword, diamond sword" + "\tshiny swords = golden sword, iron sword, diamond sword" }) @Since("1.0") public class StructAliases extends Structure { diff --git a/src/test/skript/tests/misc/boats.sk b/src/test/skript/tests/misc/boats.sk index f2deea133e0..bfb29e0a5e1 100644 --- a/src/test/skript/tests/misc/boats.sk +++ b/src/test/skript/tests/misc/boats.sk @@ -1,3 +1,4 @@ + test "boats": set {_boats::*} to "oak boat", "birch boat", "spruce boat", "jungle boat", "acacia boat", "dark oak boat", and "mangrove boat" parse if running minecraft "1.20.4": @@ -14,7 +15,7 @@ test "boats": assert {_boat} is set with "Failed to spawn %loop-value%" set {_a boat} to "a boat" parsed as entity type - set {_a boat item} to "a boat" parsed as item type + set {_a boat item} to "%loop-value%" parsed as item type assert {_boat} is {_a boat} with "%loop-value% was not a boat" assert {_boat} is {_a boat item} with "%loop-value% did not match a boat item" @@ -40,7 +41,7 @@ test "chest boats": assert {_boat} is set with "Failed to spawn %loop-value%" set {_a chest boat} to "a chest boat" parsed as entity type - set {_a chest boat item} to "a chest boat" parsed as item type + set {_a chest boat item} to "%loop-value%" parsed as item type assert {_boat} is {_a chest boat} with "%loop-value% was not a chest boat" assert {_boat} is {_a chest boat item} with "%loop-value% did not match a chest boat item" diff --git a/src/test/skript/tests/misc/item data serialization.sk b/src/test/skript/tests/misc/item data serialization.sk index d79e1713e62..4921971582f 100644 --- a/src/test/skript/tests/misc/item data serialization.sk +++ b/src/test/skript/tests/misc/item data serialization.sk @@ -1,6 +1,6 @@ test "item data serialization": # No assertion needed, it will be done internally - set {a::1} to a dirt block named "DIRT" with lore "LORE1" and "LORE2" + set {a::1} to a dirt named "DIRT" with lore "LORE1" and "LORE2" delete {a::1} diff --git a/src/test/skript/tests/regressions/2711-item-compares.sk b/src/test/skript/tests/regressions/2711-item-compares.sk index 064f6cc7cff..2ef84292444 100644 --- a/src/test/skript/tests/regressions/2711-item-compares.sk +++ b/src/test/skript/tests/regressions/2711-item-compares.sk @@ -1,5 +1,10 @@ +aliases: + closed birch door = minecraft:birch_door[open=false] + any door = birch door, closed birch door + any wood door = birch door, closed birch door + test "item comparison": set {_test} to a dragon head assert {_test} is a dragon head with "failed to compare against a head" - set {_test} to a door + set {_test} to any door assert {_test} is any door, any wood door, birch door or a closed birch door with "failed to compare against a door" diff --git a/src/test/skript/tests/regressions/3419-item comparisons.sk b/src/test/skript/tests/regressions/3419-item comparisons.sk index 8381807a12c..7baedff8e9d 100644 --- a/src/test/skript/tests/regressions/3419-item comparisons.sk +++ b/src/test/skript/tests/regressions/3419-item comparisons.sk @@ -2,13 +2,13 @@ test "item comparisons": # Basic Material Comparisons - set {_a} to a dirt block + set {_a} to dirt set {_b} to a diamond block - assert {_a} is a dirt block with "{_a} is not a dirt block (it should be)" + assert {_a} is dirt with "{_a} is not dirt (it should be)" assert {_a} is not a diamond block with "{_a} is a diamond block (it shouldn't be)" - assert {_b} is not a dirt block with "{_b} is a dirt block (it shouldn't be)" + assert {_b} is not dirt with "{_b} is dirt (it shouldn't be)" assert {_b} is a diamond block with "{_b} is not a diamond block (it should be)" assert {_a} is not {_b} with "{_a} is {_b} (it shouldn't be) (Basic Material Comparisons)" @@ -32,18 +32,18 @@ test "item comparisons": # Different Enchantment Comparisons - set {_a} to a dirt block of sharpness 1 - set {_b} to a dirt block of sharpness 2 + set {_a} to dirt of sharpness 1 + set {_b} to dirt of sharpness 2 - assert {_a} is a dirt block with "{_a} is not a dirt block (it should be)" - assert {_a} is a dirt block of sharpness 1 with "{_a} is not a dirt block of sharpness 1 (it should be)" - assert {_a} is not a dirt block of sharpness 2 with "{_a} is a dirt block of sharpness 2 (it shouldn't be)" - assert a dirt block of sharpness 1 is {_a} with "a dirt block of sharpness 1 is not {_a} (it should be)" + assert {_a} is dirt with "{_a} is not dirt (it should be)" + assert {_a} is dirt of sharpness 1 with "{_a} is not dirt of sharpness 1 (it should be)" + assert {_a} is not dirt of sharpness 2 with "{_a} is dirt of sharpness 2 (it shouldn't be)" + assert dirt of sharpness 1 is {_a} with "dirt of sharpness 1 is not {_a} (it should be)" - assert {_b} is a dirt block with "{_b} is not a dirt block (it should be)" - assert {_b} is not a dirt block of sharpness 1 with "{_b} is a dirt block of sharpness 1 (it shouldn't be)" - assert {_b} is a dirt block of sharpness 2 with "{_b} is not a dirt block of sharpness 2 (it should be)" - assert a dirt block of sharpness 1 is not {_b} with "a dirt block of sharpness 1 is {_b} (it shouldn't be)" + assert {_b} is dirt with "{_b} is not dirt (it should be)" + assert {_b} is not dirt of sharpness 1 with "{_b} is dirt of sharpness 1 (it shouldn't be)" + assert {_b} is dirt of sharpness 2 with "{_b} is not dirt of sharpness 2 (it should be)" + assert dirt of sharpness 1 is not {_b} with "dirt of sharpness 1 is {_b} (it shouldn't be)" assert {_a} is not {_b} with "{_a} is {_b} (it shouldn't be) (Different Enchantment Comparisons" assert {_b} is not {_a} with "{_b} is {_a} (it shouldn't be) (Different Enchantment Comparisons)" @@ -65,18 +65,18 @@ test "item comparisons": # Skull Comparisons set {_a} to a skeleton skull named "Skulliest Skull" - set {_b} to an ender dragon skull named "Skully Skull" + set {_b} to a dragon head named "Skully Skull" assert {_a} is a skeleton skull with "{_a} is not a skeleton skull (it should be)" assert {_a} is not a plain skeleton skull with "{_a} is an unnamed skeleton skull (it shouldn't be)" assert {_a} is a skeleton skull named "Skulliest Skull" with "{_a} is not a skeleton skull named ""Skulliest Skull"" (it should be)" - assert {_a} is not an ender dragon skull with "{_a} is an ender dragon skull (it should't be)" - assert {_a} is not an ender dragon skull named "Skulliest Skull" with "{_a} is an ender dragon skull named ""Skulliest Skull"" (it shouldn't be)" + assert {_a} is not a dragon head with "{_a} is a dragon head (it should't be)" + assert {_a} is not a dragon head named "Skulliest Skull" with "{_a} is a dragon head named ""Skulliest Skull"" (it shouldn't be)" - assert {_b} is an ender dragon skull with "{_b} is not an ender dragon skull (it should be)" - assert {_b} is not a plain ender dragon skull with "{_b} is an unnamed ender dragon skull (it shouldn't be)" - assert {_b} is an ender dragon skull named "Skully Skull" with "{_b} is not an ender dragon skull named ""Skully Skull"" (it should be)" + assert {_b} is a dragon head with "{_b} is not a dragon head (it should be)" + assert {_b} is not a plain dragon head with "{_b} is an unnamed dragon head (it shouldn't be)" + assert {_b} is a dragon head named "Skully Skull" with "{_b} is not a dragon head named ""Skully Skull"" (it should be)" assert {_b} is not a skeleton skull with "{_b} is a skeleton skull (it shouldn't be)" assert {_b} is not a skeleton skull named "Skully Skull" with "{_b} is a skeleton skull named ""Skully Skull"" (it shouldn't be)" @@ -84,23 +84,23 @@ test "item comparisons": assert {_a} is not {_b} with "{_a} is {_b} (it shouldn't be) (Skull Comparisons)" assert {_b} is not {_a} with "{_b} is {_a} (it shouldn't be) (Skull Comparisons)" - # Player Skull Comparisons + # Player Head Comparisons set {_p1} to "APickledWalrus" parsed as an offlineplayer set {_p2} to "ShaneBee" parsed as an offlineplayer set {_a} to skull of {_p1} set {_b} to skull of {_p2} - assert {_a} is a player skull with "{_a} is not a player skull (it should be)" + assert {_a} is a player head with "{_a} is not a player head (it should be)" assert {_a} is the skull of {_p1} with "{_a} is not the skull of {_p1} (it should be)" assert {_a} is not the skull of {_p2} with "{_a} is the skull of {_p2} (it shouldn't be)" - assert {_b} is a player skull with "{_b} is not a player skull (it should be)" + assert {_b} is a player head with "{_b} is not a player head (it should be)" assert {_b} is the skull of {_p2} with "{_b} is not the skull of {_p2} (it should be)" assert {_b} is not the skull of {_p1} with "{_b} is the skull of {_p1} (it shouldn't be)" - assert {_a} is not {_b} with "{_a} is {_b} (it shouldn't be) (Player Skull Comparisons)" - assert {_b} is not {_a} with "{_b} is {_a} (it shouldn't be) (Player Skull Comparisons)" + assert {_a} is not {_b} with "{_a} is {_b} (it shouldn't be) (Player Head Comparisons)" + assert {_b} is not {_a} with "{_b} is {_a} (it shouldn't be) (Player Head Comparisons)" # Remove / Remove All Tests @@ -133,11 +133,11 @@ test "item comparisons": assert {_one} is {_two} with "a diamond sword of sharpness 1 named ""TEST"" should be a diamond sword of sharpness 1" assert {_two} is not {_one} with "a diamond sword of sharpness 1 should NOT be a diamond sword of sharpness 1 named ""TEST""" - set {_three} to a sand block of unbreaking 3 with lore "Sandy Block" - set {_four} to a sand block of unbreaking 3 + set {_three} to sand of unbreaking 3 with lore "Sandy Block" + set {_four} to sand of unbreaking 3 - assert {_three} is {_four} with "a sand block of unbreaking 3 with lore ""Sandy Block"" should be a sand block of unbreaking 3" - assert {_four} is not {_three} with "a sand block of unbreaking 3 should NOT be a sand block of unbreaking 3 with lore ""Sandy Block""" + assert {_three} is {_four} with "sand of unbreaking 3 with lore ""Sandy Block"" should be sand of unbreaking 3" + assert {_four} is not {_three} with "sand of unbreaking 3 should NOT be sand of unbreaking 3 with lore ""Sandy Block""" # Same material but different data values (1.12 and below) (see https://github.com/SkriptLang/Skript/issues/4643) diff --git a/src/test/skript/tests/regressions/5345-any-aliases-random.sk b/src/test/skript/tests/regressions/5345-any-aliases-random.sk index 0fb00edf38d..437bf8d3260 100644 --- a/src/test/skript/tests/regressions/5345-any-aliases-random.sk +++ b/src/test/skript/tests/regressions/5345-any-aliases-random.sk @@ -1,9 +1,12 @@ +aliases: + any boots = diamond boots, iron boots, golden boots, leather boots + function randomAliases(empty: boolean = true) :: item: return random item out of any boots test "any aliases random": assert (random itemtype out of 14, a diamond helmet, false and console) is a diamond helmet with "Could not grab the diamond helmet out of the list." - assert (random itemtype out of 14, a diamond helmet, a gold helmet, false and console) is any helmet with "Could not grab any helmet out of the list." + assert (random itemtype out of 14, a diamond helmet, a golden helmet, false and console) is diamond helmet or golden helmet with "Could not grab any helmet out of the list." assert random item out of any boots is any boots with "Failed to return the same types as the list." set {_list::*} to true, any boots and false assert random number out of {_list::*} is not set with "Failed to error when finding incorrect type." diff --git a/src/test/skript/tests/regressions/5566-block iterator being 100 always.sk b/src/test/skript/tests/regressions/5566-block iterator being 100 always.sk index b1a3cd2dd57..b9581140abe 100644 --- a/src/test/skript/tests/regressions/5566-block iterator being 100 always.sk +++ b/src/test/skript/tests/regressions/5566-block iterator being 100 always.sk @@ -4,5 +4,5 @@ test "100 blocks fix": set {_l} to test-location ~ vector(0, -1, 10) set block at {_l} to air - assert blocks 5 below {_l} contains air, grass block, dirt block, dirt block, bedrock block and void air with "Failed to get correct blocks (got '%blocks 5 below test-location%')" + assert blocks 5 below {_l} contains air, grass block, dirt, dirt, bedrock and void air with "Failed to get correct blocks (got '%blocks 5 below test-location%')" assert size of blocks 3 below location below {_l} is 4 with "Failed to match asserted size" diff --git a/src/test/skript/tests/regressions/7120-changes overwriting indices.sk b/src/test/skript/tests/regressions/7120-changes overwriting indices.sk index 47b02990e7a..439b9c6126d 100644 --- a/src/test/skript/tests/regressions/7120-changes overwriting indices.sk +++ b/src/test/skript/tests/regressions/7120-changes overwriting indices.sk @@ -1,9 +1,9 @@ test "EffEnchant overwriting var indices": set {_test::1} to diamond sword - set {_test::a} to gold sword + set {_test::a} to golden sword set {_test::hello world} to block at spawn of world "world" enchant {_test::*} with sharpness 1 - assert {_test::*} is diamond sword of sharpness 1, gold sword of sharpness 1, and block at spawn of world "world" with "failed to enchant items" + assert {_test::*} is diamond sword of sharpness 1, golden sword of sharpness 1, and block at spawn of world "world" with "failed to enchant items" assert indices of {_test::*} is "1", "a", and "hello world" with "enchanting modified indices" test "EffReplace overwriting var indices": diff --git a/src/test/skript/tests/syntaxes/conditions/CondIsDivisibleBy.sk b/src/test/skript/tests/syntaxes/conditions/CondIsDivisibleBy.sk index 90a258a400b..9ce4462d82a 100644 --- a/src/test/skript/tests/syntaxes/conditions/CondIsDivisibleBy.sk +++ b/src/test/skript/tests/syntaxes/conditions/CondIsDivisibleBy.sk @@ -12,5 +12,5 @@ test "is divisible": assert -5, -10, and -15 can be evenly divided by 5 with "5, 10, and 15 can be evenly divided by 5!" set {_num} to "5" assert {_num} can be divided by 5 to fail with "You cannot divide by a string!" - set {_numlist::*} to "5", "10", "15" + set {_numlist::*} to "5", "10", and "15" assert {_numlist::*} can be divided by 5 to fail with "You cannot divide by a string!" diff --git a/src/test/skript/tests/syntaxes/conditions/CondIsEdible.sk b/src/test/skript/tests/syntaxes/conditions/CondIsEdible.sk index 4e24dccb2fb..1fde67cfbe6 100644 --- a/src/test/skript/tests/syntaxes/conditions/CondIsEdible.sk +++ b/src/test/skript/tests/syntaxes/conditions/CondIsEdible.sk @@ -3,4 +3,4 @@ test "edible condition": assert dirt isn't edible with "dirt is edible" assert diamond isn't edible with "diamond is edible" assert golden apple is edible with "golden apple isn't edible" - assert steak is edible with "steak isn't edible" + assert cooked beef is edible with "cooked beef isn't edible" diff --git a/src/test/skript/tests/syntaxes/conditions/CondIsFireResistant.sk b/src/test/skript/tests/syntaxes/conditions/CondIsFireResistant.sk index 61555e98fae..7cb78fb9b13 100644 --- a/src/test/skript/tests/syntaxes/conditions/CondIsFireResistant.sk +++ b/src/test/skript/tests/syntaxes/conditions/CondIsFireResistant.sk @@ -20,7 +20,7 @@ test "is fire resistant" when running minecraft "1.20.5": # multiple items: naturally not fire resistant set {_item} to diamond - set {_item2} to stone block + set {_item2} to stone assert ({_item} and {_item2}) are not fire resistant with "{_item} and {_item2} are unexpectedly fire resistant" # TODO: enable in 1.21 (doesn't work in 1.20.5 or 1.20.6) @@ -37,5 +37,5 @@ test "is fire resistant" when running minecraft "1.20.5": # multiple items: artifically fire resistant set {_item} to diamond with fire resistance - set {_item2} to fire resistant stone block + set {_item2} to fire resistant stone assert ({_item} and {_item2}) are fire resistant with "fire resistant {_item} and {_item2} are unexpectedly not fire resistant" diff --git a/src/test/skript/tests/syntaxes/conditions/CondIsFlammable.sk b/src/test/skript/tests/syntaxes/conditions/CondIsFlammable.sk index 5e2a22927bc..530f1fb0870 100644 --- a/src/test/skript/tests/syntaxes/conditions/CondIsFlammable.sk +++ b/src/test/skript/tests/syntaxes/conditions/CondIsFlammable.sk @@ -1,5 +1,5 @@ test "flammable condition": assert air isn't flammable with "air is flammable" assert sand isn't flammable with "sand is flammable" - assert oak plank is flammable with "oak plank isn't flammable" + assert oak planks is flammable with "oak plank isn't flammable" assert diamond isn't flammable with "diamond is flammable" diff --git a/src/test/skript/tests/syntaxes/conditions/CondIsLootable.sk b/src/test/skript/tests/syntaxes/conditions/CondIsLootable.sk index 2fe22856d58..86c8def8824 100644 --- a/src/test/skript/tests/syntaxes/conditions/CondIsLootable.sk +++ b/src/test/skript/tests/syntaxes/conditions/CondIsLootable.sk @@ -8,7 +8,7 @@ test "is lootable": set {_pastBlock} to block data of test-block - set test-block to wool block + set test-block to white wool assert test-block is not lootable with "is not lootable failed" set test-block to chest diff --git a/src/test/skript/tests/syntaxes/conditions/CondIsOfType.sk b/src/test/skript/tests/syntaxes/conditions/CondIsOfType.sk index 5a0d2e2c1a1..68717cdca7d 100644 --- a/src/test/skript/tests/syntaxes/conditions/CondIsOfType.sk +++ b/src/test/skript/tests/syntaxes/conditions/CondIsOfType.sk @@ -1,3 +1,6 @@ +aliases: + sword = diamond sword, iron sword, golden sword, stone sword, wooden sword + test "item is of type condition": assert stone is of type stone with "stone isn't of type stone" assert 12 stone is of type stone with "12 stone isn't of type stone" @@ -7,7 +10,7 @@ test "item is of type condition": assert diamond sword of sharpness is of type diamond sword with "enchanted diamond sword isn't of type diamond sword" assert stone sword is of type sword with "stone sword isn't of type sword" - assert gold sword of smite named "test" is not of type iron sword with "enchanted named gold sword is of type iron sword" + assert golden sword of smite named "test" is not of type iron sword with "enchanted named gold sword is of type iron sword" assert armor stand is of type armor stand with "armor stand isn't of type armor stand" assert 12 armor stand is of type 1 armor stand with "12 armor stand isn't of type 1 armor stand" diff --git a/src/test/skript/tests/syntaxes/conditions/CondIsPreferredTool.sk b/src/test/skript/tests/syntaxes/conditions/CondIsPreferredTool.sk index 98175af6b0b..0139eef1979 100644 --- a/src/test/skript/tests/syntaxes/conditions/CondIsPreferredTool.sk +++ b/src/test/skript/tests/syntaxes/conditions/CondIsPreferredTool.sk @@ -11,10 +11,10 @@ test "CondIsPreferredTool - BlockData": test "CondIsPreferredTool - Block": set {_block} to block at location(0,0,0, "world") set {_temp} to {_block}'s type - set block at {_block} to grass - assert wooden axe is preferred tool for {_block} with "failed wooden axe for grass" - assert wooden pickaxe is preferred tool for {_block} with "failed wooden pickaxe for grass" - assert diamond pickaxe is preferred tool for {_block} with "failed diamond pickaxe for grass" + set block at {_block} to grass block + assert wooden axe is preferred tool for {_block} with "failed wooden axe for grass block" + assert wooden pickaxe is preferred tool for {_block} with "failed wooden pickaxe for grass block" + assert diamond pickaxe is preferred tool for {_block} with "failed diamond pickaxe for grass block" set block at {_block} to obsidian assert wooden axe is not preferred tool for {_block} with "failed wooden axe for obsidian" diff --git a/src/test/skript/tests/syntaxes/conditions/CondIsSolid.sk b/src/test/skript/tests/syntaxes/conditions/CondIsSolid.sk index 6ea30920b2b..48f40a8fb65 100644 --- a/src/test/skript/tests/syntaxes/conditions/CondIsSolid.sk +++ b/src/test/skript/tests/syntaxes/conditions/CondIsSolid.sk @@ -1,4 +1,4 @@ test "solid condition": assert air isn't solid with "air is solid" assert diamond isn't solid with "diamond is solid" - assert oak plank is solid with "oak plank isn't solid" + assert oak planks are solid with "oak plank isn't solid" diff --git a/src/test/skript/tests/syntaxes/conditions/CondPastFuture.sk b/src/test/skript/tests/syntaxes/conditions/CondPastFuture.sk index f274c4ae120..c2b8388565e 100644 --- a/src/test/skript/tests/syntaxes/conditions/CondPastFuture.sk +++ b/src/test/skript/tests/syntaxes/conditions/CondPastFuture.sk @@ -24,12 +24,12 @@ test "date in past or future": assert {_null} has not passed with "null should not have passed" # multiple dates - set {_dates::*} to 1 day ago, 1 second ago, 100 years ago + set {_dates::*} to 1 day ago, 1 second ago, and 100 years ago assert {_dates::*} are in the past with "all dates should be in the past" assert {_dates::*} are not in the future with "all dates should not be in the future" assert {_dates::*} have passed with "all dates should have passed" - set {_dates::*} to 1 day from now, 1 second from now, 100 years from now + set {_dates::*} to 1 day from now, 1 second from now, and 100 years from now assert {_dates::*} are not in the past with "all dates should not be in the past" assert {_dates::*} are in the future with "all dates should be in the future" assert {_dates::*} have not passed with "all dates should not have passed" diff --git a/src/test/skript/tests/syntaxes/effects/EffEquip.sk b/src/test/skript/tests/syntaxes/effects/EffEquip.sk index 11b305aa010..a2a91f68500 100644 --- a/src/test/skript/tests/syntaxes/effects/EffEquip.sk +++ b/src/test/skript/tests/syntaxes/effects/EffEquip.sk @@ -1,3 +1,6 @@ +aliases: + test any boots = diamond boots, iron boots, golden boots, chainmail boots, leather boots + test "equip effect": # === ARMOUR === @@ -18,11 +21,11 @@ test "equip effect": equip {_zombie} with iron helmet equip {_zombie} with diamond chestplate equip {_zombie} with diamond leggings - equip {_zombie} with any boots + equip {_zombie} with test any boots assert helmet of {_zombie} is iron helmet with "equipping a zombie with a helmet should do exactly that" assert chestplate of {_zombie} is diamond chestplate with "equipping a zombie with a chestplate should do exactly that" assert leggings of {_zombie} is diamond leggings with "equipping a zombie with leggings should do exactly that" - assert boots of {_zombie} is any boots with "equipping a zombie with boots should do exactly that" + assert boots of {_zombie} is test any boots with "equipping a zombie with boots should do exactly that" unequip {_zombie}'s armour assert helmet of {_zombie} is air with "unequipping an entity should remove its armour" @@ -35,11 +38,11 @@ test "equip effect": spawn a horse at (spawn of world "world"): set {_horse} to entity - equip {_horse} with diamond horse armour - assert {_horse} is wearing diamond horse armour with "equipping a horse with horse armour should do exactly that" + equip {_horse} with diamond horse armor + assert {_horse} is wearing diamond horse armor with "equipping a horse with horse armour should do exactly that" - unequip diamond horse armour from {_horse} - assert {_horse} is not wearing diamond horse armour with "unequipping horse armour from a horse should do exactly that" + unequip diamond horse armor from {_horse} + assert {_horse} is not wearing diamond horse armor with "unequipping horse armour from a horse should do exactly that" # === SADDLES === diff --git a/src/test/skript/tests/syntaxes/effects/EffGlowingText.sk b/src/test/skript/tests/syntaxes/effects/EffGlowingText.sk index afc06f15022..4fab70da34e 100644 --- a/src/test/skript/tests/syntaxes/effects/EffGlowingText.sk +++ b/src/test/skript/tests/syntaxes/effects/EffGlowingText.sk @@ -1,7 +1,7 @@ test "glowing sign blocks": set {_loc} to spawn of "world" set {_original block} to type of block at {_loc} - set block at {_loc} to sign + set block at {_loc} to oak wall sign assert block at {_loc} doesn't have glowing text with "Sign had glowing text erroneously (1)" make block at {_loc} have glowing text assert block at {_loc} has glowing text with "Sign had normal text erroneously" @@ -10,7 +10,7 @@ test "glowing sign blocks": set block at {_loc} to {_original block} test "glowing sign items": - set {_sign} to floor sign + set {_sign} to oak sign assert {_sign} doesn't have glowing text with "Sign had glowing text erroneously (1)" make {_sign} have glowing text assert {_sign} has glowing text with "Sign had normal text erroneously" diff --git a/src/test/skript/tests/syntaxes/expressions/ExprArmorSlot.sk b/src/test/skript/tests/syntaxes/expressions/ExprArmorSlot.sk index 190effca9ab..b001387ea2c 100644 --- a/src/test/skript/tests/syntaxes/expressions/ExprArmorSlot.sk +++ b/src/test/skript/tests/syntaxes/expressions/ExprArmorSlot.sk @@ -1,16 +1,16 @@ test "armour slot": spawn zombie at test-location: - set boots of event-entity to gold boots - assert boots of event-entity are gold boots with "Gold boots were not applied" + set boots of event-entity to golden boots + assert boots of event-entity are golden boots with "Gold boots were not applied" set leggings of event-entity to iron leggings assert leggings of event-entity are iron leggings with "Iron leggings were not applied" set chestplate of event-entity to diamond chestplate assert chestplate of event-entity is diamond chestplate with "Diamond chestplate was not applied" - set helmet of event-entity to dirt block - assert helmet of event-entity is dirt block with "Dirt helmet was not applied" - assert armour of event-entity contains dirt block, diamond chestplate, iron leggings and gold boots with "Armour contents were not correct" + set helmet of event-entity to dirt + assert helmet of event-entity is dirt with "Dirt helmet was not applied" + assert armour of event-entity contains dirt, diamond chestplate, iron leggings and golden boots with "Armour contents were not correct" clear armour of event-entity - assert armour of event-entity does not contain dirt block, diamond chestplate, iron leggings and gold boots with "Failed to clear EquipmentSlots" + assert armour of event-entity does not contain dirt, diamond chestplate, iron leggings and golden boots with "Failed to clear EquipmentSlots" delete event-entity test "body armor wolf" when running minecraft "1.20.5": @@ -27,6 +27,6 @@ test "invalid body armor": loop a zombie, a skeleton, a zombie horse and a skeleton horse: spawn loop-value at spawn of world "world": assert (body armor of event-entity) is not set with "Entity body armor is accessible" - set body armor of event-entity to diamond armor + set body armor of event-entity to diamond chestplate assert (body armor of event-entity) is not set with "Entity body armor is accessible" clear event-entity diff --git a/src/test/skript/tests/syntaxes/expressions/ExprBlockData.sk b/src/test/skript/tests/syntaxes/expressions/ExprBlockData.sk index e7de38130a3..043d2eaf591 100644 --- a/src/test/skript/tests/syntaxes/expressions/ExprBlockData.sk +++ b/src/test/skript/tests/syntaxes/expressions/ExprBlockData.sk @@ -1,7 +1,7 @@ test "block data": set {_b} to block at test-location set block at {_b} to campfire[lit=false;waterlogged=true] - assert block at {_b} is an unlit campfire with "block at spawn should be an unlit campfire" + assert block at {_b} is campfire[lit=false] with "block at spawn should be an unlit campfire" assert block at {_b} = campfire[lit=false;waterlogged=true] with "block should have been an unlit, waterlogged campfire" assert block at {_b} = campfire[waterlogged=true] with "block should have been a waterlogged campfire" diff --git a/src/test/skript/tests/syntaxes/expressions/ExprBlockSound.sk b/src/test/skript/tests/syntaxes/expressions/ExprBlockSound.sk index e2dd76713e1..2e22f1b2d08 100644 --- a/src/test/skript/tests/syntaxes/expressions/ExprBlockSound.sk +++ b/src/test/skript/tests/syntaxes/expressions/ExprBlockSound.sk @@ -15,7 +15,7 @@ test "block sounds (1.20+)": assert place sound of {_stone::*} is "BLOCK.STONE.PLACE" with "place sound of stone wasn't BLOCK.STONE.PLACE" assert step sound of {_stone::*} is "BLOCK.STONE.STEP" with "step sound of stone wasn't BLOCK.STONE.STEP" - set {_wool::*} to getObjects(wool) + set {_wool::*} to getObjects(white wool) assert break sound of {_wool::*} is "BLOCK.WOOL.BREAK" with "break sound of stone wasn't BLOCK.WOOL.BREAK" assert fall sound of {_wool::*} is "BLOCK.WOOL.FALL" with "fall sound of stone wasn't BLOCK.WOOL.FALL" assert hit sound of {_wool::*} is "BLOCK.WOOL.HIT" with "hit sound of stone wasn't BLOCK.WOOL.HIT" diff --git a/src/test/skript/tests/syntaxes/expressions/ExprBookAuthor.sk b/src/test/skript/tests/syntaxes/expressions/ExprBookAuthor.sk index 66557129b2d..abecb84843b 100644 --- a/src/test/skript/tests/syntaxes/expressions/ExprBookAuthor.sk +++ b/src/test/skript/tests/syntaxes/expressions/ExprBookAuthor.sk @@ -1,5 +1,5 @@ test "book author": - set {_i} to book with text + set {_i} to written book assert {_i}'s book author is not set with "non-existent book author failed" set {_i}'s book author to "aB1$😀" assert case_equals({_i}'s book author, "aB1$😀") is true with "set book author failed" diff --git a/src/test/skript/tests/syntaxes/expressions/ExprBookPages.sk b/src/test/skript/tests/syntaxes/expressions/ExprBookPages.sk index a2f7b7e3a7c..5bc9fb63a42 100644 --- a/src/test/skript/tests/syntaxes/expressions/ExprBookPages.sk +++ b/src/test/skript/tests/syntaxes/expressions/ExprBookPages.sk @@ -1,6 +1,4 @@ test "book pages": - set {_i} to book with text - assert {_i}'s book pages is not set with "non-existent book pages failed" set {_i} to a written book assert {_i}'s book pages is not set with "non-existent book pages failed 2" set pages of {_i} to "&aPages testing" and "test 2" diff --git a/src/test/skript/tests/syntaxes/expressions/ExprBookTitle.sk b/src/test/skript/tests/syntaxes/expressions/ExprBookTitle.sk index 246317c5e7d..41ee41a7f5e 100644 --- a/src/test/skript/tests/syntaxes/expressions/ExprBookTitle.sk +++ b/src/test/skript/tests/syntaxes/expressions/ExprBookTitle.sk @@ -1,5 +1,5 @@ test "book title": - set {_i} to book with text + set {_i} to written book assert {_i}'s book title is not set with "non-existent book title failed" set {_i}'s book title to "aB1$😀" assert case_equals({_i}'s book title, "aB1$😀") is true with "set book title failed" diff --git a/src/test/skript/tests/syntaxes/expressions/ExprEntities.sk b/src/test/skript/tests/syntaxes/expressions/ExprEntities.sk index 88e5fb1768d..8ee6acedf52 100644 --- a/src/test/skript/tests/syntaxes/expressions/ExprEntities.sk +++ b/src/test/skript/tests/syntaxes/expressions/ExprEntities.sk @@ -21,7 +21,7 @@ test "entities in chunk": spawn 2 sheep at location(28, -60, 20, world "world") assert size of all entities in chunk at spawn of world "world" >= 10 with "Size of all entities in spawn chunk is not >= 10" - assert size of all entities in radius 3 of {_radius center} >= 10 with "Size of all entities in radius 3 of spawn is not >= 10" + assert size of all entities in radius 3 of {_radius center} >= 10 with "Size of all entities in radius 3 of -24, -60, -24 is not >= 10" assert size of all entities within {_corner::1} and {_corner::2} >= 10 with "Size of all entities within cuboid is not >= 10" diff --git a/src/test/skript/tests/syntaxes/expressions/ExprInventory.sk b/src/test/skript/tests/syntaxes/expressions/ExprInventory.sk index 038c41fac5b..62570788d51 100644 --- a/src/test/skript/tests/syntaxes/expressions/ExprInventory.sk +++ b/src/test/skript/tests/syntaxes/expressions/ExprInventory.sk @@ -1,5 +1,5 @@ test "item inventory": - set {_shulker} to any shulker box + set {_shulker} to a shulker box assert inventory of {_shulker} is set with "Failed to get shulker inventory" set slot 1 of inventory of {_shulker} to dirt assert slot 1 of inventory of {_shulker} is dirt with "Failed to set slot in shulker inventory" diff --git a/src/test/skript/tests/syntaxes/expressions/ExprItemWithEnchantmentGlint.sk b/src/test/skript/tests/syntaxes/expressions/ExprItemWithEnchantmentGlint.sk index ec557cd4186..b722628c25c 100644 --- a/src/test/skript/tests/syntaxes/expressions/ExprItemWithEnchantmentGlint.sk +++ b/src/test/skript/tests/syntaxes/expressions/ExprItemWithEnchantmentGlint.sk @@ -1,3 +1,6 @@ +aliases: + test any wool = white wool, red wool, black wool + test "item enchantment glint" when running minecraft "1.20.5": # Glint set {_item} to diamond with enchantment glint @@ -34,7 +37,7 @@ test "item enchantment glint" when running minecraft "1.20.5": test "item enchantment glint - edge cases" when running minecraft "1.20.5": assert {_null} is forced to glint to fail with "Condition 'item is forced to glint' expected to fail with non itemtypes #1" assert {_null} has enchantment glint override to fail with "Condition 'item has enchantment glint override' expected to fail with non itemtypes #1" - assert any wool does not have enchantment glint override with "Condition 'does not have enchantment glint override' failed with plural itemtype aliases" + assert (test any wool) does not have enchantment glint override with "Condition 'does not have enchantment glint override' failed with plural itemtype aliases" assert diamond with enchantment glint = diamond with enchantment glint with "Item with enchantment glint comparison failed #1" assert diamond with enchantment glint != diamond without enchantment glint with "Item with enchantment glint comparison failed #2" assert diamond != diamond with enchantment glint with "Item with enchantment glint comparison failed #3" diff --git a/src/test/skript/tests/syntaxes/expressions/ExprLocationFromVector.sk b/src/test/skript/tests/syntaxes/expressions/ExprLocationFromVector.sk index 46ca2a34633..238178fa357 100644 --- a/src/test/skript/tests/syntaxes/expressions/ExprLocationFromVector.sk +++ b/src/test/skript/tests/syntaxes/expressions/ExprLocationFromVector.sk @@ -1,7 +1,7 @@ test "location from vector": set {_world} to world "world" - set {_vector} to vector(x coordinate of spawn of {_world}, y coordinate of spawn of {_world}, z coordinate of spawn of {_world}) + set {_vector} to vector((x coordinate of spawn of {_world}), (y coordinate of spawn of {_world}), (z coordinate of spawn of {_world})) set {_location} to location of {_vector} in {_world} assert {_location} is spawn of {_world} with "location from vector failed, expected %spawn of {_world}%, got %{_vector}%" diff --git a/src/test/skript/tests/syntaxes/expressions/ExprMaxStack.sk b/src/test/skript/tests/syntaxes/expressions/ExprMaxStack.sk index 1ec4235a2f9..5f793ebd951 100644 --- a/src/test/skript/tests/syntaxes/expressions/ExprMaxStack.sk +++ b/src/test/skript/tests/syntaxes/expressions/ExprMaxStack.sk @@ -1,3 +1,7 @@ +aliases: + test any log = oak log, spruce log, dark oak log + test any wool = white wool, red wool, black wool + test "max stack - itemtype": assert max stack size of diamond sword is 1 with "diamond sword max stack size failed" assert max stack size of bucket is 16 with "bucket max stack size failed" @@ -8,7 +12,7 @@ test "max stack - itemtype": assert max stack size of {_null} is 0 to fail with "max stack size of non itemtype expected to fail ##2" assert max stack size of diamond and diamond sword is 64 and 1 with "max stack size of itemtypes 'and' case failed" assert max stack size of diamond or diamond sword is 64 or 1 with "max stack size of itemtypes 'or' case failed" - loop any log and any wool: + loop (test any log) and (test any wool): assert max stack size of loop-value is 64 with "max stack size of category itemtypes (%loop-value%) failed" test "max stack override - itemtype" when running minecraft "1.20.5": @@ -43,7 +47,7 @@ test "max stack override - itemtype" when running minecraft "1.20.5": assert max stack size of {_item} is 1 with "diamond sword should have max stack size of 1" # edge case - loop any log and any wool: + loop (test any log) and (test any wool): set {_edge} to loop-value set max stack size of {_edge} to 1 assert max stack size of {_edge} is 1 with "max stack size override of category itemtypes (%{_edge}%) failed" diff --git a/src/test/skript/tests/syntaxes/expressions/ExprNewBannerPattern.sk b/src/test/skript/tests/syntaxes/expressions/ExprNewBannerPattern.sk index f40b844a867..30b065ef6ef 100644 --- a/src/test/skript/tests/syntaxes/expressions/ExprNewBannerPattern.sk +++ b/src/test/skript/tests/syntaxes/expressions/ExprNewBannerPattern.sk @@ -2,7 +2,7 @@ test "new banner pattern": set {_pattern} to a creeper banner pattern colored red # Will fail due to the "banner pattern" item alias in skript-aliases # assert {_pattern} is a banner pattern with "New banner pattern is not a banner pattern type" - set {_item} to a banner + set {_item} to a white banner add {_pattern} to the banner patterns of {_item} assert the banner patterns of {_item} contains {_pattern} with "Banner pattern not applied to item" remove {_pattern} from the banner patterns of {_item} @@ -13,8 +13,8 @@ test "new banner pattern": assert the 1st banner pattern of {_item} is not set with "1st banner pattern of item was not cleared" set {_old} to block at test-location - set block at test-location to a banner - assert the block at test-location is a banner with "Banner block was not set" + set block at test-location to a red banner + assert the block at test-location is a red banner with "Banner block was not set" add {_pattern} to the banner patterns of (block at test-location) assert the banner patterns of (block at test-location) contains {_pattern} with "Banner pattern not applied to block" remove {_pattern} from the banner patterns of (block at test-location) diff --git a/src/test/skript/tests/syntaxes/expressions/ExprSets.sk b/src/test/skript/tests/syntaxes/expressions/ExprSets.sk index 28446c8d17c..c976d20a36d 100644 --- a/src/test/skript/tests/syntaxes/expressions/ExprSets.sk +++ b/src/test/skript/tests/syntaxes/expressions/ExprSets.sk @@ -1,3 +1,7 @@ +aliases: + test ore = gold ore, diamond ore, coal ore, emerald ore + test log = dark oak log, oak log, jungle log, spruce log + test "colours set": set {_set::*} to black, dark grey, grey, white, blue, brown, cyan, light cyan, green, light green, yellow, orange, red, pink, purple and magenta loop all colours: @@ -7,6 +11,6 @@ test "colours set": assert {_count} is size of {_set::*} with "All the colours in the collection set expression didn't match the required output" test "item sets": - assert items of type ore contains gold ore, diamond ore, coal ore and emerald ore with "Ores did not contain classic ore types" - assert items of type log contains dark oak log, oak log, jungle log and spruce log with "Logs did not contain the defined log checks" + assert items of type test ore contains gold ore, diamond ore, coal ore and emerald ore with "Ores did not contain classic ore types" + assert items of type test log contains dark oak log, oak log, jungle log and spruce log with "Logs did not contain the defined log checks" diff --git a/src/test/skript/tests/syntaxes/sections/EffSecSpawn.sk b/src/test/skript/tests/syntaxes/sections/EffSecSpawn.sk index 696a24ca888..36cd029d11f 100644 --- a/src/test/skript/tests/syntaxes/sections/EffSecSpawn.sk +++ b/src/test/skript/tests/syntaxes/sections/EffSecSpawn.sk @@ -81,7 +81,7 @@ test "spawn entities": add "salmon", "sheep", "shulker", "silverfish", "skeleton", "skeleton horse" and "slime" to {_entities::*} add "snow golem", "spider", "squid", "stray", "strider", "tadpole", "trader llama" and "tropical fish" to {_entities::*} add "turtle", "vex", "villager", "vindicator", "wandering trader", "warden", "witch" and "wither skeleton" to {_entities::*} - add "wolf", "zoglin", "zombie", "zombie horse", "zombie villager", "zombified piglin" to {_entities::*} + add "wolf", "zoglin", "zombie", "zombie horse", "zombie villager", and "zombified piglin" to {_entities::*} add "ender dragon" and "wither" to {_entities::*} add "oak boat", "oak chest boat", "armor stand", "primed tnt", "firework", "arrow", "trident" and "egg" to {_entities::*} add "snowball", "end crystal", "eye of ender", "regular minecart", "falling sand" and "falling gravel" to {_entities::*} diff --git a/src/test/skript/tests/syntaxes/structures/StructCommand.sk b/src/test/skript/tests/syntaxes/structures/StructCommand.sk index 3faa74c756b..77915a6a788 100644 --- a/src/test/skript/tests/syntaxes/structures/StructCommand.sk +++ b/src/test/skript/tests/syntaxes/structures/StructCommand.sk @@ -5,14 +5,14 @@ test "commands": options: command: skriptcommand -command {@command} [] []: +command {@command} [] []: trigger: set {_arg1} to arg-1 assert {_arg1} is "taco" with "arg-1 test failed (got '%{_arg1}%')" set {_arg2} to arg-2 assert {_arg2} is not set with "arg-2 test failed (got '%{_arg2}%')" set {_arg3} to arg-3 - assert {_arg3} is a dirt block named "steve" with "arg-3 test failed (got '%{_arg3}%')" + assert {_arg3} is dirt named "steve" with "arg-3 test failed (got '%{_arg3}%')" command //somecommand []: trigger: