From da782491766454c455ec1395a2a67befb1b11974 Mon Sep 17 00:00:00 2001 From: Legends11 <235496468+tickwarden@users.noreply.github.com> Date: Mon, 1 Jun 2026 17:30:28 +0000 Subject: [PATCH 1/3] fix: resolve execution parsing crashes on load module --- .../core/internal/load/finalize.mcfunction | 2 +- .../core/internal/load/validate.mcfunction | 2 +- .../core/internal/load/version_warn.mcfunction | 2 +- 1_20_5/data/dl_load/functions/load/all.mcfunction | 4 ++-- fix.sh | 13 +++++++++++++ 5 files changed, 18 insertions(+), 5 deletions(-) create mode 100644 fix.sh diff --git a/1_20_5/data/dl_load/functions/core/internal/load/finalize.mcfunction b/1_20_5/data/dl_load/functions/core/internal/load/finalize.mcfunction index 662cb22..13e75d8 100644 --- a/1_20_5/data/dl_load/functions/core/internal/load/finalize.mcfunction +++ b/1_20_5/data/dl_load/functions/core/internal/load/finalize.mcfunction @@ -7,7 +7,7 @@ execute if score #dl.pre dl.pre_version matches ..0 run tellraw @a ["",{"text":" data modify storage datalib:engine _log_add_tmp.message set value "✔ All modules initialized. Engine ready." data modify storage datalib:input level set value "DL" data modify storage datalib:input color set value "green" -function datalib:systems/log/add with storage datalib:engine {} +function datalib:systems/log/add with storage datalib:engine _log_add_tmp data remove storage datalib:engine _log_add_tmp.message data remove storage datalib:input level data remove storage datalib:input color diff --git a/1_20_5/data/dl_load/functions/core/internal/load/validate.mcfunction b/1_20_5/data/dl_load/functions/core/internal/load/validate.mcfunction index fe583db..7b124e6 100644 --- a/1_20_5/data/dl_load/functions/core/internal/load/validate.mcfunction +++ b/1_20_5/data/dl_load/functions/core/internal/load/validate.mcfunction @@ -5,7 +5,7 @@ execute unless data storage datalib:engine log_display run data modify storage d execute unless score #dl.log_count dl.tmp matches 0.. run scoreboard players set #dl.log_count dl.tmp 0 execute if data storage datalib:engine global{loaded:1b} run data modify storage datalib:engine _log_add_tmp.message set value "Already loaded — skipping reload." -execute if data storage datalib:engine global{loaded:1b} run function datalib:systems/log/warn with storage datalib:engine {} +execute if data storage datalib:engine global{loaded:1b} run function datalib:systems/log/warn with storage datalib:engine _log_add_tmp execute if data storage datalib:engine global{loaded:1b} run return 0 scoreboard objectives add dl.pre_version dummy diff --git a/1_20_5/data/dl_load/functions/core/internal/load/version_warn.mcfunction b/1_20_5/data/dl_load/functions/core/internal/load/version_warn.mcfunction index b55fcd1..62803bf 100644 --- a/1_20_5/data/dl_load/functions/core/internal/load/version_warn.mcfunction +++ b/1_20_5/data/dl_load/functions/core/internal/load/version_warn.mcfunction @@ -4,5 +4,5 @@ tellraw @a ["",{"text":" ","color":"#555555"},{"text":"→ Run ","color":"gray"} tellraw @a[tag=datalib.debug] ["",{"text":"[DL] ","color":"#00AAAA","bold":true},{"text":"DEBUG ","color":"aqua"},{"text":"dl.pre_version scores → ","color":"#555555"},{"text":"major=","color":"gray"},{"score":{"name":"#dl.major","objective":"dl.pre_version"},"color":"yellow"},{"text":" minor=","color":"gray"},{"score":{"name":"#dl.minor","objective":"dl.pre_version"},"color":"yellow"},{"text":" patch=","color":"gray"},{"score":{"name":"#dl.patch","objective":"dl.pre_version"},"color":"yellow"},{"text":" pre=","color":"gray"},{"score":{"name":"#dl.pre","objective":"dl.pre_version"},"color":"yellow"},{"text":" (expected: 4 0 4 pre=0)","color":"red"}] data modify storage datalib:engine _log_add_tmp.message set value "✘ Version mismatch — expected v5.1.2. Load aborted." -function datalib:systems/log/warn with storage datalib:engine {} +function datalib:systems/log/warn with storage datalib:engine _log_add_tmp data remove storage datalib:engine _log_add_tmp.message \ No newline at end of file diff --git a/1_20_5/data/dl_load/functions/load/all.mcfunction b/1_20_5/data/dl_load/functions/load/all.mcfunction index 45bd104..4515f33 100644 --- a/1_20_5/data/dl_load/functions/load/all.mcfunction +++ b/1_20_5/data/dl_load/functions/load/all.mcfunction @@ -11,7 +11,7 @@ execute unless function dl_load:core/internal/load/validate run return 0 data modify storage datalib:engine _log_add_tmp.level set value "D.L." data modify storage datalib:engine _log_add_tmp.message set value "Starting..." data modify storage datalib:engine _log_add_tmp.color set value "aqua" -function datalib:systems/log/add with storage datalib:engine {} +function datalib:systems/log/add with storage datalib:engine _log_add_tmp # Stage 2 debug summon minecraft:marker ~ ~ ~ {Tags:["datalib.stage2"],CustomName:'{"text":"DL"}'} @@ -48,6 +48,6 @@ execute if score #dl.pre dl.pre_version matches ..0 run tellraw @a[tag=datalib.d data modify storage datalib:engine _log_add_tmp.level set value "dataLib" data modify storage datalib:engine _log_add_tmp.message set value "Loaded." data modify storage datalib:engine _log_add_tmp.color set value "green" -function datalib:systems/log/add with storage datalib:engine {} +function datalib:systems/log/add with storage datalib:engine _log_add_tmp function dl_load:core/internal/load/finalize \ No newline at end of file diff --git a/fix.sh b/fix.sh new file mode 100644 index 0000000..7a32e17 --- /dev/null +++ b/fix.sh @@ -0,0 +1,13 @@ +#!/usr/bin/env bash + +sed -i 's/with storage datalib:engine {}/with storage datalib:engine _log_add_tmp/g' 1_20_5/data/dl_load/functions/load/all.mcfunction + +sed -i 's/with storage datalib:engine {}/with storage datalib:engine _log_add_tmp/g' 1_20_5/data/dl_load/functions/core/internal/load/validate.mcfunction + +sed -i 's/with storage datalib:engine {}/with storage datalib:engine _log_add_tmp/g' 1_20_5/data/dl_load/functions/core/internal/load/finalize.mcfunction + +sed -i 's/with storage datalib:engine {}/with storage datalib:engine _log_add_tmp/g' 1_20_5/data/dl_load/functions/core/internal/load/version_warn.mcfunction + +git add . +git commit -m "fix: resolve execution parsing crashes on load module" +git push \ No newline at end of file From b7df70175c9ae84d995189ec1578b16ff632d6e0 Mon Sep 17 00:00:00 2001 From: Legends11 <235496468+tickwarden@users.noreply.github.com> Date: Mon, 1 Jun 2026 20:31:12 +0300 Subject: [PATCH 2/3] Delete fix.sh --- fix.sh | 13 ------------- 1 file changed, 13 deletions(-) delete mode 100644 fix.sh diff --git a/fix.sh b/fix.sh deleted file mode 100644 index 7a32e17..0000000 --- a/fix.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/usr/bin/env bash - -sed -i 's/with storage datalib:engine {}/with storage datalib:engine _log_add_tmp/g' 1_20_5/data/dl_load/functions/load/all.mcfunction - -sed -i 's/with storage datalib:engine {}/with storage datalib:engine _log_add_tmp/g' 1_20_5/data/dl_load/functions/core/internal/load/validate.mcfunction - -sed -i 's/with storage datalib:engine {}/with storage datalib:engine _log_add_tmp/g' 1_20_5/data/dl_load/functions/core/internal/load/finalize.mcfunction - -sed -i 's/with storage datalib:engine {}/with storage datalib:engine _log_add_tmp/g' 1_20_5/data/dl_load/functions/core/internal/load/version_warn.mcfunction - -git add . -git commit -m "fix: resolve execution parsing crashes on load module" -git push \ No newline at end of file From 0cb230fb8f9cbf810b7f64183fbae15e6a46eb81 Mon Sep 17 00:00:00 2001 From: Legends11 <235496468+tickwarden@users.noreply.github.com> Date: Mon, 1 Jun 2026 17:54:51 +0000 Subject: [PATCH 3/3] Fixes --- .../api/cmd/sandbox_blocked.mcfunction | 0 .../core/security/type_violation.mcfunction | 27 ----- .../core/tick/player_systems.mcfunction | 19 ---- .../data/datalib/function/disable.mcfunction | 5 - .../function/systems/log/show.mcfunction | 8 -- .../systems/string/hover_text.mcfunction | 1 - .../systems/string/tooltip_item.mcfunction | 1 - 1_21_5/data/datalib/function/tick.mcfunction | 17 --- .../data/datalib/function/version.mcfunction | 22 ---- 1_21_5/data/dl_load/function/_.mcfunction | 29 ----- .../dl_load/function/gate/exec/ban.mcfunction | 13 --- .../function/gate/exec/ban_ip.mcfunction | 10 -- .../function/gate/exec/disable.mcfunction | 13 --- .../data/dl_load/function/gate/no.mcfunction | 28 ----- .../dl_load/function/gate/request.mcfunction | 41 ------- .../dl_load/function/gate/timeout.mcfunction | 12 --- .../data/dl_load/function/gate/yes.mcfunction | 51 --------- .../data/dl_load/function/load/all.mcfunction | 53 --------- .../dl_load/function/load/confirm.mcfunction | 72 ------------- .../data/dl_load/function/load/no.mcfunction | 39 ------- .../function/load/post_load.mcfunction | 7 -- .../dl_load/function/load/storages.mcfunction | 102 ------------------ .../function/load/version_warn.mcfunction | 0 .../data/dl_load/function/load/yes.mcfunction | 47 -------- .../dl_load/function/safe_load/no.mcfunction | 23 ---- .../dl_load/function/safe_load/yes.mcfunction | 62 ----------- .../load/function/_private/init.mcfunction | 3 - .../load/tags/function/_private/init.json | 5 - .../load/tags/function/_private/load.json | 8 -- 1_21_5/data/load/tags/function/load.json | 7 -- 1_21_5/data/load/tags/function/post_load.json | 5 - 1_21_5/data/load/tags/function/pre_load.json | 5 - 1_21_5/data/minecraft/tags/function/load.json | 5 - .../data/dl_load/function/load/all.mcfunction | 2 +- .../function/api/dialog/load_exec.mcfunction | 4 - .../function/api/dialog/show.mcfunction | 18 ---- .../api/dialog/show_dialog_exec.mcfunction | 3 - .../function/load/version_warn.mcfunction | 8 -- .../systems/hook/killed_by_arrow.json | 18 ---- .../function/api/dialog/close.mcfunction | 5 - .../function/api/dialog/load.mcfunction | 2 - .../function/api/dialog/load_exec.mcfunction | 0 .../api/dialog/notify_admins.mcfunction | 5 - .../function/api/dialog/open.mcfunction | 16 --- .../function/api/dialog/show.mcfunction | 0 .../api/dialog/show_dialog_exec.mcfunction | 0 .../core/security/type_violation.mcfunction | 21 ---- .../core/tick/player_systems.mcfunction | 28 ----- 26_2/data/datalib/function/disable.mcfunction | 5 - .../function/systems/log/show.mcfunction | 8 -- .../function/systems/security/menu.mcfunction | 18 ---- .../systems/security/menu_build.mcfunction | 15 --- .../systems/string/hover_text.mcfunction | 1 - .../systems/string/tooltip_item.mcfunction | 1 - 26_2/data/datalib/function/tick.mcfunction | 17 --- 26_2/data/datalib/function/version.mcfunction | 22 ---- .../function/world/get_time.mcfunction | 16 --- .../function/world/time_phase.mcfunction | 39 ------- 26_2/data/datalib/predicate/is_creative.json | 12 --- 26_2/data/datalib/predicate/is_daytime.json | 8 -- .../datalib/predicate/is_full_health.json | 10 -- 26_2/data/datalib/predicate/is_survival.json | 12 --- .../datalib/tags/function/admin/menu.json | 6 -- 26_2/data/dl_load/function/_.mcfunction | 29 ----- .../dl_load/function/gate/exec/ban.mcfunction | 13 --- .../function/gate/exec/ban_ip.mcfunction | 10 -- .../function/gate/exec/disable.mcfunction | 13 --- 26_2/data/dl_load/function/gate/no.mcfunction | 28 ----- .../dl_load/function/gate/request.mcfunction | 41 ------- .../dl_load/function/gate/timeout.mcfunction | 12 --- .../data/dl_load/function/gate/yes.mcfunction | 51 --------- .../data/dl_load/function/load/all.mcfunction | 53 --------- .../dl_load/function/load/confirm.mcfunction | 72 ------------- 26_2/data/dl_load/function/load/no.mcfunction | 39 ------- .../function/load/post_load.mcfunction | 7 -- .../dl_load/function/load/storages.mcfunction | 102 ------------------ .../function/load/version_warn.mcfunction | 0 .../data/dl_load/function/load/yes.mcfunction | 47 -------- .../dl_load/function/safe_load/no.mcfunction | 23 ---- .../dl_load/function/safe_load/yes.mcfunction | 62 ----------- 26_2/data/minecraft/tags/function/load.json | 5 - .../advancement/v1/attack_click_entity.json | 16 --- .../advancement/v1/interact_click_entity.json | 16 --- .../predicate/v1/riding_boat.json | 9 -- .../predicate/v1/riding_donkey.json | 9 -- .../predicate/v1/riding_horse.json | 9 -- .../predicate/v1/riding_llama.json | 9 -- .../predicate/v1/riding_minecart.json | 9 -- .../predicate/v1/riding_mule.json | 9 -- .../predicate/v1/riding_pig.json | 9 -- .../predicate/v1/riding_strider.json | 9 -- 91 files changed, 1 insertion(+), 1770 deletions(-) rename 1_21_5/{core/internal => }/data/datalib/function/api/cmd/sandbox_blocked.mcfunction (100%) delete mode 100644 1_21_5/data/datalib/function/core/security/type_violation.mcfunction delete mode 100644 1_21_5/data/datalib/function/core/tick/player_systems.mcfunction delete mode 100644 1_21_5/data/datalib/function/disable.mcfunction delete mode 100644 1_21_5/data/datalib/function/systems/log/show.mcfunction delete mode 100644 1_21_5/data/datalib/function/systems/string/hover_text.mcfunction delete mode 100644 1_21_5/data/datalib/function/systems/string/tooltip_item.mcfunction delete mode 100644 1_21_5/data/datalib/function/tick.mcfunction delete mode 100644 1_21_5/data/datalib/function/version.mcfunction delete mode 100644 1_21_5/data/dl_load/function/_.mcfunction delete mode 100644 1_21_5/data/dl_load/function/gate/exec/ban.mcfunction delete mode 100644 1_21_5/data/dl_load/function/gate/exec/ban_ip.mcfunction delete mode 100644 1_21_5/data/dl_load/function/gate/exec/disable.mcfunction delete mode 100644 1_21_5/data/dl_load/function/gate/no.mcfunction delete mode 100644 1_21_5/data/dl_load/function/gate/request.mcfunction delete mode 100644 1_21_5/data/dl_load/function/gate/timeout.mcfunction delete mode 100644 1_21_5/data/dl_load/function/gate/yes.mcfunction delete mode 100644 1_21_5/data/dl_load/function/load/all.mcfunction delete mode 100644 1_21_5/data/dl_load/function/load/confirm.mcfunction delete mode 100644 1_21_5/data/dl_load/function/load/no.mcfunction delete mode 100644 1_21_5/data/dl_load/function/load/post_load.mcfunction delete mode 100644 1_21_5/data/dl_load/function/load/storages.mcfunction rename 1_21_5/{core/internal => }/data/dl_load/function/load/version_warn.mcfunction (100%) delete mode 100644 1_21_5/data/dl_load/function/load/yes.mcfunction delete mode 100644 1_21_5/data/dl_load/function/safe_load/no.mcfunction delete mode 100644 1_21_5/data/dl_load/function/safe_load/yes.mcfunction delete mode 100644 1_21_5/data/load/function/_private/init.mcfunction delete mode 100644 1_21_5/data/load/tags/function/_private/init.json delete mode 100644 1_21_5/data/load/tags/function/_private/load.json delete mode 100644 1_21_5/data/load/tags/function/load.json delete mode 100644 1_21_5/data/load/tags/function/post_load.json delete mode 100644 1_21_5/data/load/tags/function/pre_load.json delete mode 100644 1_21_5/data/minecraft/tags/function/load.json delete mode 100644 26_2/core/internal/data/datalib/function/api/dialog/load_exec.mcfunction delete mode 100644 26_2/core/internal/data/datalib/function/api/dialog/show.mcfunction delete mode 100644 26_2/core/internal/data/datalib/function/api/dialog/show_dialog_exec.mcfunction delete mode 100644 26_2/core/internal/data/dl_load/function/load/version_warn.mcfunction delete mode 100644 26_2/data/datalib/advancement/systems/hook/killed_by_arrow.json delete mode 100644 26_2/data/datalib/function/api/dialog/close.mcfunction delete mode 100644 26_2/data/datalib/function/api/dialog/load.mcfunction rename {1_21_6/core/internal => 26_2}/data/datalib/function/api/dialog/load_exec.mcfunction (100%) delete mode 100644 26_2/data/datalib/function/api/dialog/notify_admins.mcfunction delete mode 100644 26_2/data/datalib/function/api/dialog/open.mcfunction rename {1_21_6/core/internal => 26_2}/data/datalib/function/api/dialog/show.mcfunction (100%) rename {1_21_6/core/internal => 26_2}/data/datalib/function/api/dialog/show_dialog_exec.mcfunction (100%) delete mode 100644 26_2/data/datalib/function/core/security/type_violation.mcfunction delete mode 100644 26_2/data/datalib/function/core/tick/player_systems.mcfunction delete mode 100644 26_2/data/datalib/function/disable.mcfunction delete mode 100644 26_2/data/datalib/function/systems/log/show.mcfunction delete mode 100644 26_2/data/datalib/function/systems/security/menu.mcfunction delete mode 100644 26_2/data/datalib/function/systems/security/menu_build.mcfunction delete mode 100644 26_2/data/datalib/function/systems/string/hover_text.mcfunction delete mode 100644 26_2/data/datalib/function/systems/string/tooltip_item.mcfunction delete mode 100644 26_2/data/datalib/function/tick.mcfunction delete mode 100644 26_2/data/datalib/function/version.mcfunction delete mode 100644 26_2/data/datalib/function/world/get_time.mcfunction delete mode 100644 26_2/data/datalib/function/world/time_phase.mcfunction delete mode 100644 26_2/data/datalib/predicate/is_creative.json delete mode 100644 26_2/data/datalib/predicate/is_daytime.json delete mode 100644 26_2/data/datalib/predicate/is_full_health.json delete mode 100644 26_2/data/datalib/predicate/is_survival.json delete mode 100644 26_2/data/datalib/tags/function/admin/menu.json delete mode 100644 26_2/data/dl_load/function/_.mcfunction delete mode 100644 26_2/data/dl_load/function/gate/exec/ban.mcfunction delete mode 100644 26_2/data/dl_load/function/gate/exec/ban_ip.mcfunction delete mode 100644 26_2/data/dl_load/function/gate/exec/disable.mcfunction delete mode 100644 26_2/data/dl_load/function/gate/no.mcfunction delete mode 100644 26_2/data/dl_load/function/gate/request.mcfunction delete mode 100644 26_2/data/dl_load/function/gate/timeout.mcfunction delete mode 100644 26_2/data/dl_load/function/gate/yes.mcfunction delete mode 100644 26_2/data/dl_load/function/load/all.mcfunction delete mode 100644 26_2/data/dl_load/function/load/confirm.mcfunction delete mode 100644 26_2/data/dl_load/function/load/no.mcfunction delete mode 100644 26_2/data/dl_load/function/load/post_load.mcfunction delete mode 100644 26_2/data/dl_load/function/load/storages.mcfunction rename {1_21_6/core/internal => 26_2}/data/dl_load/function/load/version_warn.mcfunction (100%) delete mode 100644 26_2/data/dl_load/function/load/yes.mcfunction delete mode 100644 26_2/data/dl_load/function/safe_load/no.mcfunction delete mode 100644 26_2/data/dl_load/function/safe_load/yes.mcfunction delete mode 100644 26_2/data/minecraft/tags/function/load.json delete mode 100644 26_2/data/player_action/advancement/v1/attack_click_entity.json delete mode 100644 26_2/data/player_action/advancement/v1/interact_click_entity.json delete mode 100644 26_2/data/player_action/predicate/v1/riding_boat.json delete mode 100644 26_2/data/player_action/predicate/v1/riding_donkey.json delete mode 100644 26_2/data/player_action/predicate/v1/riding_horse.json delete mode 100644 26_2/data/player_action/predicate/v1/riding_llama.json delete mode 100644 26_2/data/player_action/predicate/v1/riding_minecart.json delete mode 100644 26_2/data/player_action/predicate/v1/riding_mule.json delete mode 100644 26_2/data/player_action/predicate/v1/riding_pig.json delete mode 100644 26_2/data/player_action/predicate/v1/riding_strider.json diff --git a/1_21_5/core/internal/data/datalib/function/api/cmd/sandbox_blocked.mcfunction b/1_21_5/data/datalib/function/api/cmd/sandbox_blocked.mcfunction similarity index 100% rename from 1_21_5/core/internal/data/datalib/function/api/cmd/sandbox_blocked.mcfunction rename to 1_21_5/data/datalib/function/api/cmd/sandbox_blocked.mcfunction diff --git a/1_21_5/data/datalib/function/core/security/type_violation.mcfunction b/1_21_5/data/datalib/function/core/security/type_violation.mcfunction deleted file mode 100644 index c0e45e4..0000000 --- a/1_21_5/data/datalib/function/core/security/type_violation.mcfunction +++ /dev/null @@ -1,27 +0,0 @@ -# datalib:core/security/type_violation [1.21.5+ overlay] -# Extends base type_violation with test_block server-log entry. -# -# test_block (log mode) was added in Java Edition 25w03a (1.21.5). -# When powered by redstone it writes the message to the server log file, -# providing a persistent audit trail outside the in-game log buffer. -# -# Block placement: y=-62 in dataLib forceloaded chunk (0,0). -# Placed, powered, and removed in the same tick. - -# ─── base type_violation (log + tellraw + kick) ────────────────── -data modify storage datalib:engine _log_add_tmp.message set value "[Security] type_violation — command type not in allowlist" -data modify storage datalib:engine _log_add_tmp.level set value "ERROR" -data modify storage datalib:engine _log_add_tmp.color set value "red" -execute if score #dl.log_level dl.log_level matches 2.. run function datalib:systems/log/add with storage datalib:engine _log_add_tmp -data remove storage datalib:engine _log_add_tmp.message -data remove storage datalib:engine _log_add_tmp.level -data remove storage datalib:engine _log_add_tmp.color - -tellraw @s ["",{"text":"[DL] ","color":"#00AAAA","bold":true},{"text":"✘ ","color":"red"},{"text":"Security violation: command type not permitted in sandbox mode.","color":"red"}] -tellraw @a[tag=datalib.debug] ["",{"text":"[DL] ","color":"#00AAAA","bold":true},{"text":"TYPE VIOLATION ","color":"red","bold":true},{"selector":"@s","color":"gold"},{"text":" — blocked (not in allowlist)","color":"red"}] - -# ─── server log via test_block ─────────────────────────────────── -setblock 0 -62 0 minecraft:test_block[mode=log]{message:"[DL SECURITY] type_violation — command type not in allowlist. Run /function datalib:systems/log/show for details."} -setblock 0 -61 0 minecraft:redstone_block -setblock 0 -61 0 minecraft:air -setblock 0 -62 0 minecraft:air diff --git a/1_21_5/data/datalib/function/core/tick/player_systems.mcfunction b/1_21_5/data/datalib/function/core/tick/player_systems.mcfunction deleted file mode 100644 index 1537c96..0000000 --- a/1_21_5/data/datalib/function/core/tick/player_systems.mcfunction +++ /dev/null @@ -1,19 +0,0 @@ -execute as @a[scores={dl_menu=1..}] run function datalib:menu -scoreboard players set @a[scores={dl_menu=1..}] dl_menu 0 -scoreboard players enable @a[scores={dl_menu=-1..}] dl_menu - -execute as @a[scores={dl_run=1..}] run function #datalib:run -scoreboard players set @a[scores={dl_run=1..}] dl_run 0 -scoreboard players enable @a[scores={dl_run=-1..}] dl_run - -execute as @a[scores={dl_action=1..}] run function datalib:core/internal/api/trigger/dispatch - -function datalib:core/internal/api/interaction/tick_scan - -function datalib:core/internal/api/perm/trigger/tick_start - -function datalib:core/internal/api/wand/tick_scan -function datalib:core/internal/systems/hook/tick_scan - -function datalib:core/internal/systems/geo/region_watch/tick_scan -function datalib:core/internal/api/cmd/freeze/tick \ No newline at end of file diff --git a/1_21_5/data/datalib/function/disable.mcfunction b/1_21_5/data/datalib/function/disable.mcfunction deleted file mode 100644 index 55d04d5..0000000 --- a/1_21_5/data/datalib/function/disable.mcfunction +++ /dev/null @@ -1,5 +0,0 @@ -playsound minecraft:block.note_block.pling master @s ~ ~ ~ 4 2 - -function datalib:core/disable/main - -tellraw @s [{"text":"To restart:"}," ",{"text":"Reload Dataa!","color":"aqua","bold":true,"italic":false}] \ No newline at end of file diff --git a/1_21_5/data/datalib/function/systems/log/show.mcfunction b/1_21_5/data/datalib/function/systems/log/show.mcfunction deleted file mode 100644 index cc1cee8..0000000 --- a/1_21_5/data/datalib/function/systems/log/show.mcfunction +++ /dev/null @@ -1,8 +0,0 @@ -execute unless data storage datalib:engine log_display[0] run tellraw @s {"text":"[Log] No entries.","color":"gray","italic":false} -execute unless data storage datalib:engine log_display[0] run return 0 - -function datalib:core/lib/input_push -data modify storage datalib:engine _felist_input set from storage datalib:engine log_display -data modify storage datalib:input func set value "datalib:core/internal/systems/log/print_entry" -function datalib:core/lib/for_each_list with storage datalib:input {} -function datalib:core/lib/input_pop diff --git a/1_21_5/data/datalib/function/systems/string/hover_text.mcfunction b/1_21_5/data/datalib/function/systems/string/hover_text.mcfunction deleted file mode 100644 index 48f301d..0000000 --- a/1_21_5/data/datalib/function/systems/string/hover_text.mcfunction +++ /dev/null @@ -1 +0,0 @@ -$tellraw $(target) {"text":"$(text)","color":"$(color)","hover_event":{"action":"show_text","value":{"text":"$(hover)","color":"$(hover_color)"}}} diff --git a/1_21_5/data/datalib/function/systems/string/tooltip_item.mcfunction b/1_21_5/data/datalib/function/systems/string/tooltip_item.mcfunction deleted file mode 100644 index 4500bc1..0000000 --- a/1_21_5/data/datalib/function/systems/string/tooltip_item.mcfunction +++ /dev/null @@ -1 +0,0 @@ -$tellraw $(target) {"text":"$(text)","color":"$(color)","hover_event":{"action":"show_item","value":{"id":"$(item)","count":1}}} diff --git a/1_21_5/data/datalib/function/tick.mcfunction b/1_21_5/data/datalib/function/tick.mcfunction deleted file mode 100644 index 4f0b75f..0000000 --- a/1_21_5/data/datalib/function/tick.mcfunction +++ /dev/null @@ -1,17 +0,0 @@ -execute unless entity @a run return 0 -execute unless data storage datalib:engine global{loaded:1b} run return 0 - -execute if score #m_time datalib.Flags matches 1 run function datalib:core/tick/time_systems -execute if score #m_time datalib.Flags matches 0 run function datalib:core/tick/disabled - -execute if score #m_queue datalib.Flags matches 1 run function datalib:core/tick/queue_systems -execute if score #m_queue datalib.Flags matches 0 run function datalib:core/tick/disabled - -execute if score #m_player datalib.Flags matches 1 run function datalib:core/tick/player_systems -execute if score #m_player datalib.Flags matches 0 run function datalib:core/tick/disabled - -execute if score #m_hud datalib.Flags matches 1 run function datalib:core/tick/hud_systems -execute if score #m_hud datalib.Flags matches 0 run function datalib:core/tick/disabled - -execute if score #m_admin datalib.Flags matches 1 run function datalib:core/tick/admin_systems -execute if score #m_admin datalib.Flags matches 0 run function datalib:core/tick/disabled \ No newline at end of file diff --git a/1_21_5/data/datalib/function/version.mcfunction b/1_21_5/data/datalib/function/version.mcfunction deleted file mode 100644 index 123bad8..0000000 --- a/1_21_5/data/datalib/function/version.mcfunction +++ /dev/null @@ -1,22 +0,0 @@ -# ───────────────────────────────────────────── -# datalib:version -# Shows dataLib version info to the calling player. -# Usage: /function datalib:version -# ───────────────────────────────────────────── - -tellraw @s ["",{"text":"[DL] ","color":"#00AAAA","bold":true},{"text":"━━━ Version Info ","color":"aqua"},{"text":"━━━━━━━━━━━━━━","color":"#555555"}] - -tellraw @s ["",{"text":" ◈ ","color":"#00AAAA"},{"text":"dataLib","color":"white","bold":true}] - -execute if score #dl.pre dl.pre_version matches 1.. run tellraw @s ["",{"text":" ┃ ","color":"#555555"},{"text":"Version ","color":"gray"},{"text":"v","color":"#ffaa00"},{"score":{"name":"#dl.major","objective":"dl.pre_version"},"color":"#ffaa00","bold":true},{"text":".","color":"#ffaa00"},{"score":{"name":"#dl.minor","objective":"dl.pre_version"},"color":"#ffaa00","bold":true},{"text":".","color":"#ffaa00"},{"score":{"name":"#dl.patch","objective":"dl.pre_version"},"color":"#ffaa00","bold":true},{"text":"-pre","color":"#ff8800"},{"score":{"name":"#dl.pre","objective":"dl.pre_version"},"color":"#ff8800","bold":true}] -execute if score #dl.pre dl.pre_version matches ..0 run tellraw @s ["",{"text":" ┃ ","color":"#555555"},{"text":"Version ","color":"gray"},{"text":"v","color":"#ffaa00"},{"score":{"name":"#dl.major","objective":"dl.pre_version"},"color":"#ffaa00","bold":true},{"text":".","color":"#ffaa00"},{"score":{"name":"#dl.minor","objective":"dl.pre_version"},"color":"#ffaa00","bold":true},{"text":".","color":"#ffaa00"},{"score":{"name":"#dl.patch","objective":"dl.pre_version"},"color":"#ffaa00","bold":true}] - -tellraw @s ["",{"text":" ┃ ","color":"#555555"},{"text":"MC ","color":"gray"},{"text":"1.20.3–26.1+","color":"#e3ff57"},{"text":" (pack_format 26–101.1)","color":"#555555"}] -tellraw @s ["",{"text":" ┃ ","color":"#555555"},{"text":"Author ","color":"gray"},{"text":"Legends11","color":"#00ff33"},{"text":" / ","color":"#555555"},{"text":"runtoolkit","color":"aqua","underlined":true}] - -tellraw @s ["",{"text":" ┃ ","color":"#555555"},{"text":"Source ","color":"gray"},{"text":"github.com/runtoolkit/DataLib","color":"#5555ff","underlined":true}] -# Check if loaded -execute if score #dl.ver_set dl.pre_version matches 1 run tellraw @s ["",{"text":" ┃ ","color":"#555555"},{"text":"Status ","color":"gray"},{"text":"● loaded","color":"green"}] -execute unless score #dl.ver_set dl.pre_version matches 1 run tellraw @s ["",{"text":" ┃ ","color":"#555555"},{"text":"Status ","color":"gray"},{"text":"✖ not initialized","color":"red"}] - -tellraw @s ["",{"text":"[DL] ","color":"#00AAAA","bold":true},{"text":"━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━","color":"#555555"}] \ No newline at end of file diff --git a/1_21_5/data/dl_load/function/_.mcfunction b/1_21_5/data/dl_load/function/_.mcfunction deleted file mode 100644 index d32609a..0000000 --- a/1_21_5/data/dl_load/function/_.mcfunction +++ /dev/null @@ -1,29 +0,0 @@ -# dl_load:_ — Stage 0 Load Entry Point -# -# This is the ONLY function registered in the minecraft:load function tag. -# It does NOT load dataLib directly. -# -# Instead it spawns a one-shot marker entity (to ensure a stable execution -# context regardless of server-startup state), delegates to the load gate, -# then kills itself. Nothing in datalib:engine storage is touched here. -# -# WHY MARKER ENTITY PATTERN: -# - Server startup context is unreliable for tellraw/clickEvent rendering. -# - Marker 'say' commands appear in the server log even with zero players online. -# - Gives a deterministic @s context (not @a, not @p, not server console). -# - One-shot: spawned here, killed by the end of the same function. -# -# WHY DEFERRED LOAD (GATE SYSTEM): -# - minecraft:load fires on /reload AND on world open. -# - If datalib:engine storage contains live data from a prior session -# (permissions, flags, wand binds, etc.), any unconditional storage write -# causes silent overwrites and nondeterministic engine state. -# - The gate requires explicit admin confirmation before any storage touch. -# -# CONFIRMING: /function dl_load:load/yes -# CANCELLING: /function dl_load:load/no -# AUTO-CANCEL: fires after 5 minutes if no response - -summon minecraft:marker ~ ~ ~ {Tags:["datalib.stage0"],CustomName:{"text":"DL"}} -execute as @e[type=minecraft:marker,tag=datalib.stage0,limit=1] run function dl_load:load/confirm -execute as @e[type=minecraft:marker,tag=datalib.stage0,limit=1] run kill @s \ No newline at end of file diff --git a/1_21_5/data/dl_load/function/gate/exec/ban.mcfunction b/1_21_5/data/dl_load/function/gate/exec/ban.mcfunction deleted file mode 100644 index 9fd0901..0000000 --- a/1_21_5/data/dl_load/function/gate/exec/ban.mcfunction +++ /dev/null @@ -1,13 +0,0 @@ -# dl_load:gate/exec/ban -# Executor for confirmed ban command. -# Called by dl_load:gate/yes via: function ... with storage datalib:engine pending_gate -# -# Macro fields required in datalib:engine pending_gate: -# player — target player name or UUID -# reason — ban reason string -# -# MACRO LINE RULES: every $ line must contain at least one $(key). -# No $ lines without $(key) — Minecraft crashes on that. - -$ban $(player) $(reason) -$tellraw @a[tag=datalib.debug] ["",{"text":"[DL] ","color":"#00AAAA","bold":true},{"text":"cmd/ban ","color":"aqua"},{"text":"$(player)","color":"white"},{"text":" — reason: ","color":"gray"},{"text":"$(reason)","color":"yellow"}] diff --git a/1_21_5/data/dl_load/function/gate/exec/ban_ip.mcfunction b/1_21_5/data/dl_load/function/gate/exec/ban_ip.mcfunction deleted file mode 100644 index 0ad12e0..0000000 --- a/1_21_5/data/dl_load/function/gate/exec/ban_ip.mcfunction +++ /dev/null @@ -1,10 +0,0 @@ -# dl_load:gate/exec/ban_ip -# Executor for confirmed ban-ip command. -# Called by dl_load:gate/yes via: function ... with storage datalib:engine pending_gate -# -# Macro fields required in datalib:engine pending_gate: -# player — target player name or UUID (resolves to IP) -# reason — ban reason string - -$ban-ip $(player) $(reason) -$tellraw @a[tag=datalib.debug] ["",{"text":"[DL] ","color":"#00AAAA","bold":true},{"text":"cmd/ban_ip ","color":"aqua"},{"text":"$(player)","color":"white"},{"text":" — reason: ","color":"gray"},{"text":"$(reason)","color":"yellow"}] diff --git a/1_21_5/data/dl_load/function/gate/exec/disable.mcfunction b/1_21_5/data/dl_load/function/gate/exec/disable.mcfunction deleted file mode 100644 index cdd6356..0000000 --- a/1_21_5/data/dl_load/function/gate/exec/disable.mcfunction +++ /dev/null @@ -1,13 +0,0 @@ -# dl_load:gate/exec/disable -# Executor for confirmed engine disable. -# Called by dl_load:gate/yes when pending_gate{type:"disable"}. -# -# Runs the full cleanup pipeline then announces shutdown via marker. -# No macro parameters needed. - -function dl_load:core/internal/load/cleanup - -summon minecraft:marker ~ ~ ~ {Tags:["datalib.gate_disable"],CustomName:{"text":"DL"}} -execute as @e[type=minecraft:marker,tag=datalib.gate_disable,limit=1] run say [DL] Engine DISABLED. All scoreboards and storage removed. -execute as @e[type=minecraft:marker,tag=datalib.gate_disable,limit=1] run say [DL] To reinitialize: /reload or /function dl_load:_ -execute as @e[type=minecraft:marker,tag=datalib.gate_disable,limit=1] run kill @s diff --git a/1_21_5/data/dl_load/function/gate/no.mcfunction b/1_21_5/data/dl_load/function/gate/no.mcfunction deleted file mode 100644 index ad18ab5..0000000 --- a/1_21_5/data/dl_load/function/gate/no.mcfunction +++ /dev/null @@ -1,28 +0,0 @@ -# dl_load:gate/no -# Cancel the pending dangerous command. -# -# Does NOT execute the pending action. Clears pending_gate from storage. -# Idempotent — safe to call multiple times. -# -# ALSO CALLED BY: dl_load:gate/timeout (auto-cancel after 30 seconds) - -# Guard: nothing pending -execute unless score #pending dl.gate matches 1 run return 0 - -# Close the gate window -scoreboard players set #pending dl.gate 0 -scoreboard players set #confirmed dl.gate 0 - -# Cancel the still-pending timeout if admin called /no explicitly -schedule clear dl_load:gate/timeout - -# Announce cancellation via marker -summon minecraft:marker ~ ~ ~ {Tags:["datalib.gate_no"],CustomName:{"text":"DL"}} -execute as @e[type=minecraft:marker,tag=datalib.gate_no,limit=1] run say [DL GATE] Dangerous command CANCELLED. Action was NOT executed. -execute as @e[type=minecraft:marker,tag=datalib.gate_no,limit=1] run kill @s - -# Discard pending context -data remove storage datalib:engine pending_gate -scoreboard players reset #pending dl.gate -scoreboard players reset #confirmed dl.gate -scoreboard objectives remove dl.gate diff --git a/1_21_5/data/dl_load/function/gate/request.mcfunction b/1_21_5/data/dl_load/function/gate/request.mcfunction deleted file mode 100644 index 2fe2b35..0000000 --- a/1_21_5/data/dl_load/function/gate/request.mcfunction +++ /dev/null @@ -1,41 +0,0 @@ -# dl_load:gate/request -# Generic dangerous-command confirmation gate — request side. -# -# CALLER PROTOCOL -# --------------- -# Before calling this function, the caller MUST write a pending_gate -# compound to datalib:engine storage describing the action to confirm: -# -# data modify storage datalib:engine pending_gate set value {type:"ban", player:"...", reason:"..."} -# function dl_load:gate/request -# -# This function then: -# 1. Opens the dl.gate scoreboard window -# 2. Broadcasts confirmation instructions via marker say -# 3. Schedules a 30-second auto-cancel -# -# CONFIRMING: /function dl_load:gate/yes -# CANCELLING: /function dl_load:gate/no -# -# If another gate is already pending, this call is silently dropped to -# prevent multiple dangerous commands from racing in multiplayer. - -# Drop silently if a gate is already open (multiplayer safety) -scoreboard objectives add dl.gate dummy -execute if score #pending dl.gate matches 1 run return 0 - -# Open the gate window -scoreboard players set #pending dl.gate 0 -scoreboard players set #confirmed dl.gate 0 -scoreboard players set #pending dl.gate 1 - -# Broadcast via marker (server-startup safe, no player context needed) -summon minecraft:marker ~ ~ ~ {Tags:["datalib.gate_req"],CustomName:{"text":"DL"}} -execute as @e[type=minecraft:marker,tag=datalib.gate_req,limit=1] run say [DL GATE] Dangerous command pending — awaiting confirmation. -execute as @e[type=minecraft:marker,tag=datalib.gate_req,limit=1] run say [DL GATE] CONFIRM: /function dl_load:gate/yes -execute as @e[type=minecraft:marker,tag=datalib.gate_req,limit=1] run say [DL GATE] CANCEL: /function dl_load:gate/no -execute as @e[type=minecraft:marker,tag=datalib.gate_req,limit=1] run say [DL GATE] Auto-cancel fires in 30 seconds. -execute as @e[type=minecraft:marker,tag=datalib.gate_req,limit=1] run kill @s - -# Schedule 30-second auto-cancel for dangerous commands -schedule function dl_load:gate/timeout 30s replace \ No newline at end of file diff --git a/1_21_5/data/dl_load/function/gate/timeout.mcfunction b/1_21_5/data/dl_load/function/gate/timeout.mcfunction deleted file mode 100644 index 8c634e0..0000000 --- a/1_21_5/data/dl_load/function/gate/timeout.mcfunction +++ /dev/null @@ -1,12 +0,0 @@ -# dl_load:gate/timeout -# Fires 30 seconds after dl_load:gate/request if no admin response. -# -# Delegates to dl_load:gate/no which is idempotent — if the gate was -# already closed by an explicit /yes or /no, the #pending guard in -# gate/no returns 0 and nothing happens. - -summon minecraft:marker ~ ~ ~ {Tags:["datalib.gtimeout"],CustomName:{"text":"DL"}} -execute as @e[type=minecraft:marker,tag=datalib.gtimeout,limit=1] run say [DL GATE] Dangerous command timeout (30s) — auto-cancelling. -execute as @e[type=minecraft:marker,tag=datalib.gtimeout,limit=1] run kill @s - -execute if score #pending dl.gate matches 1 run function dl_load:gate/no \ No newline at end of file diff --git a/1_21_5/data/dl_load/function/gate/yes.mcfunction b/1_21_5/data/dl_load/function/gate/yes.mcfunction deleted file mode 100644 index bc792e5..0000000 --- a/1_21_5/data/dl_load/function/gate/yes.mcfunction +++ /dev/null @@ -1,51 +0,0 @@ -# dl_load:gate/yes -# Execute the pending dangerous command after admin confirmation. -# -# Reads the pending_gate compound from datalib:engine storage and dispatches -# to the correct executor based on the 'type' field. -# -# SUPPORTED TYPES -# --------------- -# "ban" → dl_load:gate/exec/ban (datalib: player, reason) -# "ban_ip" → dl_load:gate/exec/ban_ip (datalib: player, reason) -# "disable" → dl_load:gate/exec/disable (no macro params) -# -# Adding new types: write an executor in dl_load:gate/exec/, then add -# an 'execute if data' dispatch line here. - -# Guard: no gate open -execute unless score #pending dl.gate matches 1 run return 0 - -# Guard: already confirmed (double-call protection) -execute if score #confirmed dl.gate matches 1 run return 0 - -# Mark confirmed, close window -scoreboard players set #confirmed dl.gate 1 -scoreboard players set #pending dl.gate 0 - -# Cancel the 30-second timeout -schedule clear dl_load:gate/timeout - -# Announce execution via marker -summon minecraft:marker ~ ~ ~ {Tags:["datalib.gate_exec"],CustomName:{"text":"DL"}} -execute as @e[type=minecraft:marker,tag=datalib.gate_exec,limit=1] run say [DL GATE] Dangerous command CONFIRMED. Executing... -execute as @e[type=minecraft:marker,tag=datalib.gate_exec,limit=1] run kill @s - -# --- DISPATCH --- -# Each executor reads its own fields from datalib:engine pending_gate via datalib. -# The 'with storage' pattern passes pending_gate fields as $(macro) parameters. - -# ban: requires {type:"ban", player:"...", reason:"..."} -execute if data storage datalib:engine pending_gate{type:"ban"} run function dl_load:gate/exec/ban with storage datalib:engine pending_gate - -# ban_ip: requires {type:"ban_ip", player:"...", reason:"..."} -execute if data storage datalib:engine pending_gate{type:"ban_ip"} run function dl_load:gate/exec/ban_ip with storage datalib:engine pending_gate - -# disable: requires {type:"disable"} (no extra fields) -execute if data storage datalib:engine pending_gate{type:"disable"} run function dl_load:gate/exec/disable - -# --- CLEANUP --- -data remove storage datalib:engine pending_gate -scoreboard players reset #pending dl.gate -scoreboard players reset #confirmed dl.gate -scoreboard objectives remove dl.gate diff --git a/1_21_5/data/dl_load/function/load/all.mcfunction b/1_21_5/data/dl_load/function/load/all.mcfunction deleted file mode 100644 index 68640ef..0000000 --- a/1_21_5/data/dl_load/function/load/all.mcfunction +++ /dev/null @@ -1,53 +0,0 @@ -# Load — entry point called from minecraft:load tag via datalib:load -forceload add -30000000 1600 - -# Stage 1 debug -summon minecraft:marker ~ ~ ~ {Tags:["datalib.stage1"],CustomName:{"text":"DL"}} -execute as @e[type=minecraft:marker,tag=datalib.stage1,limit=1] run say Starting dataLib... -execute as @e[type=minecraft:marker,tag=datalib.stage1,limit=1] run kill @s - -execute unless function dl_load:core/internal/load/validate run return 0 - -data modify storage datalib:engine _log_add_tmp.level set value "D.L." -data modify storage datalib:engine _log_add_tmp.message set value "Starting..." -data modify storage datalib:engine _log_add_tmp.color set value "aqua" -function datalib:systems/log/add with storage datalib:engine _log_add_tmp {} - -# Stage 2 debug -summon minecraft:marker ~ ~ ~ {Tags:["datalib.stage2"],CustomName:{"text":"DL"}} -execute as @e[type=minecraft:marker,tag=datalib.stage2,limit=1] run say Loading scoreboards... -execute as @e[type=minecraft:marker,tag=datalib.stage2,limit=1] run kill @s -function dl_load:load/scoreboards - -# Stage 3 debug -summon minecraft:marker ~ ~ ~ {Tags:["datalib.stage3"],CustomName:{"text":"DL"}} -execute as @e[type=minecraft:marker,tag=datalib.stage3,limit=1] run say Loading storages... -execute as @e[type=minecraft:marker,tag=datalib.stage3,limit=1] run kill @s -function dl_load:load/storages - -function dl_load:load/other - -data modify storage datalib:engine global.loaded set value 1b - -function dl_load:core/internal/load/version_set - -# Lantern Load integration — set pack version in load.status -# Format: (major * 10000) + (minor * 100) + patch -# Example: v2.2.6 = 20206 -execute store result score #version_calc dl.tmp run scoreboard players get #dl.major dl.pre_version -scoreboard players operation #version_calc dl.tmp *= #10000 dl.tmp -execute store result score #temp dl.tmp run scoreboard players get #dl.minor dl.pre_version -scoreboard players operation #temp dl.tmp *= #100 dl.tmp -scoreboard players operation #version_calc dl.tmp += #temp dl.tmp -scoreboard players operation #version_calc dl.tmp += #dl.patch dl.pre_version -scoreboard players operation #dataLib load.status = #version_calc dl.tmp - -execute if score #dl.pre dl.pre_version matches 1.. run tellraw @a[tag=datalib.debug] ["",{"text":"[DL] ","color":"#00AAAA","bold":true},{"text":"Loaded. ","color":"green"},[{"text":"v","color":"aqua"},{"score":{"name":"#dl.major","objective":"dl.pre_version"},"color":"aqua","bold":true},{"text":".","color":"aqua"},{"score":{"name":"#dl.minor","objective":"dl.pre_version"},"color":"aqua","bold":true},{"text":".","color":"aqua"},{"score":{"name":"#dl.patch","objective":"dl.pre_version"},"color":"aqua","bold":true},{"text":"-pre","color":"#ff8800"},{"score":{"name":"#dl.pre","objective":"dl.pre_version"},"color":"#ff8800","bold":true}]] -execute if score #dl.pre dl.pre_version matches ..0 run tellraw @a[tag=datalib.debug] ["",{"text":"[DL] ","color":"#00AAAA","bold":true},{"text":"Loaded. ","color":"green"},[{"text":"v","color":"aqua"},{"score":{"name":"#dl.major","objective":"dl.pre_version"},"color":"aqua","bold":true},{"text":".","color":"aqua"},{"score":{"name":"#dl.minor","objective":"dl.pre_version"},"color":"aqua","bold":true},{"text":".","color":"aqua"},{"score":{"name":"#dl.patch","objective":"dl.pre_version"},"color":"aqua","bold":true}]] - -data modify storage datalib:engine _log_add_tmp.level set value "dataLib" -data modify storage datalib:engine _log_add_tmp.message set value "Loaded." -data modify storage datalib:engine _log_add_tmp.color set value "green" -function datalib:systems/log/add with storage datalib:engine _log_add_tmp {} - -function dl_load:core/internal/load/finalize \ No newline at end of file diff --git a/1_21_5/data/dl_load/function/load/confirm.mcfunction b/1_21_5/data/dl_load/function/load/confirm.mcfunction deleted file mode 100644 index c04d3f2..0000000 --- a/1_21_5/data/dl_load/function/load/confirm.mcfunction +++ /dev/null @@ -1,72 +0,0 @@ -# dl_load:load/confirm -# DL Load Confirmation Gate — Stage 0 dispatcher -# Execution context: minecraft:marker (spawned by dl_load:_) -# -# PURPOSE -# ------- -# The minecraft:load tag fires on /reload AND on server/world open. -# If datalib:engine storage already holds live data from a previous session -# (permission maps, flag tables, wand binds, etc.), overwriting it -# immediately causes nondeterministic state and silent data loss. -# -# This function sets a scoreboard-based pending flag, broadcasts the -# confirmation instructions to the server log via marker say (immune to -# the server-startup tellraw / clickEvent rendering bug), and schedules -# an automatic cancel after 5 minutes. -# -# NOTHING in datalib:engine storage is touched here. -# Storage writes happen only after dl_load:load/yes is called. -# -# FLOW -# ---- -# dl_load:_ (stage0) -# └─ dl_load:load/confirm ← this file (runs as marker) -# ├─ broadcasts instructions -# └─ schedules dl_load:timeout (5m) -# -# Admin: /function dl_load:load/yes -# └─ dl_load:load/all → full init pipeline -# -# Admin: /function dl_load:load/no -# └─ abort — storage untouched -# -# 5 minutes elapse with no response: -# └─ dl_load:timeout → dl_load:load/no (auto-abort) - -# Create load-gate tracking objective -# Safe to call even if objective already exists (add is idempotent) -scoreboard objectives add dl.load dummy - -# Reset any stale state from a previous incomplete gate cycle -scoreboard players set #pending dl.load 0 -scoreboard players set #confirmed dl.load 0 -scoreboard players set #cancelled dl.load 0 - -# Open the gate window -scoreboard players set #pending dl.load 1 - -# Broadcast via marker say — works at server start, no clickEvent, no players required -say [DL GATE] ======================================== -say [DL GATE] dataLib load is PENDING. -say [DL GATE] Storage has NOT been modified yet. -say [DL GATE] ---------------------------------------- -say [DL GATE] CONFIRM: /function dl_load:load/yes -say [DL GATE] CANCEL: /function dl_load:load/no -say [DL GATE] ---------------------------------------- -say [DL GATE] Auto-cancel fires in 5 minutes if no response. -say [DL GATE] ======================================== - -# Schedule 5-minute auto-cancel -# 'replace' ensures repeated /reload does not stack multiple timeout schedules -schedule function dl_load:timeout 300s replace -# ───────────────────────────────────────────────────────────────── -# SANDBOX MODE — auto-confirm -# Enable: /data modify storage datalib:engine sandbox set value 1b -# Disable: /data modify storage datalib:engine sandbox set value 0b -# Storage persists across reloads — set once, active until cleared. -# NOTE: schedule is cleared inside load/yes. Do NOT remove dl.load -# objective here — load/yes guard checks #pending dl.load == 1. -# ───────────────────────────────────────────────────────────────── -execute if data storage datalib:engine {sandbox:1b} run say [DL GATE] SANDBOX MODE — auto-confirming load. -execute if data storage datalib:engine {sandbox:1b} run function dl_load:load/yes -execute if data storage datalib:engine {sandbox:1b} run return 0 diff --git a/1_21_5/data/dl_load/function/load/no.mcfunction b/1_21_5/data/dl_load/function/load/no.mcfunction deleted file mode 100644 index 5bf102e..0000000 --- a/1_21_5/data/dl_load/function/load/no.mcfunction +++ /dev/null @@ -1,39 +0,0 @@ -# dl_load:load/no -# Admin cancelled (or timeout fired) — DL load is ABORTED. -# -# datalib:engine storage is NOT touched at any point. -# The engine remains uninitialized and fully inert. -# -# IDEMPOTENT — safe to call multiple times. -# The #pending guard ensures this is a no-op if no gate is open. -# -# ALSO CALLED BY: dl_load:timeout (auto-cancel after 5 minutes) -# -# TO RETRY: run /reload OR /function dl_load:_ -# (calling dl_load:_ directly re-runs stage0 without a full /reload) - -# Guard: nothing pending -execute unless score #pending dl.load matches 1 run return 0 - -# Close the gate window -scoreboard players set #cancelled dl.load 1 -scoreboard players set #pending dl.load 0 -scoreboard players set #confirmed dl.load 0 - -# If admin called /no explicitly, cancel the still-pending timeout -schedule clear dl_load:timeout - -# Announce cancellation via marker (works with zero players online) -summon minecraft:marker ~ ~ ~ {Tags:["datalib.gate_no"],CustomName:{"text":"DL"}} -execute as @e[type=minecraft:marker,tag=datalib.gate_no,limit=1] run say [DL GATE] ======================================== -execute as @e[type=minecraft:marker,tag=datalib.gate_no,limit=1] run say [DL GATE] Load CANCELLED. datalib:engine storage was NOT modified. -execute as @e[type=minecraft:marker,tag=datalib.gate_no,limit=1] run say [DL GATE] Engine is NOT running. -execute as @e[type=minecraft:marker,tag=datalib.gate_no,limit=1] run say [DL GATE] To retry: /reload or /function dl_load:_ -execute as @e[type=minecraft:marker,tag=datalib.gate_no,limit=1] run say [DL GATE] ======================================== -execute as @e[type=minecraft:marker,tag=datalib.gate_no,limit=1] run kill @s - -# Tear down gate objective -scoreboard players reset #pending dl.load -scoreboard players reset #cancelled dl.load -scoreboard players reset #confirmed dl.load -scoreboard objectives remove dl.load diff --git a/1_21_5/data/dl_load/function/load/post_load.mcfunction b/1_21_5/data/dl_load/function/load/post_load.mcfunction deleted file mode 100644 index ec44bce..0000000 --- a/1_21_5/data/dl_load/function/load/post_load.mcfunction +++ /dev/null @@ -1,7 +0,0 @@ -# Stage 4 — post_load: schedule #datalib:init after DL finishes loading -# dl_load:load/all is scheduled at t+16 (from Stage 0 in dl_load:_). -# Firing #datalib:init at t+20 gives 4 ticks of margin after dataLib is fully ready. -summon minecraft:marker ~ ~ ~ {Tags:["datalib.stage4"],CustomName:{"text":"DL"}} -execute as @e[type=minecraft:marker,tag=datalib.stage4,limit=1] run say Scheduling #datalib:init (t+20)... -execute as @e[type=minecraft:marker,tag=datalib.stage4,limit=1] run schedule function #datalib:init 20t replace -execute as @e[type=minecraft:marker,tag=datalib.stage4,limit=1] run kill @s diff --git a/1_21_5/data/dl_load/function/load/storages.mcfunction b/1_21_5/data/dl_load/function/load/storages.mcfunction deleted file mode 100644 index 883ef6c..0000000 --- a/1_21_5/data/dl_load/function/load/storages.mcfunction +++ /dev/null @@ -1,102 +0,0 @@ -# dl_load:load/storages -# Initializes datalib:engine storage fields that do not yet exist. -# -# SAFETY DESIGN -# ------------- -# EVERY write here uses 'execute unless data storage ...' guards. -# This means: -# - Fields that already exist from a prior session are NOT overwritten. -# - Only fields missing from storage are initialized. -# - Nondeterministic overwrite behaviour is impossible in this file. -# -# Fields that are INTENTIONALLY cleared on each reload are listed with -# explicit comments explaining why. -# -# SCOREBOARD SAFETY -# ----------------- -# Epoch is preserved across reloads — cooldown expiry times depend on it. -# Tick counter is reset (irrelevant across reloads — just a monotonic counter). -# pq_depth is reset (queue state cannot survive reload safely). -# -# STORAGE VERSION GUARD -# --------------------- -# validate.mcfunction blocks a second load if global{loaded:1b} is set, -# so we only reach here when storage is either: -# (a) fresh / never initialized, or -# (b) was cleanly disabled via datalib:disable (cleanup removed global). -# In both cases, initializing with 'unless data' guards is safe. - -execute unless score $epoch datalib.time matches -2147483648..2147483647 run scoreboard players set $epoch datalib.time 0 -scoreboard players set $tick dl.tmp 0 - -scoreboard players set $pq_depth dl.tmp 0 - -scoreboard players set $pb_four dl.tmp 1 - -execute unless data storage datalib:engine throttle run data modify storage datalib:engine throttle set value {} - -execute unless data storage datalib:engine flags run data modify storage datalib:engine flags set value {} -execute unless data storage datalib:engine states run data modify storage datalib:engine states set value {} - -execute unless data storage datalib:engine permissions run data modify storage datalib:engine permissions set value {} - -execute unless data storage datalib:engine perm_triggers run data modify storage datalib:engine perm_triggers set value {} -execute unless data storage datalib:engine perm_trigger_names run data modify storage datalib:engine perm_trigger_names set value [] - -execute unless data storage datalib:engine trigger_binds run data modify storage datalib:engine trigger_binds set value [] - -execute unless data storage datalib:engine interaction_binds run data modify storage datalib:engine interaction_binds set value {attack:[], use:[]} - -execute unless data storage datalib:engine player_pids run data modify storage datalib:engine player_pids set value {} -execute unless data storage datalib:engine _pid_seq run data modify storage datalib:engine _pid_seq set value 0 - -# UUID module init -function datalib:core/internal/systems/uuid/init - -# once_per_player module init -execute unless data storage datalib:engine once_per_player run data modify storage datalib:engine once_per_player set value {} - -# Wand module init -execute unless data storage datalib:engine wand_binds run data modify storage datalib:engine wand_binds set value [] - -# Hook module init -execute unless data storage datalib:engine hook_binds run data modify storage datalib:engine hook_binds set value [] - -# lib/fiber module init -execute unless data storage datalib:engine fibers run data modify storage datalib:engine fibers set value {} -# fibers._pending is always cleared — incomplete fibers from a prior tick -# cannot be safely resumed across a reload boundary -data remove storage datalib:engine fibers._pending - -# geo/region_watch module init -# Region watches are always cleared on reload — all packs must re-register -# their watches in the #datalib:init function tag. This is intentional: -# region watch registrations are transient and pack-owned. -data remove storage datalib:engine region_watches -data modify storage datalib:engine region_watches set value [] - -# lib/batch module init -# Incomplete batches are always cleared on reload — they cannot be safely -# resumed across a reload boundary (executing context is gone). -data remove storage datalib:engine batches -data modify storage datalib:engine batches set value {} - -# Wand cooldown module — separate storage (avoids collision with datalib:cooldown) -execute unless data storage datalib:engine wand_cooldowns run data modify storage datalib:engine wand_cooldowns set value {} - -# ───────────────────────────────────────────────────────────────── -# Security module v5.1.2+ additions -# BREAKING CHANGE: sandbox_allowlist is now a compound {} (was list []). -# Empty compound {} = all sandbox commands blocked. -# multi_type_allowlist: compound of permitted multiCommands.type values. -# multiCommands: tracks active multi-command execution context. -# ───────────────────────────────────────────────────────────────── -# Reset security to new compound format (migration: [] → {}) -execute if data storage datalib:engine security.sandbox_allowlist[] run data modify storage datalib:engine security.sandbox_allowlist set value {} -execute unless data storage datalib:engine security run data modify storage datalib:engine security set value {trust_players:0b,cmd_min_level:3,sandbox_cmd_min_level:4,admin_min_level:2,admin_can_override:0b,sandbox_allowlist:{}} -execute unless data storage datalib:engine security.sandbox_allowlist run data modify storage datalib:engine security.sandbox_allowlist set value {} -execute unless data storage datalib:engine security.multi_type_allowlist run data modify storage datalib:engine security.multi_type_allowlist set value {multi_cmd:1b,multi_cmd_adv:1b} - -# multiCommands context tracker (always reset on load — transient state) -data remove storage datalib:engine multiCommands -data modify storage datalib:engine multiCommands set value {type:"",active:0b} diff --git a/1_21_5/core/internal/data/dl_load/function/load/version_warn.mcfunction b/1_21_5/data/dl_load/function/load/version_warn.mcfunction similarity index 100% rename from 1_21_5/core/internal/data/dl_load/function/load/version_warn.mcfunction rename to 1_21_5/data/dl_load/function/load/version_warn.mcfunction diff --git a/1_21_5/data/dl_load/function/load/yes.mcfunction b/1_21_5/data/dl_load/function/load/yes.mcfunction deleted file mode 100644 index 52d7094..0000000 --- a/1_21_5/data/dl_load/function/load/yes.mcfunction +++ /dev/null @@ -1,47 +0,0 @@ -# dl_load:load/yes -# Admin confirmed DL load. Triggers the full initialization pipeline. -# -# GUARDS -# ------ -# - Gate must be open (#pending dl.load == 1) -# - Already-confirmed calls are no-ops (idempotent) -# - If called with no gate pending, silently returns 0 -# -# WHAT HAPPENS -# ------------ -# 1. Mark confirmed, close the pending window -# 2. Cancel the 5-minute timeout schedule -# 3. Tear down the dl.load objective (not needed after this point) -# 4. Schedule dl_load:load/all at t+1 (clean tick boundary) -# -# The 1-tick delay lets the scoreboard objective removal settle before -# dl_load:load/scoreboards runs and recreates its own objectives. - -# Guard: no gate open -execute unless score #pending dl.load matches 1 run return 0 - -# Guard: already confirmed (double-call protection) -execute if score #confirmed dl.load matches 1 run return 0 - -# Mark confirmed — close window -scoreboard players set #confirmed dl.load 1 -scoreboard players set #pending dl.load 0 - -# Cancel auto-cancel timeout -schedule clear dl_load:timeout - -# Announce via marker (safe on all MC versions, no player context needed) -summon minecraft:marker ~ ~ ~ {Tags:["datalib.gate_yes"],CustomName:{"text":"DL"}} -execute as @e[type=minecraft:marker,tag=datalib.gate_yes,limit=1] run say [DL GATE] Load CONFIRMED by operator. Initializing dataLib... -execute as @e[type=minecraft:marker,tag=datalib.gate_yes,limit=1] run kill @s - -# Tear down gate scoreboard before load pipeline touches scoreboards -scoreboard players reset #pending dl.load -scoreboard players reset #confirmed dl.load -scoreboard players reset #cancelled dl.load -scoreboard objectives remove dl.load - -# Fire the actual load pipeline -# 1-tick delay gives scoreboard removal a clean tick boundary before -# dl_load:load/scoreboards recreates its objectives -schedule function dl_load:load/all 1t replace \ No newline at end of file diff --git a/1_21_5/data/dl_load/function/safe_load/no.mcfunction b/1_21_5/data/dl_load/function/safe_load/no.mcfunction deleted file mode 100644 index f2a272c..0000000 --- a/1_21_5/data/dl_load/function/safe_load/no.mcfunction +++ /dev/null @@ -1,23 +0,0 @@ -# dl_load:safe_load/no -# Enhanced load cancellation with detailed logging. -# Use INSTEAD OF dl_load:load/no for audited environments. -# -# USAGE: -# /function dl_load:safe_load/no - -# Guard: gate must be open or pending -execute unless score #pending dl.load matches 1 run return 0 - -# Log via marker -summon minecraft:marker ~ ~ ~ {Tags:["datalib.safe_gate_no"],CustomName:{"text":"DL"}} -execute as @e[type=minecraft:marker,tag=datalib.safe_gate_no,limit=1] run say [DL SAFE GATE] safe_load/no — load CANCELLED by operator. -execute as @e[type=minecraft:marker,tag=datalib.safe_gate_no,limit=1] run say [DL SAFE GATE] Storage has NOT been modified. -execute if entity @s[type=minecraft:player] run execute as @e[type=minecraft:marker,tag=datalib.safe_gate_no,limit=1] run say [DL SAFE GATE] Cancelled by a player. -execute unless entity @s[type=minecraft:player] run execute as @e[type=minecraft:marker,tag=datalib.safe_gate_no,limit=1] run say [DL SAFE GATE] Cancelled by server/console. -execute as @e[type=minecraft:marker,tag=datalib.safe_gate_no,limit=1] run kill @s - -# Notify player if applicable -execute if entity @s[type=minecraft:player] run tellraw @s ["",{"text":"[DL] ","color":"#00AAAA","bold":true},{"text":"safe_load cancelled. Storage untouched.","color":"yellow"}] - -# Delegate to regular load/no -function dl_load:load/no diff --git a/1_21_5/data/dl_load/function/safe_load/yes.mcfunction b/1_21_5/data/dl_load/function/safe_load/yes.mcfunction deleted file mode 100644 index 32327a6..0000000 --- a/1_21_5/data/dl_load/function/safe_load/yes.mcfunction +++ /dev/null @@ -1,62 +0,0 @@ -# dl_load:safe_load/yes -# Enhanced load confirmation gate with additional security precautions. -# Use INSTEAD OF dl_load:load/yes when operating in a security-critical context. -# -# PRECAUTIONS (over load/yes): -# 1. Gate must be open (#pending == 1) -# 2. Player caller: must have datalib.admin tag -# 3. Player caller: must have dl.perm_level >= 4 (super-admin) -# 4. Verifies engine is NOT already loaded -# 5. Logs all checks to server output via marker -# -# Non-player callers (server console / other datapacks) are trusted and bypass -# the player checks — they are already op-gated by the server. -# -# USAGE: -# /function dl_load:safe_load/yes - -# Guard: gate must be open -execute unless score #pending dl.load matches 1 run return 0 - -# Guard: already confirmed -execute if score #confirmed dl.load matches 1 run return 0 - -# Non-player callers: trusted — delegate directly -execute unless entity @s[type=minecraft:player] run summon minecraft:marker ~ ~ ~ {Tags:["datalib.safe_gate"],CustomName:{"text":"DL"}} -execute unless entity @s[type=minecraft:player] run execute as @e[type=minecraft:marker,tag=datalib.safe_gate,limit=1] run say [DL SAFE GATE] Confirmed by server/console — delegating to load/yes. -execute unless entity @s[type=minecraft:player] run execute as @e[type=minecraft:marker,tag=datalib.safe_gate,limit=1] run kill @s -execute unless entity @s[type=minecraft:player] run function dl_load:load/yes -execute unless entity @s[type=minecraft:player] run return 0 - -# Player checks: datalib.admin tag required -execute unless entity @s[tag=datalib.admin] run tellraw @s ["",{"text":"[DL] ","color":"#00AAAA","bold":true},{"text":"✘ safe_load/yes denied — datalib.admin tag required.","color":"red"}] -execute unless entity @s[tag=datalib.admin] run return 0 - -# Player checks: perm_level >= 4 required -execute unless score @s dl.perm_level matches 4.. run tellraw @s ["",{"text":"[DL] ","color":"#00AAAA","bold":true},{"text":"✘ safe_load/yes denied — dl.perm_level >= 4 required.","color":"red"}] -execute unless score @s dl.perm_level matches 4.. run return 0 - -# Guard: engine must NOT be already loaded -execute if data storage datalib:engine global{loaded:1b} run tellraw @s ["",{"text":"[DL] ","color":"#00AAAA","bold":true},{"text":"✘ safe_load/yes denied — engine is already loaded.","color":"red"}] -execute if data storage datalib:engine global{loaded:1b} run return 0 - -# All checks passed — announce via marker -summon minecraft:marker ~ ~ ~ {Tags:["datalib.safe_gate"],CustomName:{"text":"DL"}} -execute as @e[type=minecraft:marker,tag=datalib.safe_gate,limit=1] run say [DL SAFE GATE] ============================================ -execute as @e[type=minecraft:marker,tag=datalib.safe_gate,limit=1] run say [DL SAFE GATE] safe_load/yes — all security checks PASSED. -execute as @e[type=minecraft:marker,tag=datalib.safe_gate,limit=1] run say [DL SAFE GATE] datalib.admin tag: OK -execute as @e[type=minecraft:marker,tag=datalib.safe_gate,limit=1] run say [DL SAFE GATE] perm_level >= 4: OK -execute as @e[type=minecraft:marker,tag=datalib.safe_gate,limit=1] run say [DL SAFE GATE] engine not loaded: OK -execute as @e[type=minecraft:marker,tag=datalib.safe_gate,limit=1] run say [DL SAFE GATE] Delegating to load/yes... -execute as @e[type=minecraft:marker,tag=datalib.safe_gate,limit=1] run say [DL SAFE GATE] ============================================ -execute as @e[type=minecraft:marker,tag=datalib.safe_gate,limit=1] run kill @s - -# Delegate to regular load/yes -function dl_load:load/yes - - -# Enable sandbox mode -data modify storage datalib:engine sandbox set value 1b - -# Leave players unsafe by default (v5.1.2 default is already 0b) -data modify storage datalib:engine security set value {trust_players:0b,cmd_min_level:3,sandbox_cmd_min_level:4,admin_min_level:2,admin_can_override:0b,sandbox_allowlist:[]} diff --git a/1_21_5/data/load/function/_private/init.mcfunction b/1_21_5/data/load/function/_private/init.mcfunction deleted file mode 100644 index 6f239ff..0000000 --- a/1_21_5/data/load/function/_private/init.mcfunction +++ /dev/null @@ -1,3 +0,0 @@ -# Reset scoreboards so packs can set values accurate for current load. -scoreboard objectives add load.status dummy -scoreboard players reset * load.status diff --git a/1_21_5/data/load/tags/function/_private/init.json b/1_21_5/data/load/tags/function/_private/init.json deleted file mode 100644 index 50cbdf0..0000000 --- a/1_21_5/data/load/tags/function/_private/init.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "values": [ - "load:_private/init" - ] -} diff --git a/1_21_5/data/load/tags/function/_private/load.json b/1_21_5/data/load/tags/function/_private/load.json deleted file mode 100644 index 7db226d..0000000 --- a/1_21_5/data/load/tags/function/_private/load.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "values": [ - "#load:_private/init", - {"id": "#load:pre_load", "required": false}, - {"id": "#load:load", "required": false}, - {"id": "#load:post_load", "required": false} - ] -} diff --git a/1_21_5/data/load/tags/function/load.json b/1_21_5/data/load/tags/function/load.json deleted file mode 100644 index 19c0115..0000000 --- a/1_21_5/data/load/tags/function/load.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "values": [ - "stringlib:zprivate/load", - "datalib:load", - "#player_action:load" - ] -} diff --git a/1_21_5/data/load/tags/function/post_load.json b/1_21_5/data/load/tags/function/post_load.json deleted file mode 100644 index 46d5e46..0000000 --- a/1_21_5/data/load/tags/function/post_load.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "values": [ - "dl_load:load/post_load" - ] -} diff --git a/1_21_5/data/load/tags/function/pre_load.json b/1_21_5/data/load/tags/function/pre_load.json deleted file mode 100644 index d9b5fa4..0000000 --- a/1_21_5/data/load/tags/function/pre_load.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "values": [ - "#datalib:init/pre_load" - ] -} \ No newline at end of file diff --git a/1_21_5/data/minecraft/tags/function/load.json b/1_21_5/data/minecraft/tags/function/load.json deleted file mode 100644 index 8bd6102..0000000 --- a/1_21_5/data/minecraft/tags/function/load.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "values": [ - "#load:_private/load" - ] -} diff --git a/1_21_6/data/dl_load/function/load/all.mcfunction b/1_21_6/data/dl_load/function/load/all.mcfunction index 68640ef..3137230 100644 --- a/1_21_6/data/dl_load/function/load/all.mcfunction +++ b/1_21_6/data/dl_load/function/load/all.mcfunction @@ -11,7 +11,7 @@ execute unless function dl_load:core/internal/load/validate run return 0 data modify storage datalib:engine _log_add_tmp.level set value "D.L." data modify storage datalib:engine _log_add_tmp.message set value "Starting..." data modify storage datalib:engine _log_add_tmp.color set value "aqua" -function datalib:systems/log/add with storage datalib:engine _log_add_tmp {} +function datalib:systems/log/add with storage datalib:engine _log_add_tmp # Stage 2 debug summon minecraft:marker ~ ~ ~ {Tags:["datalib.stage2"],CustomName:{"text":"DL"}} diff --git a/26_2/core/internal/data/datalib/function/api/dialog/load_exec.mcfunction b/26_2/core/internal/data/datalib/function/api/dialog/load_exec.mcfunction deleted file mode 100644 index 7dca6bf..0000000 --- a/26_2/core/internal/data/datalib/function/api/dialog/load_exec.mcfunction +++ /dev/null @@ -1,4 +0,0 @@ -$scoreboard players set @s datalib.dialog_load $(cooldown) -tag @s remove datalib.dialog_opened -tag @s add datalib.dialog_opened -tag @s add datalib.dialog_closed diff --git a/26_2/core/internal/data/datalib/function/api/dialog/show.mcfunction b/26_2/core/internal/data/datalib/function/api/dialog/show.mcfunction deleted file mode 100644 index 91b5c60..0000000 --- a/26_2/core/internal/data/datalib/function/api/dialog/show.mcfunction +++ /dev/null @@ -1,18 +0,0 @@ -# ───────────────────────────────────────────────────────────────── -# datalib:api/dialog/show [1.21.6+ overlay] -# Shows the dialog stored at datalib:engine dialog.DIALOG as inline JSON. -# Called by dialog/open after validation. -# Uses show_macro_exec to pipe DIALOG compound as inline dialog. -# ───────────────────────────────────────────────────────────────── - -execute if entity @s[tag=datalib.dialog_opened] at @s run return 0 -execute unless data storage datalib:engine dialog.DIALOG run return 0 - -execute at @s run function datalib:player/get_name -data modify storage datalib:engine dialog.NAME set from storage datalib:names temp.NAME - -function datalib:core/internal/api/dialog/show_dialog_exec with storage datalib:engine dialog - -tag @s add datalib.dialog_opened - -return 1 diff --git a/26_2/core/internal/data/datalib/function/api/dialog/show_dialog_exec.mcfunction b/26_2/core/internal/data/datalib/function/api/dialog/show_dialog_exec.mcfunction deleted file mode 100644 index 3739df6..0000000 --- a/26_2/core/internal/data/datalib/function/api/dialog/show_dialog_exec.mcfunction +++ /dev/null @@ -1,3 +0,0 @@ -# Internal: called by dialog/show via `with storage datalib:engine dialog` -# macro arg: DIALOG = dialog compound NBT object -$dialog show $(NAME) $(DIALOG) diff --git a/26_2/core/internal/data/dl_load/function/load/version_warn.mcfunction b/26_2/core/internal/data/dl_load/function/load/version_warn.mcfunction deleted file mode 100644 index 2c1ebb6..0000000 --- a/26_2/core/internal/data/dl_load/function/load/version_warn.mcfunction +++ /dev/null @@ -1,8 +0,0 @@ -tellraw @a ["",{"text":"❌ ","color":"red"},{"text":"[DL] ","color":"aqua","bold":true},{"text":"Version conflict! ","color":"red","bold":true},{"text":"Expected ","color":"gray"},{"text":"v5.1.2","color":"yellow","bold":true},{"text":" — stored scores do not match.","color":"gray"}] -tellraw @a ["",{"text":" ↳ ","color":"#555555"},{"text":"Run ","color":"gray"},{"text":"/reload","color":"white","underlined":true},{"text":" to reinitialize dataLib.","color":"gray"}] - -tellraw @a[tag=datalib.debug] ["",{"text":"[DL/DEBUG] ","color":"aqua"},{"text":"dl.pre_version → ","color":"#555555"},{"text":"major=","color":"gray"},{"score":{"name":"#dl.major","objective":"dl.pre_version"},"color":"yellow"},{"text":" minor=","color":"gray"},{"score":{"name":"#dl.minor","objective":"dl.pre_version"},"color":"yellow"},{"text":" patch=","color":"gray"},{"score":{"name":"#dl.patch","objective":"dl.pre_version"},"color":"yellow"},{"text":" pre=","color":"gray"},{"score":{"name":"#dl.pre","objective":"dl.pre_version"},"color":"yellow"},{"text":" (expected: 4 0 2 pre=0)","color":"red"}] - -data modify storage datalib:engine _log_add_tmp.message set value "❌ Version mismatch — expected v5.1.2. Load aborted." -function datalib:systems/log/warn with storage datalib:engine _log_add_tmp {} -data remove storage datalib:engine _log_add_tmp.message diff --git a/26_2/data/datalib/advancement/systems/hook/killed_by_arrow.json b/26_2/data/datalib/advancement/systems/hook/killed_by_arrow.json deleted file mode 100644 index 8e7a759..0000000 --- a/26_2/data/datalib/advancement/systems/hook/killed_by_arrow.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "criteria": { - "killed_by_arrow": { - "trigger": "minecraft:entity_killed_player", - "conditions": { - "killing_blow": { - "direct_entity": { - "minecraft:entity_type": "minecraft:arrow" - } - } - } - } - }, - "rewards": { - "function": "datalib:systems/hook/on_killed_by_arrow" - }, - "parent": "datalib:hidden/root" -} diff --git a/26_2/data/datalib/function/api/dialog/close.mcfunction b/26_2/data/datalib/function/api/dialog/close.mcfunction deleted file mode 100644 index 7f8658d..0000000 --- a/26_2/data/datalib/function/api/dialog/close.mcfunction +++ /dev/null @@ -1,5 +0,0 @@ -dialog clear @s - -tag @s remove datalib.dialog_opened - -tag @s add datalib.dialog_closed diff --git a/26_2/data/datalib/function/api/dialog/load.mcfunction b/26_2/data/datalib/function/api/dialog/load.mcfunction deleted file mode 100644 index 9d295d1..0000000 --- a/26_2/data/datalib/function/api/dialog/load.mcfunction +++ /dev/null @@ -1,2 +0,0 @@ -execute unless data storage datalib:input cooldown run data modify storage datalib:input cooldown set value 20 -function datalib:core/internal/api/dialog/load_exec with storage datalib:input {} diff --git a/1_21_6/core/internal/data/datalib/function/api/dialog/load_exec.mcfunction b/26_2/data/datalib/function/api/dialog/load_exec.mcfunction similarity index 100% rename from 1_21_6/core/internal/data/datalib/function/api/dialog/load_exec.mcfunction rename to 26_2/data/datalib/function/api/dialog/load_exec.mcfunction diff --git a/26_2/data/datalib/function/api/dialog/notify_admins.mcfunction b/26_2/data/datalib/function/api/dialog/notify_admins.mcfunction deleted file mode 100644 index 0e017b2..0000000 --- a/26_2/data/datalib/function/api/dialog/notify_admins.mcfunction +++ /dev/null @@ -1,5 +0,0 @@ -# Ensure this runs only for a valid player with an open dialog -execute unless entity @s[tag=datalib.dialog_opened] run return 0 - -# Notify all admins that a dialog has been opened -tellraw @a[tag=datalib.admin] ["",{"text":"[Dialog] ","color":"gold"},{"selector":"@s","color":"yellow"},{"text":" opened a dialog.","color":"white"}] diff --git a/26_2/data/datalib/function/api/dialog/open.mcfunction b/26_2/data/datalib/function/api/dialog/open.mcfunction deleted file mode 100644 index 6db491b..0000000 --- a/26_2/data/datalib/function/api/dialog/open.mcfunction +++ /dev/null @@ -1,16 +0,0 @@ -scoreboard players set @s datalib.dialog_load -1 -tag @s remove datalib.dialog_closed - -tag @s remove datalib.dialog_opened - - -execute unless data storage datalib:engine dialog.DIALOG run return run dialog show @s {"type":"multi_action","title":"","actions":[{"label":"Ok"}],"pause":false,"after_action":"close","body":{"type":"plain_message","contents":[{"text":"A problem occurred.","bold":true,"color":"yellow","italic":false},"\n\n",{"text":"Dialog Not Found","color":"red","bold":false,"italic":false}]}} -execute if data storage datalib:engine {dialog:{DIALOG:""}} run return run dialog show @s {"type":"multi_action","title":"","actions":[{"label":"Ok"}],"pause":false,"after_action":"close","body":{"type":"plain_message","contents":[{"text":"A problem occurred.","bold":true,"color":"yellow","italic":false},"\n\n",{"text":"Unknown Dialog","color":"red","bold":false,"italic":false}]}} -execute unless data storage datalib:engine dialog.DIALOG.type run return run dialog show @s {"type":"multi_action","title":"","actions":[{"label":"Ok"}],"pause":false,"after_action":"close","body":{"type":"plain_message","contents":[{"text":"A problem occurred.","bold":true,"color":"yellow","italic":false},"\n\n",{"text":"Unknown Dialog Type","color":"red","bold":false,"italic":false}]}} -execute unless data storage datalib:engine dialog.DIALOG.title run return run dialog show @s {"type":"multi_action","title":"","actions":[{"label":"Ok"}],"pause":false,"after_action":"close","body":{"type":"plain_message","contents":[{"text":"A problem occurred.","bold":true,"color":"yellow","italic":false},"\n\n",{"text":"Missing Dialog Title","color":"red","bold":false,"italic":false}]}} -execute if data storage datalib:engine {dialog:{DIALOG:{type:"multi_action"}}} unless data storage datalib:engine dialog.DIALOG.actions run return run dialog show @s {"type":"multi_action","title":"","actions":[{"label":"Ok"}],"pause":false,"after_action":"close","body":{"type":"plain_message","contents":[{"text":"A problem occurred.","bold":true,"color":"yellow","italic":false},"\n\n",{"text":"Missing Actions","color":"red","bold":false,"italic":false}]}} - -execute if data storage datalib:engine dialog.DIALOG run function datalib:core/internal/api/dialog/show -execute if data storage datalib:engine dialog.DIALOG run function datalib:api/dialog/notify_admins - -return 1 \ No newline at end of file diff --git a/1_21_6/core/internal/data/datalib/function/api/dialog/show.mcfunction b/26_2/data/datalib/function/api/dialog/show.mcfunction similarity index 100% rename from 1_21_6/core/internal/data/datalib/function/api/dialog/show.mcfunction rename to 26_2/data/datalib/function/api/dialog/show.mcfunction diff --git a/1_21_6/core/internal/data/datalib/function/api/dialog/show_dialog_exec.mcfunction b/26_2/data/datalib/function/api/dialog/show_dialog_exec.mcfunction similarity index 100% rename from 1_21_6/core/internal/data/datalib/function/api/dialog/show_dialog_exec.mcfunction rename to 26_2/data/datalib/function/api/dialog/show_dialog_exec.mcfunction diff --git a/26_2/data/datalib/function/core/security/type_violation.mcfunction b/26_2/data/datalib/function/core/security/type_violation.mcfunction deleted file mode 100644 index ad1ac90..0000000 --- a/26_2/data/datalib/function/core/security/type_violation.mcfunction +++ /dev/null @@ -1,21 +0,0 @@ -# datalib:core/security/type_violation -# Fired when a sandbox-blocked command type is called. -# Logs ERROR, notifies caller, notifies debug admins, kicks player. -# Context: @s = offending player. datalib:input._violation_type = command name. - -# Log entry -data modify storage datalib:engine _log_add_tmp.message set value "[Security] type_violation — sandbox command not in allowlist" -data modify storage datalib:engine _log_add_tmp.level set value "ERROR" -data modify storage datalib:engine _log_add_tmp.color set value "red" -execute if score #dl.log_level dl.log_level matches 2.. run function datalib:systems/log/add with storage datalib:engine _log_add_tmp {} -data remove storage datalib:engine _log_add_tmp.message -data remove storage datalib:engine _log_add_tmp.level -data remove storage datalib:engine _log_add_tmp.color - -# Notify player -tellraw @s ["",{"text":"[DL] ","color":"#00AAAA","bold":true},{"text":"✘ ","color":"red"},{"text":"Security violation: command not permitted in sandbox mode.","color":"red"}] - -# Notify debug admins with command name context -function datalib:core/security/type_violation/notify_admins with storage datalib:engine _log_add_tmp {} - -# Kick offending player (26.2+: kick cannot be used inside execute...run) diff --git a/26_2/data/datalib/function/core/tick/player_systems.mcfunction b/26_2/data/datalib/function/core/tick/player_systems.mcfunction deleted file mode 100644 index 878f742..0000000 --- a/26_2/data/datalib/function/core/tick/player_systems.mcfunction +++ /dev/null @@ -1,28 +0,0 @@ -execute as @a[scores={dl_menu=1..}] run function datalib:menu -scoreboard players set @a[scores={dl_menu=1..}] dl_menu 0 -scoreboard players enable @a[scores={dl_menu=-1..}] dl_menu - -execute as @a[scores={dl_run=1..}] run function #datalib:run -scoreboard players set @a[scores={dl_run=1..}] dl_run 0 -scoreboard players enable @a[scores={dl_run=-1..}] dl_run - -execute as @a[scores={dl_action=1..}] run function datalib:core/internal/api/trigger/dispatch - -function datalib:core/internal/api/interaction/tick_scan - -function datalib:core/internal/api/perm/trigger/tick_start - -scoreboard players remove @a[scores={datalib.dialog_load=1..}] datalib.dialog_load 1 - -# Countdown actionbar: show remaining ticks while dialog is loading -#execute as @a[scores={datalib.dialog_load=1..},tag=datalib.dialog_opened,tag=!datalib.dialog_closed] run title @s actionbar ["",{"text":"Loading ","color":"aqua","bold":true},{"score":{"name":"@s","objective":"datalib.dialog_load"},"color":"yellow","bold":true},{"text":" ticks","color":"gray"}] -execute as @a[scores={datalib.dialog_load=1..}] run title @s actionbar ["",{"text":"Loading ","color":"aqua","bold":true},{"score":{"name":"@s","objective":"datalib.dialog_load"},"color":"yellow","bold":true},{"text":" ticks","color":"gray"}] - -execute as @a[scores={datalib.dialog_load=0},tag=datalib.dialog_closed] at @s run function datalib:api/dialog/open -execute as @a[scores={datalib.dialog_load=0},tag=!datalib.dialog_closed,tag=!datalib.dialog_opened] at @s run function datalib:api/dialog/open - -function datalib:core/internal/api/wand/tick_scan -function datalib:core/internal/systems/hook/tick_scan - -function datalib:core/internal/systems/geo/region_watch/tick_scan -function datalib:core/internal/api/cmd/freeze/tick \ No newline at end of file diff --git a/26_2/data/datalib/function/disable.mcfunction b/26_2/data/datalib/function/disable.mcfunction deleted file mode 100644 index 0d73e7a..0000000 --- a/26_2/data/datalib/function/disable.mcfunction +++ /dev/null @@ -1,5 +0,0 @@ -playsound minecraft:block.note_block.pling master @s ~ ~ ~ 4 2 - -function datalib:core/disable/main - -tellraw @s [{"text":"To restart:"}," ",{"text":"/reload","color":"aqua","bold":true,"italic":false}] diff --git a/26_2/data/datalib/function/systems/log/show.mcfunction b/26_2/data/datalib/function/systems/log/show.mcfunction deleted file mode 100644 index cc1cee8..0000000 --- a/26_2/data/datalib/function/systems/log/show.mcfunction +++ /dev/null @@ -1,8 +0,0 @@ -execute unless data storage datalib:engine log_display[0] run tellraw @s {"text":"[Log] No entries.","color":"gray","italic":false} -execute unless data storage datalib:engine log_display[0] run return 0 - -function datalib:core/lib/input_push -data modify storage datalib:engine _felist_input set from storage datalib:engine log_display -data modify storage datalib:input func set value "datalib:core/internal/systems/log/print_entry" -function datalib:core/lib/for_each_list with storage datalib:input {} -function datalib:core/lib/input_pop diff --git a/26_2/data/datalib/function/systems/security/menu.mcfunction b/26_2/data/datalib/function/systems/security/menu.mcfunction deleted file mode 100644 index e4cdef5..0000000 --- a/26_2/data/datalib/function/systems/security/menu.mcfunction +++ /dev/null @@ -1,18 +0,0 @@ -# datalib:systems/security/menu [1.21.6 OVERLAY] -# Dialog-based security menu. Replaces tellraw version on 1.21.6+. -# Requires: dl.perm_level >= security.admin_min_level -# -# NOTE: Dialog cannot read storage/score natively — values are injected -# via macro ($) in menu_build.mcfunction. -execute unless function datalib:debug/tools/utils/perm_check run return 0 - -# Collect dynamic values into datalib:input for macro interpolation -data modify storage datalib:input sandbox set from storage datalib:engine sandbox -data modify storage datalib:input trust_players set from storage datalib:engine security.trust_players -data modify storage datalib:input cmd_min_level set from storage datalib:engine security.cmd_min_level -data modify storage datalib:input sandbox_lvl set from storage datalib:engine security.sandbox_cmd_min_level -data modify storage datalib:input admin_min_level set from storage datalib:engine security.admin_min_level -data modify storage datalib:input admin_override set from storage datalib:engine security.admin_can_override -execute store result storage datalib:input perm_level int 1 run scoreboard players get @s dl.perm_level - -function datalib:systems/security/menu_build with storage datalib:input {} diff --git a/26_2/data/datalib/function/systems/security/menu_build.mcfunction b/26_2/data/datalib/function/systems/security/menu_build.mcfunction deleted file mode 100644 index 5dc3a18..0000000 --- a/26_2/data/datalib/function/systems/security/menu_build.mcfunction +++ /dev/null @@ -1,15 +0,0 @@ -# datalib:systems/security/menu_build [1.21.6 OVERLAY — MACRO] -# Called by menu.mcfunction with storage datalib:input {}. -# Builds the dialog with runtime values injected via macro ($). -# -# INPUT (macro args from datalib:input): -# $(sandbox) — 0b / 1b -# $(trust_players) — 0b / 1b -# $(cmd_min_level) — int -# $(sandbox_lvl) — int -# $(admin_min_level) — int -# $(admin_override) — 0b / 1b -# $(perm_level) — int (caller's dl.perm_level) -data modify storage datalib:engine dialog.DIALOG set value {type:"minecraft:multi_action",title:{text:"DL Security",color:"#00AAAA",bold:1b},body:{type:"minecraft:plain_message",contents:"sandbox: $(sandbox) trust_players: $(trust_players)cmd_min_level: $(cmd_min_level) sandbox_level: $(sandbox_lvl)admin_min_level: $(admin_min_level) admin_override: $(admin_override)Your perm_level: $(perm_level)"},inputs:[{type:"minecraft:boolean",key:"sb",label:"Sandbox",initial:1b,on_true:"1b",on_false:"0b"}],actions:[{label:{text:"Refresh",color:"aqua",italic:0b},action:{type:"minecraft:run_command",command:"/function datalib:systems/security/menu"}}],pause:0b,can_close_with_escape:1b,after_action:"none"} -$data modify storage datalib:engine dialog.DIALOG.actions append value {label:{text:"Toggle Sandbox",color:"green",italic:0b},action:{type:"minecraft:dynamic/run_command",template:"/data modify storage dataLib sandbox set value $(sb)"}} -function datalib:api/dialog/load \ No newline at end of file diff --git a/26_2/data/datalib/function/systems/string/hover_text.mcfunction b/26_2/data/datalib/function/systems/string/hover_text.mcfunction deleted file mode 100644 index 48f301d..0000000 --- a/26_2/data/datalib/function/systems/string/hover_text.mcfunction +++ /dev/null @@ -1 +0,0 @@ -$tellraw $(target) {"text":"$(text)","color":"$(color)","hover_event":{"action":"show_text","value":{"text":"$(hover)","color":"$(hover_color)"}}} diff --git a/26_2/data/datalib/function/systems/string/tooltip_item.mcfunction b/26_2/data/datalib/function/systems/string/tooltip_item.mcfunction deleted file mode 100644 index 4500bc1..0000000 --- a/26_2/data/datalib/function/systems/string/tooltip_item.mcfunction +++ /dev/null @@ -1 +0,0 @@ -$tellraw $(target) {"text":"$(text)","color":"$(color)","hover_event":{"action":"show_item","value":{"id":"$(item)","count":1}}} diff --git a/26_2/data/datalib/function/tick.mcfunction b/26_2/data/datalib/function/tick.mcfunction deleted file mode 100644 index 4f0b75f..0000000 --- a/26_2/data/datalib/function/tick.mcfunction +++ /dev/null @@ -1,17 +0,0 @@ -execute unless entity @a run return 0 -execute unless data storage datalib:engine global{loaded:1b} run return 0 - -execute if score #m_time datalib.Flags matches 1 run function datalib:core/tick/time_systems -execute if score #m_time datalib.Flags matches 0 run function datalib:core/tick/disabled - -execute if score #m_queue datalib.Flags matches 1 run function datalib:core/tick/queue_systems -execute if score #m_queue datalib.Flags matches 0 run function datalib:core/tick/disabled - -execute if score #m_player datalib.Flags matches 1 run function datalib:core/tick/player_systems -execute if score #m_player datalib.Flags matches 0 run function datalib:core/tick/disabled - -execute if score #m_hud datalib.Flags matches 1 run function datalib:core/tick/hud_systems -execute if score #m_hud datalib.Flags matches 0 run function datalib:core/tick/disabled - -execute if score #m_admin datalib.Flags matches 1 run function datalib:core/tick/admin_systems -execute if score #m_admin datalib.Flags matches 0 run function datalib:core/tick/disabled \ No newline at end of file diff --git a/26_2/data/datalib/function/version.mcfunction b/26_2/data/datalib/function/version.mcfunction deleted file mode 100644 index 123bad8..0000000 --- a/26_2/data/datalib/function/version.mcfunction +++ /dev/null @@ -1,22 +0,0 @@ -# ───────────────────────────────────────────── -# datalib:version -# Shows dataLib version info to the calling player. -# Usage: /function datalib:version -# ───────────────────────────────────────────── - -tellraw @s ["",{"text":"[DL] ","color":"#00AAAA","bold":true},{"text":"━━━ Version Info ","color":"aqua"},{"text":"━━━━━━━━━━━━━━","color":"#555555"}] - -tellraw @s ["",{"text":" ◈ ","color":"#00AAAA"},{"text":"dataLib","color":"white","bold":true}] - -execute if score #dl.pre dl.pre_version matches 1.. run tellraw @s ["",{"text":" ┃ ","color":"#555555"},{"text":"Version ","color":"gray"},{"text":"v","color":"#ffaa00"},{"score":{"name":"#dl.major","objective":"dl.pre_version"},"color":"#ffaa00","bold":true},{"text":".","color":"#ffaa00"},{"score":{"name":"#dl.minor","objective":"dl.pre_version"},"color":"#ffaa00","bold":true},{"text":".","color":"#ffaa00"},{"score":{"name":"#dl.patch","objective":"dl.pre_version"},"color":"#ffaa00","bold":true},{"text":"-pre","color":"#ff8800"},{"score":{"name":"#dl.pre","objective":"dl.pre_version"},"color":"#ff8800","bold":true}] -execute if score #dl.pre dl.pre_version matches ..0 run tellraw @s ["",{"text":" ┃ ","color":"#555555"},{"text":"Version ","color":"gray"},{"text":"v","color":"#ffaa00"},{"score":{"name":"#dl.major","objective":"dl.pre_version"},"color":"#ffaa00","bold":true},{"text":".","color":"#ffaa00"},{"score":{"name":"#dl.minor","objective":"dl.pre_version"},"color":"#ffaa00","bold":true},{"text":".","color":"#ffaa00"},{"score":{"name":"#dl.patch","objective":"dl.pre_version"},"color":"#ffaa00","bold":true}] - -tellraw @s ["",{"text":" ┃ ","color":"#555555"},{"text":"MC ","color":"gray"},{"text":"1.20.3–26.1+","color":"#e3ff57"},{"text":" (pack_format 26–101.1)","color":"#555555"}] -tellraw @s ["",{"text":" ┃ ","color":"#555555"},{"text":"Author ","color":"gray"},{"text":"Legends11","color":"#00ff33"},{"text":" / ","color":"#555555"},{"text":"runtoolkit","color":"aqua","underlined":true}] - -tellraw @s ["",{"text":" ┃ ","color":"#555555"},{"text":"Source ","color":"gray"},{"text":"github.com/runtoolkit/DataLib","color":"#5555ff","underlined":true}] -# Check if loaded -execute if score #dl.ver_set dl.pre_version matches 1 run tellraw @s ["",{"text":" ┃ ","color":"#555555"},{"text":"Status ","color":"gray"},{"text":"● loaded","color":"green"}] -execute unless score #dl.ver_set dl.pre_version matches 1 run tellraw @s ["",{"text":" ┃ ","color":"#555555"},{"text":"Status ","color":"gray"},{"text":"✖ not initialized","color":"red"}] - -tellraw @s ["",{"text":"[DL] ","color":"#00AAAA","bold":true},{"text":"━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━","color":"#555555"}] \ No newline at end of file diff --git a/26_2/data/datalib/function/world/get_time.mcfunction b/26_2/data/datalib/function/world/get_time.mcfunction deleted file mode 100644 index 4464671..0000000 --- a/26_2/data/datalib/function/world/get_time.mcfunction +++ /dev/null @@ -1,16 +0,0 @@ -# ───────────────────────────────────────────────────────────────── -# datalib:world/get_time -# Compatible with 26.1+ World Clocks (minecraft:overworld) -# -# OUTPUT: -# datalib:output.daytime → in-day time (0-23999) -# datalib:output.total → total world age (gametime) -# datalib:output.day → current day number -# ───────────────────────────────────────────────────────────────── - -execute store result storage datalib:output daytime int 1 run time of minecraft:overworld query day -execute store result storage datalib:output total int 1 run time query gametime -execute store result storage datalib:output day int 1 run time of minecraft:overworld query day repetition - -# Debug (optional) -tellraw @a[tag=datalib.debug] ["",{"text":"[DL] ","color":"#00AAAA","bold":true},{"text":"world/get_time ","color":"aqua"},{"text":"day=","color":"gray"},{"storage":"datalib:output","nbt":"day","color":"green"},{"text":" daytime=","color":"gray"},{"storage":"datalib:output","nbt":"daytime","color":"green"},{"text":" total=","color":"gray"},{"storage":"datalib:output","nbt":"total","color":"green"}] diff --git a/26_2/data/datalib/function/world/time_phase.mcfunction b/26_2/data/datalib/function/world/time_phase.mcfunction deleted file mode 100644 index 3ae2d1c..0000000 --- a/26_2/data/datalib/function/world/time_phase.mcfunction +++ /dev/null @@ -1,39 +0,0 @@ -# ───────────────────────────────────────────────────────────────── -# datalib:world/time_phase -# Time phase detection compatible with 26.1+ World Clocks -# -# OUTPUT: -# datalib:output.phase → "dawn" / "day" / "dusk" / "night" -# datalib:output.daytime → raw daytime tick (0–23999) -# datalib:output.is_day → 1b (daytime) -# datalib:output.is_night → 1b (nighttime) -# datalib:output.is_dawn → 1b (dawn) -# datalib:output.is_dusk → 1b (dusk) -# ───────────────────────────────────────────────────────────────── - -# Get in-day time (26.1+ correct syntax) -execute store result score $tp_t dl.tmp run time of minecraft:overworld query day - -# Write raw daytime to storage -execute store result storage datalib:output daytime int 1 run scoreboard players get $tp_t dl.tmp - -# Reset boolean flags -data modify storage datalib:output is_day set value 0b -data modify storage datalib:output is_night set value 0b -data modify storage datalib:output is_dawn set value 0b -data modify storage datalib:output is_dusk set value 0b - -# Set boolean values -execute if score $tp_t dl.tmp matches 0..12999 run data modify storage datalib:output is_day set value 1b -execute if score $tp_t dl.tmp matches 13000..23999 run data modify storage datalib:output is_night set value 1b -execute if score $tp_t dl.tmp matches 0..999 run data modify storage datalib:output is_dawn set value 1b -execute if score $tp_t dl.tmp matches 12000..13799 run data modify storage datalib:output is_dusk set value 1b - -# Determine phase name -execute if score $tp_t dl.tmp matches 0..999 run data modify storage datalib:output phase set value "dawn" -execute if score $tp_t dl.tmp matches 1000..11999 run data modify storage datalib:output phase set value "day" -execute if score $tp_t dl.tmp matches 12000..13799 run data modify storage datalib:output phase set value "dusk" -execute if score $tp_t dl.tmp matches 13800..23999 run data modify storage datalib:output phase set value "night" - -# Debug message (optional) -tellraw @a[tag=datalib.debug] ["",{"text":"[DL] ","color":"#00AAAA","bold":true},{"text":"world/time_phase ","color":"aqua"},{"storage":"datalib:output","nbt":"phase","color":"green"},{"text":" t=","color":"gray"},{"storage":"datalib:output","nbt":"daytime","color":"white"}] diff --git a/26_2/data/datalib/predicate/is_creative.json b/26_2/data/datalib/predicate/is_creative.json deleted file mode 100644 index efafed0..0000000 --- a/26_2/data/datalib/predicate/is_creative.json +++ /dev/null @@ -1,12 +0,0 @@ -[ - { - "condition": "minecraft:entity_properties", - "entity": "this", - "predicate": { - "minecraft:entity_type": "minecraft:player", - "minecraft:type_specific/player": { - "game_mode": "creative" - } - } - } -] diff --git a/26_2/data/datalib/predicate/is_daytime.json b/26_2/data/datalib/predicate/is_daytime.json deleted file mode 100644 index eba945b..0000000 --- a/26_2/data/datalib/predicate/is_daytime.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "condition": "minecraft:time_check", - "clock": "minecraft:overworld", - "value": { - "min": 0, - "max": 12000 - } -} \ No newline at end of file diff --git a/26_2/data/datalib/predicate/is_full_health.json b/26_2/data/datalib/predicate/is_full_health.json deleted file mode 100644 index ae3b3da..0000000 --- a/26_2/data/datalib/predicate/is_full_health.json +++ /dev/null @@ -1,10 +0,0 @@ -[ - { - "condition": "minecraft:entity_properties", - "entity": "this", - "predicate": { - "minecraft:entity_type": "minecraft:player", - "minecraft:nbt": "{Health:20.0f}" - } - } -] diff --git a/26_2/data/datalib/predicate/is_survival.json b/26_2/data/datalib/predicate/is_survival.json deleted file mode 100644 index bd24b44..0000000 --- a/26_2/data/datalib/predicate/is_survival.json +++ /dev/null @@ -1,12 +0,0 @@ -[ - { - "condition": "minecraft:entity_properties", - "entity": "this", - "predicate": { - "minecraft:entity_type": "minecraft:player", - "minecraft:type_specific/player": { - "game_mode": "survival" - } - } - } -] diff --git a/26_2/data/datalib/tags/function/admin/menu.json b/26_2/data/datalib/tags/function/admin/menu.json deleted file mode 100644 index 61b36d0..0000000 --- a/26_2/data/datalib/tags/function/admin/menu.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "replace": false, - "values": [ - "datalib:systems/security/menu" - ] -} diff --git a/26_2/data/dl_load/function/_.mcfunction b/26_2/data/dl_load/function/_.mcfunction deleted file mode 100644 index d32609a..0000000 --- a/26_2/data/dl_load/function/_.mcfunction +++ /dev/null @@ -1,29 +0,0 @@ -# dl_load:_ — Stage 0 Load Entry Point -# -# This is the ONLY function registered in the minecraft:load function tag. -# It does NOT load dataLib directly. -# -# Instead it spawns a one-shot marker entity (to ensure a stable execution -# context regardless of server-startup state), delegates to the load gate, -# then kills itself. Nothing in datalib:engine storage is touched here. -# -# WHY MARKER ENTITY PATTERN: -# - Server startup context is unreliable for tellraw/clickEvent rendering. -# - Marker 'say' commands appear in the server log even with zero players online. -# - Gives a deterministic @s context (not @a, not @p, not server console). -# - One-shot: spawned here, killed by the end of the same function. -# -# WHY DEFERRED LOAD (GATE SYSTEM): -# - minecraft:load fires on /reload AND on world open. -# - If datalib:engine storage contains live data from a prior session -# (permissions, flags, wand binds, etc.), any unconditional storage write -# causes silent overwrites and nondeterministic engine state. -# - The gate requires explicit admin confirmation before any storage touch. -# -# CONFIRMING: /function dl_load:load/yes -# CANCELLING: /function dl_load:load/no -# AUTO-CANCEL: fires after 5 minutes if no response - -summon minecraft:marker ~ ~ ~ {Tags:["datalib.stage0"],CustomName:{"text":"DL"}} -execute as @e[type=minecraft:marker,tag=datalib.stage0,limit=1] run function dl_load:load/confirm -execute as @e[type=minecraft:marker,tag=datalib.stage0,limit=1] run kill @s \ No newline at end of file diff --git a/26_2/data/dl_load/function/gate/exec/ban.mcfunction b/26_2/data/dl_load/function/gate/exec/ban.mcfunction deleted file mode 100644 index 9fd0901..0000000 --- a/26_2/data/dl_load/function/gate/exec/ban.mcfunction +++ /dev/null @@ -1,13 +0,0 @@ -# dl_load:gate/exec/ban -# Executor for confirmed ban command. -# Called by dl_load:gate/yes via: function ... with storage datalib:engine pending_gate -# -# Macro fields required in datalib:engine pending_gate: -# player — target player name or UUID -# reason — ban reason string -# -# MACRO LINE RULES: every $ line must contain at least one $(key). -# No $ lines without $(key) — Minecraft crashes on that. - -$ban $(player) $(reason) -$tellraw @a[tag=datalib.debug] ["",{"text":"[DL] ","color":"#00AAAA","bold":true},{"text":"cmd/ban ","color":"aqua"},{"text":"$(player)","color":"white"},{"text":" — reason: ","color":"gray"},{"text":"$(reason)","color":"yellow"}] diff --git a/26_2/data/dl_load/function/gate/exec/ban_ip.mcfunction b/26_2/data/dl_load/function/gate/exec/ban_ip.mcfunction deleted file mode 100644 index 0ad12e0..0000000 --- a/26_2/data/dl_load/function/gate/exec/ban_ip.mcfunction +++ /dev/null @@ -1,10 +0,0 @@ -# dl_load:gate/exec/ban_ip -# Executor for confirmed ban-ip command. -# Called by dl_load:gate/yes via: function ... with storage datalib:engine pending_gate -# -# Macro fields required in datalib:engine pending_gate: -# player — target player name or UUID (resolves to IP) -# reason — ban reason string - -$ban-ip $(player) $(reason) -$tellraw @a[tag=datalib.debug] ["",{"text":"[DL] ","color":"#00AAAA","bold":true},{"text":"cmd/ban_ip ","color":"aqua"},{"text":"$(player)","color":"white"},{"text":" — reason: ","color":"gray"},{"text":"$(reason)","color":"yellow"}] diff --git a/26_2/data/dl_load/function/gate/exec/disable.mcfunction b/26_2/data/dl_load/function/gate/exec/disable.mcfunction deleted file mode 100644 index cdd6356..0000000 --- a/26_2/data/dl_load/function/gate/exec/disable.mcfunction +++ /dev/null @@ -1,13 +0,0 @@ -# dl_load:gate/exec/disable -# Executor for confirmed engine disable. -# Called by dl_load:gate/yes when pending_gate{type:"disable"}. -# -# Runs the full cleanup pipeline then announces shutdown via marker. -# No macro parameters needed. - -function dl_load:core/internal/load/cleanup - -summon minecraft:marker ~ ~ ~ {Tags:["datalib.gate_disable"],CustomName:{"text":"DL"}} -execute as @e[type=minecraft:marker,tag=datalib.gate_disable,limit=1] run say [DL] Engine DISABLED. All scoreboards and storage removed. -execute as @e[type=minecraft:marker,tag=datalib.gate_disable,limit=1] run say [DL] To reinitialize: /reload or /function dl_load:_ -execute as @e[type=minecraft:marker,tag=datalib.gate_disable,limit=1] run kill @s diff --git a/26_2/data/dl_load/function/gate/no.mcfunction b/26_2/data/dl_load/function/gate/no.mcfunction deleted file mode 100644 index ad18ab5..0000000 --- a/26_2/data/dl_load/function/gate/no.mcfunction +++ /dev/null @@ -1,28 +0,0 @@ -# dl_load:gate/no -# Cancel the pending dangerous command. -# -# Does NOT execute the pending action. Clears pending_gate from storage. -# Idempotent — safe to call multiple times. -# -# ALSO CALLED BY: dl_load:gate/timeout (auto-cancel after 30 seconds) - -# Guard: nothing pending -execute unless score #pending dl.gate matches 1 run return 0 - -# Close the gate window -scoreboard players set #pending dl.gate 0 -scoreboard players set #confirmed dl.gate 0 - -# Cancel the still-pending timeout if admin called /no explicitly -schedule clear dl_load:gate/timeout - -# Announce cancellation via marker -summon minecraft:marker ~ ~ ~ {Tags:["datalib.gate_no"],CustomName:{"text":"DL"}} -execute as @e[type=minecraft:marker,tag=datalib.gate_no,limit=1] run say [DL GATE] Dangerous command CANCELLED. Action was NOT executed. -execute as @e[type=minecraft:marker,tag=datalib.gate_no,limit=1] run kill @s - -# Discard pending context -data remove storage datalib:engine pending_gate -scoreboard players reset #pending dl.gate -scoreboard players reset #confirmed dl.gate -scoreboard objectives remove dl.gate diff --git a/26_2/data/dl_load/function/gate/request.mcfunction b/26_2/data/dl_load/function/gate/request.mcfunction deleted file mode 100644 index 2fe2b35..0000000 --- a/26_2/data/dl_load/function/gate/request.mcfunction +++ /dev/null @@ -1,41 +0,0 @@ -# dl_load:gate/request -# Generic dangerous-command confirmation gate — request side. -# -# CALLER PROTOCOL -# --------------- -# Before calling this function, the caller MUST write a pending_gate -# compound to datalib:engine storage describing the action to confirm: -# -# data modify storage datalib:engine pending_gate set value {type:"ban", player:"...", reason:"..."} -# function dl_load:gate/request -# -# This function then: -# 1. Opens the dl.gate scoreboard window -# 2. Broadcasts confirmation instructions via marker say -# 3. Schedules a 30-second auto-cancel -# -# CONFIRMING: /function dl_load:gate/yes -# CANCELLING: /function dl_load:gate/no -# -# If another gate is already pending, this call is silently dropped to -# prevent multiple dangerous commands from racing in multiplayer. - -# Drop silently if a gate is already open (multiplayer safety) -scoreboard objectives add dl.gate dummy -execute if score #pending dl.gate matches 1 run return 0 - -# Open the gate window -scoreboard players set #pending dl.gate 0 -scoreboard players set #confirmed dl.gate 0 -scoreboard players set #pending dl.gate 1 - -# Broadcast via marker (server-startup safe, no player context needed) -summon minecraft:marker ~ ~ ~ {Tags:["datalib.gate_req"],CustomName:{"text":"DL"}} -execute as @e[type=minecraft:marker,tag=datalib.gate_req,limit=1] run say [DL GATE] Dangerous command pending — awaiting confirmation. -execute as @e[type=minecraft:marker,tag=datalib.gate_req,limit=1] run say [DL GATE] CONFIRM: /function dl_load:gate/yes -execute as @e[type=minecraft:marker,tag=datalib.gate_req,limit=1] run say [DL GATE] CANCEL: /function dl_load:gate/no -execute as @e[type=minecraft:marker,tag=datalib.gate_req,limit=1] run say [DL GATE] Auto-cancel fires in 30 seconds. -execute as @e[type=minecraft:marker,tag=datalib.gate_req,limit=1] run kill @s - -# Schedule 30-second auto-cancel for dangerous commands -schedule function dl_load:gate/timeout 30s replace \ No newline at end of file diff --git a/26_2/data/dl_load/function/gate/timeout.mcfunction b/26_2/data/dl_load/function/gate/timeout.mcfunction deleted file mode 100644 index 8c634e0..0000000 --- a/26_2/data/dl_load/function/gate/timeout.mcfunction +++ /dev/null @@ -1,12 +0,0 @@ -# dl_load:gate/timeout -# Fires 30 seconds after dl_load:gate/request if no admin response. -# -# Delegates to dl_load:gate/no which is idempotent — if the gate was -# already closed by an explicit /yes or /no, the #pending guard in -# gate/no returns 0 and nothing happens. - -summon minecraft:marker ~ ~ ~ {Tags:["datalib.gtimeout"],CustomName:{"text":"DL"}} -execute as @e[type=minecraft:marker,tag=datalib.gtimeout,limit=1] run say [DL GATE] Dangerous command timeout (30s) — auto-cancelling. -execute as @e[type=minecraft:marker,tag=datalib.gtimeout,limit=1] run kill @s - -execute if score #pending dl.gate matches 1 run function dl_load:gate/no \ No newline at end of file diff --git a/26_2/data/dl_load/function/gate/yes.mcfunction b/26_2/data/dl_load/function/gate/yes.mcfunction deleted file mode 100644 index bc792e5..0000000 --- a/26_2/data/dl_load/function/gate/yes.mcfunction +++ /dev/null @@ -1,51 +0,0 @@ -# dl_load:gate/yes -# Execute the pending dangerous command after admin confirmation. -# -# Reads the pending_gate compound from datalib:engine storage and dispatches -# to the correct executor based on the 'type' field. -# -# SUPPORTED TYPES -# --------------- -# "ban" → dl_load:gate/exec/ban (datalib: player, reason) -# "ban_ip" → dl_load:gate/exec/ban_ip (datalib: player, reason) -# "disable" → dl_load:gate/exec/disable (no macro params) -# -# Adding new types: write an executor in dl_load:gate/exec/, then add -# an 'execute if data' dispatch line here. - -# Guard: no gate open -execute unless score #pending dl.gate matches 1 run return 0 - -# Guard: already confirmed (double-call protection) -execute if score #confirmed dl.gate matches 1 run return 0 - -# Mark confirmed, close window -scoreboard players set #confirmed dl.gate 1 -scoreboard players set #pending dl.gate 0 - -# Cancel the 30-second timeout -schedule clear dl_load:gate/timeout - -# Announce execution via marker -summon minecraft:marker ~ ~ ~ {Tags:["datalib.gate_exec"],CustomName:{"text":"DL"}} -execute as @e[type=minecraft:marker,tag=datalib.gate_exec,limit=1] run say [DL GATE] Dangerous command CONFIRMED. Executing... -execute as @e[type=minecraft:marker,tag=datalib.gate_exec,limit=1] run kill @s - -# --- DISPATCH --- -# Each executor reads its own fields from datalib:engine pending_gate via datalib. -# The 'with storage' pattern passes pending_gate fields as $(macro) parameters. - -# ban: requires {type:"ban", player:"...", reason:"..."} -execute if data storage datalib:engine pending_gate{type:"ban"} run function dl_load:gate/exec/ban with storage datalib:engine pending_gate - -# ban_ip: requires {type:"ban_ip", player:"...", reason:"..."} -execute if data storage datalib:engine pending_gate{type:"ban_ip"} run function dl_load:gate/exec/ban_ip with storage datalib:engine pending_gate - -# disable: requires {type:"disable"} (no extra fields) -execute if data storage datalib:engine pending_gate{type:"disable"} run function dl_load:gate/exec/disable - -# --- CLEANUP --- -data remove storage datalib:engine pending_gate -scoreboard players reset #pending dl.gate -scoreboard players reset #confirmed dl.gate -scoreboard objectives remove dl.gate diff --git a/26_2/data/dl_load/function/load/all.mcfunction b/26_2/data/dl_load/function/load/all.mcfunction deleted file mode 100644 index 68640ef..0000000 --- a/26_2/data/dl_load/function/load/all.mcfunction +++ /dev/null @@ -1,53 +0,0 @@ -# Load — entry point called from minecraft:load tag via datalib:load -forceload add -30000000 1600 - -# Stage 1 debug -summon minecraft:marker ~ ~ ~ {Tags:["datalib.stage1"],CustomName:{"text":"DL"}} -execute as @e[type=minecraft:marker,tag=datalib.stage1,limit=1] run say Starting dataLib... -execute as @e[type=minecraft:marker,tag=datalib.stage1,limit=1] run kill @s - -execute unless function dl_load:core/internal/load/validate run return 0 - -data modify storage datalib:engine _log_add_tmp.level set value "D.L." -data modify storage datalib:engine _log_add_tmp.message set value "Starting..." -data modify storage datalib:engine _log_add_tmp.color set value "aqua" -function datalib:systems/log/add with storage datalib:engine _log_add_tmp {} - -# Stage 2 debug -summon minecraft:marker ~ ~ ~ {Tags:["datalib.stage2"],CustomName:{"text":"DL"}} -execute as @e[type=minecraft:marker,tag=datalib.stage2,limit=1] run say Loading scoreboards... -execute as @e[type=minecraft:marker,tag=datalib.stage2,limit=1] run kill @s -function dl_load:load/scoreboards - -# Stage 3 debug -summon minecraft:marker ~ ~ ~ {Tags:["datalib.stage3"],CustomName:{"text":"DL"}} -execute as @e[type=minecraft:marker,tag=datalib.stage3,limit=1] run say Loading storages... -execute as @e[type=minecraft:marker,tag=datalib.stage3,limit=1] run kill @s -function dl_load:load/storages - -function dl_load:load/other - -data modify storage datalib:engine global.loaded set value 1b - -function dl_load:core/internal/load/version_set - -# Lantern Load integration — set pack version in load.status -# Format: (major * 10000) + (minor * 100) + patch -# Example: v2.2.6 = 20206 -execute store result score #version_calc dl.tmp run scoreboard players get #dl.major dl.pre_version -scoreboard players operation #version_calc dl.tmp *= #10000 dl.tmp -execute store result score #temp dl.tmp run scoreboard players get #dl.minor dl.pre_version -scoreboard players operation #temp dl.tmp *= #100 dl.tmp -scoreboard players operation #version_calc dl.tmp += #temp dl.tmp -scoreboard players operation #version_calc dl.tmp += #dl.patch dl.pre_version -scoreboard players operation #dataLib load.status = #version_calc dl.tmp - -execute if score #dl.pre dl.pre_version matches 1.. run tellraw @a[tag=datalib.debug] ["",{"text":"[DL] ","color":"#00AAAA","bold":true},{"text":"Loaded. ","color":"green"},[{"text":"v","color":"aqua"},{"score":{"name":"#dl.major","objective":"dl.pre_version"},"color":"aqua","bold":true},{"text":".","color":"aqua"},{"score":{"name":"#dl.minor","objective":"dl.pre_version"},"color":"aqua","bold":true},{"text":".","color":"aqua"},{"score":{"name":"#dl.patch","objective":"dl.pre_version"},"color":"aqua","bold":true},{"text":"-pre","color":"#ff8800"},{"score":{"name":"#dl.pre","objective":"dl.pre_version"},"color":"#ff8800","bold":true}]] -execute if score #dl.pre dl.pre_version matches ..0 run tellraw @a[tag=datalib.debug] ["",{"text":"[DL] ","color":"#00AAAA","bold":true},{"text":"Loaded. ","color":"green"},[{"text":"v","color":"aqua"},{"score":{"name":"#dl.major","objective":"dl.pre_version"},"color":"aqua","bold":true},{"text":".","color":"aqua"},{"score":{"name":"#dl.minor","objective":"dl.pre_version"},"color":"aqua","bold":true},{"text":".","color":"aqua"},{"score":{"name":"#dl.patch","objective":"dl.pre_version"},"color":"aqua","bold":true}]] - -data modify storage datalib:engine _log_add_tmp.level set value "dataLib" -data modify storage datalib:engine _log_add_tmp.message set value "Loaded." -data modify storage datalib:engine _log_add_tmp.color set value "green" -function datalib:systems/log/add with storage datalib:engine _log_add_tmp {} - -function dl_load:core/internal/load/finalize \ No newline at end of file diff --git a/26_2/data/dl_load/function/load/confirm.mcfunction b/26_2/data/dl_load/function/load/confirm.mcfunction deleted file mode 100644 index c04d3f2..0000000 --- a/26_2/data/dl_load/function/load/confirm.mcfunction +++ /dev/null @@ -1,72 +0,0 @@ -# dl_load:load/confirm -# DL Load Confirmation Gate — Stage 0 dispatcher -# Execution context: minecraft:marker (spawned by dl_load:_) -# -# PURPOSE -# ------- -# The minecraft:load tag fires on /reload AND on server/world open. -# If datalib:engine storage already holds live data from a previous session -# (permission maps, flag tables, wand binds, etc.), overwriting it -# immediately causes nondeterministic state and silent data loss. -# -# This function sets a scoreboard-based pending flag, broadcasts the -# confirmation instructions to the server log via marker say (immune to -# the server-startup tellraw / clickEvent rendering bug), and schedules -# an automatic cancel after 5 minutes. -# -# NOTHING in datalib:engine storage is touched here. -# Storage writes happen only after dl_load:load/yes is called. -# -# FLOW -# ---- -# dl_load:_ (stage0) -# └─ dl_load:load/confirm ← this file (runs as marker) -# ├─ broadcasts instructions -# └─ schedules dl_load:timeout (5m) -# -# Admin: /function dl_load:load/yes -# └─ dl_load:load/all → full init pipeline -# -# Admin: /function dl_load:load/no -# └─ abort — storage untouched -# -# 5 minutes elapse with no response: -# └─ dl_load:timeout → dl_load:load/no (auto-abort) - -# Create load-gate tracking objective -# Safe to call even if objective already exists (add is idempotent) -scoreboard objectives add dl.load dummy - -# Reset any stale state from a previous incomplete gate cycle -scoreboard players set #pending dl.load 0 -scoreboard players set #confirmed dl.load 0 -scoreboard players set #cancelled dl.load 0 - -# Open the gate window -scoreboard players set #pending dl.load 1 - -# Broadcast via marker say — works at server start, no clickEvent, no players required -say [DL GATE] ======================================== -say [DL GATE] dataLib load is PENDING. -say [DL GATE] Storage has NOT been modified yet. -say [DL GATE] ---------------------------------------- -say [DL GATE] CONFIRM: /function dl_load:load/yes -say [DL GATE] CANCEL: /function dl_load:load/no -say [DL GATE] ---------------------------------------- -say [DL GATE] Auto-cancel fires in 5 minutes if no response. -say [DL GATE] ======================================== - -# Schedule 5-minute auto-cancel -# 'replace' ensures repeated /reload does not stack multiple timeout schedules -schedule function dl_load:timeout 300s replace -# ───────────────────────────────────────────────────────────────── -# SANDBOX MODE — auto-confirm -# Enable: /data modify storage datalib:engine sandbox set value 1b -# Disable: /data modify storage datalib:engine sandbox set value 0b -# Storage persists across reloads — set once, active until cleared. -# NOTE: schedule is cleared inside load/yes. Do NOT remove dl.load -# objective here — load/yes guard checks #pending dl.load == 1. -# ───────────────────────────────────────────────────────────────── -execute if data storage datalib:engine {sandbox:1b} run say [DL GATE] SANDBOX MODE — auto-confirming load. -execute if data storage datalib:engine {sandbox:1b} run function dl_load:load/yes -execute if data storage datalib:engine {sandbox:1b} run return 0 diff --git a/26_2/data/dl_load/function/load/no.mcfunction b/26_2/data/dl_load/function/load/no.mcfunction deleted file mode 100644 index 5bf102e..0000000 --- a/26_2/data/dl_load/function/load/no.mcfunction +++ /dev/null @@ -1,39 +0,0 @@ -# dl_load:load/no -# Admin cancelled (or timeout fired) — DL load is ABORTED. -# -# datalib:engine storage is NOT touched at any point. -# The engine remains uninitialized and fully inert. -# -# IDEMPOTENT — safe to call multiple times. -# The #pending guard ensures this is a no-op if no gate is open. -# -# ALSO CALLED BY: dl_load:timeout (auto-cancel after 5 minutes) -# -# TO RETRY: run /reload OR /function dl_load:_ -# (calling dl_load:_ directly re-runs stage0 without a full /reload) - -# Guard: nothing pending -execute unless score #pending dl.load matches 1 run return 0 - -# Close the gate window -scoreboard players set #cancelled dl.load 1 -scoreboard players set #pending dl.load 0 -scoreboard players set #confirmed dl.load 0 - -# If admin called /no explicitly, cancel the still-pending timeout -schedule clear dl_load:timeout - -# Announce cancellation via marker (works with zero players online) -summon minecraft:marker ~ ~ ~ {Tags:["datalib.gate_no"],CustomName:{"text":"DL"}} -execute as @e[type=minecraft:marker,tag=datalib.gate_no,limit=1] run say [DL GATE] ======================================== -execute as @e[type=minecraft:marker,tag=datalib.gate_no,limit=1] run say [DL GATE] Load CANCELLED. datalib:engine storage was NOT modified. -execute as @e[type=minecraft:marker,tag=datalib.gate_no,limit=1] run say [DL GATE] Engine is NOT running. -execute as @e[type=minecraft:marker,tag=datalib.gate_no,limit=1] run say [DL GATE] To retry: /reload or /function dl_load:_ -execute as @e[type=minecraft:marker,tag=datalib.gate_no,limit=1] run say [DL GATE] ======================================== -execute as @e[type=minecraft:marker,tag=datalib.gate_no,limit=1] run kill @s - -# Tear down gate objective -scoreboard players reset #pending dl.load -scoreboard players reset #cancelled dl.load -scoreboard players reset #confirmed dl.load -scoreboard objectives remove dl.load diff --git a/26_2/data/dl_load/function/load/post_load.mcfunction b/26_2/data/dl_load/function/load/post_load.mcfunction deleted file mode 100644 index ec44bce..0000000 --- a/26_2/data/dl_load/function/load/post_load.mcfunction +++ /dev/null @@ -1,7 +0,0 @@ -# Stage 4 — post_load: schedule #datalib:init after DL finishes loading -# dl_load:load/all is scheduled at t+16 (from Stage 0 in dl_load:_). -# Firing #datalib:init at t+20 gives 4 ticks of margin after dataLib is fully ready. -summon minecraft:marker ~ ~ ~ {Tags:["datalib.stage4"],CustomName:{"text":"DL"}} -execute as @e[type=minecraft:marker,tag=datalib.stage4,limit=1] run say Scheduling #datalib:init (t+20)... -execute as @e[type=minecraft:marker,tag=datalib.stage4,limit=1] run schedule function #datalib:init 20t replace -execute as @e[type=minecraft:marker,tag=datalib.stage4,limit=1] run kill @s diff --git a/26_2/data/dl_load/function/load/storages.mcfunction b/26_2/data/dl_load/function/load/storages.mcfunction deleted file mode 100644 index 883ef6c..0000000 --- a/26_2/data/dl_load/function/load/storages.mcfunction +++ /dev/null @@ -1,102 +0,0 @@ -# dl_load:load/storages -# Initializes datalib:engine storage fields that do not yet exist. -# -# SAFETY DESIGN -# ------------- -# EVERY write here uses 'execute unless data storage ...' guards. -# This means: -# - Fields that already exist from a prior session are NOT overwritten. -# - Only fields missing from storage are initialized. -# - Nondeterministic overwrite behaviour is impossible in this file. -# -# Fields that are INTENTIONALLY cleared on each reload are listed with -# explicit comments explaining why. -# -# SCOREBOARD SAFETY -# ----------------- -# Epoch is preserved across reloads — cooldown expiry times depend on it. -# Tick counter is reset (irrelevant across reloads — just a monotonic counter). -# pq_depth is reset (queue state cannot survive reload safely). -# -# STORAGE VERSION GUARD -# --------------------- -# validate.mcfunction blocks a second load if global{loaded:1b} is set, -# so we only reach here when storage is either: -# (a) fresh / never initialized, or -# (b) was cleanly disabled via datalib:disable (cleanup removed global). -# In both cases, initializing with 'unless data' guards is safe. - -execute unless score $epoch datalib.time matches -2147483648..2147483647 run scoreboard players set $epoch datalib.time 0 -scoreboard players set $tick dl.tmp 0 - -scoreboard players set $pq_depth dl.tmp 0 - -scoreboard players set $pb_four dl.tmp 1 - -execute unless data storage datalib:engine throttle run data modify storage datalib:engine throttle set value {} - -execute unless data storage datalib:engine flags run data modify storage datalib:engine flags set value {} -execute unless data storage datalib:engine states run data modify storage datalib:engine states set value {} - -execute unless data storage datalib:engine permissions run data modify storage datalib:engine permissions set value {} - -execute unless data storage datalib:engine perm_triggers run data modify storage datalib:engine perm_triggers set value {} -execute unless data storage datalib:engine perm_trigger_names run data modify storage datalib:engine perm_trigger_names set value [] - -execute unless data storage datalib:engine trigger_binds run data modify storage datalib:engine trigger_binds set value [] - -execute unless data storage datalib:engine interaction_binds run data modify storage datalib:engine interaction_binds set value {attack:[], use:[]} - -execute unless data storage datalib:engine player_pids run data modify storage datalib:engine player_pids set value {} -execute unless data storage datalib:engine _pid_seq run data modify storage datalib:engine _pid_seq set value 0 - -# UUID module init -function datalib:core/internal/systems/uuid/init - -# once_per_player module init -execute unless data storage datalib:engine once_per_player run data modify storage datalib:engine once_per_player set value {} - -# Wand module init -execute unless data storage datalib:engine wand_binds run data modify storage datalib:engine wand_binds set value [] - -# Hook module init -execute unless data storage datalib:engine hook_binds run data modify storage datalib:engine hook_binds set value [] - -# lib/fiber module init -execute unless data storage datalib:engine fibers run data modify storage datalib:engine fibers set value {} -# fibers._pending is always cleared — incomplete fibers from a prior tick -# cannot be safely resumed across a reload boundary -data remove storage datalib:engine fibers._pending - -# geo/region_watch module init -# Region watches are always cleared on reload — all packs must re-register -# their watches in the #datalib:init function tag. This is intentional: -# region watch registrations are transient and pack-owned. -data remove storage datalib:engine region_watches -data modify storage datalib:engine region_watches set value [] - -# lib/batch module init -# Incomplete batches are always cleared on reload — they cannot be safely -# resumed across a reload boundary (executing context is gone). -data remove storage datalib:engine batches -data modify storage datalib:engine batches set value {} - -# Wand cooldown module — separate storage (avoids collision with datalib:cooldown) -execute unless data storage datalib:engine wand_cooldowns run data modify storage datalib:engine wand_cooldowns set value {} - -# ───────────────────────────────────────────────────────────────── -# Security module v5.1.2+ additions -# BREAKING CHANGE: sandbox_allowlist is now a compound {} (was list []). -# Empty compound {} = all sandbox commands blocked. -# multi_type_allowlist: compound of permitted multiCommands.type values. -# multiCommands: tracks active multi-command execution context. -# ───────────────────────────────────────────────────────────────── -# Reset security to new compound format (migration: [] → {}) -execute if data storage datalib:engine security.sandbox_allowlist[] run data modify storage datalib:engine security.sandbox_allowlist set value {} -execute unless data storage datalib:engine security run data modify storage datalib:engine security set value {trust_players:0b,cmd_min_level:3,sandbox_cmd_min_level:4,admin_min_level:2,admin_can_override:0b,sandbox_allowlist:{}} -execute unless data storage datalib:engine security.sandbox_allowlist run data modify storage datalib:engine security.sandbox_allowlist set value {} -execute unless data storage datalib:engine security.multi_type_allowlist run data modify storage datalib:engine security.multi_type_allowlist set value {multi_cmd:1b,multi_cmd_adv:1b} - -# multiCommands context tracker (always reset on load — transient state) -data remove storage datalib:engine multiCommands -data modify storage datalib:engine multiCommands set value {type:"",active:0b} diff --git a/1_21_6/core/internal/data/dl_load/function/load/version_warn.mcfunction b/26_2/data/dl_load/function/load/version_warn.mcfunction similarity index 100% rename from 1_21_6/core/internal/data/dl_load/function/load/version_warn.mcfunction rename to 26_2/data/dl_load/function/load/version_warn.mcfunction diff --git a/26_2/data/dl_load/function/load/yes.mcfunction b/26_2/data/dl_load/function/load/yes.mcfunction deleted file mode 100644 index 52d7094..0000000 --- a/26_2/data/dl_load/function/load/yes.mcfunction +++ /dev/null @@ -1,47 +0,0 @@ -# dl_load:load/yes -# Admin confirmed DL load. Triggers the full initialization pipeline. -# -# GUARDS -# ------ -# - Gate must be open (#pending dl.load == 1) -# - Already-confirmed calls are no-ops (idempotent) -# - If called with no gate pending, silently returns 0 -# -# WHAT HAPPENS -# ------------ -# 1. Mark confirmed, close the pending window -# 2. Cancel the 5-minute timeout schedule -# 3. Tear down the dl.load objective (not needed after this point) -# 4. Schedule dl_load:load/all at t+1 (clean tick boundary) -# -# The 1-tick delay lets the scoreboard objective removal settle before -# dl_load:load/scoreboards runs and recreates its own objectives. - -# Guard: no gate open -execute unless score #pending dl.load matches 1 run return 0 - -# Guard: already confirmed (double-call protection) -execute if score #confirmed dl.load matches 1 run return 0 - -# Mark confirmed — close window -scoreboard players set #confirmed dl.load 1 -scoreboard players set #pending dl.load 0 - -# Cancel auto-cancel timeout -schedule clear dl_load:timeout - -# Announce via marker (safe on all MC versions, no player context needed) -summon minecraft:marker ~ ~ ~ {Tags:["datalib.gate_yes"],CustomName:{"text":"DL"}} -execute as @e[type=minecraft:marker,tag=datalib.gate_yes,limit=1] run say [DL GATE] Load CONFIRMED by operator. Initializing dataLib... -execute as @e[type=minecraft:marker,tag=datalib.gate_yes,limit=1] run kill @s - -# Tear down gate scoreboard before load pipeline touches scoreboards -scoreboard players reset #pending dl.load -scoreboard players reset #confirmed dl.load -scoreboard players reset #cancelled dl.load -scoreboard objectives remove dl.load - -# Fire the actual load pipeline -# 1-tick delay gives scoreboard removal a clean tick boundary before -# dl_load:load/scoreboards recreates its objectives -schedule function dl_load:load/all 1t replace \ No newline at end of file diff --git a/26_2/data/dl_load/function/safe_load/no.mcfunction b/26_2/data/dl_load/function/safe_load/no.mcfunction deleted file mode 100644 index f2a272c..0000000 --- a/26_2/data/dl_load/function/safe_load/no.mcfunction +++ /dev/null @@ -1,23 +0,0 @@ -# dl_load:safe_load/no -# Enhanced load cancellation with detailed logging. -# Use INSTEAD OF dl_load:load/no for audited environments. -# -# USAGE: -# /function dl_load:safe_load/no - -# Guard: gate must be open or pending -execute unless score #pending dl.load matches 1 run return 0 - -# Log via marker -summon minecraft:marker ~ ~ ~ {Tags:["datalib.safe_gate_no"],CustomName:{"text":"DL"}} -execute as @e[type=minecraft:marker,tag=datalib.safe_gate_no,limit=1] run say [DL SAFE GATE] safe_load/no — load CANCELLED by operator. -execute as @e[type=minecraft:marker,tag=datalib.safe_gate_no,limit=1] run say [DL SAFE GATE] Storage has NOT been modified. -execute if entity @s[type=minecraft:player] run execute as @e[type=minecraft:marker,tag=datalib.safe_gate_no,limit=1] run say [DL SAFE GATE] Cancelled by a player. -execute unless entity @s[type=minecraft:player] run execute as @e[type=minecraft:marker,tag=datalib.safe_gate_no,limit=1] run say [DL SAFE GATE] Cancelled by server/console. -execute as @e[type=minecraft:marker,tag=datalib.safe_gate_no,limit=1] run kill @s - -# Notify player if applicable -execute if entity @s[type=minecraft:player] run tellraw @s ["",{"text":"[DL] ","color":"#00AAAA","bold":true},{"text":"safe_load cancelled. Storage untouched.","color":"yellow"}] - -# Delegate to regular load/no -function dl_load:load/no diff --git a/26_2/data/dl_load/function/safe_load/yes.mcfunction b/26_2/data/dl_load/function/safe_load/yes.mcfunction deleted file mode 100644 index 32327a6..0000000 --- a/26_2/data/dl_load/function/safe_load/yes.mcfunction +++ /dev/null @@ -1,62 +0,0 @@ -# dl_load:safe_load/yes -# Enhanced load confirmation gate with additional security precautions. -# Use INSTEAD OF dl_load:load/yes when operating in a security-critical context. -# -# PRECAUTIONS (over load/yes): -# 1. Gate must be open (#pending == 1) -# 2. Player caller: must have datalib.admin tag -# 3. Player caller: must have dl.perm_level >= 4 (super-admin) -# 4. Verifies engine is NOT already loaded -# 5. Logs all checks to server output via marker -# -# Non-player callers (server console / other datapacks) are trusted and bypass -# the player checks — they are already op-gated by the server. -# -# USAGE: -# /function dl_load:safe_load/yes - -# Guard: gate must be open -execute unless score #pending dl.load matches 1 run return 0 - -# Guard: already confirmed -execute if score #confirmed dl.load matches 1 run return 0 - -# Non-player callers: trusted — delegate directly -execute unless entity @s[type=minecraft:player] run summon minecraft:marker ~ ~ ~ {Tags:["datalib.safe_gate"],CustomName:{"text":"DL"}} -execute unless entity @s[type=minecraft:player] run execute as @e[type=minecraft:marker,tag=datalib.safe_gate,limit=1] run say [DL SAFE GATE] Confirmed by server/console — delegating to load/yes. -execute unless entity @s[type=minecraft:player] run execute as @e[type=minecraft:marker,tag=datalib.safe_gate,limit=1] run kill @s -execute unless entity @s[type=minecraft:player] run function dl_load:load/yes -execute unless entity @s[type=minecraft:player] run return 0 - -# Player checks: datalib.admin tag required -execute unless entity @s[tag=datalib.admin] run tellraw @s ["",{"text":"[DL] ","color":"#00AAAA","bold":true},{"text":"✘ safe_load/yes denied — datalib.admin tag required.","color":"red"}] -execute unless entity @s[tag=datalib.admin] run return 0 - -# Player checks: perm_level >= 4 required -execute unless score @s dl.perm_level matches 4.. run tellraw @s ["",{"text":"[DL] ","color":"#00AAAA","bold":true},{"text":"✘ safe_load/yes denied — dl.perm_level >= 4 required.","color":"red"}] -execute unless score @s dl.perm_level matches 4.. run return 0 - -# Guard: engine must NOT be already loaded -execute if data storage datalib:engine global{loaded:1b} run tellraw @s ["",{"text":"[DL] ","color":"#00AAAA","bold":true},{"text":"✘ safe_load/yes denied — engine is already loaded.","color":"red"}] -execute if data storage datalib:engine global{loaded:1b} run return 0 - -# All checks passed — announce via marker -summon minecraft:marker ~ ~ ~ {Tags:["datalib.safe_gate"],CustomName:{"text":"DL"}} -execute as @e[type=minecraft:marker,tag=datalib.safe_gate,limit=1] run say [DL SAFE GATE] ============================================ -execute as @e[type=minecraft:marker,tag=datalib.safe_gate,limit=1] run say [DL SAFE GATE] safe_load/yes — all security checks PASSED. -execute as @e[type=minecraft:marker,tag=datalib.safe_gate,limit=1] run say [DL SAFE GATE] datalib.admin tag: OK -execute as @e[type=minecraft:marker,tag=datalib.safe_gate,limit=1] run say [DL SAFE GATE] perm_level >= 4: OK -execute as @e[type=minecraft:marker,tag=datalib.safe_gate,limit=1] run say [DL SAFE GATE] engine not loaded: OK -execute as @e[type=minecraft:marker,tag=datalib.safe_gate,limit=1] run say [DL SAFE GATE] Delegating to load/yes... -execute as @e[type=minecraft:marker,tag=datalib.safe_gate,limit=1] run say [DL SAFE GATE] ============================================ -execute as @e[type=minecraft:marker,tag=datalib.safe_gate,limit=1] run kill @s - -# Delegate to regular load/yes -function dl_load:load/yes - - -# Enable sandbox mode -data modify storage datalib:engine sandbox set value 1b - -# Leave players unsafe by default (v5.1.2 default is already 0b) -data modify storage datalib:engine security set value {trust_players:0b,cmd_min_level:3,sandbox_cmd_min_level:4,admin_min_level:2,admin_can_override:0b,sandbox_allowlist:[]} diff --git a/26_2/data/minecraft/tags/function/load.json b/26_2/data/minecraft/tags/function/load.json deleted file mode 100644 index 8bd6102..0000000 --- a/26_2/data/minecraft/tags/function/load.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "values": [ - "#load:_private/load" - ] -} diff --git a/26_2/data/player_action/advancement/v1/attack_click_entity.json b/26_2/data/player_action/advancement/v1/attack_click_entity.json deleted file mode 100644 index 87b903a..0000000 --- a/26_2/data/player_action/advancement/v1/attack_click_entity.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "criteria": { - "interact_click_entity": { - "trigger": "minecraft:player_hurt_entity", - "conditions": { - "entity": { - "minecraft:entity_type": "minecraft:interaction", - "minecraft:nbt": "{Tags:[\"player_action.click_entity\"]}" - } - } - } - }, - "rewards": { - "function": "player_action:v1/internal/attack_click_entity" - } -} diff --git a/26_2/data/player_action/advancement/v1/interact_click_entity.json b/26_2/data/player_action/advancement/v1/interact_click_entity.json deleted file mode 100644 index 498510e..0000000 --- a/26_2/data/player_action/advancement/v1/interact_click_entity.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "criteria": { - "interact_click_entity": { - "trigger": "minecraft:player_interacted_with_entity", - "conditions": { - "entity": { - "minecraft:entity_type": "minecraft:interaction", - "minecraft:nbt": "{Tags:[\"player_action.click_entity\"]}" - } - } - } - }, - "rewards": { - "function": "player_action:v1/internal/interact_click_entity" - } -} diff --git a/26_2/data/player_action/predicate/v1/riding_boat.json b/26_2/data/player_action/predicate/v1/riding_boat.json deleted file mode 100644 index 14fc6ef..0000000 --- a/26_2/data/player_action/predicate/v1/riding_boat.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "condition": "minecraft:entity_properties", - "entity": "this", - "predicate": { - "minecraft:vehicle": { - "minecraft:entity_type": "#minecraft:boat" - } - } -} diff --git a/26_2/data/player_action/predicate/v1/riding_donkey.json b/26_2/data/player_action/predicate/v1/riding_donkey.json deleted file mode 100644 index 06bb3be..0000000 --- a/26_2/data/player_action/predicate/v1/riding_donkey.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "condition": "minecraft:entity_properties", - "entity": "this", - "predicate": { - "minecraft:vehicle": { - "minecraft:entity_type": "minecraft:donkey" - } - } -} diff --git a/26_2/data/player_action/predicate/v1/riding_horse.json b/26_2/data/player_action/predicate/v1/riding_horse.json deleted file mode 100644 index 1383bab..0000000 --- a/26_2/data/player_action/predicate/v1/riding_horse.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "condition": "minecraft:entity_properties", - "entity": "this", - "predicate": { - "minecraft:vehicle": { - "minecraft:entity_type": "minecraft:horse" - } - } -} diff --git a/26_2/data/player_action/predicate/v1/riding_llama.json b/26_2/data/player_action/predicate/v1/riding_llama.json deleted file mode 100644 index 37284a9..0000000 --- a/26_2/data/player_action/predicate/v1/riding_llama.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "condition": "minecraft:entity_properties", - "entity": "this", - "predicate": { - "minecraft:vehicle": { - "minecraft:entity_type": "minecraft:llama" - } - } -} diff --git a/26_2/data/player_action/predicate/v1/riding_minecart.json b/26_2/data/player_action/predicate/v1/riding_minecart.json deleted file mode 100644 index b1f17a9..0000000 --- a/26_2/data/player_action/predicate/v1/riding_minecart.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "condition": "minecraft:entity_properties", - "entity": "this", - "predicate": { - "minecraft:vehicle": { - "minecraft:entity_type": "minecraft:minecart" - } - } -} diff --git a/26_2/data/player_action/predicate/v1/riding_mule.json b/26_2/data/player_action/predicate/v1/riding_mule.json deleted file mode 100644 index 76aa71d..0000000 --- a/26_2/data/player_action/predicate/v1/riding_mule.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "condition": "minecraft:entity_properties", - "entity": "this", - "predicate": { - "minecraft:vehicle": { - "minecraft:entity_type": "minecraft:mule" - } - } -} diff --git a/26_2/data/player_action/predicate/v1/riding_pig.json b/26_2/data/player_action/predicate/v1/riding_pig.json deleted file mode 100644 index a4824a6..0000000 --- a/26_2/data/player_action/predicate/v1/riding_pig.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "condition": "minecraft:entity_properties", - "entity": "this", - "predicate": { - "minecraft:vehicle": { - "minecraft:entity_type": "minecraft:pig" - } - } -} diff --git a/26_2/data/player_action/predicate/v1/riding_strider.json b/26_2/data/player_action/predicate/v1/riding_strider.json deleted file mode 100644 index edd1624..0000000 --- a/26_2/data/player_action/predicate/v1/riding_strider.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "condition": "minecraft:entity_properties", - "entity": "this", - "predicate": { - "minecraft:vehicle": { - "minecraft:entity_type": "minecraft:strider" - } - } -}