Skip to content

Commit 4b7b3dc

Browse files
committed
✨ Sync and test 1.21.4
1 parent 371aa47 commit 4b7b3dc

File tree

5 files changed

+124
-42
lines changed

5 files changed

+124
-42
lines changed

src/systems/datapackCompiler/1.21.4/animation.mcb

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,6 @@ IF (!auto_update_rig_orientation) {
149149
if entity @s[tag=<%TAGS.GLOBAL_DATA()%>] \
150150
run function ./on_tick/transform_floating_entities
151151
}
152-
153152
execute at @s on passengers run rotate @s ~ ~
154153
}
155154
} ELSE {
@@ -969,33 +968,40 @@ IF (Object.keys(rig.variants).length > 1) {
969968
debug assert executed_as_root_entity
970969

971970
<%%
972-
global.filteredBones = Object.values(rig.nodes).filter(
973-
node => node.type === 'bone' &&
974-
!variant.excluded_nodes.includes(node.uuid) &&
975-
( // Variant has a model override or a config override for this bone.
976-
variant.models[node.uuid] !== undefined ||
971+
global.filteredNodes = Object.values(rig.nodes).filter(
972+
node => (
973+
node.type === 'bone' &&
974+
!variant.excluded_nodes.includes(node.uuid) &&
975+
( // Variant has a model override or a config override for this bone.
976+
variant.models[node.uuid] !== undefined ||
977+
node.configs.variants[variant.uuid] !== undefined
978+
)
979+
) || (
980+
BONE_TYPES.includes(node.type) &&
981+
!variant.excluded_nodes.includes(node.uuid) &&
982+
// Variant has a config override for this node.
977983
node.configs.variants[variant.uuid] !== undefined
978984
)
979985
)
980986
%%>
981987

982-
REPEAT (global.filteredBones) as bone {
988+
REPEAT (global.filteredNodes) as node {
983989
execute \
984990
on passengers \
985-
if entity @s[tag=<%TAGS.PROJECT_NODE_NAMED(export_namespace, bone.storage_name)%>] \
991+
if entity @s[tag=<%TAGS.PROJECT_NODE_NAMED(export_namespace, node.storage_name)%>] \
986992
run \
987-
block zzz/apply_to_bone_<%bone.storage_name%> {
988-
IF (variant.models[bone.uuid] !== undefined) {
993+
block zzz/apply_to_node_<%node.storage_name%> {
994+
IF (node.type === 'bone' && variant.models[node.uuid] !== undefined) {
989995
# Special case for `animated_java:empty` model.
990-
IF (variant.models[bone.uuid].model === null) {
996+
IF (variant.models[node.uuid].model === null) {
991997
data modify entity @s item.components."minecraft:custom_model_data".strings[0] set value "AJ_INTERNAL_EMPTY"
992998
} ELSE {
993999
data modify entity @s item.components."minecraft:custom_model_data".strings[0] set value "<%variant.name%>"
9941000
}
9951001
}
996-
IF (bone.configs.variants[variant.uuid]) {
1002+
IF (node.configs.variants[variant.uuid]) {
9971003
<%%
998-
global.config = BoneConfig.fromJSON(bone.configs.variants[variant.uuid])
1004+
global.config = DisplayEntityConfig.fromJSON(node.configs.variants[variant.uuid])
9991005
%%>
10001006
IF (!global.config.isDefault()) {
10011007
data merge entity @s <%global.config.toNBT(undefined, variant.is_default)%>

src/systems/datapackCompiler/1.21.4/static.mcb

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,6 @@ IF (!auto_update_rig_orientation) {
108108
if entity @s[tag=<%TAGS.GLOBAL_DATA()%>] \
109109
run function ./on_tick/transform_floating_entities
110110
}
111-
112111
execute at @s on passengers run rotate @s ~ ~
113112
}
114113
} ELSE {
@@ -550,33 +549,40 @@ IF (Object.keys(rig.variants).length > 1) {
550549
debug assert executed_as_root_entity
551550

552551
<%%
553-
global.filteredBones = Object.values(rig.nodes).filter(
554-
node => node.type === 'bone' &&
555-
!variant.excluded_nodes.includes(node.uuid) &&
556-
( // Variant has a model override or a config override for this bone.
557-
variant.models[node.uuid] !== undefined ||
552+
global.filteredNodes = Object.values(rig.nodes).filter(
553+
node => (
554+
node.type === 'bone' &&
555+
!variant.excluded_nodes.includes(node.uuid) &&
556+
( // Variant has a model override or a config override for this bone.
557+
variant.models[node.uuid] !== undefined ||
558+
node.configs.variants[variant.uuid] !== undefined
559+
)
560+
) || (
561+
BONE_TYPES.includes(node.type) &&
562+
!variant.excluded_nodes.includes(node.uuid) &&
563+
// Variant has a config override for this node.
558564
node.configs.variants[variant.uuid] !== undefined
559565
)
560566
)
561567
%%>
562568

563-
REPEAT (global.filteredBones) as bone {
569+
REPEAT (global.filteredNodes) as node {
564570
execute \
565571
on passengers \
566-
if entity @s[tag=<%TAGS.PROJECT_NODE_NAMED(export_namespace, bone.storage_name)%>] \
572+
if entity @s[tag=<%TAGS.PROJECT_NODE_NAMED(export_namespace, node.storage_name)%>] \
567573
run \
568-
block zzz/apply_to_bone_<%bone.storage_name%> {
569-
IF (variant.models[bone.uuid] !== undefined) {
574+
block zzz/apply_to_node_<%node.storage_name%> {
575+
IF (node.type === 'bone' && variant.models[node.uuid] !== undefined) {
570576
# Special case for `animated_java:empty` model.
571-
IF (variant.models[bone.uuid].model === null) {
577+
IF (variant.models[node.uuid].model === null) {
572578
data modify entity @s item.components."minecraft:custom_model_data".strings[0] set value "AJ_INTERNAL_EMPTY"
573579
} ELSE {
574580
data modify entity @s item.components."minecraft:custom_model_data".strings[0] set value "<%variant.name%>"
575581
}
576582
}
577-
IF (bone.configs.variants[variant.uuid]) {
583+
IF (node.configs.variants[variant.uuid]) {
578584
<%%
579-
global.config = BoneConfig.fromJSON(bone.configs.variants[variant.uuid])
585+
global.config = DisplayEntityConfig.fromJSON(node.configs.variants[variant.uuid])
580586
%%>
581587
IF (!global.config.isDefault()) {
582588
data merge entity @s <%global.config.toNBT(undefined, variant.is_default)%>

test-packs/1.21.4/blueprints/armor_stand_1.21.4.ajblueprint

Lines changed: 76 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"meta": {
33
"format": "animated-java:format/blueprint",
4-
"format_version": "1.8.0",
4+
"format_version": "1.8.0-beta.2",
55
"uuid": "167b27cd-b559-3f13-a97c-0841fe21f1d1",
66
"save_location": "D:\\github-repos\\animated-java\\old-animated-java\\test-packs\\1.21.4\\blueprints\\armor_stand_1.21.4.ajblueprint",
77
"last_used_export_namespace": "armor_stand"
@@ -866,16 +866,43 @@
866866
"visibility": true,
867867
"locked": false,
868868
"export": true,
869-
"block": "minecraft:stone",
870-
"config": {},
871-
"item": "minecraft:diamond",
872-
"itemDisplay": "none",
873869
"text": "[\n\t{0x00aced}yeah', 'I' '[{love light_purple}' 'text]{' displays''#FF5555'}\n\t'\\n'[{#55_FF_55}definitly' 'quite' 'cursed]\n\t'\\n'{what red}{amI #6395EE}{evenlookingat #c02c38}\n]",
874870
"lineWidth": 400,
875871
"backgroundColor": "#00000040",
876872
"align": "center",
877873
"shadow": true,
878-
"seeThrough": true
874+
"seeThrough": true,
875+
"onSummonFunction": "",
876+
"configs": {
877+
"default": {
878+
"on_apply_function": "",
879+
"billboard": "fixed",
880+
"override_brightness": false,
881+
"brightness_override": 0,
882+
"enchanted": false,
883+
"glowing": false,
884+
"override_glow_color": false,
885+
"glow_color": "#6f114b",
886+
"invisible": false,
887+
"shadow_radius": 0,
888+
"shadow_strength": 1
889+
},
890+
"variants": {
891+
"49521f4b-b970-e4bd-b594-2e05d2d46027": {
892+
"on_apply_function": "",
893+
"billboard": "vertical",
894+
"override_brightness": false,
895+
"brightness_override": 0,
896+
"enchanted": false,
897+
"glowing": true,
898+
"override_glow_color": true,
899+
"glow_color": "#6f114b",
900+
"invisible": false,
901+
"shadow_radius": 0,
902+
"shadow_strength": 1
903+
}
904+
}
905+
}
879906
},
880907
{
881908
"name": "camera",
@@ -899,23 +926,47 @@
899926
"visibility": true,
900927
"locked": false,
901928
"export": true,
902-
"block": "minecraft:stone",
903-
"config": {},
904929
"item": "minecraft:diamond",
905930
"itemDisplay": "none",
906-
"text": "\"Hello World!\"",
907-
"lineWidth": 200,
908-
"backgroundColor": "#000000",
909-
"align": "center",
910-
"shadow": false,
911-
"seeThrough": false
931+
"onSummonFunction": "",
932+
"configs": {
933+
"default": {
934+
"on_apply_function": "",
935+
"billboard": "fixed",
936+
"override_brightness": false,
937+
"brightness_override": 0,
938+
"enchanted": false,
939+
"glowing": false,
940+
"override_glow_color": false,
941+
"glow_color": "#ffffff",
942+
"invisible": false,
943+
"shadow_radius": 0,
944+
"shadow_strength": 1
945+
},
946+
"variants": {
947+
"49521f4b-b970-e4bd-b594-2e05d2d46027": {
948+
"on_apply_function": "",
949+
"billboard": "fixed",
950+
"override_brightness": false,
951+
"brightness_override": 0,
952+
"enchanted": true,
953+
"glowing": true,
954+
"override_glow_color": true,
955+
"glow_color": "#99ff00",
956+
"invisible": false,
957+
"shadow_radius": 0,
958+
"shadow_strength": 1
959+
}
960+
}
961+
}
912962
}
913963
],
914964
"outliner": [
915965
{
916966
"name": "root",
917967
"origin": [0, 0, 0],
918968
"color": 0,
969+
"onSummonFunction": "",
919970
"configs": {
920971
"default": {
921972
"billboard": "fixed",
@@ -945,6 +996,7 @@
945996
"name": "baseplate_root",
946997
"origin": [0, 0, 0],
947998
"color": 0,
999+
"onSummonFunction": "",
9481000
"configs": {
9491001
"default": {
9501002
"billboard": "fixed",
@@ -974,6 +1026,7 @@
9741026
"name": "baseplate_pivot_a",
9751027
"origin": [0, 1, 6],
9761028
"color": 0,
1029+
"onSummonFunction": "",
9771030
"configs": {
9781031
"default": {
9791032
"billboard": "fixed",
@@ -1006,6 +1059,7 @@
10061059
"name": "armor_stand_root",
10071060
"origin": [0, 1, 0],
10081061
"color": 0,
1062+
"onSummonFunction": "",
10091063
"configs": {
10101064
"default": {
10111065
"billboard": "fixed",
@@ -1036,6 +1090,7 @@
10361090
"name": "waist_pivot",
10371091
"origin": [0, 12, 0],
10381092
"color": 0,
1093+
"onSummonFunction": "",
10391094
"configs": {
10401095
"default": {
10411096
"billboard": "fixed",
@@ -1068,6 +1123,7 @@
10681123
"name": "body_waist_pivot",
10691124
"origin": [0, 12, 0],
10701125
"color": 0,
1126+
"onSummonFunction": "",
10711127
"configs": {
10721128
"default": {
10731129
"billboard": "fixed",
@@ -1100,6 +1156,7 @@
11001156
"name": "body",
11011157
"origin": [0, 24, 0],
11021158
"color": 0,
1159+
"onSummonFunction": "",
11031160
"configs": {
11041161
"default": {
11051162
"billboard": "fixed",
@@ -1167,6 +1224,7 @@
11671224
"name": "head",
11681225
"origin": [0, 23, 0],
11691226
"color": 0,
1227+
"onSummonFunction": "",
11701228
"configs": {
11711229
"default": {
11721230
"billboard": "fixed",
@@ -1215,6 +1273,7 @@
12151273
"name": "left_arm",
12161274
"origin": [-6, 23, 0],
12171275
"color": 0,
1276+
"onSummonFunction": "",
12181277
"configs": {
12191278
"default": {
12201279
"billboard": "fixed",
@@ -1263,6 +1322,7 @@
12631322
"name": "right_arm",
12641323
"origin": [6, 23, 0],
12651324
"color": 0,
1325+
"onSummonFunction": "",
12661326
"configs": {
12671327
"default": {
12681328
"billboard": "fixed",
@@ -1320,6 +1380,7 @@
13201380
"name": "left_leg",
13211381
"origin": [2, 12, 0],
13221382
"color": 0,
1383+
"onSummonFunction": "",
13231384
"configs": {
13241385
"default": {
13251386
"billboard": "fixed",
@@ -1366,6 +1427,7 @@
13661427
"name": "right_leg",
13671428
"origin": [-2, 12, 0],
13681429
"color": 0,
1430+
"onSummonFunction": "",
13691431
"configs": {
13701432
"default": {
13711433
"billboard": "fixed",
Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
{
22
"pack": {
33
"pack_format": 61,
4-
"description": "AJ Testing DP"
4+
"description": "AJ Testing DP",
5+
"supported_formats": {
6+
"min_inclusive": 61,
7+
"max_inclusive": 70
8+
}
59
}
610
}
Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
{
22
"pack": {
33
"pack_format": 46,
4-
"description": "AJ Testing RP"
4+
"description": "AJ Testing DP",
5+
"supported_formats": {
6+
"min_inclusive": 46,
7+
"max_inclusive": 54
8+
}
59
}
610
}

0 commit comments

Comments
 (0)