Skip to content

Commit f5da72a

Browse files
SnaveSutitgitbutler-client
authored andcommitted
✨ Add Custom Rig Entity Tags option to blueprint rig settings
1 parent fa73537 commit f5da72a

11 files changed

Lines changed: 43 additions & 45 deletions

File tree

src/dialogs/blueprintSettings/pages/rig.svelte

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,31 @@
11
<script lang="ts">
22
import { onDestroy } from 'svelte'
33
import Checkbox from '../../../svelteComponents/sidebarDialogItems/checkbox.svelte'
4+
import LineEdit from '../../../svelteComponents/sidebarDialogItems/lineEdit.svelte'
45
import NumberSlider from '../../../svelteComponents/sidebarDialogItems/numberSlider.svelte'
56
import { createScopedTranslator } from '../../../util/lang'
67
78
const localize = createScopedTranslator('dialog.blueprint_settings')
89
10+
let customRigEntityTags = $state(Project.animated_java.custom_rig_entity_tags)
911
let interpolationDuration = $state(Project.animated_java.interpolation_duration)
1012
let teleportationDuration = $state(Project.animated_java.teleportation_duration)
1113
let useEntityStacking = $state(Project.animated_java.use_entity_stacking)
1214
1315
onDestroy(() => {
16+
Project.animated_java.custom_rig_entity_tags = customRigEntityTags
1417
Project.animated_java.interpolation_duration = interpolationDuration
1518
Project.animated_java.teleportation_duration = teleportationDuration
1619
Project.animated_java.use_entity_stacking = useEntityStacking
1720
})
1821
</script>
1922

23+
<LineEdit
24+
label={localize('custom_rig_entity_tags.title')}
25+
description={localize('custom_rig_entity_tags.description')}
26+
bind:value={customRigEntityTags}
27+
></LineEdit>
28+
2029
<NumberSlider
2130
label={localize('interpolation_duration.title')}
2231
description={localize('interpolation_duration.description')}

