diff --git a/build.gradle b/build.gradle index 7b6379a0c..29eb2e1df 100644 --- a/build.gradle +++ b/build.gradle @@ -5,7 +5,7 @@ plugins { } group 'com.volmit.iris' -version '1.5.3' +version '1.5.3-HEADLESS' def apiVersion = '1.17' def name = 'Iris' def main = 'com.volmit.iris.Iris' diff --git a/src/main/java/com/volmit/iris/core/IrisProject.java b/src/main/java/com/volmit/iris/core/IrisProject.java index e300dd604..7f29c9f58 100644 --- a/src/main/java/com/volmit/iris/core/IrisProject.java +++ b/src/main/java/com/volmit/iris/core/IrisProject.java @@ -307,9 +307,9 @@ public class IrisProject { public void close() { activeProvider.close(); - File folder = activeProvider.getTarget().getWorld().getWorldFolder(); - Iris.linkMultiverseCore.removeFromConfig(activeProvider.getTarget().getWorld().getName()); - Bukkit.unloadWorld(activeProvider.getTarget().getWorld().getName(), false); + File folder = activeProvider.getTarget().getWorld().worldFolder(); + Iris.linkMultiverseCore.removeFromConfig(activeProvider.getTarget().getWorld().name()); + Bukkit.unloadWorld(activeProvider.getTarget().getWorld().name(), false); J.attemptAsync(() -> IO.delete(folder)); activeProvider = null; } diff --git a/src/main/java/com/volmit/iris/core/command/studio/CommandIrisStudioClose.java b/src/main/java/com/volmit/iris/core/command/studio/CommandIrisStudioClose.java index 6be720bbc..19080e304 100644 --- a/src/main/java/com/volmit/iris/core/command/studio/CommandIrisStudioClose.java +++ b/src/main/java/com/volmit/iris/core/command/studio/CommandIrisStudioClose.java @@ -56,7 +56,7 @@ public class CommandIrisStudioClose extends MortarCommand { World f = null; for (World i : Bukkit.getWorlds()) { - if (i.getWorldFolder().getAbsolutePath().equals(Iris.proj.getActiveProject().getActiveProvider().getTarget().getWorld().getWorldFolder().getAbsolutePath())) { + if (i.getWorldFolder().getAbsolutePath().equals(Iris.proj.getActiveProject().getActiveProvider().getTarget().getWorld().worldFolder().getAbsolutePath())) { continue; } diff --git a/src/main/java/com/volmit/iris/core/command/studio/CommandIrisStudioExplorerGenerator.java b/src/main/java/com/volmit/iris/core/command/studio/CommandIrisStudioExplorerGenerator.java index 7fe029d98..4f496636d 100644 --- a/src/main/java/com/volmit/iris/core/command/studio/CommandIrisStudioExplorerGenerator.java +++ b/src/main/java/com/volmit/iris/core/command/studio/CommandIrisStudioExplorerGenerator.java @@ -63,7 +63,7 @@ public class CommandIrisStudioExplorerGenerator extends MortarCommand { if (Iris.proj.isProjectOpen()) { generator = Iris.proj.getActiveProject().getActiveProvider().getData().getGeneratorLoader().load(args[0]); - seed = Iris.proj.getActiveProject().getActiveProvider().getTarget().getWorld().getSeed(); + seed = Iris.proj.getActiveProject().getActiveProvider().getTarget().getWorld().seed(); } else { generator = IrisDataManager.loadAnyGenerator(args[0]); } diff --git a/src/main/java/com/volmit/iris/core/command/studio/CommandIrisStudioTPStudio.java b/src/main/java/com/volmit/iris/core/command/studio/CommandIrisStudioTPStudio.java index 63d0af4bd..f34d11cdc 100644 --- a/src/main/java/com/volmit/iris/core/command/studio/CommandIrisStudioTPStudio.java +++ b/src/main/java/com/volmit/iris/core/command/studio/CommandIrisStudioTPStudio.java @@ -57,7 +57,7 @@ public class CommandIrisStudioTPStudio extends MortarCommand { try { sender.sendMessage("Teleporting you to the active studio world."); - sender.player().teleport(Iris.proj.getActiveProject().getActiveProvider().getTarget().getWorld().getSpawnLocation()); + sender.player().teleport(Iris.proj.getActiveProject().getActiveProvider().getTarget().getWorld().spawnLocation()); sender.player().setGameMode(GameMode.SPECTATOR); } catch (Throwable e) { Iris.reportError(e); diff --git a/src/main/java/com/volmit/iris/core/gui/IrisRenderer.java b/src/main/java/com/volmit/iris/core/gui/IrisRenderer.java index 436d57951..977438c9a 100644 --- a/src/main/java/com/volmit/iris/core/gui/IrisRenderer.java +++ b/src/main/java/com/volmit/iris/core/gui/IrisRenderer.java @@ -60,8 +60,4 @@ public class IrisRenderer { return image; } - - public void set(double worldX, double worldZ) { - renderer.getWorld().getBlockAt((int) worldX, 20, (int) worldZ).setType(Material.DIAMOND_BLOCK); - } } diff --git a/src/main/java/com/volmit/iris/core/gui/IrisVision.java b/src/main/java/com/volmit/iris/core/gui/IrisVision.java index d8dacadc7..8d074cc9b 100644 --- a/src/main/java/com/volmit/iris/core/gui/IrisVision.java +++ b/src/main/java/com/volmit/iris/core/gui/IrisVision.java @@ -24,6 +24,7 @@ import com.volmit.iris.engine.framework.Engine; import com.volmit.iris.engine.framework.IrisAccess; import com.volmit.iris.engine.object.IrisBiome; import com.volmit.iris.engine.object.IrisRegion; +import com.volmit.iris.engine.object.common.IrisWorld; import com.volmit.iris.util.collection.KList; import com.volmit.iris.util.collection.KMap; import com.volmit.iris.util.collection.KSet; @@ -70,7 +71,7 @@ public class IrisVision extends JPanel implements MouseWheelListener, KeyListene private boolean alt = false; private int posX = 0; private IrisRenderer renderer; - private World world; + private IrisWorld world; private double velocity = 0; private int lowq = 12; private int posZ = 0; @@ -726,7 +727,7 @@ public class IrisVision extends JPanel implements MouseWheelListener, KeyListene } } - private static void createAndShowGUI(Engine r, int s, World world) { + private static void createAndShowGUI(Engine r, int s, IrisWorld world) { JFrame frame = new JFrame("Vision"); IrisVision nv = new IrisVision(frame); nv.world = world; diff --git a/src/main/java/com/volmit/iris/core/gui/Pregenerator.java b/src/main/java/com/volmit/iris/core/gui/Pregenerator.java index 83a24546c..19bce324f 100644 --- a/src/main/java/com/volmit/iris/core/gui/Pregenerator.java +++ b/src/main/java/com/volmit/iris/core/gui/Pregenerator.java @@ -250,7 +250,7 @@ public class Pregenerator implements Listener { method.set("Direct (Fast)"); mcaIteration.accept(mcaox, mcaoz, (ii, jj) -> e.queue(() -> { draw(ii, jj, COLOR_MCA_GENERATE); - access.directWriteChunk(world, ii, jj, directWriter); + access.directWriteChunk(access.getCompound().getWorld(), ii, jj, directWriter); draw(ii, jj, COLOR_MCA_GENERATED_MCA); generated.getAndIncrement(); vcax.set(ii); @@ -286,7 +286,7 @@ public class Pregenerator implements Listener { int finalJ = j; requeue.add(() -> { draw(((x << 5) + finalI), ((z << 5) + finalJ), COLOR_MCA_GENERATE); - access.directWriteChunk(world, ((x << 5) + finalI), ((z << 5) + finalJ), directWriter); + access.directWriteChunk(access.getCompound().getWorld(), ((x << 5) + finalI), ((z << 5) + finalJ), directWriter); draw(((x << 5) + finalI), ((z << 5) + finalJ), COLOR_MCA_GENERATED_MCA); }); } diff --git a/src/main/java/com/volmit/iris/engine/IrisComplex.java b/src/main/java/com/volmit/iris/engine/IrisComplex.java index 1d2878269..0fe44827b 100644 --- a/src/main/java/com/volmit/iris/engine/IrisComplex.java +++ b/src/main/java/com/volmit/iris/engine/IrisComplex.java @@ -108,14 +108,14 @@ public class IrisComplex implements DataProvider { public IrisComplex(Engine engine, boolean simple) { int cacheSize = 1024 * 128; - this.rng = new RNG(engine.getWorld().getSeed()); + this.rng = new RNG(engine.getWorld().seed()); this.data = engine.getData(); double height = engine.getHeight(); fluidHeight = engine.getDimension().getFluidHeight(); generators = new KList<>(); focus = engine.getFocus(); IrisRegion focusRegion = focus != null ? findRegion(focus, engine) : null; - RNG rng = new RNG(engine.getWorld().getSeed()); + RNG rng = new RNG(engine.getWorld().seed()); //@builder engine.getDimension().getRegions().forEach((i) -> data.getRegionLoader().load(i) .getAllBiomes(this).forEach((b) -> b @@ -124,7 +124,7 @@ public class IrisComplex implements DataProvider { overlayStream = ProceduralStream.ofDouble((x, z) -> 0D); engine.getDimension().getOverlayNoise().forEach((i) -> overlayStream.add((x, z) -> i.get(rng, x, z))); rngStream = ProceduralStream.of((x, z) -> new RNG(((x.longValue()) << 32) | (z.longValue() & 0xffffffffL)) - .nextParallelRNG(engine.getWorld().getSeed()), Interpolated.RNG); + .nextParallelRNG(engine.getWorld().seed()), Interpolated.RNG); chunkRngStream = rngStream.blockToChunkCoords(); rockStream = engine.getDimension().getRockPalette().getLayerGenerator(rng.nextParallelRNG(45), data).stream() .select(engine.getDimension().getRockPalette().getBlockData(data)); @@ -193,7 +193,7 @@ public class IrisComplex implements DataProvider { .convertAware2D(this::implode).cache2D(cacheSize); heightStream = ProceduralStream.of((x, z) -> { IrisBiome b = focus != null ? focus : baseBiomeStream.get(x, z); - return getHeight(engine, b, x, z, engine.getWorld().getSeed()); + return getHeight(engine, b, x, z, engine.getWorld().seed()); }, Interpolated.DOUBLE).cache2D(cacheSize); slopeStream = heightStream.slope(3).interpolate().bilinear(3, 3).cache2D(cacheSize); objectChanceStream = ProceduralStream.ofDouble((x, z) -> { diff --git a/src/main/java/com/volmit/iris/engine/IrisEngine.java b/src/main/java/com/volmit/iris/engine/IrisEngine.java index cb66c1d98..bcfcf367c 100644 --- a/src/main/java/com/volmit/iris/engine/IrisEngine.java +++ b/src/main/java/com/volmit/iris/engine/IrisEngine.java @@ -88,7 +88,7 @@ public class IrisEngine extends BlockPopulator implements Engine { private double maxBiomeDecoratorDensity; public IrisEngine(EngineTarget target, EngineCompound compound, int index) { - Iris.info("Initializing Engine: " + target.getWorld().getName() + "/" + target.getDimension().getLoadKey() + " (" + target.getHeight() + " height)"); + Iris.info("Initializing Engine: " + target.getWorld().name() + "/" + target.getDimension().getLoadKey() + " (" + target.getHeight() + " height)"); metrics = new EngineMetrics(32); this.target = target; this.framework = new IrisEngineFramework(this); diff --git a/src/main/java/com/volmit/iris/engine/IrisEngineCompound.java b/src/main/java/com/volmit/iris/engine/IrisEngineCompound.java index 2ba9b78ca..36dac5f21 100644 --- a/src/main/java/com/volmit/iris/engine/IrisEngineCompound.java +++ b/src/main/java/com/volmit/iris/engine/IrisEngineCompound.java @@ -28,6 +28,7 @@ import com.volmit.iris.engine.hunk.Hunk; import com.volmit.iris.engine.object.IrisDimension; import com.volmit.iris.engine.object.IrisDimensionIndex; import com.volmit.iris.engine.object.IrisPosition; +import com.volmit.iris.engine.object.common.IrisWorld; import com.volmit.iris.engine.parallel.MultiBurst; import com.volmit.iris.util.atomics.AtomicRollingSequence; import com.volmit.iris.util.collection.KList; @@ -50,7 +51,7 @@ import java.util.List; public class IrisEngineCompound implements EngineCompound { @Getter - private World world; + private IrisWorld world; private final AtomicRollingSequence wallClock; @@ -77,10 +78,10 @@ public class IrisEngineCompound implements EngineCompound { @Setter private boolean studio; - public IrisEngineCompound(World world, IrisDimension rootDimension, IrisDataManager data, int maximumThreads) { + public IrisEngineCompound(IrisWorld world, IrisDimension rootDimension, IrisDataManager data, int maximumThreads) { wallClock = new AtomicRollingSequence(32); this.rootDimension = rootDimension; - Iris.info("Initializing Engine Composite for " + world.getName()); + Iris.info("Initializing Engine Composite for " + world.name()); this.world = world; engineMetadata = EngineData.load(getEngineMetadataFile()); engineMetadata.setDimension(rootDimension.getLoadKey()); @@ -208,7 +209,7 @@ public class IrisEngineCompound implements EngineCompound { } private File getEngineMetadataFile() { - return new File(world.getWorldFolder(), "iris/engine-metadata.json"); + return new File(world.worldFolder(), "iris/engine-metadata.json"); } @Override @@ -274,11 +275,6 @@ public class IrisEngineCompound implements EngineCompound { return defaultEngine; } - @Override - public void updateWorld(World world) { - this.world = world; - } - @Override public void hotload() { for (int i = 0; i < getSize(); i++) { diff --git a/src/main/java/com/volmit/iris/engine/IrisWorldCreator.java b/src/main/java/com/volmit/iris/engine/IrisWorldCreator.java index ce830b071..3eeb54c59 100644 --- a/src/main/java/com/volmit/iris/engine/IrisWorldCreator.java +++ b/src/main/java/com/volmit/iris/engine/IrisWorldCreator.java @@ -21,7 +21,7 @@ package com.volmit.iris.engine; import com.volmit.iris.core.IrisDataManager; import com.volmit.iris.engine.framework.EngineCompositeGenerator; import com.volmit.iris.engine.object.IrisDimension; -import com.volmit.iris.util.fakenews.FakeWorld; +import com.volmit.iris.engine.object.common.IrisWorld; import org.bukkit.World; import org.bukkit.WorldCreator; @@ -78,8 +78,14 @@ public class IrisWorldCreator { public WorldCreator create() { EngineCompositeGenerator g = new EngineCompositeGenerator(dimensionName, !studio); - g.initialize(new FakeWorld(name, minHeight, maxHeight, seed, new File(name), findEnvironment())); - + g.initialize(IrisWorld.builder() + .name(name) + .minHeight(minHeight) + .maxHeight(maxHeight) + .seed(seed) + .worldFolder(new File(name)) + .environment(findEnvironment()) + .build()); return new WorldCreator(name) .environment(findEnvironment()) .generateStructures(true) diff --git a/src/main/java/com/volmit/iris/engine/actuator/IrisBiomeActuator.java b/src/main/java/com/volmit/iris/engine/actuator/IrisBiomeActuator.java index 5e9a9dd89..e69d2df0a 100644 --- a/src/main/java/com/volmit/iris/engine/actuator/IrisBiomeActuator.java +++ b/src/main/java/com/volmit/iris/engine/actuator/IrisBiomeActuator.java @@ -37,7 +37,7 @@ public class IrisBiomeActuator extends EngineAssignedActuator { public IrisBiomeActuator(Engine engine) { super(engine, "Biome"); - rng = new RNG(engine.getWorld().getSeed() + 243995); + rng = new RNG(engine.getWorld().seed() + 243995); } private boolean injectBiome(Hunk h, int x, int y, int z, Object bb) { diff --git a/src/main/java/com/volmit/iris/engine/actuator/IrisDecorantActuator.java b/src/main/java/com/volmit/iris/engine/actuator/IrisDecorantActuator.java index 7ddde6c93..9ecc0a538 100644 --- a/src/main/java/com/volmit/iris/engine/actuator/IrisDecorantActuator.java +++ b/src/main/java/com/volmit/iris/engine/actuator/IrisDecorantActuator.java @@ -50,7 +50,7 @@ public class IrisDecorantActuator extends EngineAssignedActuator { public IrisDecorantActuator(Engine engine) { super(engine, "Decorant"); shouldRay = shouldRayDecorate(); - this.rng = new RNG(engine.getTarget().getWorld().getSeed()); + this.rng = new RNG(engine.getTarget().getWorld().seed()); surfaceDecorator = new IrisSurfaceDecorator(getEngine()); ceilingDecorator = new IrisCeilingDecorator(getEngine()); seaSurfaceDecorator = new IrisSeaSurfaceDecorator(getEngine()); diff --git a/src/main/java/com/volmit/iris/engine/actuator/IrisTerrainIslandActuator.java b/src/main/java/com/volmit/iris/engine/actuator/IrisTerrainIslandActuator.java index ee92ad37c..3b1480b5b 100644 --- a/src/main/java/com/volmit/iris/engine/actuator/IrisTerrainIslandActuator.java +++ b/src/main/java/com/volmit/iris/engine/actuator/IrisTerrainIslandActuator.java @@ -45,7 +45,7 @@ public class IrisTerrainIslandActuator extends EngineAssignedActuator public IrisTerrainIslandActuator(Engine engine) { super(engine, "TerrainIsland"); - rng = new RNG(engine.getWorld().getSeed()); + rng = new RNG(engine.getWorld().seed()); carving = getDimension().isCarving() && getDimension().getCarveLayers().isNotEmpty(); hasUnder = getDimension().getUndercarriage() != null && !getDimension().getUndercarriage().getGenerator().isFlat(); } diff --git a/src/main/java/com/volmit/iris/engine/actuator/IrisTerrainNormalActuator.java b/src/main/java/com/volmit/iris/engine/actuator/IrisTerrainNormalActuator.java index b06397c27..8638ffc3e 100644 --- a/src/main/java/com/volmit/iris/engine/actuator/IrisTerrainNormalActuator.java +++ b/src/main/java/com/volmit/iris/engine/actuator/IrisTerrainNormalActuator.java @@ -42,7 +42,7 @@ public class IrisTerrainNormalActuator extends EngineAssignedActuator public IrisTerrainNormalActuator(Engine engine) { super(engine, "Terrain"); - rng = new RNG(engine.getWorld().getSeed()); + rng = new RNG(engine.getWorld().seed()); carving = getDimension().isCarving() && getDimension().getCarveLayers().isNotEmpty(); hasUnder = getDimension().getUndercarriage() != null && !getDimension().getUndercarriage().getGenerator().isFlat(); } diff --git a/src/main/java/com/volmit/iris/engine/data/chunk/LinkedTerrainChunk.java b/src/main/java/com/volmit/iris/engine/data/chunk/LinkedTerrainChunk.java index 92ca2792e..aa28d7e93 100644 --- a/src/main/java/com/volmit/iris/engine/data/chunk/LinkedTerrainChunk.java +++ b/src/main/java/com/volmit/iris/engine/data/chunk/LinkedTerrainChunk.java @@ -22,9 +22,10 @@ import com.volmit.iris.Iris; import com.volmit.iris.core.nms.BiomeBaseInjector; import com.volmit.iris.core.nms.INMS; import com.volmit.iris.util.data.IrisBiomeStorage; -import com.volmit.iris.util.fakenews.HeightedFakeWorld; +import net.minecraft.world.level.chunk.BiomeStorage; import org.bukkit.Bukkit; import org.bukkit.Material; +import org.bukkit.World; import org.bukkit.block.Biome; import org.bukkit.block.data.BlockData; import org.bukkit.generator.ChunkGenerator.BiomeGrid; @@ -38,8 +39,14 @@ public class LinkedTerrainChunk implements TerrainChunk { private ChunkData rawChunkData; private final BiomeGrid storage; - public LinkedTerrainChunk(int maxHeight) { - this(null, maxHeight); + public LinkedTerrainChunk(World world) + { + this(null, Bukkit.createChunkData(world)); + } + + public LinkedTerrainChunk(World world, BiomeGrid storage) + { + this(storage, Bukkit.createChunkData(world)); } public LinkedTerrainChunk(BiomeGrid storage, ChunkData data) { @@ -48,23 +55,6 @@ public class LinkedTerrainChunk implements TerrainChunk { biome3D = storage != null ? null : new IrisBiomeStorage(); } - public LinkedTerrainChunk(BiomeGrid storage, int maxHeight) { - this.storage = storage; - rawChunkData = createChunkData(maxHeight); - biome3D = storage != null ? null : new IrisBiomeStorage(); - } - - private ChunkData createChunkData(int maxHeight) { - try { - return Bukkit.createChunkData(new HeightedFakeWorld(maxHeight)); - } catch (Throwable e) { - Iris.reportError(e); - e.printStackTrace(); - } - - return null; - } - @Override public BiomeBaseInjector getBiomeBaseInjector() { return (x, y, z, bb) -> INMS.get().forceBiomeInto(x, y, z, bb, storage); diff --git a/src/main/java/com/volmit/iris/engine/data/chunk/TerrainChunk.java b/src/main/java/com/volmit/iris/engine/data/chunk/TerrainChunk.java index 785962413..078a39bef 100644 --- a/src/main/java/com/volmit/iris/engine/data/chunk/TerrainChunk.java +++ b/src/main/java/com/volmit/iris/engine/data/chunk/TerrainChunk.java @@ -28,25 +28,17 @@ import org.jetbrains.annotations.NotNull; public interface TerrainChunk extends BiomeGrid, ChunkData { static TerrainChunk create(World world) { - return create(world.getMaxHeight()); - } - - static TerrainChunk create(int maxHeight) { - return new LinkedTerrainChunk(maxHeight); + return new LinkedTerrainChunk(world); } static TerrainChunk create(World world, BiomeGrid grid) { - return create(world.getMaxHeight(), grid); + return new LinkedTerrainChunk(world, grid); } static TerrainChunk create(ChunkData raw, BiomeGrid grid) { return new LinkedTerrainChunk(grid, raw); } - static TerrainChunk create(int maxHeight, BiomeGrid grid) { - return new LinkedTerrainChunk(grid, maxHeight); - } - BiomeBaseInjector getBiomeBaseInjector(); void setRaw(ChunkData data); diff --git a/src/main/java/com/volmit/iris/engine/framework/Engine.java b/src/main/java/com/volmit/iris/engine/framework/Engine.java index d2ad0638a..38ffb462c 100644 --- a/src/main/java/com/volmit/iris/engine/framework/Engine.java +++ b/src/main/java/com/volmit/iris/engine/framework/Engine.java @@ -27,6 +27,7 @@ import com.volmit.iris.engine.data.B; import com.volmit.iris.engine.data.DataProvider; import com.volmit.iris.engine.hunk.Hunk; import com.volmit.iris.engine.object.*; +import com.volmit.iris.engine.object.common.IrisWorld; import com.volmit.iris.engine.parallax.ParallaxAccess; import com.volmit.iris.engine.parallel.MultiBurst; import com.volmit.iris.util.collection.KList; @@ -105,7 +106,7 @@ public interface Engine extends DataProvider, Fallible, GeneratorAccess, LootPro return getTarget().getData(); } - default World getWorld() { + default IrisWorld getWorld() { return getTarget().getWorld(); } diff --git a/src/main/java/com/volmit/iris/engine/framework/EngineComponent.java b/src/main/java/com/volmit/iris/engine/framework/EngineComponent.java index f62641efc..440525632 100644 --- a/src/main/java/com/volmit/iris/engine/framework/EngineComponent.java +++ b/src/main/java/com/volmit/iris/engine/framework/EngineComponent.java @@ -69,7 +69,7 @@ public interface EngineComponent { } default long getSeed() { - return getTarget().getWorld().getSeed(); + return getTarget().getWorld().seed(); } default EngineFramework getFramework() { diff --git a/src/main/java/com/volmit/iris/engine/framework/EngineCompositeGenerator.java b/src/main/java/com/volmit/iris/engine/framework/EngineCompositeGenerator.java index 0039e714a..f16276dcb 100644 --- a/src/main/java/com/volmit/iris/engine/framework/EngineCompositeGenerator.java +++ b/src/main/java/com/volmit/iris/engine/framework/EngineCompositeGenerator.java @@ -33,11 +33,11 @@ import com.volmit.iris.engine.hunk.Hunk; import com.volmit.iris.engine.object.IrisBiome; import com.volmit.iris.engine.object.IrisDimension; import com.volmit.iris.engine.object.IrisPosition; +import com.volmit.iris.engine.object.common.IrisWorld; import com.volmit.iris.engine.parallel.BurstExecutor; import com.volmit.iris.engine.parallel.MultiBurst; import com.volmit.iris.util.collection.KList; import com.volmit.iris.util.collection.KMap; -import com.volmit.iris.util.fakenews.FakeWorld; import com.volmit.iris.util.format.C; import com.volmit.iris.util.format.Form; import com.volmit.iris.util.io.ReactiveFolder; @@ -48,7 +48,6 @@ import com.volmit.iris.util.scheduling.ChronoLatch; import com.volmit.iris.util.scheduling.J; import com.volmit.iris.util.scheduling.PrecisionStopwatch; import io.netty.util.internal.ConcurrentSet; -import io.papermc.lib.PaperLib; import lombok.Getter; import org.bukkit.*; import org.bukkit.block.Biome; @@ -79,9 +78,7 @@ public class EngineCompositeGenerator extends ChunkGenerator implements IrisAcce private long mst = 0; private int generated = 0; private int lgenerated = 0; - private final KMap chunkCache; private final ChronoLatch hotloadcd; - private final AtomicBoolean fake; @Getter private double generatedPerSecond = 0; private final int art; @@ -93,8 +90,6 @@ public class EngineCompositeGenerator extends ChunkGenerator implements IrisAcce public EngineCompositeGenerator(String query, boolean production) { super(); - chunkCache = new KMap<>(); - fake = new AtomicBoolean(true); hotloadcd = new ChronoLatch(3500); mst = M.ms(); this.production = production; @@ -113,6 +108,7 @@ public class EngineCompositeGenerator extends ChunkGenerator implements IrisAcce }); } + @Override public void hotload() { if (isStudio()) { Iris.proj.updateWorkspace(); @@ -158,14 +154,14 @@ public class EngineCompositeGenerator extends ChunkGenerator implements IrisAcce } } - private synchronized IrisDimension getDimension(World world) { + private synchronized IrisDimension getDimension(IrisWorld world) { String query = dimensionQuery; - query = Iris.linkMultiverseCore.getWorldNameType(world.getName(), query); + query = Iris.linkMultiverseCore.getWorldNameType(world.name(), query); IrisDimension dim = null; if (query == null) { - File iris = new File(world.getWorldFolder(), "iris"); + File iris = new File(world.worldFolder(), "iris"); if (iris.exists() && iris.isDirectory()) { for (File i : iris.listFiles()) { @@ -191,7 +187,7 @@ public class EngineCompositeGenerator extends ChunkGenerator implements IrisAcce } if (query == null) { - Iris.error("Cannot find iris dimension data for world: " + world.getName() + "! Assuming " + IrisSettings.get().getGenerator().getDefaultWorldType() + "!"); + Iris.error("Cannot find iris dimension data for world: " + world.name() + "! Assuming " + IrisSettings.get().getGenerator().getDefaultWorldType() + "!"); query = IrisSettings.get().getGenerator().getDefaultWorldType(); } @@ -213,8 +209,8 @@ public class EngineCompositeGenerator extends ChunkGenerator implements IrisAcce dim = new IrisDataManager(getDataFolder(world)).getDimensionLoader().load(od.getLoadKey()); if (dim == null) { - Iris.info("Installing Iris pack " + od.getName() + " into world " + world.getName() + "..."); - Iris.proj.installIntoWorld(new VolmitSender(Bukkit.getConsoleSender(), Iris.instance.getTag()), od.getLoadKey(), world.getWorldFolder()); + Iris.info("Installing Iris pack " + od.getName() + " into world " + world.name() + "..."); + Iris.proj.installIntoWorld(new VolmitSender(Bukkit.getConsoleSender(), Iris.instance.getTag()), od.getLoadKey(), world.worldFolder()); dim = new IrisDataManager(getDataFolder(world)).getDimensionLoader().load(od.getLoadKey()); if (dim == null) { @@ -294,20 +290,7 @@ public class EngineCompositeGenerator extends ChunkGenerator implements IrisAcce return dim; } - public synchronized void initialize(World world) { - if (!(world instanceof FakeWorld) && fake.get() && this.compound.get() != null) { - fake.set(false); - this.compound.get().updateWorld(world); - getTarget().updateWorld(world); - placeStrongholds(world); - - for (int i = 0; i < getComposite().getSize(); i++) { - getComposite().getEngine(i).getTarget().updateWorld(world); - } - - Iris.info("Attached Real World to Engine Target"); - } - + public synchronized void initialize(IrisWorld world) { if (initialized.get()) { return; } @@ -445,8 +428,8 @@ public class EngineCompositeGenerator extends ChunkGenerator implements IrisAcce ); } - private File getDataFolder(World world) { - return new File(world.getWorldFolder(), "iris/pack"); + private File getDataFolder(IrisWorld world) { + return new File(world.worldFolder(), "iris/pack"); } private File getDataFolder(String world) { @@ -458,7 +441,13 @@ public class EngineCompositeGenerator extends ChunkGenerator implements IrisAcce public ChunkData generateChunkData(@NotNull World world, @NotNull Random ignored, int x, int z, @NotNull BiomeGrid biome) { PrecisionStopwatch ps = PrecisionStopwatch.start(); TerrainChunk tc = TerrainChunk.create(world, biome); - generateChunkRawData(world, x, z, tc).run(); + generateChunkRawData(getComposite().getWorld(), x, z, tc).run(); + + if(!getComposite().getWorld().hasRealWorld()) + { + getComposite().getWorld().bind(world); + } + generated++; ps.end(); @@ -469,7 +458,8 @@ public class EngineCompositeGenerator extends ChunkGenerator implements IrisAcce return tc.getRaw(); } - public void directWriteMCA(World w, int x, int z, NBTWorld writer, MultiBurst burst) { + @Override + public void directWriteMCA(IrisWorld w, int x, int z, NBTWorld writer, MultiBurst burst) { BurstExecutor e = burst.burst(1024); int mcaox = x << 5; int mcaoz = z << 5; @@ -485,7 +475,8 @@ public class EngineCompositeGenerator extends ChunkGenerator implements IrisAcce e.complete(); } - public void directWriteChunk(World w, int x, int z, NBTWorld writer) { + @Override + public void directWriteChunk(IrisWorld w, int x, int z, NBTWorld writer) { int ox = x << 4; int oz = z << 4; com.volmit.iris.engine.data.mca.Chunk cc = writer.getChunk(x, z); @@ -526,12 +517,12 @@ public class EngineCompositeGenerator extends ChunkGenerator implements IrisAcce @Override public int getMinHeight() { - return w.getMinHeight(); + return w.minHeight(); } @Override public int getMaxHeight() { - return w.getMaxHeight(); + return w.maxHeight(); } @Override @@ -614,50 +605,8 @@ public class EngineCompositeGenerator extends ChunkGenerator implements IrisAcce }).run(); } - public Chunk generatePaper(World world, int x, int z) { - precache(world, x, z); - Chunk c = PaperLib.getChunkAtAsync(world, x, z, true).join(); - chunkCache.remove(Cache.key(x, z)); - return c; - } - - public void precache(World world, int x, int z) { - synchronized (this) { - initialize(world); - } - - synchronized (chunkCache) { - if (chunkCache.containsKey(Cache.key(x, z))) { - return; - } - } - - PregeneratedData data = new PregeneratedData(getComposite().getHeight() - 1); - compound.get().generate(x * 16, z * 16, data.getBlocks(), data.getPost(), data.getBiomes()); - synchronized (chunkCache) { - chunkCache.put(Cache.key(x, z), data); - } - } - - @Override - public int getPrecacheSize() { - return chunkCache.size(); - } - - public int getCachedChunks() { - return chunkCache.size(); - } - - public Runnable generateChunkRawData(World world, int x, int z, TerrainChunk tc) { + public Runnable generateChunkRawData(IrisWorld world, int x, int z, TerrainChunk tc) { initialize(world); - - synchronized (chunkCache) { - long g = Cache.key(x, z); - if (chunkCache.containsKey(g)) { - return chunkCache.remove(g).inject(tc); - } - } - Hunk blocks = Hunk.view((ChunkData) tc); Hunk biomes = Hunk.view((BiomeGrid) tc); Hunk post = Hunk.newAtomicHunk(biomes.getWidth(), biomes.getHeight(), biomes.getDepth()); @@ -783,146 +732,15 @@ public class EngineCompositeGenerator extends ChunkGenerator implements IrisAcce // TODO: DO IT } - @Override - public void clearRegeneratedLists(int x, int z) { - for (int i = 0; i < getComposite().getSize(); i++) { - getComposite().getEngine(i).getParallax().delete(x, z); - } - } - - @Override - public void regenerate(int x, int z) { - - clearRegeneratedLists(x, z); - int xx = x * 16; - int zz = z * 16; - BiomeBaseInjector inj = (a, b, c, d) -> { - }; - //noinspection deprecation - generateChunkRawData(getComposite().getWorld(), x, z, new TerrainChunk() { - @Override - public BiomeBaseInjector getBiomeBaseInjector() { - return inj; - } - - @Override - public void setRaw(ChunkData data) { - - } - - @NotNull - @Override - public Biome getBiome(int x, int z) { - return Biome.THE_VOID; - } - - @NotNull - @Override - public Biome getBiome(int x, int y, int z) { - return Biome.THE_VOID; - } - - @Override - public void setBiome(int x, int z, Biome bio) { - - } - - @Override - public void setBiome(int x, int y, int z, Biome bio) { - - } - - @Override - public int getMinHeight() { - return getComposite().getWorld().getMinHeight(); - } - - @Override - public int getMaxHeight() { - return getComposite().getWorld().getMaxHeight(); - } - - @Override - public void setBlock(int x, int y, int z, BlockData blockData) { - if (!getBlockData(x, y, z).matches(blockData)) { - Iris.edit.set(compound.get().getWorld(), x + xx, y, z + zz, blockData); - } - } - - @NotNull - @Override - public BlockData getBlockData(int x, int y, int z) { - return Iris.edit.get(compound.get().getWorld(), x + xx, y, z + zz); - } - - @Override - public ChunkData getRaw() { - return null; - } - - @Override - public void inject(BiomeGrid biome) { - - } - - @Override - public void setBlock(int i, int i1, int i2, @NotNull Material material) { - setBlock(i, i1, i2, material.createBlockData()); - } - - @Override - public void setBlock(int i, int i1, int i2, @NotNull MaterialData materialData) { - setBlock(i, i1, i2, materialData.getItemType()); - } - - @Override - public void setRegion(int i, int i1, int i2, int i3, int i4, int i5, @NotNull Material material) { - - } - - @Override - public void setRegion(int i, int i1, int i2, int i3, int i4, int i5, @NotNull MaterialData materialData) { - - } - - @Override - public void setRegion(int i, int i1, int i2, int i3, int i4, int i5, @NotNull BlockData blockData) { - - } - - @NotNull - @Override - public Material getType(int i, int i1, int i2) { - return getBlockData(i, i1, i2).getMaterial(); - } - - @NotNull - @Override - public MaterialData getTypeAndData(int i, int i1, int i2) { - return null; - } - - @Override - public byte getData(int i, int i1, int i2) { - return 0; - } - }); - - Iris.edit.flushNow(); - - } - - @Override public void close() { J.car(art); if (getComposite() != null) { getComposite().close(); - - if (isStudio()) { - IrisWorlds.evacuate(getComposite().getWorld()); - Bukkit.unloadWorld(getComposite().getWorld(), !isStudio()); + if (isStudio() && getComposite().getWorld().hasRealWorld()) { + getComposite().getWorld().evacuate(); + Bukkit.unloadWorld(getComposite().getWorld().realWorld(), !isStudio()); } } } diff --git a/src/main/java/com/volmit/iris/engine/framework/EngineCompound.java b/src/main/java/com/volmit/iris/engine/framework/EngineCompound.java index cff9a2dd9..ef0740b62 100644 --- a/src/main/java/com/volmit/iris/engine/framework/EngineCompound.java +++ b/src/main/java/com/volmit/iris/engine/framework/EngineCompound.java @@ -26,6 +26,7 @@ import com.volmit.iris.engine.hunk.Hunk; import com.volmit.iris.engine.object.IrisBiome; import com.volmit.iris.engine.object.IrisDimension; import com.volmit.iris.engine.object.IrisPosition; +import com.volmit.iris.engine.object.common.IrisWorld; import com.volmit.iris.engine.parallel.MultiBurst; import com.volmit.iris.util.collection.KList; import com.volmit.iris.util.collection.KMap; @@ -43,7 +44,7 @@ public interface EngineCompound extends Listener, Hotloadable, DataProvider { void generate(int x, int z, Hunk blocks, Hunk postblocks, Hunk biomes); - World getWorld(); + IrisWorld getWorld(); List getStrongholdPositions(); @@ -149,8 +150,6 @@ public interface EngineCompound extends Listener, Hotloadable, DataProvider { return v.v(); } - void updateWorld(World world); - default int getLowestBedrock() { int f = Integer.MAX_VALUE; diff --git a/src/main/java/com/volmit/iris/engine/framework/EngineParallaxManager.java b/src/main/java/com/volmit/iris/engine/framework/EngineParallaxManager.java index cea30dd0f..9c9d88709 100644 --- a/src/main/java/com/volmit/iris/engine/framework/EngineParallaxManager.java +++ b/src/main/java/com/volmit/iris/engine/framework/EngineParallaxManager.java @@ -271,7 +271,7 @@ public interface EngineParallaxManager extends DataProvider, IObjectPlacer { if (!getParallaxAccess().isFeatureGenerated(xx, zz)) { burst.queue(() -> { getParallaxAccess().setFeatureGenerated(xx, zz); - RNG rng = new RNG(Cache.key(xx, zz)).nextParallelRNG(getEngine().getTarget().getWorld().getSeed()); + RNG rng = new RNG(Cache.key(xx, zz)).nextParallelRNG(getEngine().getTarget().getWorld().seed()); IrisRegion region = getComplex().getRegionStream().get(xxx, zzz); IrisBiome biome = getComplex().getTrueBiomeStream().get(xxx, zzz); generateParallaxFeatures(rng, xx, zz, region, biome); @@ -332,7 +332,7 @@ public interface EngineParallaxManager extends DataProvider, IObjectPlacer { if (getEngine().getDimension().isPlaceObjects()) { int xx = x << 4; int zz = z << 4; - RNG rng = new RNG(Cache.key(x, z)).nextParallelRNG(getEngine().getTarget().getWorld().getSeed()); + RNG rng = new RNG(Cache.key(x, z)).nextParallelRNG(getEngine().getTarget().getWorld().seed()); IrisRegion region = getComplex().getRegionStream().get(xx + 8, zz + 8); IrisBiome biome = getComplex().getTrueBiomeStream().get(xx + 8, zz + 8); after.addAll(generateParallaxJigsaw(rng, x, z, biome, region)); @@ -351,7 +351,7 @@ public interface EngineParallaxManager extends DataProvider, IObjectPlacer { int xx = x << 4; int zz = z << 4; getParallaxAccess().setParallaxGenerated(x, z); - RNG rng = new RNG(Cache.key(x, z)).nextParallelRNG(getEngine().getTarget().getWorld().getSeed()); + RNG rng = new RNG(Cache.key(x, z)).nextParallelRNG(getEngine().getTarget().getWorld().seed()); IrisBiome biome = getComplex().getTrueBiomeStream().get(xx + 8, zz + 8); IrisRegion region = getComplex().getRegionStream().get(xx + 8, zz + 8); generateParallaxSurface(rng, x, z, biome, region, false); diff --git a/src/main/java/com/volmit/iris/engine/framework/EngineTarget.java b/src/main/java/com/volmit/iris/engine/framework/EngineTarget.java index bdd833b0b..6c7f2856c 100644 --- a/src/main/java/com/volmit/iris/engine/framework/EngineTarget.java +++ b/src/main/java/com/volmit/iris/engine/framework/EngineTarget.java @@ -20,10 +20,10 @@ package com.volmit.iris.engine.framework; import com.volmit.iris.core.IrisDataManager; import com.volmit.iris.engine.object.IrisDimension; +import com.volmit.iris.engine.object.common.IrisWorld; import com.volmit.iris.engine.parallax.ParallaxWorld; import com.volmit.iris.engine.parallel.MultiBurst; import lombok.Data; -import org.bukkit.World; import java.io.File; @@ -31,27 +31,23 @@ import java.io.File; public class EngineTarget { private final MultiBurst burster; private final IrisDimension dimension; - private World world; + private IrisWorld world; private final int height; private final IrisDataManager data; private final ParallaxWorld parallaxWorld; private final boolean inverted; - public EngineTarget(World world, IrisDimension dimension, IrisDataManager data, int height, boolean inverted, int threads) { + public EngineTarget(IrisWorld world, IrisDimension dimension, IrisDataManager data, int height, boolean inverted, int threads) { this.world = world; this.height = height; this.dimension = dimension; this.data = data; - this.parallaxWorld = new ParallaxWorld(256, new File(world.getWorldFolder(), "iris/" + dimension.getLoadKey() + "/parallax")); + this.parallaxWorld = new ParallaxWorld(256, new File(world.worldFolder(), "iris/" + dimension.getLoadKey() + "/parallax")); this.inverted = inverted; this.burster = new MultiBurst(threads); } - public void updateWorld(World world) { - this.world = world; - } - - public EngineTarget(World world, IrisDimension dimension, IrisDataManager data, int height, int threads) { + public EngineTarget(IrisWorld world, IrisDimension dimension, IrisDataManager data, int height, int threads) { this(world, dimension, data, height, false, threads); } } diff --git a/src/main/java/com/volmit/iris/engine/framework/IrisAccess.java b/src/main/java/com/volmit/iris/engine/framework/IrisAccess.java index ebc927194..8c6e692f7 100644 --- a/src/main/java/com/volmit/iris/engine/framework/IrisAccess.java +++ b/src/main/java/com/volmit/iris/engine/framework/IrisAccess.java @@ -25,6 +25,7 @@ import com.volmit.iris.engine.data.DataProvider; import com.volmit.iris.engine.data.mca.NBTWorld; import com.volmit.iris.engine.object.IrisBiome; import com.volmit.iris.engine.object.IrisRegion; +import com.volmit.iris.engine.object.common.IrisWorld; import com.volmit.iris.engine.parallel.MultiBurst; import com.volmit.iris.util.collection.KList; import com.volmit.iris.util.math.M; @@ -44,9 +45,9 @@ import java.util.function.Consumer; @SuppressWarnings("EmptyMethod") public interface IrisAccess extends Hotloadable, DataProvider { - void directWriteMCA(World w, int x, int z, NBTWorld writer, MultiBurst burst); + void directWriteMCA(IrisWorld w, int x, int z, NBTWorld writer, MultiBurst burst); - void directWriteChunk(World w, int x, int z, NBTWorld writer); + void directWriteChunk(IrisWorld w, int x, int z, NBTWorld writer); int getGenerated(); @@ -72,8 +73,6 @@ public interface IrisAccess extends Hotloadable, DataProvider { void changeThreadCount(int m); - void regenerate(int x, int z); - void close(); boolean isClosed(); @@ -87,6 +86,12 @@ public interface IrisAccess extends Hotloadable, DataProvider { boolean isStudio(); default Location lookForBiome(IrisBiome biome, long timeout, Consumer triesc) { + if(!getCompound().getWorld().hasRealWorld()) + { + Iris.error("Cannot GOTO without a bound world (headless mode)"); + return null; + } + IrisComplex.cacheLock.set(true); ChronoLatch cl = new ChronoLatch(250, false); long s = M.ms(); @@ -130,7 +135,7 @@ public interface IrisAccess extends Hotloadable, DataProvider { if (b != null && b.getLoadKey().equals(biome.getLoadKey())) { found.lazySet(true); - location.lazySet(new Location(e.getWorld(), x, e.getHeight(x, z), z)); + location.lazySet(new Location(e.getWorld().realWorld(), x, e.getHeight(x, z), z)); } tries.getAndIncrement(); @@ -167,6 +172,12 @@ public interface IrisAccess extends Hotloadable, DataProvider { } default Location lookForRegion(IrisRegion reg, long timeout, Consumer triesc) { + if(!getCompound().getWorld().hasRealWorld()) + { + Iris.error("Cannot GOTO without a bound world (headless mode)"); + return null; + } + IrisComplex.cacheLock.set(true); ChronoLatch cl = new ChronoLatch(3000, false); long s = M.ms(); @@ -204,7 +215,7 @@ public interface IrisAccess extends Hotloadable, DataProvider { if (b != null && b.getLoadKey() != null && b.getLoadKey().equals(reg.getLoadKey())) { found.lazySet(true); - location.lazySet(new Location(e.getWorld(), x, e.getHeight(x, z) + e.getMinHeight(), z)); + location.lazySet(new Location(e.getWorld().realWorld(), x, e.getHeight(x, z) + e.getMinHeight(), z)); } tries.getAndIncrement(); @@ -238,14 +249,6 @@ public interface IrisAccess extends Hotloadable, DataProvider { return location.get(); } - void clearRegeneratedLists(int x, int z); - - void precache(World world, int x, int z); - - int getPrecacheSize(); - - Chunk generatePaper(World world, int cx, int cz); - default int getParallaxChunkCount() { int v = 0; diff --git a/src/main/java/com/volmit/iris/engine/headless/HeadlessGenerator.java b/src/main/java/com/volmit/iris/engine/headless/HeadlessGenerator.java new file mode 100644 index 000000000..b2f2967a7 --- /dev/null +++ b/src/main/java/com/volmit/iris/engine/headless/HeadlessGenerator.java @@ -0,0 +1,63 @@ +/* + * Iris is a World Generator for Minecraft Bukkit Servers + * Copyright (c) 2021 Arcane Arts (Volmit Software) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.volmit.iris.engine.headless; + +import com.volmit.iris.engine.data.mca.NBTWorld; +import com.volmit.iris.engine.framework.EngineCompositeGenerator; +import com.volmit.iris.engine.parallel.MultiBurst; +import lombok.Data; + +@Data +public class HeadlessGenerator { + private final HeadlessWorld world; + private final EngineCompositeGenerator generator; + private final NBTWorld writer; + private final MultiBurst burst; + + public HeadlessGenerator(HeadlessWorld world) + { + this.world = world; + burst = new MultiBurst("Iris Headless Generator", 9, Runtime.getRuntime().availableProcessors()); + generator = new EngineCompositeGenerator(world.getDimension().getLoadKey(), true); + generator.initialize(world.getWorld()); + writer = new NBTWorld(world.getWorld().worldFolder()); + } + + public void generateChunk(int x, int z) + { + generator.directWriteChunk(world.getWorld(), x, z, writer); + } + + public void generateRegion(int x, int z) + { + generator.directWriteMCA(world.getWorld(), x, z, writer, burst); + } + + public void save() + { + writer.save(); + } + + public void close() + { + burst.shutdownAndAwait(); + generator.close(); + writer.close(); + } +} diff --git a/src/main/java/com/volmit/iris/engine/headless/HeadlessWorld.java b/src/main/java/com/volmit/iris/engine/headless/HeadlessWorld.java new file mode 100644 index 000000000..b84ddf929 --- /dev/null +++ b/src/main/java/com/volmit/iris/engine/headless/HeadlessWorld.java @@ -0,0 +1,80 @@ +/* + * Iris is a World Generator for Minecraft Bukkit Servers + * Copyright (c) 2021 Arcane Arts (Volmit Software) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.volmit.iris.engine.headless; + +import com.volmit.iris.Iris; +import com.volmit.iris.core.IrisDataManager; +import com.volmit.iris.engine.framework.EngineCompositeGenerator; +import com.volmit.iris.engine.object.IrisDimension; +import com.volmit.iris.engine.object.common.IrisWorld; +import com.volmit.iris.util.plugin.VolmitSender; +import lombok.Data; +import org.bukkit.Bukkit; +import org.bukkit.World; +import org.bukkit.WorldCreator; + +import java.io.File; + +@Data +@SuppressWarnings("ResultOfMethodCallIgnored") +public class HeadlessWorld { + private final IrisDimension dimension; + private final String worldName; + private final IrisWorld world; + + public HeadlessWorld(String worldName, IrisDimension dimension, long seed) + { + this.worldName = worldName; + this.dimension = dimension; + world = IrisWorld.builder() + .environment(dimension.getEnvironment()) + .worldFolder(new File(worldName)) + .seed(seed) + .maxHeight(256) + .minHeight(0) + .name(worldName) + .build(); + world.worldFolder().mkdirs(); + new File(world.worldFolder(), "region").mkdirs(); + + if(!new File(world.worldFolder(), "iris").exists()) + { + Iris.proj.installIntoWorld(new VolmitSender(Bukkit.getConsoleSender(), Iris.instance.getTag("Headless")), dimension.getLoadKey(), world.worldFolder()); + } + } + + public HeadlessGenerator headlessMode() + { + return new HeadlessGenerator(this); + } + + public World load() + { + return new WorldCreator(worldName) + .environment(dimension.getEnvironment()) + .seed(world.seed()) + .generator(new EngineCompositeGenerator(dimension.getLoadKey(), true)) + .createWorld(); + } + + public static HeadlessWorld from(String name, String dimension, long seed) + { + return new HeadlessWorld(name, IrisDataManager.loadAnyDimension(dimension), seed); + } +} diff --git a/src/main/java/com/volmit/iris/engine/modifier/IrisCaveModifier.java b/src/main/java/com/volmit/iris/engine/modifier/IrisCaveModifier.java index 8e2cd9644..1596152f1 100644 --- a/src/main/java/com/volmit/iris/engine/modifier/IrisCaveModifier.java +++ b/src/main/java/com/volmit/iris/engine/modifier/IrisCaveModifier.java @@ -43,7 +43,7 @@ public class IrisCaveModifier extends EngineAssignedModifier { public IrisCaveModifier(Engine engine) { super(engine, "Cave"); - rng = new RNG(engine.getWorld().getSeed() + 28934555); + rng = new RNG(engine.getWorld().seed() + 28934555); gg = new FastNoiseDouble(324895L * rng.nextParallelRNG(49678).imax()); } diff --git a/src/main/java/com/volmit/iris/engine/modifier/IrisDepositModifier.java b/src/main/java/com/volmit/iris/engine/modifier/IrisDepositModifier.java index 623678fee..035e95383 100644 --- a/src/main/java/com/volmit/iris/engine/modifier/IrisDepositModifier.java +++ b/src/main/java/com/volmit/iris/engine/modifier/IrisDepositModifier.java @@ -36,7 +36,7 @@ public class IrisDepositModifier extends EngineAssignedModifier { public IrisDepositModifier(Engine engine) { super(engine, "Deposit"); - rng = new RNG(getEngine().getWorld().getSeed() + 12938).nextParallelRNG(28348777); + rng = new RNG(getEngine().getWorld().seed() + 12938).nextParallelRNG(28348777); } @Override diff --git a/src/main/java/com/volmit/iris/engine/modifier/IrisPostModifier.java b/src/main/java/com/volmit/iris/engine/modifier/IrisPostModifier.java index 89aeaf6e7..67309d589 100644 --- a/src/main/java/com/volmit/iris/engine/modifier/IrisPostModifier.java +++ b/src/main/java/com/volmit/iris/engine/modifier/IrisPostModifier.java @@ -40,7 +40,7 @@ public class IrisPostModifier extends EngineAssignedModifier { public IrisPostModifier(Engine engine) { super(engine, "Post"); - rng = new RNG(getEngine().getWorld().getSeed() + 12938).nextParallelRNG(28348777); + rng = new RNG(getEngine().getWorld().seed() + 12938).nextParallelRNG(28348777); } @Override diff --git a/src/main/java/com/volmit/iris/engine/modifier/IrisRavineModifier.java b/src/main/java/com/volmit/iris/engine/modifier/IrisRavineModifier.java index 25fcaa5ac..1fd82cdbb 100644 --- a/src/main/java/com/volmit/iris/engine/modifier/IrisRavineModifier.java +++ b/src/main/java/com/volmit/iris/engine/modifier/IrisRavineModifier.java @@ -41,7 +41,7 @@ public class IrisRavineModifier extends EngineAssignedModifier { public IrisRavineModifier(Engine engine) { super(engine, "Ravine"); - rng = new RNG(getEngine().getWorld().getSeed()).nextParallelRNG(29596878); + rng = new RNG(getEngine().getWorld().seed()).nextParallelRNG(29596878); cng = NoiseStyle.IRIS_THICK.create(rng); } diff --git a/src/main/java/com/volmit/iris/engine/object/IrisEntityInitialSpawn.java b/src/main/java/com/volmit/iris/engine/object/IrisEntityInitialSpawn.java index 8feff8a42..1e72382a3 100644 --- a/src/main/java/com/volmit/iris/engine/object/IrisEntityInitialSpawn.java +++ b/src/main/java/com/volmit/iris/engine/object/IrisEntityInitialSpawn.java @@ -82,7 +82,7 @@ public class IrisEntityInitialSpawn { return null; } - if (rng.aquire(() -> new RNG(g.getTarget().getWorld().getSeed() + 4)).i(1, getRarity()) == 1) { + if (rng.aquire(() -> new RNG(g.getTarget().getWorld().seed() + 4)).i(1, getRarity()) == 1) { return spawn100(g, at); } @@ -90,6 +90,6 @@ public class IrisEntityInitialSpawn { } private Entity spawn100(Engine g, Location at) { - return getRealEntity(g).spawn(g, at.clone().add(0.5, 1, 0.5), rng.aquire(() -> new RNG(g.getTarget().getWorld().getSeed() + 4))); + return getRealEntity(g).spawn(g, at.clone().add(0.5, 1, 0.5), rng.aquire(() -> new RNG(g.getTarget().getWorld().seed() + 4))); } } diff --git a/src/main/java/com/volmit/iris/engine/object/IrisEntitySpawnOverride.java b/src/main/java/com/volmit/iris/engine/object/IrisEntitySpawnOverride.java index 488cb519a..1cc0150f9 100644 --- a/src/main/java/com/volmit/iris/engine/object/IrisEntitySpawnOverride.java +++ b/src/main/java/com/volmit/iris/engine/object/IrisEntitySpawnOverride.java @@ -88,8 +88,8 @@ public class IrisEntitySpawnOverride { return null; } - if (rng.aquire(() -> new RNG(g.getTarget().getWorld().getSeed() + 4)).i(1, getRarity()) == 1) { - return getRealEntity(g).spawn(g, at, rng.aquire(() -> new RNG(g.getTarget().getWorld().getSeed() + 4))); + if (rng.aquire(() -> new RNG(g.getTarget().getWorld().seed() + 4)).i(1, getRarity()) == 1) { + return getRealEntity(g).spawn(g, at, rng.aquire(() -> new RNG(g.getTarget().getWorld().seed() + 4))); } return null; diff --git a/src/main/java/com/volmit/iris/engine/object/common/IrisWorld.java b/src/main/java/com/volmit/iris/engine/object/common/IrisWorld.java index 859aa037d..3d1f5b2c9 100644 --- a/src/main/java/com/volmit/iris/engine/object/common/IrisWorld.java +++ b/src/main/java/com/volmit/iris/engine/object/common/IrisWorld.java @@ -18,28 +18,94 @@ package com.volmit.iris.engine.object.common; +import com.volmit.iris.Iris; +import com.volmit.iris.engine.IrisWorlds; +import com.volmit.iris.util.collection.KList; import lombok.Builder; import lombok.Data; +import lombok.experimental.Accessors; +import org.bukkit.Location; import org.bukkit.World; +import org.bukkit.entity.Entity; +import org.bukkit.entity.LivingEntity; +import org.bukkit.entity.Player; import java.io.File; +import java.util.Collection; +import java.util.List; @Builder @Data +@Accessors(chain = true, fluent = true) public class IrisWorld { + private static final KList NO_PLAYERS = new KList<>(); + private static final KList NO_ENTITIES = new KList<>(); private String name; private File worldFolder; private long seed; private World.Environment environment; - private boolean real; + private World realWorld; + private int minHeight; + private int maxHeight; public static IrisWorld fromWorld(World world) { - return IrisWorld.builder() - .name(world.getName()) - .worldFolder(world.getWorldFolder()) - .seed(world.getSeed()) - .environment(world.getEnvironment()) - .build(); + return bindWorld(IrisWorld.builder().build(), world); + } + + private static IrisWorld bindWorld(IrisWorld iw, World world) + { + return iw.name(world.getName()) + .worldFolder(world.getWorldFolder()) + .seed(world.getSeed()) + .minHeight(world.getMinHeight()) + .maxHeight(world.getMaxHeight()) + .realWorld(world) + .environment(world.getEnvironment()); + } + + public boolean hasRealWorld() + { + return realWorld != null; + } + + public List getPlayers() { + + if(hasRealWorld()) + { + return realWorld().getPlayers(); + } + + return NO_PLAYERS; + } + + public void evacuate() { + if(hasRealWorld()) + { + IrisWorlds.evacuate(realWorld()); + } + } + + public void bind(World world) { + bindWorld(this, world); + } + + public Location spawnLocation() { + if(hasRealWorld()) + { + return realWorld().getSpawnLocation(); + } + + Iris.error("This world is not real yet, cannot get spawn location! HEADLESS!"); + return null; + } + + public Collection getEntitiesByClass(Class t) { + if(hasRealWorld()) + { + return realWorld().getEntitiesByClass(t); + } + + return (KList) NO_ENTITIES; } } diff --git a/src/main/java/com/volmit/iris/engine/parallel/MultiBurst.java b/src/main/java/com/volmit/iris/engine/parallel/MultiBurst.java index da965047b..e79883bd7 100644 --- a/src/main/java/com/volmit/iris/engine/parallel/MultiBurst.java +++ b/src/main/java/com/volmit/iris/engine/parallel/MultiBurst.java @@ -95,4 +95,22 @@ public class MultiBurst { public void shutdown() { service.shutdown(); } + + public void shutdownAndAwait() { + service.shutdown(); + + try + { + while(!service.awaitTermination(10, TimeUnit.SECONDS)) + { + Iris.info("Still waiting to shutdown burster..."); + } + } + + catch(Throwable e) + { + e.printStackTrace(); + Iris.reportError(e); + } + } } diff --git a/src/main/java/com/volmit/iris/util/fakenews/FakeEngine.java b/src/main/java/com/volmit/iris/util/fakenews/FakeEngine.java deleted file mode 100644 index b6fb97c02..000000000 --- a/src/main/java/com/volmit/iris/util/fakenews/FakeEngine.java +++ /dev/null @@ -1,197 +0,0 @@ -/* - * Iris is a World Generator for Minecraft Bukkit Servers - * Copyright (c) 2021 Arcane Arts (Volmit Software) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -package com.volmit.iris.util.fakenews; - -import com.volmit.iris.core.IrisDataManager; -import com.volmit.iris.engine.IrisEngineFramework; -import com.volmit.iris.engine.framework.*; -import com.volmit.iris.engine.hunk.Hunk; -import com.volmit.iris.engine.object.*; -import lombok.Getter; -import org.bukkit.World; -import org.bukkit.block.Biome; -import org.bukkit.block.data.BlockData; - - -public class FakeEngine implements Engine { - - - @Getter - private double maxBiomeObjectDensity; - - @Getter - private double maxBiomeLayerDensity; - - @Getter - private double maxBiomeDecoratorDensity; - - @Getter - private final IrisDimension dimension; - - private final EngineFramework framework; - - @Getter - private final World world; - - public FakeEngine(IrisDimension dimension, FakeWorld world) { - this.dimension = dimension; - this.world = world; - computeBiomeMaxes(); - this.framework = new IrisEngineFramework(this); - } - - private void computeBiomeMaxes() { - for (IrisBiome i : getDimension().getAllBiomes(this)) { - double density = 0; - - for (IrisObjectPlacement j : i.getObjects()) { - density += j.getDensity() * j.getChance(); - } - - maxBiomeObjectDensity = Math.max(maxBiomeObjectDensity, density); - density = 0; - - for (IrisDecorator j : i.getDecorators()) { - density += Math.max(j.getStackMax(), 1) * j.getChance(); - } - - maxBiomeDecoratorDensity = Math.max(maxBiomeDecoratorDensity, density); - density = 0; - - for (IrisBiomePaletteLayer j : i.getLayers()) { - density++; - } - - maxBiomeLayerDensity = Math.max(maxBiomeLayerDensity, density); - } - } - - @Override - public void close() { - } - - @Override - public boolean isClosed() { - return false; - } - - @Override - public IrisDataManager getData() { - return dimension.getLoader().copy(); - } - - @Override - public EngineWorldManager getWorldManager() { - return null; - } - - @Override - public void setParallelism(int parallelism) { - } - - @Override - public int getParallelism() { - return 0; - } - - @Override - public EngineTarget getTarget() { - return null; - } - - @Override - public EngineFramework getFramework() { - return null; - } - - @Override - public void setMinHeight(int min) { - } - - @Override - public void recycle() { - } - - @Override - public int getIndex() { - return 0; - } - - @Override - public int getMinHeight() { - return 0; - } - - @Override - public int getHeight() { - return 64; - } - - @Override - public double modifyX(double x) { - return 0; - } - - @Override - public double modifyZ(double z) { - return 0; - } - - @Override - public void generate(int x, int z, Hunk blocks, Hunk biomes) { - } - - @Override - public EngineMetrics getMetrics() { - return null; - } - - @Override - public EngineEffects getEffects() { - return null; - } - - @Override - public EngineCompound getCompound() { - return null; - } - - @Override - public IrisBiome getFocus() { - return null; - } - - @Override - public void fail(String error, Throwable e) { - } - - @Override - public boolean hasFailed() { - return false; - } - - @Override - public int getCacheID() { - return 0; - } - - @Override - public void hotload() { - } -} diff --git a/src/main/java/com/volmit/iris/util/fakenews/FakeWorld.java b/src/main/java/com/volmit/iris/util/fakenews/FakeWorld.java deleted file mode 100644 index a86b67185..000000000 --- a/src/main/java/com/volmit/iris/util/fakenews/FakeWorld.java +++ /dev/null @@ -1,1214 +0,0 @@ -/* - * Iris is a World Generator for Minecraft Bukkit Servers - * Copyright (c) 2021 Arcane Arts (Volmit Software) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -package com.volmit.iris.util.fakenews; - -import lombok.Setter; -import org.bukkit.*; -import org.bukkit.block.Biome; -import org.bukkit.block.Block; -import org.bukkit.block.data.BlockData; -import org.bukkit.boss.DragonBattle; -import org.bukkit.entity.*; -import org.bukkit.generator.BlockPopulator; -import org.bukkit.generator.ChunkGenerator; -import org.bukkit.inventory.ItemStack; -import org.bukkit.material.MaterialData; -import org.bukkit.metadata.MetadataValue; -import org.bukkit.plugin.Plugin; -import org.bukkit.util.BoundingBox; -import org.bukkit.util.Consumer; -import org.bukkit.util.RayTraceResult; -import org.bukkit.util.Vector; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; - -import java.io.File; -import java.util.*; -import java.util.function.Predicate; - -@SuppressWarnings("deprecation") -public class FakeWorld implements World { - private final int height; - private final int minHeight; - private final long seed; - private final File worldFolder; - private final Environment environment; - @Setter - private String worldName; - - public FakeWorld(String name, int minHeight, int height, long seed, File worldFolder, Environment environment) { - this.worldName = name; - this.height = height; - this.seed = seed; - this.worldFolder = worldFolder; - this.minHeight = minHeight; - this.environment = environment; - worldFolder.mkdirs(); - } - - @Override - public void sendPluginMessage(@NotNull Plugin source, @NotNull String channel, @NotNull byte[] message) { - - } - - @NotNull - @Override - public Set getListeningPluginChannels() { - - return null; - } - - @Override - public void setMetadata(@NotNull String metadataKey, @NotNull MetadataValue newMetadataValue) { - - } - - @NotNull - @Override - public List getMetadata(@NotNull String metadataKey) { - - return null; - } - - @Override - public boolean hasMetadata(@NotNull String metadataKey) { - - return false; - } - - @Override - public void removeMetadata(@NotNull String metadataKey, @NotNull Plugin owningPlugin) { - - } - - @NotNull - @Override - public Block getBlockAt(int x, int y, int z) { - - return null; - } - - @NotNull - @Override - public Block getBlockAt(@NotNull Location location) { - - return null; - } - - @Override - public int getHighestBlockYAt(int x, int z) { - - return 0; - } - - @Override - public int getHighestBlockYAt(@NotNull Location location) { - - return 0; - } - - @NotNull - @Override - public Block getHighestBlockAt(int x, int z) { - - return null; - } - - @NotNull - @Override - public Block getHighestBlockAt(@NotNull Location location) { - - return null; - } - - @Override - public int getHighestBlockYAt(int x, int z, @NotNull HeightMap heightMap) { - - return 0; - } - - @Override - public int getHighestBlockYAt(@NotNull Location location, @NotNull HeightMap heightMap) { - - return 0; - } - - @NotNull - @Override - public Block getHighestBlockAt(int x, int z, @NotNull HeightMap heightMap) { - - return null; - } - - @NotNull - @Override - public Block getHighestBlockAt(@NotNull Location location, @NotNull HeightMap heightMap) { - - return null; - } - - @NotNull - @Override - public Chunk getChunkAt(int x, int z) { - - return null; - } - - @NotNull - @Override - public Chunk getChunkAt(@NotNull Location location) { - - return null; - } - - @NotNull - @Override - public Chunk getChunkAt(@NotNull Block block) { - - return null; - } - - @Override - public boolean isChunkLoaded(@NotNull Chunk chunk) { - - return false; - } - - @NotNull - @Override - public Chunk[] getLoadedChunks() { - - return null; - } - - @Override - public void loadChunk(@NotNull Chunk chunk) { - - } - - @Override - public boolean isChunkLoaded(int x, int z) { - - return false; - } - - @Override - public boolean isChunkGenerated(int x, int z) { - - return false; - } - - @Override - public boolean isChunkInUse(int x, int z) { - - return false; - } - - @Override - public void loadChunk(int x, int z) { - - } - - @Override - public boolean loadChunk(int x, int z, boolean generate) { - - return false; - } - - @Override - public boolean unloadChunk(@NotNull Chunk chunk) { - - return false; - } - - @Override - public boolean unloadChunk(int x, int z) { - - return false; - } - - @Override - public boolean unloadChunk(int x, int z, boolean save) { - - return false; - } - - @Override - public boolean unloadChunkRequest(int x, int z) { - - return false; - } - - @Override - public boolean regenerateChunk(int x, int z) { - - return false; - } - - @Override - public boolean refreshChunk(int x, int z) { - - return false; - } - - @Override - public boolean isChunkForceLoaded(int x, int z) { - - return false; - } - - @Override - public void setChunkForceLoaded(int x, int z, boolean forced) { - - } - - @NotNull - @Override - public Collection getForceLoadedChunks() { - - return null; - } - - @Override - public boolean addPluginChunkTicket(int x, int z, @NotNull Plugin plugin) { - - return false; - } - - @Override - public boolean removePluginChunkTicket(int x, int z, @NotNull Plugin plugin) { - - return false; - } - - @Override - public void removePluginChunkTickets(@NotNull Plugin plugin) { - - } - - @NotNull - @Override - public Collection getPluginChunkTickets(int x, int z) { - - return null; - } - - @NotNull - @Override - public Map> getPluginChunkTickets() { - - return null; - } - - @NotNull - @Override - public Item dropItem(@NotNull Location location, @NotNull ItemStack item) { - - return null; - } - - @NotNull - @Override - public Item dropItem(@NotNull Location location, @NotNull ItemStack itemStack, @Nullable Consumer consumer) { - return null; - } - - @NotNull - @Override - public Item dropItemNaturally(@NotNull Location location, @NotNull ItemStack item) { - - return null; - } - - @NotNull - @Override - public Item dropItemNaturally(@NotNull Location location, @NotNull ItemStack itemStack, @Nullable Consumer consumer) { - return null; - } - - @NotNull - @Override - public Arrow spawnArrow(@NotNull Location location, @NotNull Vector direction, float speed, float spread) { - - return null; - } - - @NotNull - @Override - public T spawnArrow(@NotNull Location location, @NotNull Vector direction, float speed, float spread, @NotNull Class clazz) { - - return null; - } - - @Override - public boolean generateTree(@NotNull Location location, @NotNull TreeType type) { - - return false; - } - - @Override - public boolean generateTree(@NotNull Location loc, @NotNull TreeType type, @NotNull BlockChangeDelegate delegate) { - - return false; - } - - @NotNull - @Override - public Entity spawnEntity(@NotNull Location loc, @NotNull EntityType type) { - - return null; - } - - @NotNull - @Override - public LightningStrike strikeLightning(@NotNull Location loc) { - - return null; - } - - @NotNull - @Override - public LightningStrike strikeLightningEffect(@NotNull Location loc) { - - return null; - } - - @NotNull - @Override - public List getEntities() { - - return null; - } - - @NotNull - @Override - public List getLivingEntities() { - - return null; - } - - @NotNull - @SuppressWarnings({"RedundantSuppression", "unchecked"}) - @Override - public Collection getEntitiesByClass(@NotNull @SuppressWarnings("unchecked") Class... classes) { - - return null; - } - - @NotNull - @Override - public Collection getEntitiesByClass(@NotNull Class cls) { - - return null; - } - - @NotNull - @Override - public Collection getEntitiesByClasses(@NotNull Class... classes) { - - return null; - } - - @NotNull - @Override - public List getPlayers() { - - return null; - } - - @NotNull - @Override - public Collection getNearbyEntities(@NotNull Location location, double x, double y, double z) { - - return null; - } - - @NotNull - @Override - public Collection getNearbyEntities(@NotNull Location location, double x, double y, double z, Predicate filter) { - - return null; - } - - @NotNull - @Override - public Collection getNearbyEntities(@NotNull BoundingBox boundingBox) { - - return null; - } - - @NotNull - @Override - public Collection getNearbyEntities(@NotNull BoundingBox boundingBox, Predicate filter) { - - return null; - } - - @Override - public RayTraceResult rayTraceEntities(@NotNull Location start, @NotNull Vector direction, double maxDistance) { - - return null; - } - - @Override - public RayTraceResult rayTraceEntities(@NotNull Location start, @NotNull Vector direction, double maxDistance, double raySize) { - - return null; - } - - @Override - public RayTraceResult rayTraceEntities(@NotNull Location start, @NotNull Vector direction, double maxDistance, Predicate filter) { - - return null; - } - - @Override - public RayTraceResult rayTraceEntities(@NotNull Location start, @NotNull Vector direction, double maxDistance, double raySize, Predicate filter) { - - return null; - } - - @Override - public RayTraceResult rayTraceBlocks(@NotNull Location start, @NotNull Vector direction, double maxDistance) { - - return null; - } - - @Override - public RayTraceResult rayTraceBlocks(@NotNull Location start, @NotNull Vector direction, double maxDistance, @NotNull FluidCollisionMode fluidCollisionMode) { - - return null; - } - - @Override - public RayTraceResult rayTraceBlocks(@NotNull Location start, @NotNull Vector direction, double maxDistance, @NotNull FluidCollisionMode fluidCollisionMode, boolean ignorePassableBlocks) { - - return null; - } - - @Override - public RayTraceResult rayTrace(@NotNull Location start, @NotNull Vector direction, double maxDistance, @NotNull FluidCollisionMode fluidCollisionMode, boolean ignorePassableBlocks, double raySize, Predicate filter) { - - return null; - } - - @NotNull - @Override - public String getName() { - - return worldName; - } - - @NotNull - @Override - public UUID getUID() { - - return null; - } - - @NotNull - @Override - public Location getSpawnLocation() { - - return null; - } - - @Override - public boolean setSpawnLocation(@NotNull Location location) { - - return false; - } - - @Override - public boolean setSpawnLocation(int i, int i1, int i2, float v) { - return false; - } - - @Override - public boolean setSpawnLocation(int x, int y, int z) { - - return false; - } - - @Override - public long getTime() { - - return 0; - } - - @Override - public void setTime(long time) { - - } - - @Override - public long getFullTime() { - - return 0; - } - - @Override - public void setFullTime(long time) { - - } - - @Override - public long getGameTime() { - return 0; - } - - @Override - public boolean hasStorm() { - - return false; - } - - @Override - public void setStorm(boolean hasStorm) { - - } - - @Override - public int getWeatherDuration() { - - return 0; - } - - @Override - public void setWeatherDuration(int duration) { - - } - - @Override - public boolean isThundering() { - - return false; - } - - @Override - public void setThundering(boolean thundering) { - - } - - @Override - public int getThunderDuration() { - - return 0; - } - - @Override - public void setThunderDuration(int duration) { - - } - - @Override - public boolean isClearWeather() { - return false; - } - - @Override - public void setClearWeatherDuration(int i) { - - } - - @Override - public int getClearWeatherDuration() { - return 0; - } - - @Override - public boolean createExplosion(double x, double y, double z, float power) { - - return false; - } - - @Override - public boolean createExplosion(double x, double y, double z, float power, boolean setFire) { - - return false; - } - - @Override - public boolean createExplosion(double x, double y, double z, float power, boolean setFire, boolean breakBlocks) { - - return false; - } - - @Override - public boolean createExplosion(double x, double y, double z, float power, boolean setFire, boolean breakBlocks, Entity source) { - - return false; - } - - @Override - public boolean createExplosion(@NotNull Location loc, float power) { - - return false; - } - - @Override - public boolean createExplosion(@NotNull Location loc, float power, boolean setFire) { - - return false; - } - - @Override - public boolean createExplosion(@NotNull Location loc, float power, boolean setFire, boolean breakBlocks) { - - return false; - } - - @Override - public boolean createExplosion(@NotNull Location loc, float power, boolean setFire, boolean breakBlocks, Entity source) { - - return false; - } - - @NotNull - @Override - public Environment getEnvironment() { - - return environment; - } - - @Override - public long getSeed() { - - return seed; - } - - @Override - public boolean getPVP() { - - return false; - } - - @Override - public void setPVP(boolean pvp) { - - } - - @Override - public ChunkGenerator getGenerator() { - - return null; - } - - @Override - public void save() { - - } - - @NotNull - @Override - public List getPopulators() { - - return null; - } - - @NotNull - @Override - public T spawn(@NotNull Location location, @NotNull Class clazz) throws IllegalArgumentException { - - return null; - } - - @NotNull - @Override - public T spawn(@NotNull Location location, @NotNull Class clazz, Consumer function) throws IllegalArgumentException { - - return null; - } - - @NotNull - @Override - public FallingBlock spawnFallingBlock(@NotNull Location location, @NotNull MaterialData data) throws IllegalArgumentException { - - return null; - } - - @NotNull - @Override - public FallingBlock spawnFallingBlock(@NotNull Location location, @NotNull BlockData data) throws IllegalArgumentException { - - return null; - } - - @NotNull - @Override - public FallingBlock spawnFallingBlock(@NotNull Location location, @NotNull Material material, byte data) throws IllegalArgumentException { - - return null; - } - - @Override - public void playEffect(@NotNull Location location, @NotNull Effect effect, int data) { - - } - - @Override - public void playEffect(@NotNull Location location, @NotNull Effect effect, int data, int radius) { - - } - - @Override - public void playEffect(@NotNull Location location, @NotNull Effect effect, T data) { - - } - - @Override - public void playEffect(@NotNull Location location, @NotNull Effect effect, T data, int radius) { - - } - - @NotNull - @Override - public ChunkSnapshot getEmptyChunkSnapshot(int x, int z, boolean includeBiome, boolean includeBiomeTemp) { - - return null; - } - - @Override - public void setSpawnFlags(boolean allowMonsters, boolean allowAnimals) { - - } - - @Override - public boolean getAllowAnimals() { - - return false; - } - - @Override - public boolean getAllowMonsters() { - - return false; - } - - @NotNull - @Override - public Biome getBiome(int x, int z) { - - return null; - } - - @NotNull - @Override - public Biome getBiome(int x, int y, int z) { - - return null; - } - - @Override - public void setBiome(int x, int z, @NotNull Biome bio) { - - } - - @Override - public void setBiome(int x, int y, int z, @NotNull Biome bio) { - - } - - @Override - public double getTemperature(int x, int z) { - - return 0; - } - - @Override - public double getTemperature(int x, int y, int z) { - - return 0; - } - - @Override - public double getHumidity(int x, int z) { - - return 0; - } - - @Override - public double getHumidity(int x, int y, int z) { - - return 0; - } - - @Override - public int getMinHeight() { - return minHeight; - } - - @Override - public int getMaxHeight() { - - return height; - } - - @Override - public int getSeaLevel() { - - return 0; - } - - @Override - public boolean getKeepSpawnInMemory() { - - return false; - } - - @Override - public void setKeepSpawnInMemory(boolean keepLoaded) { - - } - - @Override - public boolean isAutoSave() { - - return false; - } - - @Override - public void setAutoSave(boolean value) { - - } - - @Override - public void setDifficulty(@NotNull Difficulty difficulty) { - - } - - @NotNull - @Override - public Difficulty getDifficulty() { - - return null; - } - - @NotNull - @Override - public File getWorldFolder() { - - return worldFolder; - } - - @Override - public WorldType getWorldType() { - - return null; - } - - @Override - public boolean canGenerateStructures() { - - return false; - } - - @Override - public boolean isHardcore() { - - return false; - } - - @Override - public void setHardcore(boolean hardcore) { - - } - - @Override - public long getTicksPerAnimalSpawns() { - - return 0; - } - - @Override - public void setTicksPerAnimalSpawns(int ticksPerAnimalSpawns) { - - } - - @Override - public long getTicksPerMonsterSpawns() { - - return 0; - } - - @Override - public void setTicksPerMonsterSpawns(int ticksPerMonsterSpawns) { - - } - - @Override - public long getTicksPerWaterSpawns() { - - return 0; - } - - @Override - public void setTicksPerWaterSpawns(int ticksPerWaterSpawns) { - - } - - @Override - public long getTicksPerWaterAmbientSpawns() { - - return 0; - } - - @Override - public void setTicksPerWaterAmbientSpawns(int ticksPerAmbientSpawns) { - - } - - @Override - public long getTicksPerAmbientSpawns() { - - return 0; - } - - @Override - public void setTicksPerAmbientSpawns(int ticksPerAmbientSpawns) { - - } - - @Override - public int getMonsterSpawnLimit() { - - return 0; - } - - @Override - public void setMonsterSpawnLimit(int limit) { - - } - - @Override - public int getAnimalSpawnLimit() { - - return 0; - } - - @Override - public void setAnimalSpawnLimit(int limit) { - - } - - @Override - public int getWaterAnimalSpawnLimit() { - - return 0; - } - - @Override - public void setWaterAnimalSpawnLimit(int limit) { - - } - - @Override - public int getWaterAmbientSpawnLimit() { - - return 0; - } - - @Override - public void setWaterAmbientSpawnLimit(int limit) { - - } - - @Override - public int getAmbientSpawnLimit() { - - return 0; - } - - @Override - public void setAmbientSpawnLimit(int limit) { - - } - - @Override - public void playSound(@NotNull Location location, @NotNull Sound sound, float volume, float pitch) { - - } - - @Override - public void playSound(@NotNull Location location, @NotNull String sound, float volume, float pitch) { - - } - - @Override - public void playSound(@NotNull Location location, @NotNull Sound sound, @NotNull SoundCategory category, float volume, float pitch) { - - } - - @Override - public void playSound(@NotNull Location location, @NotNull String sound, @NotNull SoundCategory category, float volume, float pitch) { - - } - - @NotNull - @Override - public String[] getGameRules() { - - return null; - } - - @Override - public String getGameRuleValue(String rule) { - - return null; - } - - @Override - public boolean setGameRuleValue(@NotNull String rule, @NotNull String value) { - - return false; - } - - @Override - public boolean isGameRule(@NotNull String rule) { - - return false; - } - - @Override - public T getGameRuleValue(@NotNull GameRule rule) { - - return null; - } - - @Override - public T getGameRuleDefault(@NotNull GameRule rule) { - - return null; - } - - @Override - public boolean setGameRule(@NotNull GameRule rule, @NotNull T newValue) { - - return false; - } - - @NotNull - @Override - public WorldBorder getWorldBorder() { - - return null; - } - - @Override - public void spawnParticle(@NotNull Particle particle, @NotNull Location location, int count) { - - } - - @Override - public void spawnParticle(@NotNull Particle particle, double x, double y, double z, int count) { - - } - - @Override - public void spawnParticle(@NotNull Particle particle, @NotNull Location location, int count, T data) { - - } - - @Override - public void spawnParticle(@NotNull Particle particle, double x, double y, double z, int count, T data) { - - } - - @Override - public void spawnParticle(@NotNull Particle particle, @NotNull Location location, int count, double offsetX, double offsetY, double offsetZ) { - - } - - @Override - public void spawnParticle(@NotNull Particle particle, double x, double y, double z, int count, double offsetX, double offsetY, double offsetZ) { - - } - - @Override - public void spawnParticle(@NotNull Particle particle, @NotNull Location location, int count, double offsetX, double offsetY, double offsetZ, T data) { - - } - - @Override - public void spawnParticle(@NotNull Particle particle, double x, double y, double z, int count, double offsetX, double offsetY, double offsetZ, T data) { - - } - - @Override - public void spawnParticle(@NotNull Particle particle, @NotNull Location location, int count, double offsetX, double offsetY, double offsetZ, double extra) { - - } - - @Override - public void spawnParticle(@NotNull Particle particle, double x, double y, double z, int count, double offsetX, double offsetY, double offsetZ, double extra) { - - } - - @Override - public void spawnParticle(@NotNull Particle particle, @NotNull Location location, int count, double offsetX, double offsetY, double offsetZ, double extra, T data) { - - } - - @Override - public void spawnParticle(@NotNull Particle particle, double x, double y, double z, int count, double offsetX, double offsetY, double offsetZ, double extra, T data) { - - } - - @Override - public void spawnParticle(@NotNull Particle particle, @NotNull Location location, int count, double offsetX, double offsetY, double offsetZ, double extra, T data, boolean force) { - - } - - @Override - public void spawnParticle(@NotNull Particle particle, double x, double y, double z, int count, double offsetX, double offsetY, double offsetZ, double extra, T data, boolean force) { - - } - - @Override - public Location locateNearestStructure(@NotNull Location origin, @NotNull StructureType structureType, int radius, boolean findUnexplored) { - return null; - } - - @Override - public int getViewDistance() { - return 0; - } - - @NotNull - @Override - public Spigot spigot() { - return null; - } - - @Override - public Raid locateNearestRaid(@NotNull Location location, int radius) { - return null; - } - - @NotNull - @Override - public List getRaids() { - return null; - } - - @Override - public DragonBattle getEnderDragonBattle() { - return null; - } -} diff --git a/src/main/java/com/volmit/iris/util/fakenews/HeightedFakeWorld.java b/src/main/java/com/volmit/iris/util/fakenews/HeightedFakeWorld.java deleted file mode 100644 index 8176f0cb9..000000000 --- a/src/main/java/com/volmit/iris/util/fakenews/HeightedFakeWorld.java +++ /dev/null @@ -1,1200 +0,0 @@ -/* - * Iris is a World Generator for Minecraft Bukkit Servers - * Copyright (c) 2021 Arcane Arts (Volmit Software) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -package com.volmit.iris.util.fakenews; - -import org.bukkit.*; -import org.bukkit.block.Biome; -import org.bukkit.block.Block; -import org.bukkit.block.data.BlockData; -import org.bukkit.boss.DragonBattle; -import org.bukkit.entity.*; -import org.bukkit.generator.BlockPopulator; -import org.bukkit.generator.ChunkGenerator; -import org.bukkit.inventory.ItemStack; -import org.bukkit.material.MaterialData; -import org.bukkit.metadata.MetadataValue; -import org.bukkit.plugin.Plugin; -import org.bukkit.util.BoundingBox; -import org.bukkit.util.Consumer; -import org.bukkit.util.RayTraceResult; -import org.bukkit.util.Vector; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; - -import java.io.File; -import java.util.*; -import java.util.function.Predicate; - -@SuppressWarnings({"deprecation", "ClassCanBeRecord", "unchecked"}) -public class HeightedFakeWorld implements World { - private final int height; - - public HeightedFakeWorld(int height) { - this.height = height; - } - - @Override - public void sendPluginMessage(@NotNull Plugin source, @NotNull String channel, @NotNull byte[] message) { - - } - - @NotNull - @Override - public Set getListeningPluginChannels() { - - return null; - } - - @Override - public void setMetadata(@NotNull String metadataKey, @NotNull MetadataValue newMetadataValue) { - - } - - @NotNull - @Override - public List getMetadata(@NotNull String metadataKey) { - - return null; - } - - @Override - public boolean hasMetadata(@NotNull String metadataKey) { - - return false; - } - - @Override - public void removeMetadata(@NotNull String metadataKey, @NotNull Plugin owningPlugin) { - - } - - @NotNull - @Override - public Block getBlockAt(int x, int y, int z) { - - return null; - } - - @NotNull - @Override - public Block getBlockAt(@NotNull Location location) { - - return null; - } - - @Override - public int getHighestBlockYAt(int x, int z) { - - return 0; - } - - @Override - public int getHighestBlockYAt(@NotNull Location location) { - - return 0; - } - - @NotNull - @Override - public Block getHighestBlockAt(int x, int z) { - - return null; - } - - @NotNull - @Override - public Block getHighestBlockAt(@NotNull Location location) { - - return null; - } - - @Override - public int getHighestBlockYAt(int x, int z, @NotNull HeightMap heightMap) { - - return 0; - } - - @Override - public int getHighestBlockYAt(@NotNull Location location, @NotNull HeightMap heightMap) { - - return 0; - } - - @NotNull - @Override - public Block getHighestBlockAt(int x, int z, @NotNull HeightMap heightMap) { - - return null; - } - - @NotNull - @Override - public Block getHighestBlockAt(@NotNull Location location, @NotNull HeightMap heightMap) { - - return null; - } - - @NotNull - @Override - public Chunk getChunkAt(int x, int z) { - - return null; - } - - @NotNull - @Override - public Chunk getChunkAt(@NotNull Location location) { - - return null; - } - - @NotNull - @Override - public Chunk getChunkAt(@NotNull Block block) { - - return null; - } - - @Override - public boolean isChunkLoaded(@NotNull Chunk chunk) { - - return false; - } - - @NotNull - @Override - public Chunk[] getLoadedChunks() { - - return null; - } - - @Override - public void loadChunk(@NotNull Chunk chunk) { - - } - - @Override - public boolean isChunkLoaded(int x, int z) { - - return false; - } - - @Override - public boolean isChunkGenerated(int x, int z) { - - return false; - } - - @Override - public boolean isChunkInUse(int x, int z) { - - return false; - } - - @Override - public void loadChunk(int x, int z) { - - } - - @Override - public boolean loadChunk(int x, int z, boolean generate) { - - return false; - } - - @Override - public boolean unloadChunk(@NotNull Chunk chunk) { - - return false; - } - - @Override - public boolean unloadChunk(int x, int z) { - - return false; - } - - @Override - public boolean unloadChunk(int x, int z, boolean save) { - - return false; - } - - @Override - public boolean unloadChunkRequest(int x, int z) { - - return false; - } - - @Override - public boolean regenerateChunk(int x, int z) { - - return false; - } - - @Override - public boolean refreshChunk(int x, int z) { - - return false; - } - - @Override - public boolean isChunkForceLoaded(int x, int z) { - - return false; - } - - @Override - public void setChunkForceLoaded(int x, int z, boolean forced) { - - } - - @NotNull - @Override - public Collection getForceLoadedChunks() { - - return null; - } - - @Override - public boolean addPluginChunkTicket(int x, int z, @NotNull Plugin plugin) { - - return false; - } - - @Override - public boolean removePluginChunkTicket(int x, int z, @NotNull Plugin plugin) { - - return false; - } - - @Override - public void removePluginChunkTickets(@NotNull Plugin plugin) { - - } - - @NotNull - @Override - public Collection getPluginChunkTickets(int x, int z) { - - return null; - } - - @NotNull - @Override - public Map> getPluginChunkTickets() { - - return null; - } - - @NotNull - @Override - public Item dropItem(@NotNull Location location, @NotNull ItemStack item) { - - return null; - } - - @NotNull - @Override - public Item dropItem(@NotNull Location location, @NotNull ItemStack itemStack, @Nullable Consumer consumer) { - return null; - } - - @NotNull - @Override - public Item dropItemNaturally(@NotNull Location location, @NotNull ItemStack item) { - - return null; - } - - @NotNull - @Override - public Item dropItemNaturally(@NotNull Location location, @NotNull ItemStack itemStack, @Nullable Consumer consumer) { - return null; - } - - @NotNull - @Override - public Arrow spawnArrow(@NotNull Location location, @NotNull Vector direction, float speed, float spread) { - - return null; - } - - @NotNull - @Override - public T spawnArrow(@NotNull Location location, @NotNull Vector direction, float speed, float spread, @NotNull Class clazz) { - - return null; - } - - @Override - public boolean generateTree(@NotNull Location location, @NotNull TreeType type) { - - return false; - } - - @Override - public boolean generateTree(@NotNull Location loc, @NotNull TreeType type, @NotNull BlockChangeDelegate delegate) { - - return false; - } - - @NotNull - @Override - public Entity spawnEntity(@NotNull Location loc, @NotNull EntityType type) { - - return null; - } - - @NotNull - @Override - public LightningStrike strikeLightning(@NotNull Location loc) { - - return null; - } - - @NotNull - @Override - public LightningStrike strikeLightningEffect(@NotNull Location loc) { - - return null; - } - - @NotNull - @Override - public List getEntities() { - - return null; - } - - @NotNull - @Override - public List getLivingEntities() { - - return null; - } - - @NotNull - @Override - public Collection getEntitiesByClass(@NotNull Class... classes) { - - return null; - } - - @NotNull - @Override - public Collection getEntitiesByClass(@NotNull Class cls) { - - return null; - } - - @NotNull - @Override - public Collection getEntitiesByClasses(@NotNull Class... classes) { - - return null; - } - - @NotNull - @Override - public List getPlayers() { - - return null; - } - - @NotNull - @Override - public Collection getNearbyEntities(@NotNull Location location, double x, double y, double z) { - - return null; - } - - @NotNull - @Override - public Collection getNearbyEntities(@NotNull Location location, double x, double y, double z, Predicate filter) { - - return null; - } - - @NotNull - @Override - public Collection getNearbyEntities(@NotNull BoundingBox boundingBox) { - - return null; - } - - @NotNull - @Override - public Collection getNearbyEntities(@NotNull BoundingBox boundingBox, Predicate filter) { - - return null; - } - - @Override - public RayTraceResult rayTraceEntities(@NotNull Location start, @NotNull Vector direction, double maxDistance) { - - return null; - } - - @Override - public RayTraceResult rayTraceEntities(@NotNull Location start, @NotNull Vector direction, double maxDistance, double raySize) { - - return null; - } - - @Override - public RayTraceResult rayTraceEntities(@NotNull Location start, @NotNull Vector direction, double maxDistance, Predicate filter) { - - return null; - } - - @Override - public RayTraceResult rayTraceEntities(@NotNull Location start, @NotNull Vector direction, double maxDistance, double raySize, Predicate filter) { - - return null; - } - - @Override - public RayTraceResult rayTraceBlocks(@NotNull Location start, @NotNull Vector direction, double maxDistance) { - - return null; - } - - @Override - public RayTraceResult rayTraceBlocks(@NotNull Location start, @NotNull Vector direction, double maxDistance, @NotNull FluidCollisionMode fluidCollisionMode) { - - return null; - } - - @Override - public RayTraceResult rayTraceBlocks(@NotNull Location start, @NotNull Vector direction, double maxDistance, @NotNull FluidCollisionMode fluidCollisionMode, boolean ignorePassableBlocks) { - - return null; - } - - @Override - public RayTraceResult rayTrace(@NotNull Location start, @NotNull Vector direction, double maxDistance, @NotNull FluidCollisionMode fluidCollisionMode, boolean ignorePassableBlocks, double raySize, Predicate filter) { - - return null; - } - - @NotNull - @Override - public String getName() { - - return null; - } - - @NotNull - @Override - public UUID getUID() { - - return null; - } - - @NotNull - @Override - public Location getSpawnLocation() { - - return null; - } - - @Override - public boolean setSpawnLocation(@NotNull Location location) { - - return false; - } - - @Override - public boolean setSpawnLocation(int i, int i1, int i2, float v) { - return false; - } - - @Override - public boolean setSpawnLocation(int x, int y, int z) { - - return false; - } - - @Override - public long getTime() { - - return 0; - } - - @Override - public void setTime(long time) { - - } - - @Override - public long getFullTime() { - - return 0; - } - - @Override - public void setFullTime(long time) { - - } - - @Override - public long getGameTime() { - return 0; - } - - @Override - public boolean hasStorm() { - - return false; - } - - @Override - public void setStorm(boolean hasStorm) { - - } - - @Override - public int getWeatherDuration() { - - return 0; - } - - @Override - public void setWeatherDuration(int duration) { - - } - - @Override - public boolean isThundering() { - - return false; - } - - @Override - public void setThundering(boolean thundering) { - - } - - @Override - public int getThunderDuration() { - - return 0; - } - - @Override - public void setThunderDuration(int duration) { - - } - - @Override - public boolean isClearWeather() { - return false; - } - - @Override - public void setClearWeatherDuration(int i) { - - } - - @Override - public int getClearWeatherDuration() { - return 0; - } - - @Override - public boolean createExplosion(double x, double y, double z, float power) { - - return false; - } - - @Override - public boolean createExplosion(double x, double y, double z, float power, boolean setFire) { - - return false; - } - - @Override - public boolean createExplosion(double x, double y, double z, float power, boolean setFire, boolean breakBlocks) { - - return false; - } - - @Override - public boolean createExplosion(double x, double y, double z, float power, boolean setFire, boolean breakBlocks, Entity source) { - - return false; - } - - @Override - public boolean createExplosion(@NotNull Location loc, float power) { - - return false; - } - - @Override - public boolean createExplosion(@NotNull Location loc, float power, boolean setFire) { - - return false; - } - - @Override - public boolean createExplosion(@NotNull Location loc, float power, boolean setFire, boolean breakBlocks) { - - return false; - } - - @Override - public boolean createExplosion(@NotNull Location loc, float power, boolean setFire, boolean breakBlocks, Entity source) { - - return false; - } - - @NotNull - @Override - public Environment getEnvironment() { - - return null; - } - - @Override - public long getSeed() { - - return 0; - } - - @Override - public boolean getPVP() { - - return false; - } - - @Override - public void setPVP(boolean pvp) { - - } - - @Override - public ChunkGenerator getGenerator() { - - return null; - } - - @Override - public void save() { - - } - - @NotNull - @Override - public List getPopulators() { - - return null; - } - - @NotNull - @Override - public T spawn(@NotNull Location location, @NotNull Class clazz) throws IllegalArgumentException { - - return null; - } - - @NotNull - @Override - public T spawn(@NotNull Location location, @NotNull Class clazz, Consumer function) throws IllegalArgumentException { - - return null; - } - - @NotNull - @Override - public FallingBlock spawnFallingBlock(@NotNull Location location, @NotNull MaterialData data) throws IllegalArgumentException { - - return null; - } - - @NotNull - @Override - public FallingBlock spawnFallingBlock(@NotNull Location location, @NotNull BlockData data) throws IllegalArgumentException { - - return null; - } - - @NotNull - @Override - public FallingBlock spawnFallingBlock(@NotNull Location location, @NotNull Material material, byte data) throws IllegalArgumentException { - - return null; - } - - @Override - public void playEffect(@NotNull Location location, @NotNull Effect effect, int data) { - - } - - @Override - public void playEffect(@NotNull Location location, @NotNull Effect effect, int data, int radius) { - - } - - @Override - public void playEffect(@NotNull Location location, @NotNull Effect effect, T data) { - - } - - @Override - public void playEffect(@NotNull Location location, @NotNull Effect effect, T data, int radius) { - - } - - @NotNull - @Override - public ChunkSnapshot getEmptyChunkSnapshot(int x, int z, boolean includeBiome, boolean includeBiomeTemp) { - - return null; - } - - @Override - public void setSpawnFlags(boolean allowMonsters, boolean allowAnimals) { - - } - - @Override - public boolean getAllowAnimals() { - - return false; - } - - @Override - public boolean getAllowMonsters() { - - return false; - } - - @NotNull - @Override - public Biome getBiome(int x, int z) { - - return null; - } - - @NotNull - @Override - public Biome getBiome(int x, int y, int z) { - - return null; - } - - @Override - public void setBiome(int x, int z, @NotNull Biome bio) { - - } - - @Override - public void setBiome(int x, int y, int z, @NotNull Biome bio) { - - } - - @Override - public double getTemperature(int x, int z) { - - return 0; - } - - @Override - public double getTemperature(int x, int y, int z) { - - return 0; - } - - @Override - public double getHumidity(int x, int z) { - - return 0; - } - - @Override - public double getHumidity(int x, int y, int z) { - - return 0; - } - - @Override - public int getMinHeight() { - return 0; - } - - @Override - public int getMaxHeight() { - - return height; - } - - @Override - public int getSeaLevel() { - - return 0; - } - - @Override - public boolean getKeepSpawnInMemory() { - - return false; - } - - @Override - public void setKeepSpawnInMemory(boolean keepLoaded) { - - } - - @Override - public boolean isAutoSave() { - - return false; - } - - @Override - public void setAutoSave(boolean value) { - - } - - @Override - public void setDifficulty(@NotNull Difficulty difficulty) { - - } - - @NotNull - @Override - public Difficulty getDifficulty() { - - return null; - } - - @NotNull - @Override - public File getWorldFolder() { - - return null; - } - - @Override - public WorldType getWorldType() { - - return null; - } - - @Override - public boolean canGenerateStructures() { - - return false; - } - - @Override - public boolean isHardcore() { - - return false; - } - - @Override - public void setHardcore(boolean hardcore) { - - } - - @Override - public long getTicksPerAnimalSpawns() { - - return 0; - } - - @Override - public void setTicksPerAnimalSpawns(int ticksPerAnimalSpawns) { - - } - - @Override - public long getTicksPerMonsterSpawns() { - - return 0; - } - - @Override - public void setTicksPerMonsterSpawns(int ticksPerMonsterSpawns) { - - } - - @Override - public long getTicksPerWaterSpawns() { - - return 0; - } - - @Override - public void setTicksPerWaterSpawns(int ticksPerWaterSpawns) { - - } - - @Override - public long getTicksPerWaterAmbientSpawns() { - - return 0; - } - - @Override - public void setTicksPerWaterAmbientSpawns(int ticksPerAmbientSpawns) { - - } - - @Override - public long getTicksPerAmbientSpawns() { - - return 0; - } - - @Override - public void setTicksPerAmbientSpawns(int ticksPerAmbientSpawns) { - - } - - @Override - public int getMonsterSpawnLimit() { - - return 0; - } - - @Override - public void setMonsterSpawnLimit(int limit) { - - } - - @Override - public int getAnimalSpawnLimit() { - - return 0; - } - - @Override - public void setAnimalSpawnLimit(int limit) { - - } - - @Override - public int getWaterAnimalSpawnLimit() { - - return 0; - } - - @Override - public void setWaterAnimalSpawnLimit(int limit) { - - } - - @Override - public int getWaterAmbientSpawnLimit() { - - return 0; - } - - @Override - public void setWaterAmbientSpawnLimit(int limit) { - - } - - @Override - public int getAmbientSpawnLimit() { - - return 0; - } - - @Override - public void setAmbientSpawnLimit(int limit) { - - } - - @Override - public void playSound(@NotNull Location location, @NotNull Sound sound, float volume, float pitch) { - - } - - @Override - public void playSound(@NotNull Location location, @NotNull String sound, float volume, float pitch) { - - } - - @Override - public void playSound(@NotNull Location location, @NotNull Sound sound, @NotNull SoundCategory category, float volume, float pitch) { - - } - - @Override - public void playSound(@NotNull Location location, @NotNull String sound, @NotNull SoundCategory category, float volume, float pitch) { - - } - - @NotNull - @Override - public String[] getGameRules() { - - return null; - } - - @Override - public String getGameRuleValue(String rule) { - - return null; - } - - @Override - public boolean setGameRuleValue(@NotNull String rule, @NotNull String value) { - - return false; - } - - @Override - public boolean isGameRule(@NotNull String rule) { - - return false; - } - - @Override - public T getGameRuleValue(@NotNull GameRule rule) { - - return null; - } - - @Override - public T getGameRuleDefault(@NotNull GameRule rule) { - - return null; - } - - @Override - public boolean setGameRule(@NotNull GameRule rule, @NotNull T newValue) { - - return false; - } - - @NotNull - @Override - public WorldBorder getWorldBorder() { - - return null; - } - - @Override - public void spawnParticle(@NotNull Particle particle, @NotNull Location location, int count) { - - } - - @Override - public void spawnParticle(@NotNull Particle particle, double x, double y, double z, int count) { - - } - - @Override - public void spawnParticle(@NotNull Particle particle, @NotNull Location location, int count, T data) { - - } - - @Override - public void spawnParticle(@NotNull Particle particle, double x, double y, double z, int count, T data) { - - } - - @Override - public void spawnParticle(@NotNull Particle particle, @NotNull Location location, int count, double offsetX, double offsetY, double offsetZ) { - - } - - @Override - public void spawnParticle(@NotNull Particle particle, double x, double y, double z, int count, double offsetX, double offsetY, double offsetZ) { - - } - - @Override - public void spawnParticle(@NotNull Particle particle, @NotNull Location location, int count, double offsetX, double offsetY, double offsetZ, T data) { - - } - - @Override - public void spawnParticle(@NotNull Particle particle, double x, double y, double z, int count, double offsetX, double offsetY, double offsetZ, T data) { - - } - - @Override - public void spawnParticle(@NotNull Particle particle, @NotNull Location location, int count, double offsetX, double offsetY, double offsetZ, double extra) { - - } - - @Override - public void spawnParticle(@NotNull Particle particle, double x, double y, double z, int count, double offsetX, double offsetY, double offsetZ, double extra) { - - } - - @Override - public void spawnParticle(@NotNull Particle particle, @NotNull Location location, int count, double offsetX, double offsetY, double offsetZ, double extra, T data) { - - } - - @Override - public void spawnParticle(@NotNull Particle particle, double x, double y, double z, int count, double offsetX, double offsetY, double offsetZ, double extra, T data) { - - } - - @Override - public void spawnParticle(@NotNull Particle particle, @NotNull Location location, int count, double offsetX, double offsetY, double offsetZ, double extra, T data, boolean force) { - - } - - @Override - public void spawnParticle(@NotNull Particle particle, double x, double y, double z, int count, double offsetX, double offsetY, double offsetZ, double extra, T data, boolean force) { - - } - - @Override - public Location locateNearestStructure(@NotNull Location origin, @NotNull StructureType structureType, int radius, boolean findUnexplored) { - return null; - } - - @Override - public int getViewDistance() { - return 0; - } - - @NotNull - @Override - public Spigot spigot() { - return null; - } - - @Override - public Raid locateNearestRaid(@NotNull Location location, int radius) { - return null; - } - - @NotNull - @Override - public List getRaids() { - return null; - } - - @Override - public DragonBattle getEnderDragonBattle() { - return null; - } -}