Skip to content

Commit 9c1202c

Browse files
committed
Data Pack Exporter refactor
MAJOR BREAKING CHANGE: Animated Java Rigs are now created inside of the `animated_java` data pack and resource pack namespace. This means you'll need to update any function calls from "project_name:..." to "animated_java:project_name/..." Improved Resource Pack structure Improved exported Data Pack structure. Improved DPE reliability. Improved custom NBT merging. Added ability to export data pack and resource pack to the same root folder.
1 parent 384304e commit 9c1202c

21 files changed

+1235
-1250
lines changed

exporters/datapackExporter/datapackExporter.ts

Lines changed: 60 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { loadDataPackGenerator } from './exporter/datapackGen'
1+
import { generateDatapack } from './exporter/gen/datapack'
22
import { loadTranslations } from './exporter/translations'
33

44
export function loadExporter() {
@@ -109,6 +109,39 @@ export function loadExporter() {
109109
docsLink:
110110
'/docs/exporters/datapack_exporter/settings#include_remove_all_function',
111111
}),
112+
// Tag Toggles
113+
include_on_load_function_tags: new Settings.CheckboxSetting({
114+
id: 'animated_java:datapack_exporter/include_on_load_function_tags',
115+
displayName: TRANSLATIONS.include_on_load_function_tags.name,
116+
description: TRANSLATIONS.include_on_load_function_tags.description,
117+
defaultValue: true,
118+
docsLink:
119+
'/docs/exporters/datapack_exporter/settings#include_on_load_function_tags',
120+
}),
121+
include_on_tick_function_tags: new Settings.CheckboxSetting({
122+
id: 'animated_java:datapack_exporter/include_on_tick_function_tags',
123+
displayName: TRANSLATIONS.include_on_tick_function_tags.name,
124+
description: TRANSLATIONS.include_on_tick_function_tags.description,
125+
defaultValue: true,
126+
docsLink:
127+
'/docs/exporters/datapack_exporter/settings#include_on_tick_function_tags',
128+
}),
129+
include_on_summon_function_tags: new Settings.CheckboxSetting({
130+
id: 'animated_java:datapack_exporter/include_on_summon_function_tags',
131+
displayName: TRANSLATIONS.include_on_summon_function_tags.name,
132+
description: TRANSLATIONS.include_on_summon_function_tags.description,
133+
defaultValue: true,
134+
docsLink:
135+
'/docs/exporters/datapack_exporter/settings#include_on_summon_function_tags',
136+
}),
137+
include_on_remove_function_tags: new Settings.CheckboxSetting({
138+
id: 'animated_java:datapack_exporter/include_on_remove_function_tags',
139+
displayName: TRANSLATIONS.include_on_remove_function_tags.name,
140+
description: TRANSLATIONS.include_on_remove_function_tags.description,
141+
defaultValue: true,
142+
docsLink:
143+
'/docs/exporters/datapack_exporter/settings#include_on_remove_function_tags',
144+
}),
112145
}
113146
},
114147
settingsStructure: [
@@ -158,7 +191,32 @@ export function loadExporter() {
158191
},
159192
],
160193
},
194+
{
195+
type: 'group',
196+
title: TRANSLATIONS.function_tag_toggles_group.title,
197+
openByDefault: false,
198+
children: [
199+
{
200+
type: 'setting',
201+
settingId: 'animated_java:datapack_exporter/include_on_load_function_tags',
202+
},
203+
{
204+
type: 'setting',
205+
settingId: 'animated_java:datapack_exporter/include_on_tick_function_tags',
206+
},
207+
{
208+
type: 'setting',
209+
settingId:
210+
'animated_java:datapack_exporter/include_on_summon_function_tags',
211+
},
212+
{
213+
type: 'setting',
214+
settingId:
215+
'animated_java:datapack_exporter/include_on_remove_function_tags',
216+
},
217+
],
218+
},
161219
],
162-
export: loadDataPackGenerator() as any,
220+
export: generateDatapack as any,
163221
})
164222
}

exporters/datapackExporter/datapack_structure.yml

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ datapack:
9090
- as_locator_targets.json
9191
- as_cameras.json
9292
- as_camera_targets.json
93-
- on_summon.json:
93+
- on_summon:
9494
- as_root.json
9595
- as_rig_entities.json
9696
- as_bones.json
@@ -106,12 +106,6 @@ datapack:
106106
- as_locator_targets.json
107107
- as_cameras.json
108108
- as_camera_targets.json
109-
- entity_types:
110-
- functions:
111-
- rig_root.json
112-
- rig_bones.json
113-
- project_name:
114-
- rig_entities.json
115109
- minecraft:
116110
- tags:
117111
- functions:

exporters/datapackExporter/exporter/datapackGen.ts

Lines changed: 0 additions & 136 deletions
This file was deleted.

0 commit comments

Comments
 (0)