Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test - Update for MC 1.19+ #7240

Open
wants to merge 7 commits into
base: dev/feature
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/test/skript/tests/misc/displaydata.sk
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
test "display entity data" when running minecraft "1.19":
test "display entity data":
spawn a text display at spawn of world "world":
set {_text} to entity

Expand Down
2 changes: 1 addition & 1 deletion src/test/skript/tests/misc/displays.sk
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
test "spawn displays" when running minecraft "1.19.4":
test "spawn displays":
spawn a text display at spawn of world "world":
set {_display} to event-display
assert billboard of display within {_display} is "fixed" parsed as billboard with "default billboard was not fixed"
Expand Down
2 changes: 1 addition & 1 deletion src/test/skript/tests/misc/registry.sk
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
test "registry" when minecraft version is "1.14":
test "registry":

# Test namespaced keys
assert curse of vanishing = minecraft:vanishing_curse with "'curse of vanishing' enchant should match namespace key"
Expand Down
2 changes: 1 addition & 1 deletion src/test/skript/tests/regressions/2535-foxdata fixes.sk
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
test "fox EntityData fixes" when running minecraft "1.15.2":
test "fox EntityData fixes":
spawn red fox at location(0, 64, 0, world "world")
spawn 3 snow foxes at location(0, 64, 0, world "world")
delete all foxes
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
test "mooshroom EntityData fixes" when running minecraft "1.15.2":
test "mooshroom EntityData fixes":
spawn brown mooshroom at location(0, 64, 0, world "world")
spawn 3 red mooshrooms at location(0, 64, 0, world "world")
delete all mooshrooms
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
test "villager comparisons" when running minecraft "1.15.2":
test "villager comparisons":
spawn cleric at location(0, 64, 0, world "world")
assert last spawned entity is a cleric with "comparison failed"
delete last spawned entity
1 change: 0 additions & 1 deletion src/test/skript/tests/regressions/3253-entitydata fixes.sk
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ test "entity data fixes":
assert last spawned entity is an adult sheep with "last spawned entity should have been an adult sheep"
assert last spawned entity is an adult entity with "last spawned entity should have been an adult entity"

test "entity data fixes - 1.16.5" when running minecraft "1.16.5":
spawn a baby piglin at test-location
assert last spawned entity is a baby piglin with "last spawned entity should have been a baby piglin"
assert last spawned entity is a baby entity with "last spawned entity should have been a baby entity"
Expand Down
8 changes: 0 additions & 8 deletions src/test/skript/tests/regressions/3303-item durability.sk
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,3 @@ test "item durability":
set {_i} to a diamond sword
set durability of {_i} to 500
assert durability of {_i} != damage value of {_i} with "Durability of item should not equal damage value"

test "block data value" when running below minecraft "1.13.2":
set test-block to farmland
set {_b} to block above test-block
set block at {_b} to fully grown wheat plant
assert data value of block at {_b} = 7 with "Data value of block should have been 7"
set data value of block at {_b} to 1
assert data value of block at {_b} = 1 with "Data value of block should have been 1"
5 changes: 4 additions & 1 deletion src/test/skript/tests/regressions/4769-fire-visualeffect.sk
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,12 @@ test "fire visual effect comparison":
assert a block is a block with "failed to compare block classinfo against block classinfo"
assert an itemtype is an itemtype with "failed to compare itemtype classinfo against itemtype classinfo"
assert a diamond is an itemtype with "failed to compare itemtype 'diamond' against itemtype classinfo"
set {_below} to type of block below block at spawn of world "world"
set {_block} to type of block at spawn of world "world"
set block at spawn of world "world" to fire
set block below block at spawn of world "world" to oak planks
set block at spawn of world "world" to fire[]
assert block at spawn of world "world" is fire with "failed to compare fire (itemtype) with a block"
set block below block at spawn of world "world" to {_below}
set block at spawn of world "world" to {_block}
play 5 fire at spawn of world "world"
assert "fire" parsed as visual effect is fire with "failed to compare visual effects"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
test "composter the imposter" when running minecraft "1.14.4":
test "composter the imposter":
set {_block} to type of test-block
set test-block to composter
assert test-block is composter with "failed to compare composter (itemtype) with a block"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
test "spawn xp orb overwriting merged value" when running minecraft "1.14.4":
test "spawn xp orb overwriting merged value":
# 1.13.2 seems not to merge xp orbs in the same way, so this test is skipped

# 1.21 also does not merge orbs, so this test is disabled.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
test "leather horse armor unequipable" when running minecraft "1.14":
test "leather horse armor unequipable":
if minecraft version is "1.20.6":
stop # horse armor equipping is broken on Paper 1.20.6. see https://github.com/PaperMC/Paper/pull/11139

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@

