@@ -7,6 +7,7 @@ import { resolveEnvVariables } from '../util/misc'
77import { translate } from '../util/translation'
88import { hashAnimations , renderProjectAnimations } from './animationRenderer'
99import { compileDataPack } from './datapackCompiler'
10+ import { exportJSON } from './jsonExporter'
1011import { compileResourcePack } from './resourcepackCompiler'
1112import { renderRig , hashRig } from './rigRenderer'
1213
@@ -25,9 +26,20 @@ async function actuallyExportProject(forceSave = true) {
2526 const resourcePackFolder = resolveEnvVariables ( aj . resource_pack )
2627 const dataPackFolder = resolveEnvVariables ( aj . data_pack )
2728
28- console . log ( 'Exporting to' , resourcePackFolder , dataPackFolder )
29-
30- if ( aj . enable_advanced_resource_pack_settings ) {
29+ if ( aj . enable_plugin_mode ) {
30+ modelExportFolder = PathModule . join (
31+ 'assets/animated_java/models/item/' ,
32+ aj . export_namespace
33+ )
34+ textureExportFolder = PathModule . join (
35+ 'assets/animated_java/textures/item/' ,
36+ aj . export_namespace
37+ )
38+ displayItemPath = PathModule . join (
39+ 'assets/minecraft/models/item/' ,
40+ aj . display_item . split ( ':' ) . at ( - 1 ) ! + '.json'
41+ )
42+ } else if ( aj . enable_advanced_resource_pack_settings ) {
3143 modelExportFolder = aj . model_folder
3244 textureExportFolder = aj . texture_folder
3345 displayItemPath = aj . display_item_path
@@ -69,23 +81,34 @@ async function actuallyExportProject(forceSave = true) {
6981 const rigHash = hashRig ( rig )
7082 const animationHash = hashAnimations ( animations )
7183
72- if ( aj . enable_resource_pack ) {
73- compileResourcePack ( {
84+ if ( aj . enable_plugin_mode ) {
85+ exportJSON ( {
7486 rig,
7587 animations,
7688 displayItemPath,
77- resourcePackFolder,
7889 textureExportFolder,
7990 modelExportFolder,
80- dataPackFolder,
8191 } )
92+ } else {
93+ if ( aj . enable_resource_pack ) {
94+ compileResourcePack ( {
95+ rig,
96+ animations,
97+ displayItemPath,
98+ resourcePackFolder,
99+ textureExportFolder,
100+ modelExportFolder,
101+ dataPackFolder,
102+ } )
103+ }
104+
105+ if ( aj . enable_data_pack ) {
106+ await compileDataPack ( { rig, animations, dataPackFolder, rigHash, animationHash } )
107+ }
108+
109+ Project ! . last_used_export_namespace = aj . export_namespace
82110 }
83111
84- if ( aj . enable_data_pack ) {
85- await compileDataPack ( { rig, animations, dataPackFolder, rigHash, animationHash } )
86- }
87-
88- Project ! . last_used_export_namespace = aj . export_namespace
89112 console . timeEnd ( 'Exporting project took' )
90113
91114 if ( forceSave ) saveBlueprint ( )
0 commit comments