Skip to content

Commit

Permalink
Merge pull request #169 from aksiome/id-tests
Browse files Browse the repository at this point in the history
✅ Id module tests
  • Loading branch information
aksiome authored Mar 25, 2024
2 parents 3ce99f6 + a94d25c commit b341e9f
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions datapacks/Bookshelf/data/bs.id/tests/update_cuids.mcfunction
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Updating cuids always returns a continuous chain
# @batch bs.id

execute summon minecraft:marker run function #bs.id:give_cuid
execute summon minecraft:armor_stand run function #bs.id:give_cuid
execute summon minecraft:armor_stand run function #bs.id:give_cuid
execute summon minecraft:marker run function #bs.id:give_cuid
execute summon minecraft:marker run function #bs.id:give_cuid
execute summon minecraft:armor_stand run function #bs.id:give_cuid
execute summon minecraft:marker run function #bs.id:give_cuid
kill @e[type=minecraft:armor_stand,distance=..1]

function #bs.id:update_cuids
scoreboard players set #packtest.i bs.data 0
execute store result score #packtest bs.data run scoreboard players operation #packtest.i bs.data > @e bs.cid
execute as @e[type=minecraft:marker] if score @s bs.cid = #packtest.i bs.data run scoreboard players remove #packtest.i bs.data 1
execute as @e[type=minecraft:marker] if score @s bs.cid = #packtest.i bs.data run scoreboard players remove #packtest.i bs.data 1
execute as @e[type=minecraft:marker] if score @s bs.cid = #packtest.i bs.data run scoreboard players remove #packtest.i bs.data 1
execute as @e[type=minecraft:marker] if score @s bs.cid = #packtest.i bs.data run scoreboard players remove #packtest.i bs.data 1
scoreboard players operation #packtest bs.data -= #packtest.i bs.data
kill @e[type=minecraft:marker,distance=..1]
assert score #packtest bs.data matches 4

0 comments on commit b341e9f

Please sign in to comment.