-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
util: Document functions and minor improvements
This adds documentation to all util ffunctions. Work towards #5 Additionally, some names in match_uuid changed.
- Loading branch information
1 parent
8617e48
commit 3af131c
Showing
19 changed files
with
143 additions
and
9 deletions.
There are no files selected for viewing
8 changes: 4 additions & 4 deletions
8
data/bingo/functions/lobby/player_settings/save/new_config.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 |
---|---|---|
@@ -1,10 +1,10 @@ | ||
data modify storage bingo:player configurations append value {} | ||
data modify storage bingo:player configurations[-1].name set from entity @s Item.tag.display.Name | ||
|
||
data modify storage bingo:tmp uuid set from entity @s Thrower | ||
data modify storage temp.bingo:input/uuid uuid set from entity @s Thrower | ||
kill @s | ||
execute as @a run function bingo:util/match_uuid | ||
|
||
execute as @a[tag=bingo.uuid, limit=1] run function bingo:lobby/player_settings/save/copy_data_to_config | ||
execute as @a[tag=bingo.uuid, limit=1] run tellraw @s {"translate": "bingo.lobby.settings.player.save.new.success", "with": [{"storage": "bingo:player", "nbt": "configurations[-1].name", "interpret": true}]} | ||
tag @a[tag=bingo.uuid, limit=1] remove bingo.uuid | ||
execute as @a[tag=bingo.uuid_match, limit=1] run function bingo:lobby/player_settings/save/copy_data_to_config | ||
execute as @a[tag=bingo.uuid_match, limit=1] run tellraw @s {"translate": "bingo.lobby.settings.player.save.new.success", "with": [{"storage": "bingo:player", "nbt": "configurations[-1].name", "interpret": true}]} | ||
tag @a[tag=bingo.uuid_match, limit=1] remove bingo.uuid_match |
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
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 |
---|---|---|
@@ -1,2 +1,8 @@ | ||
#> bingo:util/find_player_team/aqua | ||
# | ||
# Marks team aqua as current team | ||
# | ||
# @within function bingo:util/find_player_team | ||
|
||
data modify storage bingo:card teams[{id:"bingo:aqua"}].selected set value true | ||
tag @a[team=bingo.aqua] add bingo.in_current_team |
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 |
---|---|---|
@@ -1,2 +1,8 @@ | ||
#> bingo:util/find_player_team/black | ||
# | ||
# Marks team aqua as current team | ||
# | ||
# @within function bingo:util/find_player_team | ||
|
||
data modify storage bingo:card teams[{id:"bingo:black"}].selected set value true | ||
tag @a[team=bingo.black] add bingo.in_current_team |
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 |
---|---|---|
@@ -1,2 +1,8 @@ | ||
#> bingo:util/find_player_team/blue | ||
# | ||
# Marks team blue as current team | ||
# | ||
# @within function bingo:util/find_player_team | ||
|
||
data modify storage bingo:card teams[{id:"bingo:blue"}].selected set value true | ||
tag @a[team=bingo.blue] add bingo.in_current_team |
6 changes: 6 additions & 0 deletions
6
data/bingo/functions/util/find_player_team/dark_aqua.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 |
---|---|---|
@@ -1,2 +1,8 @@ | ||
#> bingo:util/find_player_team/dark_aqua | ||
# | ||
# Marks team dark_aqua as current team | ||
# | ||
# @within function bingo:util/find_player_team | ||
|
||
data modify storage bingo:card teams[{id:"bingo:dark_aqua"}].selected set value true | ||
tag @a[team=bingo.dark_aqua] add bingo.in_current_team |
6 changes: 6 additions & 0 deletions
6
data/bingo/functions/util/find_player_team/dark_blue.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 |
---|---|---|
@@ -1,2 +1,8 @@ | ||
#> bingo:util/find_player_team/dark_blue | ||
# | ||
# Marks team dark_blue as current team | ||
# | ||
# @within function bingo:util/find_player_team | ||
|
||
data modify storage bingo:card teams[{id:"bingo:dark_blue"}].selected set value true | ||
tag @a[team=bingo.dark_blue] add bingo.in_current_team |
6 changes: 6 additions & 0 deletions
6
data/bingo/functions/util/find_player_team/dark_gray.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 |
---|---|---|
@@ -1,2 +1,8 @@ | ||
#> bingo:util/find_player_team/dark_gray | ||
# | ||
# Marks team dark_gray as current team | ||
# | ||
# @within function bingo:util/find_player_team | ||
|
||
data modify storage bingo:card teams[{id:"bingo:dark_gray"}].selected set value true | ||
tag @a[team=bingo.dark_gray] add bingo.in_current_team |
6 changes: 6 additions & 0 deletions
6
data/bingo/functions/util/find_player_team/dark_green.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 |
---|---|---|
@@ -1,2 +1,8 @@ | ||
#> bingo:util/find_player_team/dark_green | ||
# | ||
# Marks team dark_green as current team | ||
# | ||
# @within function bingo:util/find_player_team | ||
|
||
data modify storage bingo:card teams[{id:"bingo:dark_green"}].selected set value true | ||
tag @a[team=bingo.dark_green] add bingo.in_current_team |
6 changes: 6 additions & 0 deletions
6
data/bingo/functions/util/find_player_team/dark_purple.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 |
---|---|---|
@@ -1,2 +1,8 @@ | ||
#> bingo:util/find_player_team/dark_purple | ||
# | ||
# Marks team dark_purple as current team | ||
# | ||
# @within function bingo:util/find_player_team | ||
|
||
data modify storage bingo:card teams[{id:"bingo:dark_purple"}].selected set value true | ||
tag @a[team=bingo.dark_purpl] add bingo.in_current_team |
6 changes: 6 additions & 0 deletions
6
data/bingo/functions/util/find_player_team/dark_red.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 |
---|---|---|
@@ -1,2 +1,8 @@ | ||
#> bingo:util/find_player_team/dark_red | ||
# | ||
# Marks team dark_red as current team | ||
# | ||
# @within function bingo:util/find_player_team | ||
|
||
data modify storage bingo:card teams[{id:"bingo:dark_red"}].selected set value true | ||
tag @a[team=bingo.dark_red] add bingo.in_current_team |
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 |
---|---|---|
@@ -1,2 +1,8 @@ | ||
#> bingo:util/find_player_team/gold | ||
# | ||
# Marks team gold as current team | ||
# | ||
# @within function bingo:util/find_player_team | ||
|
||
data modify storage bingo:card teams[{id:"bingo:gold"}].selected set value true | ||
tag @a[team=bingo.gold] add bingo.in_current_team |
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 |
---|---|---|
@@ -1,2 +1,8 @@ | ||
#> bingo:util/find_player_team/gray | ||
# | ||
# Marks team gray as current team | ||
# | ||
# @within function bingo:util/find_player_team | ||
|
||
data modify storage bingo:card teams[{id:"bingo:gray"}].selected set value true | ||
tag @a[team=bingo.gray] add bingo.in_current_team |
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 |
---|---|---|
@@ -1,2 +1,8 @@ | ||
#> bingo:util/find_player_team/green | ||
# | ||
# Marks team green as current team | ||
# | ||
# @within function bingo:util/find_player_team | ||
|
||
data modify storage bingo:card teams[{id:"bingo:green"}].selected set value true | ||
tag @a[team=bingo.green] add bingo.in_current_team |
6 changes: 6 additions & 0 deletions
6
data/bingo/functions/util/find_player_team/light_purple.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 |
---|---|---|
@@ -1,2 +1,8 @@ | ||
#> bingo:util/find_player_team/light_purple | ||
# | ||
# Marks team light_purple as current team | ||
# | ||
# @within function bingo:util/find_player_team | ||
|
||
data modify storage bingo:card teams[{id:"bingo:light_purple"}].selected set value true | ||
tag @a[team=bingo.light_purp] add bingo.in_current_team |
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 |
---|---|---|
@@ -1,2 +1,8 @@ | ||
#> bingo:util/find_player_team/red | ||
# | ||
# Marks team red as current team | ||
# | ||
# @within function bingo:util/find_player_team | ||
|
||
data modify storage bingo:card teams[{id:"bingo:red"}].selected set value true | ||
tag @a[team=bingo.red] add bingo.in_current_team |
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 |
---|---|---|
@@ -1,2 +1,8 @@ | ||
#> bingo:util/find_player_team/white | ||
# | ||
# Marks team white as current team | ||
# | ||
# @within function bingo:util/find_player_team | ||
|
||
data modify storage bingo:card teams[{id:"bingo:white"}].selected set value true | ||
tag @a[team=bingo.white] add bingo.in_current_team |
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 |
---|---|---|
@@ -1,2 +1,8 @@ | ||
#> bingo:util/find_player_team/yellow | ||
# | ||
# Marks team yellow as current team | ||
# | ||
# @within function bingo:util/find_player_team | ||
|
||
data modify storage bingo:card teams[{id:"bingo:yellow"}].selected set value true | ||
tag @a[team=bingo.yellow] add bingo.in_current_team |
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 |
---|---|---|
@@ -1,7 +1,28 @@ | ||
#Tags @s with bingo.uuid, if @s has the same UUID as bingo:tmp | ||
#declare tag bingo.uuid | ||
#> bingo:util/match_uuid | ||
# | ||
# Tags @s with bingo.uuid if the uuid of that entity matches the input. | ||
# | ||
# @internal | ||
# @input storage temp.bingo:input/uuid | ||
# @output tag bingo.uuid_match | ||
# @context entity Entity to check | ||
#> | ||
# @private | ||
#declare score_holder $match_uuid.success | ||
|
||
data modify storage bingo:tmp uuidCopy set from storage bingo:tmp uuid | ||
execute store success score $success bingo.tmp run data modify storage bingo:tmp uuidCopy set from entity @s UUID | ||
#> | ||
# Output tag for bingo:util/match_uuid | ||
# May only be set by this function | ||
# | ||
# @internal | ||
#declare tag bingo.uuid_match | ||
#> | ||
# Input for bingo:util/match_uuid | ||
# May only be read by this function | ||
# | ||
# @internal | ||
#declare storage temp.bingo:input/uuid | ||
|
||
execute if score $success bingo.tmp matches 0 run tag @s add bingo.uuid | ||
execute store success score $match_uuid.success bingo.tmp run data modify storage temp.bingo:input/uuid uuid set from entity @s UUID | ||
|
||
execute if score $match_uuid.success bingo.tmp matches 0 run tag @s add bingo.uuid_match |