Skip to content

Commit 0ad8d6f

Browse files
committed
Bump minercraft version
1 parent 16b1a2e commit 0ad8d6f

File tree

3 files changed

+34
-16
lines changed

3 files changed

+34
-16
lines changed

gradle.properties

+6-6
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@ org.gradle.parallel=true
44

55
# Fabric Properties
66
# check these on https://fabricmc.net/develop
7-
minecraft_version=1.21.1
8-
yarn_mappings=1.21.1+build.3
9-
loader_version=0.16.5
7+
minecraft_version=1.21.2
8+
yarn_mappings=1.21.2+build.1
9+
loader_version=0.16.7
10+
11+
# Fabric API
12+
fabric_version=0.106.1+1.21.2
1013

1114
# Mod Properties
1215
mod_version=1.0.0
1316
maven_group=com.cyao
1417
archives_base_name=2d-minecraft
15-
16-
# Dependencies
17-
fabric_version=0.105.0+1.21.1

src/main/java/com/cyao/PaperWorldGenerator.java

+27-9
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
import net.minecraft.world.gen.chunk.*;
2020
import net.minecraft.world.gen.noise.NoiseConfig;
2121

22+
import java.util.Iterator;
2223
import java.util.Set;
2324
import java.util.concurrent.CompletableFuture;
2425

@@ -42,28 +43,45 @@ public CompletableFuture<Chunk> populateNoise(Blender blender, NoiseConfig noise
4243
int i = generationShapeConfig.minimumY();
4344
int j = MathHelper.floorDiv(i, generationShapeConfig.verticalCellBlockCount());
4445
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(() -> {
4647
int l = chunk.getSectionIndex(k * generationShapeConfig.verticalCellBlockCount() - 1 + i);
4748
int m = chunk.getSectionIndex(i);
48-
Set<ChunkSection> set = Sets.<ChunkSection>newHashSet();
49+
Set<ChunkSection> set = Sets.newHashSet();
4950

50-
for (int n = l; n >= m; n--) {
51+
for(int n = l; n >= m; --n) {
5152
ChunkSection chunkSection = chunk.getSection(n);
5253
chunkSection.lock();
5354
set.add(chunkSection);
5455
}
5556

56-
Chunk var20;
57+
boolean var19 = false;
58+
59+
Chunk var21;
5760
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;
5964
} 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+
6273
}
6374
}
6475

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"));
6785
}
6886

6987
private Chunk populateNoise(Blender blender, StructureAccessor structureAccessor, NoiseConfig noiseConfig, Chunk chunk, int minimumCellY, int cellHeight) {

src/main/resources/fabric.mod.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
],
2525
"depends": {
2626
"fabricloader": ">=0.16.5",
27-
"minecraft": "~1.21.1",
27+
"minecraft": ">=1.21.0",
2828
"java": ">=21",
2929
"fabric-api": "*"
3030
},

0 commit comments

Comments
 (0)