Fix crash with multitread random

This commit is contained in:
paulevsGitch 2021-12-09 10:06:51 +03:00
parent 8b89808634
commit 9bde4c11b9
2 changed files with 5 additions and 3 deletions

View file

@ -1,4 +1,4 @@
package ru.bclib.api.biomes;
package ru.bclib.interfaces;
import net.minecraft.world.level.block.state.BlockState;

View file

@ -103,8 +103,10 @@ public class SquareBiomeMap implements BiomeMap {
ChunkPos cpos = new ChunkPos(MHelper.floor(x / SquareBiomeChunk.WIDTH), MHelper.floor(z / SquareBiomeChunk.WIDTH));
SquareBiomeChunk chunk = maps.get(cpos);
if (chunk == null) {
random.setLargeFeatureWithSalt(0, cpos.x, cpos.z, 0);
chunk = new SquareBiomeChunk(random, picker);
synchronized (random) {
random.setLargeFeatureWithSalt(0, cpos.x, cpos.z, 0);
chunk = new SquareBiomeChunk(random, picker);
}
maps.put(cpos, chunk);
}