@@ -4,6 +4,7 @@ import { openBlueprintSettingsDialog } from '../interface/blueprintSettingsDialo
44import { PROGRESS_DESCRIPTION , openExportProgressDialog } from '../interface/exportProgressDialog'
55import { openUnexpectedErrorDialog } from '../interface/unexpectedErrorDialog'
66import { resolvePath } from '../util/fileUtil'
7+ import { isResourcePackPath } from '../util/minecraftUtil'
78import { translate } from '../util/translation'
89import { Variant } from '../variants'
910import { hashAnimations , renderProjectAnimations } from './animationRenderer'
@@ -24,6 +25,22 @@ async function actuallyExportProject(forceSave = true) {
2425 try {
2526 console . time ( 'Exporting project took' )
2627
28+ // Verify that all variant texture maps are valid
29+ for ( const variant of Variant . all ) {
30+ variant . verifyTextureMap ( )
31+ }
32+
33+ // Verify that all non-external textures have unique names
34+ for ( const texture of Texture . all ) {
35+ if ( texture . path && isResourcePackPath ( texture . path ) && fs . existsSync ( texture . path ) )
36+ continue
37+ if ( Texture . all . some ( t => t !== texture && t . name === texture . name ) ) {
38+ throw new IntentionalExportError (
39+ `Texture name "${ texture . name } " is used more than once. Please make sure all textures have unique names.`
40+ )
41+ }
42+ }
43+
2744 let textureExportFolder : string , modelExportFolder : string , displayItemPath : string
2845
2946 const resourcePackFolder = resolvePath ( aj . resource_pack )
@@ -161,7 +178,5 @@ export async function exportProject(forceSave = true) {
161178
162179 settingsDialog . close ( 0 )
163180
164- // Verify that all textures have unique IDs
165-
166181 await actuallyExportProject ( forceSave )
167182}
0 commit comments