-
-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #169 from aksiome/id-tests
✅ Id module tests
- Loading branch information
Showing
1 changed file
with
22 additions
and
0 deletions.
There are no files selected for viewing
22 changes: 22 additions & 0 deletions
22
datapacks/Bookshelf/data/bs.id/tests/update_cuids.mcfunction
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |