@@ -96,7 +96,8 @@ window.BedrockEntityManager = class BedrockEntityManager {
9696 }
9797 }
9898 if ( valid_textures_list . length == 1 ) {
99- new Texture ( { keep_size : true , render_mode} ) . fromPath ( valid_textures_list [ 0 ] ) . add ( )
99+ let texture = new Texture ( { keep_size : true , render_mode} ) . fromPath ( valid_textures_list [ 0 ] ) . add ( )
100+ if ( isApp ) loadAdjacentTextureSet ( texture ) ;
100101 if ( render_mode == 'layered' ) {
101102 updateLayeredTextures ( ) ;
102103 }
@@ -169,14 +170,15 @@ window.BedrockEntityManager = class BedrockEntityManager {
169170 cancelIndex : 2 ,
170171 onButton ( index ) {
171172 dialog . hide ( ) ;
173+ let textures_to_import = [ ] ;
172174 if ( index == 1 ) {
173- valid_textures_list . forEach ( path => {
174- new Texture ( { keep_size : true , render_mode} ) . fromPath ( path ) . add ( )
175- } )
175+ textures_to_import = valid_textures_list ;
176176 } else if ( index == 0 ) {
177- selected_textures . forEach ( path => {
178- new Texture ( { keep_size : true , render_mode} ) . fromPath ( path ) . add ( )
179- } )
177+ textures_to_import = selected_textures ;
178+ }
179+ for ( let path of textures_to_import ) {
180+ let texture = new Texture ( { keep_size : true , render_mode} ) . fromPath ( path ) . add ( ) ;
181+ if ( isApp ) loadAdjacentTextureSet ( texture ) ;
180182 }
181183 if ( render_mode == 'layered' ) {
182184 updateLayeredTextures ( ) ;
@@ -322,7 +324,8 @@ window.BedrockEntityManager = class BedrockEntityManager {
322324 } else {
323325 function tryItWith ( extension ) {
324326 if ( fs . existsSync ( texture_path + '.' + extension ) ) {
325- var texture = new Texture ( { keep_size : true } ) . fromPath ( texture_path + '.' + extension ) . add ( )
327+ var texture = new Texture ( { keep_size : true } ) . fromPath ( texture_path + '.' + extension ) . add ( ) ;
328+ loadAdjacentTextureSet ( texture ) ;
326329 return true ;
327330 }
328331 }
@@ -454,6 +457,7 @@ window.BedrockBlockManager = class BedrockBlockManager {
454457 ] )
455458 if ( full_texture_path ) {
456459 let texture = new Texture ( { keep_size : true } ) . fromPath ( full_texture_path ) . add ( ) ;
460+ if ( isApp ) loadAdjacentTextureSet ( texture ) ;
457461 if ( target == '*' ) {
458462 texture . use_as_default = true ;
459463
0 commit comments