mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2026-10-26 05:50:39 +00:00
better
This commit is contained in:
1 parent
537b0f8dd6
commit
fd38f0d127
2 files changed
+7
-7
No files matched your search
@@ -14,6 +14,7 @@ import com.volmit.iris.util.math.Position2;
|
|||||||
import com.volmit.iris.util.math.RollingSequence;
|
import com.volmit.iris.util.math.RollingSequence;
|
||||||
import com.volmit.iris.util.parallel.BurstExecutor;
|
import com.volmit.iris.util.parallel.BurstExecutor;
|
||||||
import com.volmit.iris.util.parallel.MultiBurst;
|
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.PrecisionStopwatch;
|
||||||
import com.volmit.iris.util.scheduling.Queue;
|
import com.volmit.iris.util.scheduling.Queue;
|
||||||
import com.volmit.iris.util.scheduling.ShurikenQueue;
|
import com.volmit.iris.util.scheduling.ShurikenQueue;
|
||||||
@@ -76,7 +77,7 @@ public class IrisMerger {
|
|||||||
*/
|
*/
|
||||||
@Deprecated
|
@Deprecated
|
||||||
public void generateVanillaUnderground(int cx, int cz, Engine engine) {
|
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.");
|
throw new IllegalStateException("MemoryWorld is null. Ensure that it has been initialized.");
|
||||||
if (engine.getWorld().realWorld() == null)
|
if (engine.getWorld().realWorld() == null)
|
||||||
return;
|
return;
|
||||||
@@ -102,6 +103,9 @@ public class IrisMerger {
|
|||||||
Chunk chunk = bukkit.getChunkAt(cx, cz);
|
Chunk chunk = bukkit.getChunkAt(cx, cz);
|
||||||
Chunk ichunk = engine.getWorld().realWorld().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 totalHeight = bukkit.getMaxHeight() - bukkit.getMinHeight();
|
||||||
int minHeight = Math.abs(bukkit.getMinHeight());
|
int minHeight = Math.abs(bukkit.getMinHeight());
|
||||||
|
|
||||||
@@ -198,7 +202,7 @@ public class IrisMerger {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
J.s(chunk::unload);
|
||||||
mergeDuration.put(p.getMilliseconds());
|
mergeDuration.put(p.getMilliseconds());
|
||||||
Iris.info("Vanilla merge average in: " + Form.duration(mergeDuration.getAverage(), 8));
|
Iris.info("Vanilla merge average in: " + Form.duration(mergeDuration.getAverage(), 8));
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
@@ -256,10 +260,6 @@ public class IrisMerger {
|
|||||||
if (!chunk.isGenerated())
|
if (!chunk.isGenerated())
|
||||||
throw new IllegalStateException("Chunk is not generated!");
|
throw new IllegalStateException("Chunk is not generated!");
|
||||||
|
|
||||||
if (!chunk.isLoaded()) {
|
|
||||||
chunk.load();
|
|
||||||
}
|
|
||||||
|
|
||||||
int minHeight = chunk.getWorld().getMinHeight();
|
int minHeight = chunk.getWorld().getMinHeight();
|
||||||
int maxHeight = chunk.getWorld().getMaxHeight();
|
int maxHeight = chunk.getWorld().getMaxHeight();
|
||||||
int totalHeight = Math.abs(minHeight) + maxHeight;
|
int totalHeight = Math.abs(minHeight) + maxHeight;
|
||||||
|
|||||||
@@ -385,7 +385,7 @@ public class BukkitChunkGenerator extends ChunkGenerator implements PlatformChun
|
|||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
private void onChunkGeneration(ChunkLoadEvent event) {
|
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;
|
return;
|
||||||
engine.getMerger().generateVanillaUnderground(event.getChunk().getX(), event.getChunk().getZ(), engine);
|
engine.getMerger().generateVanillaUnderground(event.getChunk().getX(), event.getChunk().getZ(), engine);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user