src/formats/blueprint/settings.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ export interface BlueprintSettings {
3535
on_post_tick_function: string
3636
interpolation_duration: number
3737
teleportation_duration: number
38+
custom_rig_entity_tags: string
3839
auto_update_rig_orientation: boolean
3940
use_storage_for_animation: boolean
4041
use_entity_stacking: boolean
@@ -74,6 +75,7 @@ export const defaultValues: BlueprintSettings = {
7475
interpolation_duration: 1,
7576
teleportation_duration: 1,
7677

78+
custom_rig_entity_tags: '',
7779
auto_update_rig_orientation: true,
7880
use_storage_for_animation: false,
7981
use_entity_stacking: false,

src/lang/en.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,14 @@ animated_java:
312312
313313
Treat this input as if it were a `.mcfunction` file.
314314
315-
Supports [MC-Build](https://mcbuild.dev) syntax.
315+
custom_rig_entity_tags:
316+
title: Custom Rig Entity Tags
317+
description: |-
318+
[Markdown]
319+
A list of tags (separated by commas) to add to ***every entity*** in the rig when summoned.
320+
321+
E.g. `tag1, tag2, tag3`
322+
316323
interpolation_duration:
317324
title: Interpolation Duration
318325
description: |-

src/systems/datapackCompiler/1.20.4/main.mcb

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -559,13 +559,7 @@ function summon {
559559
}
560560

561561
summon minecraft:item_display ~ ~ ~ { \
562-
Tags:[ \
563-
'<%TAGS.NEW()%>', \
564-
'<%TAGS.GLOBAL_ENTITY()%>', \
565-
'<%TAGS.GLOBAL_ROOT()%>', \
566-
'<%TAGS.PROJECT_ENTITY(blueprint_id)%>', \
567-
'<%TAGS.PROJECT_ROOT(blueprint_id)%>' \
568-
], \
562+
Tags:<%root_entity_tags%>, \
569563
teleport_duration: 0, \
570564
interpolation_duration: <%interpolation_duration%>, \
571565
Passengers:<%root_entity_passengers%>, \

src/systems/datapackCompiler/1.20.5/main.mcb

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -562,13 +562,7 @@ function summon {
562562
}
563563

564564
summon minecraft:item_display ~ ~ ~ { \
565-
Tags:[ \
566-
'<%TAGS.NEW()%>', \
567-
'<%TAGS.GLOBAL_ENTITY()%>', \
568-
'<%TAGS.GLOBAL_ROOT()%>', \
569-
'<%TAGS.PROJECT_ENTITY(blueprint_id)%>', \
570-
'<%TAGS.PROJECT_ROOT(blueprint_id)%>' \
571-
], \
565+
Tags:<%root_entity_tags%>, \
572566
teleport_duration: 0, \
573567
interpolation_duration: <%interpolation_duration%>, \
574568
Passengers:<%root_entity_passengers%>, \

src/systems/datapackCompiler/1.21.0/main.mcb

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -563,13 +563,7 @@ function summon {
563563
}
564564

565565
summon minecraft:item_display ~ ~ ~ { \
566-
Tags:[ \
567-
'<%TAGS.NEW()%>', \
568-
'<%TAGS.GLOBAL_ENTITY()%>', \
569-
'<%TAGS.GLOBAL_ROOT()%>', \
570-
'<%TAGS.PROJECT_ENTITY(blueprint_id)%>', \
571-
'<%TAGS.PROJECT_ROOT(blueprint_id)%>' \
572-
], \
566+
Tags:<%root_entity_tags%>, \
573567
teleport_duration: 0, \
574568
interpolation_duration: <%interpolation_duration%>, \
575569
Passengers:<%root_entity_passengers%>, \

src/systems/datapackCompiler/1.21.2/main.mcb

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -562,13 +562,7 @@ function summon {
562562
}
563563

564564
summon minecraft:item_display ~ ~ ~ { \
565-
Tags:[ \
566-
'<%TAGS.NEW()%>', \
567-
'<%TAGS.GLOBAL_ENTITY()%>', \
568-
'<%TAGS.GLOBAL_ROOT()%>', \
569-
'<%TAGS.PROJECT_ENTITY(blueprint_id)%>', \
570-
'<%TAGS.PROJECT_ROOT(blueprint_id)%>' \
571-
], \
565+
Tags:<%root_entity_tags%>, \
572566
teleport_duration: 0, \
573567
interpolation_duration: <%interpolation_duration%>, \
574568
Passengers:<%root_entity_passengers%>, \

src/systems/datapackCompiler/1.21.4/main.mcb

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -651,13 +651,7 @@ function summon {
651651
}
652652

653653
summon minecraft:item_display ~ ~ ~ { \
654-
Tags:[ \
655-
'<%TAGS.NEW()%>', \
656-
'<%TAGS.GLOBAL_ENTITY()%>', \
657-
'<%TAGS.GLOBAL_ROOT()%>', \
658-
'<%TAGS.PROJECT_ENTITY(blueprint_id)%>', \
659-
'<%TAGS.PROJECT_ROOT(blueprint_id)%>' \
660-
], \
654+
Tags:<%root_entity_tags%>, \
661655
teleport_duration: 0, \
662656
interpolation_duration: <%interpolation_duration%>, \
663657
Passengers:<%root_entity_passengers%>, \

src/systems/datapackCompiler/1.21.5/main.mcb

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -650,13 +650,7 @@ function summon {
650650
}
651651

652652
summon minecraft:item_display ~ ~ ~ { \
653-
Tags:[ \
654-
'<%TAGS.NEW()%>', \
655-
'<%TAGS.GLOBAL_ENTITY()%>', \
656-
'<%TAGS.GLOBAL_ROOT()%>', \
657-
'<%TAGS.PROJECT_ENTITY(blueprint_id)%>', \
658-
'<%TAGS.PROJECT_ROOT(blueprint_id)%>' \
659-
], \
653+
Tags:<%root_entity_tags%>, \
660654
teleport_duration: 0, \
661655
interpolation_duration: <%interpolation_duration%>, \
662656
Passengers:<%root_entity_passengers%>, \

src/systems/datapackCompiler/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ import {
3737
import ENTITY_NAMES from './entityNames'
3838
import { compileMcbProject } from './mcbCompiler'
3939
import OBJECTIVES from './objectives'
40-
import TAGS, { getNodeTags } from './tags'
40+
import TAGS, { getNodeTags, getRootEntityTags } from './tags'
4141
import TELLRAW from './tellraw'
4242

4343
const BONE_TYPES = ['bone', 'text_display', 'item_display', 'block_display']
@@ -603,6 +603,7 @@ const dataPackCompiler: DataPackCompiler = async ({
603603
auto_update_rig_orientation: aj.auto_update_rig_orientation,
604604
debug_mode: debugMode,
605605
use_entity_stacking: aj.use_entity_stacking,
606+
root_entity_tags: getRootEntityTags().toString(),
606607
}
607608

608609
const mcbFiles = getMCBFilesByVersion(version)

0 commit comments

Comments
 (0)