# Test not related to a made issue. Details at pull request.
test "100 blocks fix":
set {_l} to test-location ~ vector(0, -1, 0)
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 size of blocks 3 below location below {_l} is 4 with "Failed to match asserted size"
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
test "CondIsPreferredTool - BlockData" when running minecraft "1.19.2":
test "CondIsPreferredTool - BlockData":
assert wooden pickaxe is preferred tool for minecraft:stone[] with "failed wooden pickaxe for stone blockdata"
assert wooden pickaxe is preferred tool for minecraft:dirt[] with "failed wooden pickaxe for dirt blockdata"
assert wooden pickaxe is not preferred tool for minecraft:obsidian[] with "failed wooden pickaxe for obsidian blockdata"
Expand All @@ -8,7 +8,7 @@ test "CondIsPreferredTool - BlockData" when running minecraft "1.19.2":
assert wooden axe is not preferred tool for minecraft:stone[] with "failed wooden axe for stone blockdata"
assert wooden axe is preferred tool for minecraft:dirt[] with "failed wooden axe for dirt blockdata"

test "CondIsPreferredTool - Block" when running minecraft "1.16.5":
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
Expand Down
27 changes: 1 addition & 26 deletions src/test/skript/tests/syntaxes/conditions/CondIsWithin.sk
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
test "within condition" when running minecraft "1.17":
test "within condition":
# two locations
set {_loc1} to location(0, 0, 0, "world")
set {_loc2} to location(20, 20, 20, "world")
Expand Down Expand Up @@ -31,28 +31,3 @@ test "within condition" when running minecraft "1.17":
assert {_loc1} is not within {_pig} with "failed within entity"

delete random entity of {_pig}

test "within condition" when running below minecraft "1.17":
# two locations
set {_loc1} to location(0, 0, 0, "world")
set {_loc2} to location(20, 20, 20, "world")
assert location(10, 10, 10, "world") is within {_loc1} and {_loc2} with "failed within two locs"
assert location(10, -10, 10, "world") is not within {_loc1} and {_loc2} with "failed within two locs"
assert location(0, 0, 0, "world") is not within {_none} and {_none} with "failed within two locs"

# chunks
set {_chunk1} to chunk at {_loc1}
assert location(10, 10, 10, "world") is within {_chunk1} with "failed within chunk"
assert location(-10, 10, -10, "world") is not within {_chunk1} with "failed within chunk"

# worlds
assert location(10, 10, 10, "world") is within world("world") with "failed within world"

# entities
set {_loc} to test-location
spawn a pig at {_loc}
set {_pig} to last spawned entity
assert {_loc} is within {_pig} with "failed within entity"
assert {_loc1} is not within {_pig} with "failed within entity"

delete random entity of {_pig}
2 changes: 1 addition & 1 deletion src/test/skript/tests/syntaxes/effects/EffDetonate.sk
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ test "detonate entity effect":
detonate last spawned entity
assert last spawned entity isn't valid with "creepers should instantly detonate when spawned"

test "detonate explosive minecart" when running minecraft "1.19":
test "detonate explosive minecart":
spawn a minecart with tnt at event-location
assert last spawned entity is valid with "minecarts with tnt should not detonate when they are first spawned"
detonate last spawned entity
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
test "explode creeper effect/condition" when running minecraft "1.15.2":
test "explode creeper effect/condition":
spawn a creeper at test-location
assert last spawned creeper is not going to explode with "creepers should not explode when they are first spawned"
start ignition of the last spawned creeper
Expand Down
4 changes: 2 additions & 2 deletions src/test/skript/tests/syntaxes/effects/EffGlowingText.sk
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
test "glowing sign blocks" when running minecraft "1.17.1":
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
Expand All @@ -9,7 +9,7 @@ test "glowing sign blocks" when running minecraft "1.17.1":
assert block at {_loc} doesn't have glowing text with "Sign had glowing text erroneously (2)"
set block at {_loc} to {_original block}

