Skip to content
This repository was archived by the owner on May 19, 2026. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ jobs:
- name: Read version
id: ver
run: |
# Extract version like "v4.0.2" from the description array in pack.mcmeta
# Extract version like "v5.1.1" from the description array in pack.mcmeta
VERSION=$(jq -r '
.pack.description |
if type == "array" then
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ data modify storage datalib:output data set from storage datalib:engine
execute unless data storage datalib:output data.global{loaded:1b} run return 0

# engine stores v2.2.2-pre1 (lowercase v)
execute unless data storage datalib:output data.global{version:"v5.1.0"} run return 0
execute unless data storage datalib:output data.global{version:"v5.1.1"} run return 0

# --- Tehlikeli komutlar: injection engeli (permission-level 3 / singleplayer uyumsuz) ---
execute if data storage datalib:output inputs{func:"datalib:api/cmd/op"} run return 0
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
execute unless data storage datalib:engine global run data modify storage datalib:engine global set value {version:"v5.1.0"}
data modify storage datalib:engine global.version set value "v5.1.0"
execute unless data storage datalib:engine global run data modify storage datalib:engine global set value {version:"v5.1.1"}
data modify storage datalib:engine global.version set value "v5.1.1"

execute unless data storage datalib:engine log_display run data modify storage datalib:engine log_display set value []
execute unless score #dl.log_count dl.tmp matches 0.. run scoreboard players set #dl.log_count dl.tmp 0
Expand All @@ -12,7 +12,7 @@ scoreboard objectives add dl.pre_version dummy
scoreboard players set #dl.mismatch dl.pre_version 0
execute if score #dl.ver_set dl.pre_version matches 1 run execute unless score #dl.major dl.pre_version matches 5 run scoreboard players set #dl.mismatch dl.pre_version 1
execute if score #dl.ver_set dl.pre_version matches 1 run execute unless score #dl.minor dl.pre_version matches 1 run scoreboard players set #dl.mismatch dl.pre_version 1
execute if score #dl.ver_set dl.pre_version matches 1 run execute unless score #dl.patch dl.pre_version matches 0 run scoreboard players set #dl.mismatch dl.pre_version 1
execute if score #dl.ver_set dl.pre_version matches 1 run execute unless score #dl.patch dl.pre_version matches 1 run scoreboard players set #dl.mismatch dl.pre_version 1
execute if score #dl.ver_set dl.pre_version matches 1 run execute unless score #dl.pre dl.pre_version matches 0 run scoreboard players set #dl.mismatch dl.pre_version 1
execute if score #dl.mismatch dl.pre_version matches 1 run function dl_load:load/internal/version_warn
execute if score #dl.mismatch dl.pre_version matches 1 run return 0
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
scoreboard players set #dl.major dl.pre_version 5
scoreboard players set #dl.minor dl.pre_version 1
scoreboard players set #dl.patch dl.pre_version 0
scoreboard players set #dl.patch dl.pre_version 1
scoreboard players set #dl.pre dl.pre_version 1
scoreboard players set #dl.ver_set dl.pre_version 1
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
tellraw @a ["",{"text":"[DL] ","color":"#00AAAA","bold":true},{"text":"✘ ","color":"red"},{"text":"Version conflict! ","color":"red","bold":true},{"text":"Expected ","color":"#555555"},{"text":"v5.1.0","color":"aqua","bold":true},{"text":" — stored scores do not match.","color":"#555555"}]
tellraw @a ["",{"text":"[DL] ","color":"#00AAAA","bold":true},{"text":"✘ ","color":"red"},{"text":"Version conflict! ","color":"red","bold":true},{"text":"Expected ","color":"#555555"},{"text":"v5.1.1","color":"aqua","bold":true},{"text":" — stored scores do not match.","color":"#555555"}]
tellraw @a ["",{"text":" ","color":"#555555"},{"text":"→ Run ","color":"gray"},{"text":"/reload","color":"aqua","underlined":true,"hoverEvent":{"action":"show_text","value":"Reload Dat"}},{"text":" to reinitialize dataLib.","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:input message set value "✘ Version mismatch — expected v5.1.0. Load aborted."
data modify storage datalib:input message set value "✘ Version mismatch — expected v5.1.1. Load aborted."
function datalib:systems/log/warn with storage datalib:input {}
data remove storage datalib:input message
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
# Called by cmd/ files when sandbox:1b is active AND command is NOT in allowlist.
# Reads datalib:engine _sandbox_cmd (set by caller), logs, notifies, and kicks.
#
# NOTE (v5.1.0): Primary enforcement path now goes through sandbox_gate.
# NOTE (v5.1.1): Primary enforcement path now goes through sandbox_gate.
# This function is retained for direct callers and backwards compatibility.
function datalib:api/cmd/internal/sandbox_blocked_macro with storage datalib:engine {}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Adds a command prefix to datalib:engine security.sandbox_allowlist (compound).
# Compound format: {give:1b, say:1b, ...} — O(1) lookup.
#
# BREAKING CHANGE (v5.1.0): allowlist is now a compound, not a list.
# BREAKING CHANGE (v5.1.1): allowlist is now a compound, not a list.
# INPUT: $(prefix) — command prefix string, e.g. "say" or "give"
$data modify storage datalib:engine security.sandbox_allowlist merge value {$(prefix):1b}
$tellraw @a[tag=datalib.debug] ["",{"text":"[DL] ","color":"#00AAAA","bold":true},{"text":"security/allowlist_add ","color":"aqua"},{"text":"$(prefix)","color":"green"}]
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
# execute unless function datalib:core/security/cmd_gate run return 0
# $$(cmd)
#
# SECURITY MODEL (v5.1.0+):
# SECURITY MODEL (v5.1.1+):
# • Engine must be loaded (loaded:1b).
# • Players require dl.perm_level >= security.cmd_min_level.
# • sandbox:1b raises the floor to security.sandbox_cmd_min_level.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ data modify storage datalib:output data set from storage datalib:engine
execute unless data storage datalib:output data.global{loaded:1b} run return 0

# engine stores v2.2.2-pre1 (lowercase v)
execute unless data storage datalib:output data.global{version:"v5.1.0"} run return 0
execute unless data storage datalib:output data.global{version:"v5.1.1"} run return 0

# --- Tehlikeli komutlar: injection engeli (permission-level 3 / singleplayer uyumsuz) ---
execute if data storage datalib:output inputs{func:"datalib:api/cmd/op"} run return 0
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
execute unless data storage datalib:engine global run data modify storage datalib:engine global set value {version:"v5.1.0"}
data modify storage datalib:engine global.version set value "v5.1.0"
execute unless data storage datalib:engine global run data modify storage datalib:engine global set value {version:"v5.1.1"}
data modify storage datalib:engine global.version set value "v5.1.1"

execute unless data storage datalib:engine log_display run data modify storage datalib:engine log_display set value []
execute unless score #dl.log_count dl.tmp matches 0.. run scoreboard players set #dl.log_count dl.tmp 0
Expand All @@ -12,7 +12,7 @@ scoreboard objectives add dl.pre_version dummy
scoreboard players set #dl.mismatch dl.pre_version 0
execute if score #dl.ver_set dl.pre_version matches 1 run execute unless score #dl.major dl.pre_version matches 5 run scoreboard players set #dl.mismatch dl.pre_version 1
execute if score #dl.ver_set dl.pre_version matches 1 run execute unless score #dl.minor dl.pre_version matches 1 run scoreboard players set #dl.mismatch dl.pre_version 1
execute if score #dl.ver_set dl.pre_version matches 1 run execute unless score #dl.patch dl.pre_version matches 0 run scoreboard players set #dl.mismatch dl.pre_version 1
execute if score #dl.ver_set dl.pre_version matches 1 run execute unless score #dl.patch dl.pre_version matches 1 run scoreboard players set #dl.mismatch dl.pre_version 1
execute if score #dl.ver_set dl.pre_version matches 1 run execute unless score #dl.pre dl.pre_version matches 0 run scoreboard players set #dl.mismatch dl.pre_version 1
execute if score #dl.mismatch dl.pre_version matches 1 run function dl_load:load/internal/version_warn
execute if score #dl.mismatch dl.pre_version matches 1 run return 0
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
scoreboard players set #dl.major dl.pre_version 5
scoreboard players set #dl.minor dl.pre_version 1
scoreboard players set #dl.patch dl.pre_version 0
scoreboard players set #dl.patch dl.pre_version 1
scoreboard players set #dl.pre dl.pre_version 0
scoreboard players set #dl.ver_set dl.pre_version 1
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
tellraw @a ["",{"text":"[DL] ","color":"#00AAAA","bold":true},{"text":"✘ ","color":"red"},{"text":"Version conflict! ","color":"red","bold":true},{"text":"Expected ","color":"#555555"},{"text":"v5.1.0","color":"aqua","bold":true},{"text":" — stored scores do not match.","color":"#555555"}]
tellraw @a ["",{"text":"[DL] ","color":"#00AAAA","bold":true},{"text":"✘ ","color":"red"},{"text":"Version conflict! ","color":"red","bold":true},{"text":"Expected ","color":"#555555"},{"text":"v5.1.1","color":"aqua","bold":true},{"text":" — stored scores do not match.","color":"#555555"}]
tellraw @a ["",{"text":" ","color":"#555555"},{"text":"→ Run ","color":"gray"},{"text":"/reload","color":"aqua","underlined":true,"hoverEvent":{"action":"show_text","value":"Reload Dat"}},{"text":" to reinitialize AME.","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:input message set value "✘ Version mismatch — expected v5.1.0. Load aborted."
data modify storage datalib:input message set value "✘ Version mismatch — expected v5.1.1. Load aborted."
function datalib:systems/log/warn with storage datalib:input {}
data remove storage datalib:input message
4 changes: 2 additions & 2 deletions 1_20_5/data/dl_load/functions/load/storages.mcfunction
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ data remove storage datalib:engine batches
data modify storage datalib:engine batches set value {}

# ─────────────────────────────────────────────────────────────────
# Security module v5.1.0+ additions
# Security module v5.1.1+ 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.
Expand All @@ -66,7 +66,7 @@ data modify storage datalib:engine multiCommands set value {type:"",active:0b}
# Wand cooldown module — separate storage
execute unless data storage datalib:engine wand_cooldowns run data modify storage datalib:engine wand_cooldowns set value {}

# Security v5.1.0+ migration: sandbox_allowlist list → compound
# Security v5.1.1+ migration: sandbox_allowlist list → compound
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.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}
Expand Down
2 changes: 1 addition & 1 deletion 1_20_5/data/dl_load/functions/safe_load/yes.mcfunction
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,5 @@ function dl_load:load/yes
# Enable sandbox mode
data modify storage datalib:engine sandbox set value 1b

# Leave players unsafe by default (v5.0.0 default is already 0b)
# Leave players unsafe by default (v5.1.1 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:[]}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# datalib:api/cmd/internal/sandbox_blocked [1.21.5+ overlay]
# Extends the base sandbox_blocked with a test_block server log entry.
#
# NOTE (v5.1.0): The primary sandbox enforcement path now goes through
# NOTE (v5.1.1): The primary sandbox enforcement path now goes through
# datalib:api/cmd/internal/sandbox_gate → datalib:core/security/type_violation.
# This function is retained for direct callers and backwards compatibility.
# The type_violation overlay (1_21_5) handles test_block logging for the
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
tellraw @a ["",{"text":"❌ ","color":"red"},{"text":"[DL] ","color":"aqua","bold":true},{"text":"Version conflict! ","color":"red","bold":true},{"text":"Expected ","color":"gray"},{"text":"v4.0.2","color":"yellow","bold":true},{"text":" — stored scores do not match.","color":"gray"}]
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.1","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:input message set value "❌ Version mismatch — expected v4.0.2. Load aborted."
data modify storage datalib:input message set value "❌ Version mismatch — expected v5.1.1. Load aborted."
function datalib:systems/log/warn with storage datalib:input {}
data remove storage datalib:input message
2 changes: 1 addition & 1 deletion 1_21_5/data/dl_load/function/load/storages.mcfunction
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ data modify storage datalib:engine batches set value {}
execute unless data storage datalib:engine wand_cooldowns run data modify storage datalib:engine wand_cooldowns set value {}

# ─────────────────────────────────────────────────────────────────
# Security module v5.1.0+ additions
# Security module v5.1.1+ 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.
Expand Down
2 changes: 1 addition & 1 deletion 1_21_5/data/dl_load/function/safe_load/yes.mcfunction
Original file line number Diff line number Diff line change
Expand Up @@ -58,5 +58,5 @@ function dl_load:load/yes
# Enable sandbox mode
data modify storage datalib:engine sandbox set value 1b

# Leave players unsafe by default (v5.0.0 default is already 0b)
# Leave players unsafe by default (v5.1.1 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:[]}
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
tellraw @a ["",{"text":"❌ ","color":"red"},{"text":"[DL] ","color":"aqua","bold":true},{"text":"Version conflict! ","color":"red","bold":true},{"text":"Expected ","color":"gray"},{"text":"v4.0.2","color":"yellow","bold":true},{"text":" — stored scores do not match.","color":"gray"}]
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.1","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:input message set value "❌ Version mismatch — expected v4.0.2. Load aborted."
data modify storage datalib:input message set value "❌ Version mismatch — expected v5.1.1. Load aborted."
function datalib:systems/log/warn with storage datalib:input {}
data remove storage datalib:input message
2 changes: 1 addition & 1 deletion 1_21_6/data/dl_load/function/load/storages.mcfunction
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ data modify storage datalib:engine batches set value {}
execute unless data storage datalib:engine wand_cooldowns run data modify storage datalib:engine wand_cooldowns set value {}

# ─────────────────────────────────────────────────────────────────
# Security module v5.1.0+ additions
# Security module v5.1.1+ 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.
Expand Down
2 changes: 1 addition & 1 deletion 1_21_6/data/dl_load/function/safe_load/yes.mcfunction
Original file line number Diff line number Diff line change
Expand Up @@ -58,5 +58,5 @@ function dl_load:load/yes
# Enable sandbox mode
data modify storage datalib:engine sandbox set value 1b

# Leave players unsafe by default (v5.0.0 default is already 0b)
# Leave players unsafe by default (v5.1.1 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:[]}
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
---


> Current version: **v5.1.0**
> Current version: **v5.1.1**
---

---
Expand All @@ -17,7 +17,7 @@
## 📦 Installation

```
1. Place dataLib-v5.1.0 into <world>/datapacks/
1. Place dataLib-v5.1.1 into <world>/datapacks/
2. /reload
3. /function dl_load:load/yes
4. /tag @s add datalib.admin
Expand All @@ -30,7 +30,7 @@
```
datalib:engine (persistent data)
├── global
│ ├── version: "v5.1.0"
│ ├── version: "v5.1.1"
│ └── tick: <int>
├── players
│ └── Steve { coins:150, level:5, xp:2300, online:1b, ... }
Expand Down Expand Up @@ -84,7 +84,7 @@ Provides deterministic load order, version tracking, and pre/load/post-load hook
# Check if dataLib is loaded
execute if score dataLib load.status matches 1.. run say dataLib is loaded

# Get version (major*10000 + minor*100 + patch → v5.1.0 = 50000)
# Get version (major*10000 + minor*100 + patch → v5.1.1 = 50000)
scoreboard players get dataLib load.status
```

Expand Down Expand Up @@ -124,4 +124,4 @@ function datalib:core/lib/string/replace

---

*dataLib v5.1.0 | MC Java 1.20.3–26.1+ | Pure Datapack*
*dataLib v5.1.1 | MC Java 1.20.3–26.1+ | Pure Datapack*
Loading