# One-time setup/upgrade for UI trigger objective (safe on existing worlds)

scoreboard objectives add bc_ui trigger

# Per-player UI state
scoreboard objectives add bc_ui_filter dummy
scoreboard objectives add bc_ui_last dummy
scoreboard objectives add bc_ui_page dummy
scoreboard objectives add bc_ui_idx dummy
scoreboard objectives add bc_ui_start dummy
scoreboard objectives add bc_ui_end dummy

# Default
scoreboard players set @a bc_ui 0
scoreboard players set @a bc_ui_filter 0
scoreboard players set @a bc_ui_last 9000
scoreboard players set @a bc_ui_page 1

data modify storage bordercraft:state ui_init set value 1b
