Skip to content

Commit

Permalink
init: Shorten and rearange some score_holder declarations
Browse files Browse the repository at this point in the history
This moves the iterator score_holder declaration to
spawn_card_preview_frames.

$init/spawn_card_preview_frames.<name> score_holders are now using
$card_frames/spawn.<name> instead.
  • Loading branch information
NeunEinser committed Mar 2, 2021
1 parent 3af131c commit 3e388f9
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
7 changes: 1 addition & 6 deletions data/bingo/functions/init/setup_lobby.mcfunction
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,7 @@ setblock 4 62 4 minecraft:barrier
setblock 4 63 4 minecraft:chiseled_quartz_block

kill @e[type=minecraft:item_frame, tag=bingo.card_frame]
#>
# @within
# function bingo:init/setup_lobby
# function bingo:init/spawn_card_preview_frames
#declare score_holder $init/spawn_card_preview_frames.i
scoreboard players set $init/spawn_card_preview_frames.i bingo.tmp 0
scoreboard players set $card_frames/spawn.i bingo.tmp 0
execute positioned -2 68 -11 run function bingo:init/spawn_card_preview_frames

forceload remove -8 -8 7 7
Expand Down
19 changes: 12 additions & 7 deletions data/bingo/functions/init/spawn_card_preview_frames.mcfunction
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,24 @@
# top left
#>
# @private
#declare score_holder $init/spawn_card_preview_frames.mod
#declare score_holder $card_frames/spawn.row
#>
# @private
#declare tag bingo.new
#>
# @within
# function bingo:init/setup_lobby
# function bingo:init/spawn_card_preview_frames
#declare score_holder $card_frames/spawn.i

summon minecraft:item_frame ~ ~ ~ {Facing: 3b, Tags: ["bingo.card_frame", "bingo.new"], Item:{id:"minecraft:barrier", Count: 1b}, ItemDropChance: 0.0f}
scoreboard players operation @e[type=minecraft:item_frame, tag=bingo.card_frame, tag=bingo.new] bingo.frame_id = $init/spawn_card_preview_frames.i bingo.tmp
scoreboard players operation @e[type=minecraft:item_frame, tag=bingo.card_frame, tag=bingo.new] bingo.frame_id = $card_frames/spawn.i bingo.tmp

tag @e[type=minecraft:item_frame, tag=bingo.card_frame] remove bingo.new

scoreboard players add $init/spawn_card_preview_frames.i bingo.tmp 1
scoreboard players operation $init/spawn_card_preview_frames.mod bingo.tmp = $init/spawn_card_preview_frames.i bingo.tmp
scoreboard players operation $init/spawn_card_preview_frames.mod bingo.tmp %= 5 bingo.const
scoreboard players add $card_frames/spawn.i bingo.tmp 1
scoreboard players operation $card_frames/spawn.row bingo.tmp = $card_frames/spawn.i bingo.tmp
scoreboard players operation $card_frames/spawn.row bingo.tmp %= 5 bingo.const

execute if score $init/spawn_card_preview_frames.i bingo.tmp matches ..24 if score $init/spawn_card_preview_frames.mod bingo.tmp matches 1.. positioned ~1 ~ ~ run function bingo:init/spawn_card_preview_frames
execute if score $init/spawn_card_preview_frames.i bingo.tmp matches ..24 if score $init/spawn_card_preview_frames.mod bingo.tmp matches 0 positioned ~-4 ~-1 ~ run function bingo:init/spawn_card_preview_frames
execute if score $card_frames/spawn.i bingo.tmp matches ..24 if score $card_frames/spawn.row bingo.tmp matches 1.. positioned ~1 ~ ~ run function bingo:init/spawn_card_preview_frames
execute if score $card_frames/spawn.i bingo.tmp matches ..24 if score $card_frames/spawn.row bingo.tmp matches 0 positioned ~-4 ~-1 ~ run function bingo:init/spawn_card_preview_frames

0 comments on commit 3e388f9

Please sign in to comment.