19
19
import net .minecraft .world .gen .chunk .*;
20
20
import net .minecraft .world .gen .noise .NoiseConfig ;
21
21
22
+ import java .util .Iterator ;
22
23
import java .util .Set ;
23
24
import java .util .concurrent .CompletableFuture ;
24
25
@@ -42,28 +43,45 @@ public CompletableFuture<Chunk> populateNoise(Blender blender, NoiseConfig noise
42
43
int i = generationShapeConfig .minimumY ();
43
44
int j = MathHelper .floorDiv (i , generationShapeConfig .verticalCellBlockCount ());
44
45
int k = MathHelper .floorDiv (generationShapeConfig .height (), generationShapeConfig .verticalCellBlockCount ());
45
- return k <= 0 ? CompletableFuture .completedFuture (chunk ) : CompletableFuture .supplyAsync (Util . debugSupplier ( "wgen_fill_noise" , () -> {
46
+ return k <= 0 ? CompletableFuture .completedFuture (chunk ) : CompletableFuture .supplyAsync (() -> {
46
47
int l = chunk .getSectionIndex (k * generationShapeConfig .verticalCellBlockCount () - 1 + i );
47
48
int m = chunk .getSectionIndex (i );
48
- Set <ChunkSection > set = Sets .< ChunkSection > newHashSet ();
49
+ Set <ChunkSection > set = Sets .newHashSet ();
49
50
50
- for (int n = l ; n >= m ; n -- ) {
51
+ for (int n = l ; n >= m ; -- n ) {
51
52
ChunkSection chunkSection = chunk .getSection (n );
52
53
chunkSection .lock ();
53
54
set .add (chunkSection );
54
55
}
55
56
56
- Chunk var20 ;
57
+ boolean var19 = false ;
58
+
59
+ Chunk var21 ;
57
60
try {
58
- var20 = this .populateNoise (blender , structureAccessor , noiseConfig , chunk , j , k );
61
+ var19 = true ;
62
+ var21 = this .populateNoise (blender , structureAccessor , noiseConfig , chunk , j , k );
63
+ var19 = false ;
59
64
} finally {
60
- for (ChunkSection chunkSection3 : set ) {
61
- chunkSection3 .unlock ();
65
+ if (var19 ) {
66
+ Iterator var16 = set .iterator ();
67
+
68
+ while (var16 .hasNext ()) {
69
+ ChunkSection chunkSection3 = (ChunkSection )var16 .next ();
70
+ chunkSection3 .unlock ();
71
+ }
72
+
62
73
}
63
74
}
64
75
65
- return var20 ;
66
- }), Util .getMainWorkerExecutor ());
76
+ Iterator var22 = set .iterator ();
77
+
78
+ while (var22 .hasNext ()) {
79
+ ChunkSection chunkSection2 = (ChunkSection )var22 .next ();
80
+ chunkSection2 .unlock ();
81
+ }
82
+
83
+ return var21 ;
84
+ }, Util .getMainWorkerExecutor ().named ("wgen_fill_noise" ));
67
85
}
68
86
69
87
private Chunk populateNoise (Blender blender , StructureAccessor structureAccessor , NoiseConfig noiseConfig , Chunk chunk , int minimumCellY , int cellHeight ) {
0 commit comments