test "glowing sign items" when running minecraft "1.17.1":
test "glowing sign items":
set {_sign} to floor sign
assert {_sign} doesn't have glowing text with "Sign had glowing text erroneously (1)"
make {_sign} have glowing text
Expand Down
2 changes: 1 addition & 1 deletion src/test/skript/tests/syntaxes/effects/EffHandedness.sk
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
test "left handedness" when running minecraft "1.17.1":
test "left handedness":
spawn skeleton at test-location:
make entity right handed
assert entity is not left handed with "zombie is left handed after being made right handed"
Expand Down
2 changes: 1 addition & 1 deletion src/test/skript/tests/syntaxes/effects/EffInvisible.sk
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
test "entity invisibility" when running minecraft "1.16.3":
test "entity invisibility":
spawn pig at test-location:
make entity invisible
assert entity is invisible with "failed to make pig invisible"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
test "block data" when running minecraft "1.14.4":
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"
Expand Down
2 changes: 1 addition & 1 deletion src/test/skript/tests/syntaxes/expressions/ExprColorOf.sk
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

# test "color of fireworks":

test "color of displays" when running minecraft "1.19.4":
test "color of displays":
spawn a text display at spawn of world "world":
set {_e} to entity

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
test "custom model data expressions/condition" when running minecraft "1.15.2":
test "custom model data expressions/condition":
set {_item} to a diamond sword with custom model data 456
assert {_item} has custom model data with "{_item} does not have custom model data"
if {_item} has custom model data:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
test "display billboard" when running minecraft "1.19.4":
test "display billboard":

spawn a text display at spawn of world "world":
set {_e} to entity
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
test "display brightness" when running minecraft "1.19.4":
test "display brightness":
spawn block display at spawn of world "world":
set {_e::1} to entity
spawn item display at spawn of world "world":
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
test "display glow color override" when running minecraft "1.19":
test "display glow color override":

spawn block display at spawn of world "world":
set {_e::1} to entity
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
test "display height/width" when running minecraft "1.19":
test "display height/width":

spawn block display at spawn of world "world":
set {_e::1} to entity
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
test "display interpolation" when running minecraft "1.19.4":
test "display interpolation":

spawn block display at spawn of world "world":
set {_e::1} to entity
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
test "display radius/strength" when running minecraft "1.19":
test "display radius/strength":

spawn block display at spawn of world "world":
set {_e::1} to entity
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
test "display transformation rotations" when running minecraft "1.19.4":
test "display transformation rotations":

spawn block display at spawn of world "world":
set {_e::1} to entity
Expand Down Expand Up @@ -27,7 +27,7 @@ test "display transformation rotations" when running minecraft "1.19.4":
delete entities within {_e::*}


test "display transformation translation / scales" when running minecraft "1.19.4":
test "display transformation translation / scales":
spawn block display at spawn of world "world":
set {_e::1} to entity
spawn item display at spawn of world "world":
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
test "display view range" when running minecraft "1.19":
test "display view range":

spawn block display at spawn of world "world":
set {_e::1} to entity
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ test "explosive yield":
assert explosive yield of last spawned tnt is 10 with "an explosive's explosive yield should be 10 if it is set to 10"
delete last spawned primed tnt

test "creeper explosive yield" when running minecraft "1.12.2":
test "creeper explosive yield":
spawn a creeper at test-location
assert explosive yield of last spawned creeper is 3 with "explosive yield of a creeper is 3 by default"
set explosive yield of last spawned creeper to 10
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
test "freeze time" when running minecraft "1.18":
test "freeze time":
spawn cow at test-location:
assert freeze time of entity is set with "freeze time get failed"
set freeze time of entity to 3 seconds
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
test "item display transforms" when running minecraft "1.19.4":
test "item display transforms":

spawn block display at spawn of world "world":
set {_bd} to entity
Expand Down
Original file line number Diff line number Diff line change
@@ -1,34 +1,4 @@
test "lowest/highest solid block (old height)" when running below minecraft "1.18":

# highest solid block
set {_oldBlock::1} to block data of block at location(0.5, 255.5, 0.5, "world")
set {_oldBlock::2} to block data of block at location(0.5, 254.5, 0.5, "world")
set {_oldBlock::3} to block data of block at location(0.5, 253.5, 0.5, "world")
set block at location(0.5, 255.5, 0.5, "world") to air
set block at location(0.5, 254.5, 0.5, "world") to air
set block at location(0.5, 253.5, 0.5, "world") to dirt
set {_highest} to highest solid block at location(0.5, 64, 0.5, "world")
assert type of {_highest} is dirt with "highest block is not dirt (got '%type of {_highest}%')"
assert location of {_highest} is location(0.5, 253.5, 0.5, "world") with "highest block is not at 0.5,253.5,0.5 (got '%location of {_highest}%')"
set block at location(0.5, 255.5, 0.5, "world") to {_oldBlock::1}
set block at location(0.5, 254.5, 0.5, "world") to {_oldBlock::2}
set block at location(0.5, 253.5, 0.5, "world") to {_oldBlock::3}

