Hashmap fix (#102)

This commit is contained in:
paulevsGitch 2022-02-17 17:28:41 +03:00
parent 39d5f58f0c
commit e013f80912
2 changed files with 7 additions and 5 deletions

View file

@ -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

View file

@ -75,14 +75,16 @@ public class HexBiomeMap implements BiomeMap {
@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