Skip to content

Commit 9e113a0

Browse files
committed
✨ Sync and test 1.21.5
1 parent 4b7b3dc commit 9e113a0

File tree

4 files changed

+98
-27
lines changed

4 files changed

+98
-27
lines changed

src/nodeConfigs.ts

Lines changed: 20 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,26 @@ export class DisplayEntityConfig {
223223

224224
if (this.enchanted) {
225225
const item = (compound.get('item') as NbtCompound) ?? new NbtCompound()
226-
if (!compareVersions(Project!.animated_java.target_minecraft_version, '1.20.4')) {
226+
if (!compareVersions('1.21.5', Project!.animated_java.target_minecraft_version)) {
227+
// >= 1.21.5
228+
const components = (item.get('components') as NbtCompound) ?? new NbtCompound()
229+
item.set('components', components)
230+
const enchantments =
231+
(components.get('minecraft:enchantments') as NbtCompound) ?? new NbtCompound()
232+
components.set('minecraft:enchantments', enchantments)
233+
enchantments.set('minecraft:infinity', new NbtInt(1))
234+
} else if (compareVersions(Project!.animated_java.target_minecraft_version, '1.20.4')) {
235+
// 1.20.5 - 1.21.4
236+
const components = (item.get('components') as NbtCompound) ?? new NbtCompound()
237+
item.set('components', components)
238+
const enchantments =
239+
(components.get('minecraft:enchantments') as NbtCompound) ?? new NbtCompound()
240+
components.set('minecraft:enchantments', enchantments)
241+
enchantments.set(
242+
'levels',
243+
new NbtCompound().set('minecraft:infinity', new NbtInt(1))
244+
)
245+
} else {
227246
// <= 1.20.4
228247
const tag = (item.get('tag') as NbtCompound) ?? new NbtCompound()
229248
item.set('tag', tag)
@@ -234,16 +253,6 @@ export class DisplayEntityConfig {
234253
.set('id', new NbtString('minecraft:infinity'))
235254
.set('lvl', new NbtInt(1))
236255
)
237-
} else {
238-
const components = (item.get('components') as NbtCompound) ?? new NbtCompound()
239-
item.set('components', components)
240-
const enchantments =
241-
(components.get('minecraft:enchantments') as NbtCompound) ?? new NbtCompound()
242-
components.set('minecraft:enchantments', enchantments)
243-
enchantments.set(
244-
'levels',
245-
new NbtCompound().set('minecraft:infinity', new NbtInt(1))
246-
)
247256
}
248257
compound.set('item', item)
249258
}

src/systems/datapackCompiler/1.21.2/global.mcb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@ dir global {
1212

1313
# Purposefully load gu first, as other functions depend on it.
1414
function *global/gu/on_load
15+
function #*global/on_load
1516
IF (debug_mode) {
1617
scoreboard players reset * <%OBJECTIVES.IS_RIG_LOADED()%>
1718
execute as @e[type=item_display,tag=<%TAGS.GLOBAL_ROOT()%>] at @s run function *global/root/on_load
1819
}
19-
function #*global/on_load
2020
}
2121

2222
IF (debug_mode) {

src/systems/datapackCompiler/1.21.5/global.mcb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@ dir global {
1212

1313
# Purposefully load gu first, as other functions depend on it.
1414
function *global/gu/on_load
15+
function #*global/on_load
1516
IF (debug_mode) {
1617
scoreboard players reset * <%OBJECTIVES.IS_RIG_LOADED()%>
1718
execute as @e[type=item_display,tag=<%TAGS.GLOBAL_ROOT()%>] at @s run function *global/root/on_load
1819
}
19-
function #*global/on_load
2020
}
2121

2222
IF (debug_mode) {

test-packs/1.21.5/blueprints/armor_stand_1.21.5.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.5\\blueprints\\armor_stand_1.21.5.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",

0 commit comments

Comments
 (0)