Skip to content

Commit

Permalink
Hashmap fix (#102)
Browse files Browse the repository at this point in the history
  • Loading branch information
paulevsGitch committed Feb 17, 2022
1 parent 39d5f58 commit e013f80
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ loader_version= 0.12.12
fabric_version = 0.46.2+1.18

# Mod Properties
mod_version = 1.3.3
mod_version = 1.3.4
maven_group = ru.bclib
archives_base_name = bclib

Expand Down
10 changes: 6 additions & 4 deletions src/main/java/ru/bclib/world/generator/map/hex/HexBiomeMap.java
Original file line number Diff line number Diff line change
Expand Up @@ -75,14 +75,16 @@ public BCLBiome getBiome(double x, double y, double z) {
@Override
public BiomeChunk getChunk(final int cx, final int cz, final boolean update) {
final ChunkPos pos = new ChunkPos(cx, cz);
return chunks.computeIfAbsent(pos, i -> {
HexBiomeChunk chunk = chunks.get(pos);
if (chunk == null) {
Random random = new Random(MHelper.getSeed(seed, cx, cz));
HexBiomeChunk chunk = new HexBiomeChunk(random, picker);
chunk = new HexBiomeChunk(random, picker);
if (update && processor != null) {
processor.accept(cx, cz, chunk.getSide());
}
return chunk;
});
chunks.put(pos, chunk);
}
return chunk;
}

@Override
Expand Down

0 comments on commit e013f80

Please sign in to comment.