Skip to content

Commit 920cb80

Browse files
committed
🐛 Cameras and locators are missing the majority of their tags
1 parent 28f61be commit 920cb80

File tree

3 files changed

+35
-36
lines changed

3 files changed

+35
-36
lines changed

src/systems/datapackCompiler/1.21.4/animation.mcb

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -432,12 +432,13 @@ dir <%export_namespace%> {
432432
execute store result score @s <%OBJECTIVES.ID()%> run scoreboard players add aj.last_id <%OBJECTIVES.ID()%> 1
433433

434434
execute on passengers if entity @s[tag=<%TAGS.GLOBAL_DATA()%>] run {
435+
435436
function *global/internal/gu/convert_uuid_array_to_string with entity @s
436437
data modify entity @s data.bones.data_data set from storage aj:uuid main.out
437438

438439
REPEAT (Object.values(rig.nodes).filter(v => v.type === 'locator')) as locator {
439440
IF (locator.config && locator.config.use_entity) {
440-
summon <%locator.config.entity_type%> ~ ~ ~ {Tags:['<%TAGS.NEW()%>', '<%TAGS.GLOBAL_LOCATOR()%>', '<%TAGS.PROJECT_LOCATOR(export_namespace)%>', '<%TAGS.PROJECT_LOCATOR(export_namespace, locator.name)%>']}
441+
summon <%locator.config.entity_type%> ~ ~ ~ {Tags:<%getNodeTags(locator, rig)%>}
441442
execute as @e[type=<%locator.config.entity_type%>,tag=<%TAGS.NEW()%>,tag=<%TAGS.GLOBAL_LOCATOR()%>,limit=1,distance=..0.01] run {
442443
tag @s remove <%TAGS.NEW()%>
443444

@@ -453,7 +454,7 @@ dir <%export_namespace%> {
453454
}
454455

455456
REPEAT (Object.values(rig.nodes).filter(v => v.type === 'camera')) as camera {
456-
summon item_display ~ ~ ~ {Tags:['<%TAGS.NEW()%>', '<%TAGS.GLOBAL_CAMERA()%>', '<%TAGS.PROJECT_CAMERA(export_namespace)%>', '<%TAGS.PROJECT_CAMERA(export_namespace, camera.name)%>'], teleport_duration: 2}
457+
summon item_display ~ ~ ~ {Tags:<%getNodeTags(camera, rig)%>, teleport_duration: 2}
457458
execute as @e[type=item_display,tag=<%TAGS.NEW()%>,tag=<%TAGS.GLOBAL_CAMERA()%>,limit=1,distance=..0.01] run {
458459
tag @s remove <%TAGS.NEW()%>
459460
function *global/internal/gu/convert_uuid_array_to_string with entity @s
@@ -468,8 +469,6 @@ dir <%export_namespace%> {
468469
}
469470
}
470471

471-
tag @s remove <%TAGS.NEW()%>
472-
473472
# Variant Arguement
474473
IF (Object.keys(rig.variants).length > 1) {
475474
execute if data storage aj:temp args.variant run { with storage aj:temp args
@@ -537,6 +536,9 @@ dir <%export_namespace%> {
537536
%%>
538537
# Custom Summon Commands
539538

539+
tag @s remove <%TAGS.NEW()%>
540+
execute on passengers run tag @s remove <%TAGS.NEW()%>
541+
540542
# Run the on_summon function for the root entity.
541543
function #*<%export_namespace%>/as_root/on_summon
542544
}

src/systems/datapackCompiler/index.ts

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,7 @@
1-
import { isFunctionTagPath } from '../../util/fileUtil'
2-
import mcbFiles from '../datapackCompiler/mcbFiles'
3-
import { AnyRenderedNode, IRenderedRig, IRenderedVariant } from '../rigRenderer'
4-
import { IRenderedAnimation } from '../animationRenderer'
5-
import { Variant } from '../../variants'
61
import { NbtByte, NbtCompound, NbtFloat, NbtInt, NbtList, NbtString } from 'deepslate/lib/nbt'
7-
import {
8-
arrayToNbtFloatArray,
9-
getFunctionNamespace,
10-
matrixToNbtFloatArray,
11-
replacePathPart,
12-
sortObjectKeys,
13-
transformationToNbt,
14-
} from '../util'
2+
import { MAX_PROGRESS, PROGRESS, PROGRESS_DESCRIPTION } from '../../interface/dialog/exportProgress'
153
import { BoneConfig, TextDisplayConfig } from '../../nodeConfigs'
4+
import { isFunctionTagPath } from '../../util/fileUtil'
165
import {
176
getDataPackFormat,
187
IFunctionTag,
@@ -21,13 +10,24 @@ import {
2110
parseDataPackPath,
2211
parseResourceLocation,
2312
} from '../../util/minecraftUtil'
24-
import { JsonText } from '../minecraft/jsonText'
25-
import { MAX_PROGRESS, PROGRESS, PROGRESS_DESCRIPTION } from '../../interface/dialog/exportProgress'
2613
import { eulerFromQuaternion, floatToHex, roundTo, tinycolorToDecimal } from '../../util/misc'
2714
import { MSLimiter } from '../../util/msLimiter'
15+
import { Variant } from '../../variants'
16+
import { IRenderedAnimation } from '../animationRenderer'
17+
import mcbFiles from '../datapackCompiler/mcbFiles'
18+
import { IntentionalExportError } from '../exporter'
19+
import { JsonText } from '../minecraft/jsonText'
20+
import { AnyRenderedNode, IRenderedRig, IRenderedVariant } from '../rigRenderer'
21+
import {
22+
arrayToNbtFloatArray,
23+
getFunctionNamespace,
24+
matrixToNbtFloatArray,
25+
replacePathPart,
26+
sortObjectKeys,
27+
transformationToNbt,
28+
} from '../util'
2829
import { compile } from './compiler'
2930
import { TAGS } from './tags'
30-
import { IntentionalExportError } from '../exporter'
3131

3232
const BONE_TYPES = ['bone', 'text_display', 'item_display', 'block_display']
3333

@@ -69,6 +69,7 @@ function getNodeTags(node: AnyRenderedNode, rig: IRenderedRig): NbtList {
6969

7070
tags.push(
7171
// Global
72+
TAGS.NEW(),
7273
TAGS.GLOBAL_ENTITY(),
7374
TAGS.GLOBAL_NODE(),
7475
TAGS.GLOBAL_NODE_NAMED(node.safe_name),
@@ -592,6 +593,7 @@ async function generateRootEntityPassengers(rig: IRenderedRig, rigHash: string)
592593
.set(
593594
'Tags',
594595
new NbtList([
596+
new NbtString(TAGS.NEW()),
595597
new NbtString(TAGS.GLOBAL_ENTITY()),
596598
new NbtString(TAGS.GLOBAL_DATA()),
597599
new NbtString(TAGS.PROJECT_ENTITY(aj.export_namespace)),
@@ -1069,6 +1071,7 @@ export default async function compileDataPack(options: {
10691071
.length > 0,
10701072
has_cameras: Object.values(rig.nodes).filter(n => n.type === 'camera').length > 0,
10711073
is_static,
1074+
getNodeTags,
10721075
}
10731076

10741077
const mcbFile = is_static

0 commit comments

Comments
 (0)