From 66673e2f52711825606847139fc345962af0882c Mon Sep 17 00:00:00 2001 From: Harrison Date: Tue, 21 Apr 2020 17:01:53 -0500 Subject: [PATCH] Made sure alternator was semi-multithread safe. --- .../world/IslandWorldGeneratorAlternator.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/main/java/ca/recrown/islandsurvivalcraft/world/IslandWorldGeneratorAlternator.java b/src/main/java/ca/recrown/islandsurvivalcraft/world/IslandWorldGeneratorAlternator.java index adf8803..0346f18 100644 --- a/src/main/java/ca/recrown/islandsurvivalcraft/world/IslandWorldGeneratorAlternator.java +++ b/src/main/java/ca/recrown/islandsurvivalcraft/world/IslandWorldGeneratorAlternator.java @@ -21,11 +21,10 @@ public class IslandWorldGeneratorAlternator { this.islandBiomeGenerator = biomeGenerator; } - public IslandWorldGenerator getIslandChunkGeneratorSystemForWorld(World world, Random random) { + public synchronized IslandWorldGenerator getIslandChunkGeneratorSystemForWorld(World world, Random random) { if (!chunkGenerator.containsKey(world.getUID())) { chunkGenerator.put(world.getUID(), new IslandWorldGenerator(world, islandBiomeGenerator.getInstance(), random)); } - return chunkGenerator.get(world.getUID()); } } \ No newline at end of file