diff --git a/core/src/main/java/com/volmit/iris/core/pregenerator/IrisPregenerator.java b/core/src/main/java/com/volmit/iris/core/pregenerator/IrisPregenerator.java index 56ee44b05..79f82af5c 100644 --- a/core/src/main/java/com/volmit/iris/core/pregenerator/IrisPregenerator.java +++ b/core/src/main/java/com/volmit/iris/core/pregenerator/IrisPregenerator.java @@ -19,8 +19,12 @@ package com.volmit.iris.core.pregenerator; import com.volmit.iris.Iris; +import com.volmit.iris.core.nms.IHeadless; +import com.volmit.iris.core.nms.INMS; +import com.volmit.iris.core.nms.v1X.NMSBinding1X; import com.volmit.iris.core.pack.IrisPack; import com.volmit.iris.core.tools.IrisPackBenchmarking; +import com.volmit.iris.core.tools.IrisToolbelt; import com.volmit.iris.util.collection.KList; import com.volmit.iris.util.collection.KSet; import com.volmit.iris.util.format.C; diff --git a/core/src/main/java/com/volmit/iris/core/pregenerator/PregeneratorMethod.java b/core/src/main/java/com/volmit/iris/core/pregenerator/PregeneratorMethod.java index 282f2d2c1..c55b1f3ee 100644 --- a/core/src/main/java/com/volmit/iris/core/pregenerator/PregeneratorMethod.java +++ b/core/src/main/java/com/volmit/iris/core/pregenerator/PregeneratorMethod.java @@ -18,7 +18,9 @@ package com.volmit.iris.core.pregenerator; +import com.volmit.iris.engine.framework.Engine; import com.volmit.iris.util.mantle.Mantle; +import org.bukkit.World; /** * Represents something that is capable of generating in chunks or regions, or both @@ -77,4 +79,6 @@ public interface PregeneratorMethod { void generateChunk(int x, int z, PregenListener listener); Mantle getMantle(); + + World getWorld(); } diff --git a/core/src/main/java/com/volmit/iris/core/pregenerator/methods/AsyncOrMedievalPregenMethod.java b/core/src/main/java/com/volmit/iris/core/pregenerator/methods/AsyncOrMedievalPregenMethod.java index f33fe2cdc..575162ee7 100644 --- a/core/src/main/java/com/volmit/iris/core/pregenerator/methods/AsyncOrMedievalPregenMethod.java +++ b/core/src/main/java/com/volmit/iris/core/pregenerator/methods/AsyncOrMedievalPregenMethod.java @@ -26,8 +26,10 @@ import org.bukkit.World; public class AsyncOrMedievalPregenMethod implements PregeneratorMethod { private final PregeneratorMethod method; + private final World world; public AsyncOrMedievalPregenMethod(World world, int threads) { + this.world = world; method = PaperLib.isPaper() ? new AsyncPregenMethod(world, threads) : new MedievalPregenMethod(world); } @@ -70,4 +72,9 @@ public class AsyncOrMedievalPregenMethod implements PregeneratorMethod { public Mantle getMantle() { return method.getMantle(); } + + @Override + public World getWorld() { + return world; + } } diff --git a/core/src/main/java/com/volmit/iris/core/pregenerator/methods/AsyncPregenMethod.java b/core/src/main/java/com/volmit/iris/core/pregenerator/methods/AsyncPregenMethod.java index 495454f22..422a82924 100644 --- a/core/src/main/java/com/volmit/iris/core/pregenerator/methods/AsyncPregenMethod.java +++ b/core/src/main/java/com/volmit/iris/core/pregenerator/methods/AsyncPregenMethod.java @@ -177,4 +177,9 @@ public class AsyncPregenMethod implements PregeneratorMethod { return null; } + + @Override + public World getWorld() { + return world; + } } diff --git a/core/src/main/java/com/volmit/iris/core/pregenerator/methods/DummyPregenMethod.java b/core/src/main/java/com/volmit/iris/core/pregenerator/methods/DummyPregenMethod.java index 9ff345fc3..ce849bbf5 100644 --- a/core/src/main/java/com/volmit/iris/core/pregenerator/methods/DummyPregenMethod.java +++ b/core/src/main/java/com/volmit/iris/core/pregenerator/methods/DummyPregenMethod.java @@ -21,6 +21,7 @@ package com.volmit.iris.core.pregenerator.methods; import com.volmit.iris.core.pregenerator.PregenListener; import com.volmit.iris.core.pregenerator.PregeneratorMethod; import com.volmit.iris.util.mantle.Mantle; +import org.bukkit.World; public class DummyPregenMethod implements PregeneratorMethod { @Override @@ -62,4 +63,9 @@ public class DummyPregenMethod implements PregeneratorMethod { public Mantle getMantle() { return null; } + + @Override + public World getWorld() { + return null; + } } diff --git a/core/src/main/java/com/volmit/iris/core/pregenerator/methods/HeadlessPregenMethod.java b/core/src/main/java/com/volmit/iris/core/pregenerator/methods/HeadlessPregenMethod.java index 7196032fa..6c54c0249 100644 --- a/core/src/main/java/com/volmit/iris/core/pregenerator/methods/HeadlessPregenMethod.java +++ b/core/src/main/java/com/volmit/iris/core/pregenerator/methods/HeadlessPregenMethod.java @@ -9,6 +9,7 @@ import com.volmit.iris.core.pregenerator.PregeneratorMethod; import com.volmit.iris.engine.framework.Engine; import com.volmit.iris.util.mantle.Mantle; import com.volmit.iris.util.parallel.MultiBurst; +import org.bukkit.World; import java.io.IOException; import java.util.concurrent.Semaphore; @@ -18,8 +19,10 @@ public class HeadlessPregenMethod implements PregeneratorMethod { private final IHeadless headless; private final Semaphore semaphore; private final int max; + private final World world; public HeadlessPregenMethod(Engine engine) { + this.world = engine.getWorld().realWorld(); this.max = IrisSettings.getThreadCount(IrisSettings.get().getConcurrency().getParallelism()); this.engine = engine; this.headless = INMS.get().createHeadless(engine); @@ -84,4 +87,9 @@ public class HeadlessPregenMethod implements PregeneratorMethod { public Mantle getMantle() { return engine.getMantle().getMantle(); } + + @Override + public World getWorld() { + return world; + } } diff --git a/core/src/main/java/com/volmit/iris/core/pregenerator/methods/HybridPregenMethod.java b/core/src/main/java/com/volmit/iris/core/pregenerator/methods/HybridPregenMethod.java index 8ae773641..22c82b016 100644 --- a/core/src/main/java/com/volmit/iris/core/pregenerator/methods/HybridPregenMethod.java +++ b/core/src/main/java/com/volmit/iris/core/pregenerator/methods/HybridPregenMethod.java @@ -71,4 +71,9 @@ public class HybridPregenMethod implements PregeneratorMethod { public Mantle getMantle() { return inWorld.getMantle(); } + + @Override + public World getWorld() { + return world; + } } diff --git a/core/src/main/java/com/volmit/iris/core/pregenerator/methods/MedievalPregenMethod.java b/core/src/main/java/com/volmit/iris/core/pregenerator/methods/MedievalPregenMethod.java index cdecf2bcc..a350969c4 100644 --- a/core/src/main/java/com/volmit/iris/core/pregenerator/methods/MedievalPregenMethod.java +++ b/core/src/main/java/com/volmit/iris/core/pregenerator/methods/MedievalPregenMethod.java @@ -134,4 +134,9 @@ public class MedievalPregenMethod implements PregeneratorMethod { return null; } + + @Override + public World getWorld() { + return world; + } }