Skip to content

Commit 6d92cae

Browse files
committed
📋 Update all export targets with new tech
1 parent f0b1dcd commit 6d92cae

15 files changed

Lines changed: 708 additions & 789 deletions

File tree

src/systems/datapackCompiler/1.20.4/animation.mcb

Lines changed: 81 additions & 86 deletions
Large diffs are not rendered by default.

src/systems/datapackCompiler/1.20.4/global.mcb

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ dir global {
2626
}
2727

2828
tag functions on_load {
29-
*<%export_namespace%>/on_load
29+
<%blueprint_id%>/on_load
3030
}
3131

3232
dir root {
@@ -39,7 +39,7 @@ dir global {
3939
}
4040

4141
function run_project_tick {
42-
$function animated_java:$(export_namespace)/root/on_tick
42+
$function $(blueprint_id)/root/on_tick
4343
}
4444

4545
IF (debug_mode) {
@@ -58,7 +58,7 @@ dir global {
5858
# data_manager prep read
5959

6060
# Get export namespace
61-
data modify storage <%temp_storage%> args.export_namespace set from storage <%temp_storage%> entry.data.export_namespace
61+
data modify storage <%temp_storage%> args.blueprint_id set from storage <%temp_storage%> entry.data.blueprint_id
6262
# Overwrite the rig hash so the warning doesn't show again.
6363
data modify storage <%temp_storage%> entry.data.rig_hash set value '<%rig_hash%>'
6464
data_manager write
@@ -156,8 +156,8 @@ dir global {
156156
block { with storage <%temp_storage%> entry.data
157157
# REVIEW - The replace here is a bit hacky.
158158
# Because this is a core function, I need to create a generic version of
159-
# project_storage that uses a macro to get the export namespace instead of hardcoding it.
160-
$execute if data storage <%project_storage.replace(export_namespace, '$(export_namespace)')%> {rig_hash:'$(rig_hash)'} run return 0
159+
# project_storage that uses a macro to get the blueprint ID instead of hardcoding it.
160+
$execute if data storage <%project_storage.replace(blueprint_id, '$(blueprint_id)')%> {rig_hash:'$(rig_hash)'} run return 0
161161
return 1
162162
}
163163
}
@@ -219,6 +219,7 @@ dir global {
219219
}
220220
}
221221

222+
# Storage-based per-entity NBT storage. Thanks Xanbelor for the concept!
222223
dir data_manager {
223224
function on_load {
224225
scoreboard players add #aj.data_manager.index <%OBJECTIVES.I()%> 0
@@ -254,13 +255,3 @@ dir global {
254255
}
255256
}
256257
}
257-
258-
dir <%export_namespace%> {
259-
function on_load {
260-
function *<%export_namespace%>/invalid_version_warning
261-
}
262-
263-
function invalid_version_warning {
264-
tellraw @a <%TELLRAW.INVALID_VERSION()%>
265-
}
266-
}

src/systems/datapackCompiler/1.20.4/static.mcb

Lines changed: 47 additions & 57 deletions
Large diffs are not rendered by default.

src/systems/datapackCompiler/1.20.5/animation.mcb

Lines changed: 81 additions & 87 deletions
Large diffs are not rendered by default.

src/systems/datapackCompiler/1.20.5/static.mcb

Lines changed: 47 additions & 58 deletions
Large diffs are not rendered by default.

src/systems/datapackCompiler/1.21.0/animation.mcb

Lines changed: 81 additions & 87 deletions
Large diffs are not rendered by default.

src/systems/datapackCompiler/1.21.0/global.mcb

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
import ./global.mcbt
21
# DIFFERENCES FROM 1.20.4:
32
# - @n entity selector
43

4+
import ./global.mcbt
5+
56
dir global {
67
function on_load minecraft:load {
78
# Initialize Scoreboards
@@ -28,7 +29,7 @@ dir global {
2829
}
2930

3031
tag functions on_load {
31-
*<%export_namespace%>/on_load
32+
<%blueprint_id%>/on_load
3233
}
3334

3435
dir root {
@@ -41,7 +42,7 @@ dir global {
4142
}
4243

4344
function run_project_tick {
44-
$function animated_java:$(export_namespace)/root/on_tick
45+
$function $(blueprint_id)/root/on_tick
4546
}
4647

4748
IF (debug_mode) {
@@ -60,7 +61,7 @@ dir global {
6061
# data_manager prep read
6162

6263
# Get export namespace
63-
data modify storage <%temp_storage%> args.export_namespace set from storage <%temp_storage%> entry.data.export_namespace
64+
data modify storage <%temp_storage%> args.blueprint_id set from storage <%temp_storage%> entry.data.blueprint_id
6465
# Overwrite the rig hash so the warning doesn't show again.
6566
data modify storage <%temp_storage%> entry.data.rig_hash set value '<%rig_hash%>'
6667
data_manager write
@@ -158,8 +159,8 @@ dir global {
158159
block { with storage <%temp_storage%> entry.data
159160
# REVIEW - The replace here is a bit hacky.
160161
# Because this is a core function, I need to create a generic version of
161-
# project_storage that uses a macro to get the export namespace instead of hardcoding it.
162-
$execute if data storage <%project_storage.replace(export_namespace, '$(export_namespace)')%> {rig_hash:'$(rig_hash)'} run return 0
162+
# project_storage that uses a macro to get the blueprint ID instead of hardcoding it.
163+
$execute if data storage <%project_storage.replace(blueprint_id, '$(blueprint_id)')%> {rig_hash:'$(rig_hash)'} run return 0
163164
return 1
164165
}
165166
}
@@ -221,6 +222,7 @@ dir global {
221222
}
222223
}
223224

225+
# Storage-based per-entity NBT storage. Thanks Xanbelor for the concept!
224226
dir data_manager {
225227
function on_load {
226228
scoreboard players add #aj.data_manager.index <%OBJECTIVES.I()%> 0
@@ -256,13 +258,3 @@ dir global {
256258
}
257259
}
258260
}
259-
260-
dir <%export_namespace%> {
261-
function on_load {
262-
function *<%export_namespace%>/invalid_version_warning
263-
}
264-
265-
function invalid_version_warning {
266-
tellraw @a <%TELLRAW.INVALID_VERSION()%>
267-
}
268-
}

0 commit comments

Comments
 (0)