Skip to content
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 "v5.1.1" from the description array in pack.mcmeta
# Extract version like "v5.1.2" 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
@@ -1,5 +1,5 @@
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 global run data modify storage datalib:engine global set value {version:"v5.1.2"}
data modify storage datalib:engine global.version set value "v5.1.2"

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 Down
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.1","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.2","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.1. Load aborted."
data modify storage datalib:input message set value "✘ Version mismatch — expected v5.1.2. 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.1): Primary enforcement path now goes through sandbox_gate.
# NOTE (v5.1.2): 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.1): allowlist is now a compound, not a list.
# BREAKING CHANGE (v5.1.2): 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.1+):
# SECURITY MODEL (v5.1.2+):
# • 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
@@ -1,5 +1,5 @@
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 global run data modify storage datalib:engine global set value {version:"v5.1.2"}
data modify storage datalib:engine global.version set value "v5.1.2"

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 Down
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.1","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.2","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.1. Load aborted."
data modify storage datalib:input message set value "✘ Version mismatch — expected v5.1.2. 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.1+ additions
# 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.
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.1+ migration: sandbox_allowlist list → compound
# Security v5.1.2+ 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.1.1 default is already 0b)
# 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:[]}
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.1): The primary sandbox enforcement path now goes through
# NOTE (v5.1.2): 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":"v5.1.1","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.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:input message set value "❌ Version mismatch — expected v5.1.1. Load aborted."
data modify storage datalib:input message set value "❌ Version mismatch — expected v5.1.2. 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.1+ additions
# 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.
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.1.1 default is already 0b)
# 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:[]}
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":"v5.1.1","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.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:input message set value "❌ Version mismatch — expected v5.1.1. Load aborted."
data modify storage datalib:input message set value "❌ Version mismatch — expected v5.1.2. 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.1+ additions
# 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.
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.1.1 default is already 0b)
# 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:[]}
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
**Minecraft Java Edition 1.20.3–26.1.2+ | Multiplayer-Safe | Pure Datapack**

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

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

```
1. Place dataLib-v5.1.1 into <world>/datapacks/
1. Place dataLib-v5.1.2 into <world>/datapacks/
2. /reload
3. /function dl_load:load/yes
4. /tag @s add datalib.admin
Expand All @@ -29,7 +29,7 @@
```
datalib:engine (persistent data)
├── global
│ ├── version: "v5.1.1"
│ ├── version: "v5.1.2"
│ └── tick: <int>
├── players
│ └── Steve { coins:150, level:5, xp:2300, online:1b, ... }
Expand Down Expand Up @@ -83,7 +83,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.1 = 50000)
# Get version (major*10000 + minor*100 + patch → v5.1.2 = 50000)
scoreboard players get dataLib load.status
```

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

---

*dataLib v5.1.1 | MC Java 1.20.3–26.1+ | Pure Datapack*
*dataLib v5.1.2 | MC Java 1.20.3–26.1+ | Pure Datapack*
2 changes: 1 addition & 1 deletion assets/minecraft/lang/de_de.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"datalib.msg.safe_load.denied.admin": "safe_load/yes verweigert — datalib.admin-Tag erforderlich.",
"datalib.msg.safe_load.denied.perm": "safe_load/yes verweigert — dl.perm_level \u2265 4 erforderlich.",
"datalib.msg.safe_load.denied.loaded":"safe_load/yes verweigert — Engine bereits geladen.",
"datalib.msg.version_conflict": "Versionskonflikt! Erwartet v5.1.1 \u2014 gespeicherte Werte stimmen nicht \u00fcberein.",
"datalib.msg.version_conflict": "Versionskonflikt! Erwartet v5.1.2 \u2014 gespeicherte Werte stimmen nicht \u00fcberein.",
"datalib.msg.version_reload": "\u2192 F\u00fchren Sie /reload aus, um dataLib neu zu initialisieren.",

"datalib.subtitle.load_success": "dataLib geladen",
Expand Down
2 changes: 1 addition & 1 deletion assets/minecraft/lang/en_us.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"datalib.msg.safe_load.denied.admin": "safe_load/yes denied — datalib.admin tag required.",
"datalib.msg.safe_load.denied.perm": "safe_load/yes denied — dl.perm_level \u2265 4 required.",
"datalib.msg.safe_load.denied.loaded":"safe_load/yes denied — engine is already loaded.",
"datalib.msg.version_conflict": "Version conflict! Expected v5.1.1 \u2014 stored scores do not match.",
"datalib.msg.version_conflict": "Version conflict! Expected v5.1.2 \u2014 stored scores do not match.",
"datalib.msg.version_reload": "\u2192 Run /reload to reinitialize dataLib.",

"datalib.subtitle.load_success": "dataLib loaded",
Expand Down
2 changes: 1 addition & 1 deletion assets/minecraft/lang/tr_tr.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"datalib.msg.safe_load.denied.admin": "safe_load/yes reddedildi — datalib.admin etiketi gerekli.",
"datalib.msg.safe_load.denied.perm": "safe_load/yes reddedildi — dl.perm_level \u2265 4 gerekli.",
"datalib.msg.safe_load.denied.loaded":"safe_load/yes reddedildi — motor zaten yüklü.",
"datalib.msg.version_conflict": "Sürüm çakışması! Beklenen v5.1.1 \u2014 kayıtlı puanlar eşleşmiyor.",
"datalib.msg.version_conflict": "Sürüm çakışması! Beklenen v5.1.2 \u2014 kayıtlı puanlar eşleşmiyor.",
"datalib.msg.version_reload": "\u2192 dataLib'i yeniden başlatmak için /reload çalıştırın.",

"datalib.subtitle.load_success": "dataLib yüklendi",
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":"v5.1.1","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.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:input message set value "❌ Version mismatch — expected v5.1.1. Load aborted."
data modify storage datalib:input message set value "❌ Version mismatch — expected v5.1.2. Load aborted."
function datalib:systems/log/warn with storage datalib:input {}
data remove storage datalib:input message
Loading