# lowest solid block
set {_oldBlock::1} to block data of block at location(0.5, 0.5, 0.5, "world")
set {_oldBlock::2} to block data of block at location(0.5, 1.5, 0.5, "world")
set {_oldBlock::3} to block data of block at location(0.5, 2.5, 0.5, "world")
set block at location(0.5, 0.5, 0.5, "world") to air
set block at location(0.5, 1.5, 0.5, "world") to air
set block at location(0.5, 2.5, 0.5, "world") to dirt
set {_lowest} to lowest solid block at location(0.5, 64, 0.5, "world")
assert type of {_lowest} is dirt with "lowest block is not dirt (got '%type of {_lowest}%')"
assert location of {_lowest} is location(0.5, 2.5, 0.5, "world") with "lowest block is not at 0.5,2.5,0.5 (got '%location of {_lowest}%')"
set block at location(0.5, 0.5, 0.5, "world") to {_oldBlock::1}
set block at location(0.5, 1.5, 0.5, "world") to {_oldBlock::2}
set block at location(0.5, 2.5, 0.5, "world") to {_oldBlock::3}

test "lowest/highest solid block (new height)" when running minecraft "1.18":
test "lowest/highest solid block (new height)":

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
test "lowest/highest solid block (new height)":
test "lowest/highest solid block":

# highest solid block
set {_oldBlock::1} to block data of block at location(0.5, 319.5, 0.5, "world")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
test "max players" when running minecraft "1.16.5":
test "max players":
set real max players count to 5
assert real max players count is 5 with "setting max players failed"
add 3 to real max players
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
test "quaternion axis angle" when running minecraft "1.19":
test "quaternion axis angle":
set {_v} to vector(1, 2, 3)
set {_q} to axisAngle(45, {_v})
assert rotation angle of {_q} is 45 with "angle of quaternion failed"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
test "text alignment" when running minecraft "1.19.4":
test "text alignment":

spawn item display at spawn of world "world":
set {_id} to entity
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
test "line width" when running minecraft "1.19.4":
test "line width":

spawn item display at spawn of world "world":
set {_id} to entity
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
test "text opacity" when running minecraft "1.19.4":
test "text opacity":

spawn item display at spawn of world "world":
set {_id} to entity
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ test "whitelist":
reset whitelist
assert whitelist is not set with "Failed to empty whitelist"

test "enforce whitelist" when running minecraft "1.17":
test "enforce whitelist":
enforce whitelist
assert server whitelist is enforced with "Failed to enforce server whitelist"
unenforce whitelist
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
test "vector xyz":
if running minecraft "1.19.4":
assert the w component of vector(0, 0, 0) is not set with "w vector component return value for vector unexpectedly"
assert the w component of vector(0, 0, 0) is not set with "w vector component return value for vector unexpectedly"
assert the x component of vector(1, 0, 0) is 1 with "x vector component failed"
assert the y component of vector(0, 1, 0) is 1 with "y vector component failed"
assert the z component of vector(0, 0, 1) is 1 with "z vector component failed"

set {_v} to vector(0,0,0)
set x of {_v} to infinity value
if running minecraft "1.19.4":
assert the w component of {_v} is not set with "set x of vector created w component somehow"
assert the w component of {_v} is not set with "set x of vector created w component somehow"
assert the x component of {_v} is infinity value with "set x of vector failed"
assert the y component of {_v} is 0 with "set x of vector modified other components"
assert the z component of {_v} is 0 with "set x of vector modified other components"
Expand All @@ -30,7 +28,7 @@ test "vector xyz":
assert the x component of {_v::*} is (-1.5, -1.5, and -1.5) with "x component of multiple vectors failed"
assert the y component of {_v::*} is (2, 3, and 4) with "changing x component of multiple vectors changed y components too"

test "quaternion wxyz" when running minecraft "1.19.4":
test "quaternion wxyz":
assert the w component of quaternion(1, 0, 0, 0) is 1 with "w vector component failed"
assert the x component of quaternion(1, 0, 0, 0) is 0 with "x vector component failed"
assert the y component of quaternion(1, 0, 0, 0) is 0 with "y vector component failed"
Expand Down
2 changes: 1 addition & 1 deletion src/test/skript/tests/syntaxes/functions/offlinePlayer.sk
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ test "offline player function":
set {_lookup} to offlineplayer("Notch")
assert {_lookup} is set with "Failed to look up offline player"

test "offline player function no lookup" when running minecraft "1.16":
test "offline player function no lookup":
set {_non-lookup} to offlineplayer("Dinnerbone", false)
assert {_non-lookup} is not set with "Looked up offline player when told not to"
Loading
Loading