mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2026-04-03 06:16:19 +00:00
better
This commit is contained in:
@@ -14,6 +14,7 @@ import com.volmit.iris.util.math.Position2;
|
||||
import com.volmit.iris.util.math.RollingSequence;
|
||||
import com.volmit.iris.util.parallel.BurstExecutor;
|
||||
import com.volmit.iris.util.parallel.MultiBurst;
|
||||
import com.volmit.iris.util.scheduling.J;
|
||||
import com.volmit.iris.util.scheduling.PrecisionStopwatch;
|
||||
import com.volmit.iris.util.scheduling.Queue;
|
||||
import com.volmit.iris.util.scheduling.ShurikenQueue;
|
||||
@@ -76,7 +77,7 @@ public class IrisMerger {
|
||||
*/
|
||||
@Deprecated
|
||||
public void generateVanillaUnderground(int cx, int cz, Engine engine) {
|
||||
if (engine.getMemoryWorld() == null)
|
||||
if (engine.getMemoryWorld() == null && useGenerator)
|
||||
throw new IllegalStateException("MemoryWorld is null. Ensure that it has been initialized.");
|
||||
if (engine.getWorld().realWorld() == null)
|
||||
return;
|
||||
@@ -102,6 +103,9 @@ public class IrisMerger {
|
||||
Chunk chunk = bukkit.getChunkAt(cx, cz);
|
||||
Chunk ichunk = engine.getWorld().realWorld().getChunkAt(cx, cz);
|
||||
|
||||
if (!chunk.isLoaded())
|
||||
J.s(chunk::load);
|
||||
|
||||
int totalHeight = bukkit.getMaxHeight() - bukkit.getMinHeight();
|
||||
int minHeight = Math.abs(bukkit.getMinHeight());
|
||||
|
||||
@@ -198,7 +202,7 @@ public class IrisMerger {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
J.s(chunk::unload);
|
||||
mergeDuration.put(p.getMilliseconds());
|
||||
Iris.info("Vanilla merge average in: " + Form.duration(mergeDuration.getAverage(), 8));
|
||||
} catch (Exception e) {
|
||||
@@ -256,10 +260,6 @@ public class IrisMerger {
|
||||
if (!chunk.isGenerated())
|
||||
throw new IllegalStateException("Chunk is not generated!");
|
||||
|
||||
if (!chunk.isLoaded()) {
|
||||
chunk.load();
|
||||
}
|
||||
|
||||
int minHeight = chunk.getWorld().getMinHeight();
|
||||
int maxHeight = chunk.getWorld().getMaxHeight();
|
||||
int totalHeight = Math.abs(minHeight) + maxHeight;
|
||||
|
||||
@@ -385,7 +385,7 @@ public class BukkitChunkGenerator extends ChunkGenerator implements PlatformChun
|
||||
|
||||
@EventHandler
|
||||
private void onChunkGeneration(ChunkLoadEvent event) {
|
||||
if (engine == null ||!event.isNewChunk() || !engine.getWorld().realWorld().equals(event.getWorld()) || !engine.getDimension().isEnableExperimentalMerger() || engine.getMemoryWorld() == null)
|
||||
if (engine == null ||!event.isNewChunk() || !engine.getWorld().realWorld().equals(event.getWorld()) || !engine.getDimension().isEnableExperimentalMerger())
|
||||
return;
|
||||
engine.getMerger().generateVanillaUnderground(event.getChunk().getX(), event.getChunk().getZ(), engine);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user