-
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.
tick: Document and move related functions to sub-folder
This documents the tick and set_player_id function (work towards #5). Both functions are moved to the tick subfolder now.
- Loading branch information
1 parent
a7cdefa
commit ada088d
Showing
4 changed files
with
31 additions
and
7 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,15 @@ | ||
#> bingo:tick/set_player_id | ||
# | ||
# This function gives @s a unique player ID. | ||
# | ||
# @within function bingo:tick/** | ||
# @context entity Player to give the next ID | ||
#> | ||
# Score holder which holds the next id. | ||
# This is part of the bingo.id objective | ||
# | ||
# @private | ||
#declare score_holder $next | ||
|
||
scoreboard players operation @s bingo.id = $next bingo.id | ||
scoreboard players add $next bingo.id 1 |
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,16 @@ | ||
#> bingo:tick/tick | ||
# | ||
# This function is called every tick | ||
# | ||
# This contains some base logic, but most of the stuff happens in | ||
# bingo:card_display/display_card or GAMELOOP_TO_BE_IMPLEMENTED | ||
# | ||
# @within tag/function minecraft:tick | ||
# @handles #minecraft:tick | ||
|
||
execute as @a run function bingo:card_display/display_card | ||
|
||
execute in bingo:lobby run function bingo:lobby/tick | ||
|
||
# Assign each player a unique ID | ||
execute as @a unless score @s bingo.id matches -2147483648.. run function bingo:tick/set_player_id |