@@ -8,17 +8,16 @@ import {
8
8
system ,
9
9
world ,
10
10
} from '@minecraft/server'
11
- import { Vector , getRole , prompt , util } from 'lib'
11
+ import { Vector , getRole , prompt } from 'lib'
12
12
import { Sounds } from 'lib/assets/config'
13
13
import { table } from 'lib/database/abstract'
14
14
import { ngettext , t } from 'lib/text'
15
- import stringifyError from 'lib/utils/error '
15
+ import { stringify } from 'lib/utils/inspect '
16
16
import { WeakPlayerMap } from 'lib/weak-player-storage'
17
17
import { stringifyReplaceTargets , toPermutation , toReplaceTarget } from 'modules/world-edit/menu'
18
18
import { WE_CONFIG , spawnParticlesInArea } from '../config'
19
19
import { BigStructure } from './big-structure'
20
20
import { Cuboid } from './ccuboid'
21
- import { stringify } from 'lib/utils/inspect'
22
21
23
22
// TODO Add WorldEdit.runMultipleAsyncJobs
24
23
@@ -364,13 +363,14 @@ export class WorldEdit {
364
363
system . runJob (
365
364
( function * fillBetweenJob ( ) {
366
365
nextBlock: for ( const position of Vector . foreach ( selection . min , selection . max ) ) {
366
+ const block = world . overworld . getBlock ( position )
367
+
367
368
for ( const replaceBlock of replaceTargets ) {
368
369
try {
369
- const block = world . overworld . getBlock ( position )
370
-
371
370
if ( replaceBlock && ! block ?. permutation . matches ( replaceBlock . typeId , replaceBlock . states ) ) continue
372
371
373
372
block ?. setPermutation ( toPermutation ( blocks . randomElement ( ) ) )
373
+ yield
374
374
continue nextBlock
375
375
} catch ( e ) {
376
376
if ( errors < 3 && e instanceof Error ) {
@@ -384,10 +384,9 @@ export class WorldEdit {
384
384
console . error ( e )
385
385
386
386
errors ++
387
+ } finally {
388
+ all ++
387
389
}
388
-
389
- all ++
390
- yield
391
390
}
392
391
}
393
392
} ) ( ) ,
0 commit comments