From 784d20c587cfccfafe1abfbebc5bdbce6d51640d Mon Sep 17 00:00:00 2001 From: NeunEinser Date: Thu, 4 Mar 2021 17:28:35 +0100 Subject: [PATCH] Command Queue: Refactor & Document This refactors command queue to be easier to understand and removes some unnecessary functions. Everything in there is now also documented (Work towards #5) and names are changed to follow #4. --- .../check_z_limit.mcfunction | 11 ++++++ .../next_negative_x.mcfunction | 8 ++++ .../next_negative_z.mcfunction | 8 ++++ .../next_positive_x.mcfunction | 8 ++++ .../next_positive_y.mcfunction | 8 ++++ .../next_positive_z.mcfunction | 8 ++++ .../run.mcfunction | 39 +++++++++++++++++++ .../init_for_new_tick.mcfunction | 23 +++++++++++ .../functions/command_queue/iter.mcfunction | 23 +++++++++++ .../functions/command_queue/run.mcfunction | 37 ++++++++++++++++++ data/bingo/functions/init/init.mcfunction | 6 --- .../item_detection/helper/announce.mcfunction | 12 +++--- .../check_limits.mcfunction | 10 ----- .../check_z_limit.mcfunction | 4 -- .../init_new_run.mcfunction | 7 ---- .../run_command_from_string/iter.mcfunction | 9 ----- .../next_negative_x.mcfunction | 2 - .../next_negative_z.mcfunction | 2 - .../next_positive_x.mcfunction | 2 - .../next_positive_z.mcfunction | 2 - .../run_command_from_string/next_x.mcfunction | 2 - .../run_command_from_string/next_y.mcfunction | 2 - .../run_command_from_string/next_z.mcfunction | 2 - .../run_command_from_string/run.mcfunction | 3 -- .../set_command_block.mcfunction | 4 -- 25 files changed, 179 insertions(+), 63 deletions(-) create mode 100644 data/bingo/functions/command_queue/claculate_next_position_and_set_command_block/check_z_limit.mcfunction create mode 100644 data/bingo/functions/command_queue/claculate_next_position_and_set_command_block/next_negative_x.mcfunction create mode 100644 data/bingo/functions/command_queue/claculate_next_position_and_set_command_block/next_negative_z.mcfunction create mode 100644 data/bingo/functions/command_queue/claculate_next_position_and_set_command_block/next_positive_x.mcfunction create mode 100644 data/bingo/functions/command_queue/claculate_next_position_and_set_command_block/next_positive_y.mcfunction create mode 100644 data/bingo/functions/command_queue/claculate_next_position_and_set_command_block/next_positive_z.mcfunction create mode 100644 data/bingo/functions/command_queue/claculate_next_position_and_set_command_block/run.mcfunction create mode 100644 data/bingo/functions/command_queue/init_for_new_tick.mcfunction create mode 100644 data/bingo/functions/command_queue/iter.mcfunction create mode 100644 data/bingo/functions/command_queue/run.mcfunction delete mode 100644 data/bingo/functions/run_command_from_string/check_limits.mcfunction delete mode 100644 data/bingo/functions/run_command_from_string/check_z_limit.mcfunction delete mode 100644 data/bingo/functions/run_command_from_string/init_new_run.mcfunction delete mode 100644 data/bingo/functions/run_command_from_string/iter.mcfunction delete mode 100644 data/bingo/functions/run_command_from_string/next_negative_x.mcfunction delete mode 100644 data/bingo/functions/run_command_from_string/next_negative_z.mcfunction delete mode 100644 data/bingo/functions/run_command_from_string/next_positive_x.mcfunction delete mode 100644 data/bingo/functions/run_command_from_string/next_positive_z.mcfunction delete mode 100644 data/bingo/functions/run_command_from_string/next_x.mcfunction delete mode 100644 data/bingo/functions/run_command_from_string/next_y.mcfunction delete mode 100644 data/bingo/functions/run_command_from_string/next_z.mcfunction delete mode 100644 data/bingo/functions/run_command_from_string/run.mcfunction delete mode 100644 data/bingo/functions/run_command_from_string/set_command_block.mcfunction diff --git a/data/bingo/functions/command_queue/claculate_next_position_and_set_command_block/check_z_limit.mcfunction b/data/bingo/functions/command_queue/claculate_next_position_and_set_command_block/check_z_limit.mcfunction new file mode 100644 index 00000000..4532b818 --- /dev/null +++ b/data/bingo/functions/command_queue/claculate_next_position_and_set_command_block/check_z_limit.mcfunction @@ -0,0 +1,11 @@ +#> bingo:command_queue/claculate_next_position_and_set_command_block/check_z_limit +# +# This function checks z limits and moves to the next z or y position, depending +# on the result +# +# @within function bingo:command_queue/claculate_next_position_and_set_command_block/run + +execute if score $command_queue/next_pos.mody bingo.tmp matches 0 if score $command_queue.z bingo.tmp matches 15 run function bingo:command_queue/claculate_next_position_and_set_command_block/next_positive_y +execute if score $command_queue/next_pos.mody bingo.tmp matches 1 if score $command_queue.z bingo.tmp matches 0 run function bingo:command_queue/claculate_next_position_and_set_command_block/next_positive_y +execute if score $command_queue/next_pos.mody bingo.tmp matches 0 unless score $command_queue.z bingo.tmp matches 15 run function bingo:command_queue/claculate_next_position_and_set_command_block/next_positive_z +execute if score $command_queue/next_pos.mody bingo.tmp matches 1 unless score $command_queue.z bingo.tmp matches 0 run function bingo:command_queue/claculate_next_position_and_set_command_block/next_negative_z \ No newline at end of file diff --git a/data/bingo/functions/command_queue/claculate_next_position_and_set_command_block/next_negative_x.mcfunction b/data/bingo/functions/command_queue/claculate_next_position_and_set_command_block/next_negative_x.mcfunction new file mode 100644 index 00000000..4c88f533 --- /dev/null +++ b/data/bingo/functions/command_queue/claculate_next_position_and_set_command_block/next_negative_x.mcfunction @@ -0,0 +1,8 @@ +#> bingo:command_queue/claculate_next_position_and_set_command_block/next_negative_x +# +# This function sets a command block facing west and moves to the negative x +# +# @within function bingo:command_queue/claculate_next_position_and_set_command_block/run + +setblock ~ ~ ~ minecraft:chain_command_block[facing=west]{auto: true} +scoreboard players remove $command_queue.x bingo.tmp 1 \ No newline at end of file diff --git a/data/bingo/functions/command_queue/claculate_next_position_and_set_command_block/next_negative_z.mcfunction b/data/bingo/functions/command_queue/claculate_next_position_and_set_command_block/next_negative_z.mcfunction new file mode 100644 index 00000000..8498fdb0 --- /dev/null +++ b/data/bingo/functions/command_queue/claculate_next_position_and_set_command_block/next_negative_z.mcfunction @@ -0,0 +1,8 @@ +#> bingo:command_queue/claculate_next_position_and_set_command_block/next_negative_z +# +# This function sets a command block facing west and moves to the negative z +# +# @within function bingo:command_queue/claculate_next_position_and_set_command_block/check_z_limit + +setblock ~ ~ ~ minecraft:chain_command_block[facing=north]{auto: true} +scoreboard players remove $command_queue.z bingo.tmp 1 \ No newline at end of file diff --git a/data/bingo/functions/command_queue/claculate_next_position_and_set_command_block/next_positive_x.mcfunction b/data/bingo/functions/command_queue/claculate_next_position_and_set_command_block/next_positive_x.mcfunction new file mode 100644 index 00000000..d15f7382 --- /dev/null +++ b/data/bingo/functions/command_queue/claculate_next_position_and_set_command_block/next_positive_x.mcfunction @@ -0,0 +1,8 @@ +#> bingo:command_queue/claculate_next_position_and_set_command_block/next_positive_x +# +# This function sets a command block facing east and moves to the positive x +# +# @within function bingo:command_queue/claculate_next_position_and_set_command_block/run + +setblock ~ ~ ~ minecraft:chain_command_block[facing=east]{auto: true} +scoreboard players add $command_queue.x bingo.tmp 1 \ No newline at end of file diff --git a/data/bingo/functions/command_queue/claculate_next_position_and_set_command_block/next_positive_y.mcfunction b/data/bingo/functions/command_queue/claculate_next_position_and_set_command_block/next_positive_y.mcfunction new file mode 100644 index 00000000..cacfa158 --- /dev/null +++ b/data/bingo/functions/command_queue/claculate_next_position_and_set_command_block/next_positive_y.mcfunction @@ -0,0 +1,8 @@ +#> bingo:command_queue/claculate_next_position_and_set_command_block/next_positive_y +# +# This function sets a command block facing up and moves to the positive y +# +# @within function bingo:command_queue/claculate_next_position_and_set_command_block/check_z_limit + +setblock ~ ~ ~ minecraft:chain_command_block[facing=up]{auto: true} +scoreboard players add $command_queue.y bingo.tmp 1 \ No newline at end of file diff --git a/data/bingo/functions/command_queue/claculate_next_position_and_set_command_block/next_positive_z.mcfunction b/data/bingo/functions/command_queue/claculate_next_position_and_set_command_block/next_positive_z.mcfunction new file mode 100644 index 00000000..7b0c81fa --- /dev/null +++ b/data/bingo/functions/command_queue/claculate_next_position_and_set_command_block/next_positive_z.mcfunction @@ -0,0 +1,8 @@ +#> bingo:command_queue/claculate_next_position_and_set_command_block/next_positive_z +# +# This function sets a command block facing south and moves to the positive z +# +# @within function bingo:command_queue/claculate_next_position_and_set_command_block/check_z_limit + +setblock ~ ~ ~ minecraft:chain_command_block[facing=south]{auto: true} +scoreboard players add $command_queue.z bingo.tmp 1 \ No newline at end of file diff --git a/data/bingo/functions/command_queue/claculate_next_position_and_set_command_block/run.mcfunction b/data/bingo/functions/command_queue/claculate_next_position_and_set_command_block/run.mcfunction new file mode 100644 index 00000000..d92a6bfc --- /dev/null +++ b/data/bingo/functions/command_queue/claculate_next_position_and_set_command_block/run.mcfunction @@ -0,0 +1,39 @@ +#> bingo:command_queue/claculate_next_position_and_set_command_block/run +# +# This function calculates the position for the next command block and stores it +# in $command_queue.x/y/z. +# +# The position of the marker aec is also changed in here. +# +# @within function bingo:command_queue/iter +# @writes +# score_holder $command_queue.x +# score_holder $command_queue.y +# score_holder $command_queue.z + +#> +# Contains the result of z % 2 +# +# @within bingo:command_queue/claculate_next_position_and_set_command_block/** +#declare score_holder $command_queue/next_pos.modz +#> +# Contains the result of y % 2 +# +# @within bingo:command_queue/claculate_next_position_and_set_command_block/** +#declare score_holder $command_queue/next_pos.mody + +scoreboard players operation $command_queue/next_pos.modz bingo.tmp = $command_queue.z bingo.tmp +scoreboard players operation $command_queue/next_pos.modz bingo.tmp %= 2 bingo.const +scoreboard players operation $command_queue/next_pos.mody bingo.tmp = $command_queue.y bingo.tmp +scoreboard players operation $command_queue/next_pos.mody bingo.tmp %= 2 bingo.const + +# Check for hitting the limit on the x axis. If (z % 2) == (y % 2), we move towards positive x, otherwise towards negative x. +execute if score $command_queue/next_pos.modz bingo.tmp = $command_queue/next_pos.mody bingo.tmp if score $command_queue.x bingo.tmp matches 15 run function bingo:command_queue/claculate_next_position_and_set_command_block/check_z_limit +execute unless score $command_queue/next_pos.modz bingo.tmp = $command_queue/next_pos.mody bingo.tmp if score $command_queue.x bingo.tmp matches 0 run function bingo:command_queue/claculate_next_position_and_set_command_block/check_z_limit + +execute if score $command_queue/next_pos.modz bingo.tmp = $command_queue/next_pos.mody bingo.tmp unless score $command_queue.x bingo.tmp matches 15 run function bingo:command_queue/claculate_next_position_and_set_command_block/next_positive_x +execute unless score $command_queue/next_pos.modz bingo.tmp = $command_queue/next_pos.mody bingo.tmp unless score $command_queue.x bingo.tmp matches 0 run function bingo:command_queue/claculate_next_position_and_set_command_block/next_negative_x + +execute store result entity @s Pos[0] double 1 run scoreboard players get $command_queue.x bingo.tmp +execute store result entity @s Pos[1] double 1 run scoreboard players get $command_queue.y bingo.tmp +execute store result entity @s Pos[2] double 1 run scoreboard players get $command_queue.z bingo.tmp \ No newline at end of file diff --git a/data/bingo/functions/command_queue/init_for_new_tick.mcfunction b/data/bingo/functions/command_queue/init_for_new_tick.mcfunction new file mode 100644 index 00000000..795417c1 --- /dev/null +++ b/data/bingo/functions/command_queue/init_for_new_tick.mcfunction @@ -0,0 +1,23 @@ +#> bingo:command_queue/init_for_new_tick +# +# This function initializes some values and entities needed for a run. +# It will only be executed once per tick. +# +# The area effect cloud spawned can be used as an indicator whether this +# function was already run in the current tick. +# +# The area effect cloud can be identified by the tag "bingp.command". +# +# @within function bingo:command_queue/run + +#> +# This tag identifies the area effect cloud used to set the command blocks. +# +# @within function bingo:command_queue/** +#declare tag bingo.command + +summon minecraft:area_effect_cloud 1 0 0 {Tags: ["bingo.command"]} +data merge block 0 0 0 {auto: true} +scoreboard players set $command_queue.x bingo.tmp 1 +scoreboard players set $command_queue.y bingo.tmp 0 +scoreboard players set $command_queue.z bingo.tmp 0 \ No newline at end of file diff --git a/data/bingo/functions/command_queue/iter.mcfunction b/data/bingo/functions/command_queue/iter.mcfunction new file mode 100644 index 00000000..9319b1b9 --- /dev/null +++ b/data/bingo/functions/command_queue/iter.mcfunction @@ -0,0 +1,23 @@ +#> bingo:command_queue/iter +# +# One iteration of the command queue. Places one command and is executed again +# automatically until there are no more commands in the given command queue. +# +# @within +# function bingo:command_queue/iter +# function bingo:command_queue/run + +#> +# Score holder to store the size of the current command queue. +# +# @private +#declare score_holder $command_queue/iter.size + +execute store result score $command_queue/iter.size bingo.tmp run data get storage temp:bingo.input/command_queue queue +execute if score $command_queue/iter.size bingo.tmp matches 2.. run function bingo:command_queue/claculate_next_position_and_set_command_block/run +execute if score $command_queue/iter.size bingo.tmp matches 1 run setblock ~ ~ ~ minecraft:chain_command_block[facing=down]{auto: true} + +data modify block ~ ~ ~ Command set from storage temp:bingo.input/command_queue queue[0] +data remove storage temp:bingo.input/command_queue queue[0] + +execute if score $command_queue/iter.size bingo.tmp matches 2.. at @s run function bingo:command_queue/iter \ No newline at end of file diff --git a/data/bingo/functions/command_queue/run.mcfunction b/data/bingo/functions/command_queue/run.mcfunction new file mode 100644 index 00000000..cf693577 --- /dev/null +++ b/data/bingo/functions/command_queue/run.mcfunction @@ -0,0 +1,37 @@ +#> bingo:command_queue/run +# +# This function runs the command queue. +# The command queue can execute a list of provided commands in the next tick. +# +# @internal +# @input storage temp:bingo.input/command_queue queue + +#> +# This storage is used as input by the command queue. +# It may only be read by related functions. +# +# It holds a list of commands to execute in the next tick. The field queue +# is used for that. +# +# @internal +#declare storage temp:bingo.input/command_queue + +#> +# This score holder holds the current x coordinate +# +# @within function bingo:command_queue/** +#declare score_holder $command_queue.x +#> +# This score holder holds the current y coordinate +# +# @within function bingo:command_queue/** +#declare score_holder $command_queue.y +#> +# This score holder holds the current z coordinate +# +# @within function bingo:command_queue/** +#declare score_holder $command_queue.z + +execute at @e[type=minecraft:area_effect_cloud, tag=bingo.command, limit=1] run data modify storage temp:bingo.input/command_queue queue prepend from block ~ ~ ~ Command +execute unless entity @e[type=minecraft:area_effect_cloud, tag=bingo.command, limit=1] in bingo:lobby run function bingo:command_queue/init_for_new_tick +execute as @e[type=minecraft:area_effect_cloud, tag=bingo.command, limit=1] at @s run function bingo:command_queue/iter \ No newline at end of file diff --git a/data/bingo/functions/init/init.mcfunction b/data/bingo/functions/init/init.mcfunction index 55a9162f..4a9ce41e 100644 --- a/data/bingo/functions/init/init.mcfunction +++ b/data/bingo/functions/init/init.mcfunction @@ -122,12 +122,6 @@ scoreboard objectives add bingo.tmp dummy # @public scoreboard objectives add bingo.const dummy -#> -# This objective is used by run_command_from_string. -# -# @internal -scoreboard objectives add bingo.commands dummy - #> # This objective is used to spread certain longer text messages across multiple # messages. diff --git a/data/bingo/functions/item_detection/helper/announce.mcfunction b/data/bingo/functions/item_detection/helper/announce.mcfunction index dd5dcfa1..b6230026 100644 --- a/data/bingo/functions/item_detection/helper/announce.mcfunction +++ b/data/bingo/functions/item_detection/helper/announce.mcfunction @@ -18,10 +18,10 @@ execute if score $items bingo.tmp matches 25 run tellraw @a {"translate": "bingo execute store result storage bingo:tmp player int 1 run scoreboard players get @s bingo.id data modify storage bingo:card slots[{selected: true}].players append from storage bingo:tmp player -data modify storage bingo:commands queue append from storage bingo:card slots[{selected: true}].item.clearCommand[0] -data modify storage bingo:commands queue append value "function bingo:item_detection/helper/tag_players_for_item_clear" -data modify storage bingo:commands queue append from storage bingo:card slots[{selected: true}].item.clearCommand[1] -data modify storage bingo:commands queue append value "tag @a remove bingo.clear" -data modify storage bingo:commands queue append value "data modify storage bingo:card slots[{selected: true}].selected set value false" +data modify storage temp:bingo.input/command_queue queue append from storage bingo:card slots[{selected: true}].item.clearCommand[0] +data modify storage temp:bingo.input/command_queue queue append value "function bingo:item_detection/helper/tag_players_for_item_clear" +data modify storage temp:bingo.input/command_queue queue append from storage bingo:card slots[{selected: true}].item.clearCommand[1] +data modify storage temp:bingo.input/command_queue queue append value "tag @a remove bingo.clear" +data modify storage temp:bingo.input/command_queue queue append value "data modify storage bingo:card slots[{selected: true}].selected set value false" -function bingo:run_command_from_string/run \ No newline at end of file +function bingo:command_queue/run \ No newline at end of file diff --git a/data/bingo/functions/run_command_from_string/check_limits.mcfunction b/data/bingo/functions/run_command_from_string/check_limits.mcfunction deleted file mode 100644 index 7887a4a0..00000000 --- a/data/bingo/functions/run_command_from_string/check_limits.mcfunction +++ /dev/null @@ -1,10 +0,0 @@ -scoreboard players operation $modz bingo.commands = $z bingo.commands -scoreboard players operation $modz bingo.commands %= 2 bingo.const -scoreboard players operation $mody bingo.commands = $y bingo.commands -scoreboard players operation $mody bingo.commands %= 2 bingo.const - -execute if score $modz bingo.commands = $mody bingo.commands if score $x bingo.commands matches 15 run function bingo:run_command_from_string/check_z_limit -execute unless score $modz bingo.commands = $mody bingo.commands if score $x bingo.commands matches 0 run function bingo:run_command_from_string/check_z_limit - -execute if score $modz bingo.commands = $mody bingo.commands unless score $x bingo.commands matches 15 run function bingo:run_command_from_string/next_x -execute unless score $modz bingo.commands = $mody bingo.commands unless score $x bingo.commands matches 0 run function bingo:run_command_from_string/next_x \ No newline at end of file diff --git a/data/bingo/functions/run_command_from_string/check_z_limit.mcfunction b/data/bingo/functions/run_command_from_string/check_z_limit.mcfunction deleted file mode 100644 index 46cd0385..00000000 --- a/data/bingo/functions/run_command_from_string/check_z_limit.mcfunction +++ /dev/null @@ -1,4 +0,0 @@ -execute if score $mody bingo.commands matches 0 if score $z bingo.commands matches 15 run function bingo:run_command_from_string/next_y -execute if score $mody bingo.commands matches 1 if score $z bingo.commands matches 0 run function bingo:run_command_from_string/next_y -execute if score $mody bingo.commands matches 0 unless score $z bingo.commands matches 15 run function bingo:run_command_from_string/next_z -execute if score $mody bingo.commands matches 1 unless score $z bingo.commands matches 0 run function bingo:run_command_from_string/next_z \ No newline at end of file diff --git a/data/bingo/functions/run_command_from_string/init_new_run.mcfunction b/data/bingo/functions/run_command_from_string/init_new_run.mcfunction deleted file mode 100644 index 158d6055..00000000 --- a/data/bingo/functions/run_command_from_string/init_new_run.mcfunction +++ /dev/null @@ -1,7 +0,0 @@ -#declare tag bingo.command - -summon minecraft:area_effect_cloud 1 0 0 {Tags: ["bingo.command"]} -data merge block 0 0 0 {auto: true} -scoreboard players set $x bingo.commands 1 -scoreboard players set $y bingo.commands 0 -scoreboard players set $z bingo.commands 0 \ No newline at end of file diff --git a/data/bingo/functions/run_command_from_string/iter.mcfunction b/data/bingo/functions/run_command_from_string/iter.mcfunction deleted file mode 100644 index f9ac935c..00000000 --- a/data/bingo/functions/run_command_from_string/iter.mcfunction +++ /dev/null @@ -1,9 +0,0 @@ -execute store result entity @s Pos[0] double 1 run scoreboard players get $x bingo.commands -execute store result entity @s Pos[1] double 1 run scoreboard players get $y bingo.commands -execute store result entity @s Pos[2] double 1 run scoreboard players get $z bingo.commands - -execute store result score $size bingo.commands run data get storage bingo:commands queue -execute at @s run function bingo:run_command_from_string/set_command_block - -data remove storage bingo:commands queue[0] -execute if score $size bingo.commands matches 1.. run function bingo:run_command_from_string/iter \ No newline at end of file diff --git a/data/bingo/functions/run_command_from_string/next_negative_x.mcfunction b/data/bingo/functions/run_command_from_string/next_negative_x.mcfunction deleted file mode 100644 index 74bfb826..00000000 --- a/data/bingo/functions/run_command_from_string/next_negative_x.mcfunction +++ /dev/null @@ -1,2 +0,0 @@ -setblock ~ ~ ~ minecraft:chain_command_block[facing=west]{auto: true} -scoreboard players remove $x bingo.commands 1 \ No newline at end of file diff --git a/data/bingo/functions/run_command_from_string/next_negative_z.mcfunction b/data/bingo/functions/run_command_from_string/next_negative_z.mcfunction deleted file mode 100644 index a07a53e2..00000000 --- a/data/bingo/functions/run_command_from_string/next_negative_z.mcfunction +++ /dev/null @@ -1,2 +0,0 @@ -setblock ~ ~ ~ minecraft:chain_command_block[facing=north]{auto: true} -scoreboard players remove $z bingo.commands 1 \ No newline at end of file diff --git a/data/bingo/functions/run_command_from_string/next_positive_x.mcfunction b/data/bingo/functions/run_command_from_string/next_positive_x.mcfunction deleted file mode 100644 index f8f2135d..00000000 --- a/data/bingo/functions/run_command_from_string/next_positive_x.mcfunction +++ /dev/null @@ -1,2 +0,0 @@ -setblock ~ ~ ~ minecraft:chain_command_block[facing=east]{auto: true} -scoreboard players add $x bingo.commands 1 \ No newline at end of file diff --git a/data/bingo/functions/run_command_from_string/next_positive_z.mcfunction b/data/bingo/functions/run_command_from_string/next_positive_z.mcfunction deleted file mode 100644 index 683a0f8a..00000000 --- a/data/bingo/functions/run_command_from_string/next_positive_z.mcfunction +++ /dev/null @@ -1,2 +0,0 @@ -setblock ~ ~ ~ minecraft:chain_command_block[facing=south]{auto: true} -scoreboard players add $z bingo.commands 1 \ No newline at end of file diff --git a/data/bingo/functions/run_command_from_string/next_x.mcfunction b/data/bingo/functions/run_command_from_string/next_x.mcfunction deleted file mode 100644 index 7aa62757..00000000 --- a/data/bingo/functions/run_command_from_string/next_x.mcfunction +++ /dev/null @@ -1,2 +0,0 @@ -execute if score $modz bingo.commands = $mody bingo.commands run function bingo:run_command_from_string/next_positive_x -execute unless score $modz bingo.commands = $mody bingo.commands run function bingo:run_command_from_string/next_negative_x \ No newline at end of file diff --git a/data/bingo/functions/run_command_from_string/next_y.mcfunction b/data/bingo/functions/run_command_from_string/next_y.mcfunction deleted file mode 100644 index ae41b31b..00000000 --- a/data/bingo/functions/run_command_from_string/next_y.mcfunction +++ /dev/null @@ -1,2 +0,0 @@ -setblock ~ ~ ~ minecraft:chain_command_block[facing=up]{auto: true} -scoreboard players add $y bingo.commands 1 \ No newline at end of file diff --git a/data/bingo/functions/run_command_from_string/next_z.mcfunction b/data/bingo/functions/run_command_from_string/next_z.mcfunction deleted file mode 100644 index 99e7540d..00000000 --- a/data/bingo/functions/run_command_from_string/next_z.mcfunction +++ /dev/null @@ -1,2 +0,0 @@ -execute if score $mody bingo.commands matches 0 run function bingo:run_command_from_string/next_positive_z -execute if score $mody bingo.commands matches 1 run function bingo:run_command_from_string/next_negative_z \ No newline at end of file diff --git a/data/bingo/functions/run_command_from_string/run.mcfunction b/data/bingo/functions/run_command_from_string/run.mcfunction deleted file mode 100644 index f2fc9d22..00000000 --- a/data/bingo/functions/run_command_from_string/run.mcfunction +++ /dev/null @@ -1,3 +0,0 @@ -execute at @e[type=minecraft:area_effect_cloud, tag=bingo.command, limit=1] run data modify storage bingo:commands queue prepend from block ~ ~ ~ Command -execute unless entity @e[type=minecraft:area_effect_cloud, tag=bingo.command, limit=1] in bingo:lobby run function bingo:run_command_from_string/init_new_run -execute as @e[type=minecraft:area_effect_cloud, tag=bingo.command, limit=1] at @s run function bingo:run_command_from_string/iter \ No newline at end of file diff --git a/data/bingo/functions/run_command_from_string/set_command_block.mcfunction b/data/bingo/functions/run_command_from_string/set_command_block.mcfunction deleted file mode 100644 index 3aa70563..00000000 --- a/data/bingo/functions/run_command_from_string/set_command_block.mcfunction +++ /dev/null @@ -1,4 +0,0 @@ -execute if score $size bingo.commands matches 2.. run function bingo:run_command_from_string/check_limits -execute if score $size bingo.commands matches 1 run setblock ~ ~ ~ minecraft:chain_command_block[facing=down]{auto: true} - -data modify block ~ ~ ~ Command set from storage bingo:commands queue[0]