Allow paper multicore to call without locking

This commit is contained in:
DanMB
2022-06-04 22:19:36 -07:00
parent 3b5bdcfb51
commit ce8cc2cf37
3 changed files with 4 additions and 5 deletions
@@ -80,7 +80,7 @@ public class IrisBiomeActuator extends EngineAssignedActuator<Biome> {
try { try {
IrisBiomeCustom custom = ib.getCustomBiome(rng, x, 0, z); IrisBiomeCustom custom = ib.getCustomBiome(rng, x, 0, z);
Object biomeBase = INMS.get().getCustomBiomeBaseHolderFor(getDimension().getLoadKey() + ":" + custom.getId()); Object biomeBase = INMS.get().getCustomBiomeBaseHolderFor(getDimension().getLoadKey() + ":" + custom.getId());
//
if(biomeBase == null || !injectBiome(h, x, 0, z, biomeBase)) { if(biomeBase == null || !injectBiome(h, x, 0, z, biomeBase)) {
throw new RuntimeException("Cant inject biome!"); throw new RuntimeException("Cant inject biome!");
} }
@@ -156,7 +156,6 @@ public class IrisTerrainNormalActuator extends EngineAssignedActuator<BlockData>
} else { } else {
h.set(xf, i, zf, getComplex().getRockStream().get(realX, realZ)); h.set(xf, i, zf, getComplex().getRockStream().get(realX, realZ));
} }
} }
} }
} }
@@ -270,7 +270,7 @@ public class BukkitChunkGenerator extends ChunkGenerator implements PlatformChun
public @NotNull ChunkData generateChunkData(@NotNull World world, @NotNull Random ignored, int x, int z, @NotNull BiomeGrid biome) { public @NotNull ChunkData generateChunkData(@NotNull World world, @NotNull Random ignored, int x, int z, @NotNull BiomeGrid biome) {
try { try {
getEngine(world); getEngine(world);
loadLock.acquire(); //loadLock.acquire();
computeStudioGenerator(); computeStudioGenerator();
TerrainChunk tc = TerrainChunk.create(world, biome); TerrainChunk tc = TerrainChunk.create(world, biome);
this.world.bind(world); this.world.bind(world);
@@ -285,10 +285,10 @@ public class BukkitChunkGenerator extends ChunkGenerator implements PlatformChun
ChunkData c = tc.getRaw(); ChunkData c = tc.getRaw();
Iris.debug("Generated " + x + " " + z); Iris.debug("Generated " + x + " " + z);
loadLock.release(); //loadLock.release();
return c; return c;
} catch(Throwable e) { } catch(Throwable e) {
loadLock.release(); //loadLock.release();
Iris.error("======================================"); Iris.error("======================================");
e.printStackTrace(); e.printStackTrace();
Iris.reportErrorChunk(x, z, e, "CHUNK"); Iris.reportErrorChunk(x, z, e, "CHUNK");