@@ -9,6 +9,7 @@ import { addProjectToRecentProjects } from './util/misc'
99import { Valuable } from './util/stores'
1010import { TRANSPARENT_TEXTURE , TRANSPARENT_TEXTURE_MATERIAL , Variant } from './variants'
1111import FormatPageSvelte from './components/formatPage.svelte'
12+ import { translate } from './util/translation'
1213
1314/**
1415 * The serialized Variant Bone Config
@@ -283,8 +284,6 @@ export const BLUEPRINT_CODEC = new Blockbench.Codec('animated_java_blueprint', {
283284 newElement . faces [ face ] . texture = defaultTexture . uuid
284285 }
285286 }
286- } else if ( newElement instanceof AnimatedJava . API . TextDisplay ) {
287- console . log ( 'TextDisplay' , newElement )
288287 }
289288 }
290289 }
@@ -471,8 +470,18 @@ export const BLUEPRINT_CODEC = new Blockbench.Codec('animated_java_blueprint', {
471470 content : BLUEPRINT_CODEC . compile ( ) ,
472471 // eslint-disable-next-line @typescript-eslint/naming-convention
473472 custom_writer : ( content , path ) => {
474- Project ! . save_path = path
475- BLUEPRINT_CODEC . write ( content , path )
473+ if ( fs . existsSync ( PathModule . dirname ( path ) ) ) {
474+ Project ! . save_path = path
475+ BLUEPRINT_CODEC . write ( content , path )
476+ } else {
477+ console . error (
478+ `Failed to export Animated Java Blueprint, file location '${ path } ' does not exist!`
479+ )
480+ Blockbench . showMessageBox ( {
481+ title : translate ( 'error.blueprint_export_path_doesnt_exist.title' ) ,
482+ message : translate ( 'error.blueprint_export_path_doesnt_exist' , path ) ,
483+ } )
484+ }
476485 } ,
477486 } )
478487 } ,
@@ -500,7 +509,6 @@ export const BLUEPRINT_FORMAT = new Blockbench.ModelFormat({
500509 component : {
501510 methods : { } ,
502511 created ( ) {
503- // if (formatPage)
504512 void injectSvelteCompomponent ( {
505513 elementSelector : ( ) => $ ( '#format_page_animated_java_blueprint_mount' ) [ 0 ] ,
506514 svelteComponent : FormatPageSvelte ,
@@ -643,7 +651,6 @@ events.SELECT_AJ_PROJECT.subscribe(() => {
643651 } )
644652} )
645653events . UNSELECT_AJ_PROJECT . subscribe ( project => {
646- console . log ( 'Unselecting Animated Java Project' , project )
647654 if ( project . visualBoundingBox ) scene . remove ( project . visualBoundingBox )
648655 disableRotationLock ( )
649656} )
0 commit comments