more removal of unnecessary settings

This commit is contained in:
CrazyDev22
2024-05-03 19:56:43 +02:00
parent 6e247597a4
commit d4f9a20379
@@ -1,447 +1,443 @@
/* /*
* Iris is a World Generator for Minecraft Bukkit Servers * Iris is a World Generator for Minecraft Bukkit Servers
* Copyright (c) 2022 Arcane Arts (Volmit Software) * Copyright (c) 2022 Arcane Arts (Volmit Software)
* *
* This program is free software: you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or * the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ */
package com.volmit.iris.engine.object; package com.volmit.iris.engine.object;
import com.volmit.iris.Iris; import com.volmit.iris.Iris;
import com.volmit.iris.core.IrisSettings; import com.volmit.iris.core.IrisSettings;
import com.volmit.iris.core.loader.IrisData; import com.volmit.iris.core.loader.IrisData;
import com.volmit.iris.core.loader.IrisRegistrant; import com.volmit.iris.core.loader.IrisRegistrant;
import com.volmit.iris.engine.data.cache.AtomicCache; import com.volmit.iris.engine.data.cache.AtomicCache;
import com.volmit.iris.engine.framework.Engine; import com.volmit.iris.engine.framework.Engine;
import com.volmit.iris.engine.object.annotations.*; import com.volmit.iris.engine.object.annotations.*;
import com.volmit.iris.util.collection.KList; import com.volmit.iris.util.collection.KList;
import com.volmit.iris.util.data.DataProvider; import com.volmit.iris.util.data.DataProvider;
import com.volmit.iris.util.data.Dimension; import com.volmit.iris.util.data.Dimension;
import com.volmit.iris.util.io.IO; import com.volmit.iris.util.io.IO;
import com.volmit.iris.util.json.JSONObject; import com.volmit.iris.util.json.JSONObject;
import com.volmit.iris.util.math.Position2; import com.volmit.iris.util.math.Position2;
import com.volmit.iris.util.math.RNG; import com.volmit.iris.util.math.RNG;
import com.volmit.iris.util.noise.CNG; import com.volmit.iris.util.noise.CNG;
import com.volmit.iris.util.plugin.VolmitSender; import com.volmit.iris.util.plugin.VolmitSender;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;
import lombok.experimental.Accessors; import lombok.experimental.Accessors;
import org.bukkit.Material; import org.bukkit.Material;
import org.bukkit.World.Environment; import org.bukkit.World.Environment;
import org.bukkit.block.data.BlockData; import org.bukkit.block.data.BlockData;
import java.io.DataInput; import java.io.DataInput;
import java.io.File; import java.io.File;
import java.io.IOException; import java.io.IOException;
@Accessors(chain = true) @Accessors(chain = true)
@AllArgsConstructor @AllArgsConstructor
@NoArgsConstructor @NoArgsConstructor
@Desc("Represents a dimension") @Desc("Represents a dimension")
@Data @Data
@EqualsAndHashCode(callSuper = false) @EqualsAndHashCode(callSuper = false)
public class IrisDimension extends IrisRegistrant { public class IrisDimension extends IrisRegistrant {
public static final BlockData STONE = Material.STONE.createBlockData(); public static final BlockData STONE = Material.STONE.createBlockData();
public static final BlockData WATER = Material.WATER.createBlockData(); public static final BlockData WATER = Material.WATER.createBlockData();
private final transient AtomicCache<Position2> parallaxSize = new AtomicCache<>(); private final transient AtomicCache<Position2> parallaxSize = new AtomicCache<>();
private final transient AtomicCache<CNG> rockLayerGenerator = new AtomicCache<>(); private final transient AtomicCache<CNG> rockLayerGenerator = new AtomicCache<>();
private final transient AtomicCache<CNG> fluidLayerGenerator = new AtomicCache<>(); private final transient AtomicCache<CNG> fluidLayerGenerator = new AtomicCache<>();
private final transient AtomicCache<CNG> coordFracture = new AtomicCache<>(); private final transient AtomicCache<CNG> coordFracture = new AtomicCache<>();
private final transient AtomicCache<Double> sinr = new AtomicCache<>(); private final transient AtomicCache<Double> sinr = new AtomicCache<>();
private final transient AtomicCache<Double> cosr = new AtomicCache<>(); private final transient AtomicCache<Double> cosr = new AtomicCache<>();
private final transient AtomicCache<Double> rad = new AtomicCache<>(); private final transient AtomicCache<Double> rad = new AtomicCache<>();
private final transient AtomicCache<Boolean> featuresUsed = new AtomicCache<>(); private final transient AtomicCache<Boolean> featuresUsed = new AtomicCache<>();
private final transient AtomicCache<KList<Position2>> strongholdsCache = new AtomicCache<>(); private final transient AtomicCache<KList<Position2>> strongholdsCache = new AtomicCache<>();
@MinNumber(2) @MinNumber(2)
@Required @Required
@Desc("The human readable name of this dimension") @Desc("The human readable name of this dimension")
private String name = "A Dimension"; private String name = "A Dimension";
@MinNumber(1) @MinNumber(1)
@MaxNumber(2032) @MaxNumber(2032)
@Desc("Maximum height at which players can be teleported to through gameplay.") @Desc("Maximum height at which players can be teleported to through gameplay.")
private int logicalHeight = 256; private int logicalHeight = 256;
@Desc("Maximum height at which players can be teleported to through gameplay.") @RegistryListResource(IrisJigsawStructure.class)
private int logicalHeightEnd = 256; @Desc("If defined, Iris will place the given jigsaw structure where minecraft should place the overworld stronghold.")
@Desc("Maximum height at which players can be teleported to through gameplay.") private String stronghold;
private int logicalHeightNether = 256; @Desc("If set to true, Iris will remove chunks to allow visualizing cross sections of chunks easily")
@RegistryListResource(IrisJigsawStructure.class) private boolean debugChunkCrossSections = false;
@Desc("If defined, Iris will place the given jigsaw structure where minecraft should place the overworld stronghold.") @Desc("Vertically split up the biome palettes with 3 air blocks in between to visualize them")
private String stronghold; private boolean explodeBiomePalettes = false;
@Desc("If set to true, Iris will remove chunks to allow visualizing cross sections of chunks easily") @Desc("Studio Mode for testing different parts of the world")
private boolean debugChunkCrossSections = false; private StudioMode studioMode = StudioMode.NORMAL;
@Desc("Vertically split up the biome palettes with 3 air blocks in between to visualize them") @MinNumber(1)
private boolean explodeBiomePalettes = false; @MaxNumber(16)
@Desc("Studio Mode for testing different parts of the world") @Desc("Customize the palette height explosion")
private StudioMode studioMode = StudioMode.NORMAL; private int explodeBiomePaletteSize = 3;
@MinNumber(1) @MinNumber(2)
@MaxNumber(16) @MaxNumber(16)
@Desc("Customize the palette height explosion") @Desc("Every X/Z % debugCrossSectionsMod == 0 cuts the chunk")
private int explodeBiomePaletteSize = 3; private int debugCrossSectionsMod = 3;
@MinNumber(2) @Desc("The average distance between strongholds")
@MaxNumber(16) private int strongholdJumpDistance = 1280;
@Desc("Every X/Z % debugCrossSectionsMod == 0 cuts the chunk") @Desc("Define the maximum strongholds to place")
private int debugCrossSectionsMod = 3; private int maxStrongholds = 14;
@Desc("The average distance between strongholds") @Desc("Tree growth override settings")
private int strongholdJumpDistance = 1280; private IrisTreeSettings treeSettings = new IrisTreeSettings();
@Desc("Define the maximum strongholds to place") @Desc("Spawn Entities in this dimension over time. Iris will continually replenish these mobs just like vanilla does.")
private int maxStrongholds = 14; @ArrayType(min = 1, type = String.class)
@Desc("Tree growth override settings") @RegistryListResource(IrisSpawner.class)
private IrisTreeSettings treeSettings = new IrisTreeSettings(); private KList<String> entitySpawners = new KList<>();
@Desc("Spawn Entities in this dimension over time. Iris will continually replenish these mobs just like vanilla does.") @Desc("Reference loot tables in this area")
@ArrayType(min = 1, type = String.class) private IrisLootReference loot = new IrisLootReference();
@RegistryListResource(IrisSpawner.class) @MinNumber(0)
private KList<String> entitySpawners = new KList<>(); @Desc("The version of this dimension. Changing this will stop users from accidentally upgrading (and breaking their worlds).")
@Desc("Reference loot tables in this area") private int version = 1;
private IrisLootReference loot = new IrisLootReference(); @ArrayType(min = 1, type = IrisBlockDrops.class)
@MinNumber(0) @Desc("Define custom block drops for this dimension")
@Desc("The version of this dimension. Changing this will stop users from accidentally upgrading (and breaking their worlds).") private KList<IrisBlockDrops> blockDrops = new KList<>();
private int version = 1; @Desc("Should bedrock be generated or not.")
@ArrayType(min = 1, type = IrisBlockDrops.class) private boolean bedrock = true;
@Desc("Define custom block drops for this dimension") @MinNumber(0)
private KList<IrisBlockDrops> blockDrops = new KList<>(); @MaxNumber(1)
@Desc("Should bedrock be generated or not.") @Desc("The land chance. Up to 1.0 for total land or 0.0 for total sea")
private boolean bedrock = true; private double landChance = 0.625;
@MinNumber(0) @Desc("The placement style of regions")
@MaxNumber(1) private IrisGeneratorStyle regionStyle = NoiseStyle.CELLULAR_IRIS_DOUBLE.style();
@Desc("The land chance. Up to 1.0 for total land or 0.0 for total sea") @Desc("The placement style of land/sea")
private double landChance = 0.625; private IrisGeneratorStyle continentalStyle = NoiseStyle.CELLULAR_IRIS_DOUBLE.style();
@Desc("The placement style of regions") @Desc("The placement style of biomes")
private IrisGeneratorStyle regionStyle = NoiseStyle.CELLULAR_IRIS_DOUBLE.style(); private IrisGeneratorStyle landBiomeStyle = NoiseStyle.CELLULAR_IRIS_DOUBLE.style();
@Desc("The placement style of land/sea") @Desc("The placement style of biomes")
private IrisGeneratorStyle continentalStyle = NoiseStyle.CELLULAR_IRIS_DOUBLE.style(); private IrisGeneratorStyle shoreBiomeStyle = NoiseStyle.CELLULAR_IRIS_DOUBLE.style();
@Desc("The placement style of biomes") @Desc("The placement style of biomes")
private IrisGeneratorStyle landBiomeStyle = NoiseStyle.CELLULAR_IRIS_DOUBLE.style(); private IrisGeneratorStyle seaBiomeStyle = NoiseStyle.CELLULAR_IRIS_DOUBLE.style();
@Desc("The placement style of biomes") @Desc("The placement style of biomes")
private IrisGeneratorStyle shoreBiomeStyle = NoiseStyle.CELLULAR_IRIS_DOUBLE.style(); private IrisGeneratorStyle caveBiomeStyle = NoiseStyle.CELLULAR_IRIS_DOUBLE.style();
@Desc("The placement style of biomes") @Desc("Instead of filling objects with air, fills them with cobweb so you can see them")
private IrisGeneratorStyle seaBiomeStyle = NoiseStyle.CELLULAR_IRIS_DOUBLE.style(); private boolean debugSmartBore = false;
@Desc("The placement style of biomes") @Desc("Generate decorations or not")
private IrisGeneratorStyle caveBiomeStyle = NoiseStyle.CELLULAR_IRIS_DOUBLE.style(); private boolean decorate = true;
@Desc("Instead of filling objects with air, fills them with cobweb so you can see them") @Desc("Use post processing or not")
private boolean debugSmartBore = false; private boolean postProcessing = true;
@Desc("Generate decorations or not") @Desc("Add slabs in post processing")
private boolean decorate = true; private boolean postProcessingSlabs = true;
@Desc("Use post processing or not") @Desc("Add painted walls in post processing")
private boolean postProcessing = true; private boolean postProcessingWalls = true;
@Desc("Add slabs in post processing") @Desc("Carving configuration for the dimension")
private boolean postProcessingSlabs = true; private IrisCarving carving = new IrisCarving();
@Desc("Add painted walls in post processing") @Desc("Configuration of fluid bodies such as rivers & lakes")
private boolean postProcessingWalls = true; private IrisFluidBodies fluidBodies = new IrisFluidBodies();
@Desc("Carving configuration for the dimension") @Desc("forceConvertTo320Height")
private IrisCarving carving = new IrisCarving(); private Boolean forceConvertTo320Height = false;
@Desc("Configuration of fluid bodies such as rivers & lakes") @Desc("The world environment")
private IrisFluidBodies fluidBodies = new IrisFluidBodies(); private Environment environment = Environment.NORMAL;
@Desc("forceConvertTo320Height") @RegistryListResource(IrisRegion.class)
private Boolean forceConvertTo320Height = false; @Required
@Desc("The world environment") @ArrayType(min = 1, type = String.class)
private Environment environment = Environment.NORMAL; @Desc("Define all of the regions to include in this dimension. Dimensions -> Regions -> Biomes -> Objects etc")
@RegistryListResource(IrisRegion.class) private KList<String> regions = new KList<>();
@Required @ArrayType(min = 1, type = IrisJigsawStructurePlacement.class)
@ArrayType(min = 1, type = String.class) @Desc("Jigsaw structures")
@Desc("Define all of the regions to include in this dimension. Dimensions -> Regions -> Biomes -> Objects etc") private KList<IrisJigsawStructurePlacement> jigsawStructures = new KList<>();
private KList<String> regions = new KList<>(); @Required
@ArrayType(min = 1, type = IrisJigsawStructurePlacement.class) @MinNumber(0)
@Desc("Jigsaw structures") @MaxNumber(1024)
private KList<IrisJigsawStructurePlacement> jigsawStructures = new KList<>(); @Desc("The fluid height for this dimension")
@Required private int fluidHeight = 63;
@MinNumber(0) @Desc("Define the min and max Y bounds of this dimension. Please keep in mind that Iris internally generates from 0 to (max - min). \n\nFor example at -64 to 320, Iris is internally generating to 0 to 384, then on outputting chunks, it shifts it down by the min height (64 blocks). The default is -64 to 320. \n\nThe fluid height is placed at (fluid height + min height). So a fluid height of 63 would actually show up in the world at 1.")
@MaxNumber(1024) private IrisRange dimensionHeight = new IrisRange(-64, 320);
@Desc("The fluid height for this dimension") @Desc("Enable smart vanilla height")
private int fluidHeight = 63; private boolean smartVanillaHeight = false;
@Desc("Define the min and max Y bounds of this dimension. Please keep in mind that Iris internally generates from 0 to (max - min). \n\nFor example at -64 to 320, Iris is internally generating to 0 to 384, then on outputting chunks, it shifts it down by the min height (64 blocks). The default is -64 to 320. \n\nThe fluid height is placed at (fluid height + min height). So a fluid height of 63 would actually show up in the world at 1.") @RegistryListResource(IrisBiome.class)
private IrisRange dimensionHeight = new IrisRange(-64, 320); @Desc("Keep this either undefined or empty. Setting any biome name into this will force iris to only generate the specified biome. Great for testing.")
@Desc("Enable smart vanilla height") private String focus = "";
private boolean smartVanillaHeight = false; @RegistryListResource(IrisRegion.class)
@RegistryListResource(IrisBiome.class) @Desc("Keep this either undefined or empty. Setting any region name into this will force iris to only generate the specified region. Great for testing.")
@Desc("Keep this either undefined or empty. Setting any biome name into this will force iris to only generate the specified biome. Great for testing.") private String focusRegion = "";
private String focus = ""; @MinNumber(0.0001)
@RegistryListResource(IrisRegion.class) @MaxNumber(512)
@Desc("Keep this either undefined or empty. Setting any region name into this will force iris to only generate the specified region. Great for testing.") @Desc("Zoom in or out the biome size. Higher = bigger biomes")
private String focusRegion = ""; private double biomeZoom = 5D;
@MinNumber(0.0001) @MinNumber(0)
@MaxNumber(512) @MaxNumber(360)
@Desc("Zoom in or out the biome size. Higher = bigger biomes") @Desc("You can rotate the input coordinates by an angle. This can make terrain appear more natural (less sharp corners and lines). This literally rotates the entire dimension by an angle. Hint: Try 12 degrees or something not on a 90 or 45 degree angle.")
private double biomeZoom = 5D; private double dimensionAngleDeg = 0;
@MinNumber(0) @Required
@MaxNumber(360) @Desc("Define the mode of this dimension (required!)")
@Desc("You can rotate the input coordinates by an angle. This can make terrain appear more natural (less sharp corners and lines). This literally rotates the entire dimension by an angle. Hint: Try 12 degrees or something not on a 90 or 45 degree angle.") private IrisDimensionMode mode = new IrisDimensionMode();
private double dimensionAngleDeg = 0; @MinNumber(0)
@Required @MaxNumber(8192)
@Desc("Define the mode of this dimension (required!)") @Desc("Coordinate fracturing applies noise to the input coordinates. This creates the 'iris swirls' and wavy features. The distance pushes these waves further into places they shouldnt be. This is a block value multiplier.")
private IrisDimensionMode mode = new IrisDimensionMode(); private double coordFractureDistance = 20;
@MinNumber(0) @MinNumber(0.0001)
@MaxNumber(8192) @MaxNumber(512)
@Desc("Coordinate fracturing applies noise to the input coordinates. This creates the 'iris swirls' and wavy features. The distance pushes these waves further into places they shouldnt be. This is a block value multiplier.") @Desc("Coordinate fracturing zoom. Higher = less frequent warping, Lower = more frequent and rapid warping / swirls.")
private double coordFractureDistance = 20; private double coordFractureZoom = 8;
@MinNumber(0.0001) @MinNumber(0.0001)
@MaxNumber(512) @MaxNumber(512)
@Desc("Coordinate fracturing zoom. Higher = less frequent warping, Lower = more frequent and rapid warping / swirls.") @Desc("This zooms in the land space")
private double coordFractureZoom = 8; private double landZoom = 1;
@MinNumber(0.0001) @MinNumber(0.0001)
@MaxNumber(512) @MaxNumber(512)
@Desc("This zooms in the land space") @Desc("This zooms oceanic biomes")
private double landZoom = 1; private double seaZoom = 1;
@MinNumber(0.0001) @MinNumber(0.0001)
@MaxNumber(512) @MaxNumber(512)
@Desc("This zooms oceanic biomes") @Desc("Zoom in continents")
private double seaZoom = 1; private double continentZoom = 1;
@MinNumber(0.0001) @MinNumber(0.0001)
@MaxNumber(512) @MaxNumber(512)
@Desc("Zoom in continents") @Desc("Change the size of regions")
private double continentZoom = 1; private double regionZoom = 1;
@MinNumber(0.0001) @Desc("Disable this to stop placing objects, entities, features & updates")
@MaxNumber(512) private boolean useMantle = true;
@Desc("Change the size of regions") @Desc("Prevent Leaf decay as if placed in creative mode")
private double regionZoom = 1; private boolean preventLeafDecay = false;
@Desc("Disable this to stop placing objects, entities, features & updates") @ArrayType(min = 1, type = IrisDepositGenerator.class)
private boolean useMantle = true; @Desc("Define global deposit generators")
@Desc("Prevent Leaf decay as if placed in creative mode") private KList<IrisDepositGenerator> deposits = new KList<>();
private boolean preventLeafDecay = false; @ArrayType(min = 1, type = IrisShapedGeneratorStyle.class)
@ArrayType(min = 1, type = IrisDepositGenerator.class) @Desc("Overlay additional noise on top of the interoplated terrain.")
@Desc("Define global deposit generators") private KList<IrisShapedGeneratorStyle> overlayNoise = new KList<>();
private KList<IrisDepositGenerator> deposits = new KList<>(); @Desc("If true, the spawner system has infinite energy. This is NOT recommended because it would allow for mobs to keep spawning over and over without a rate limit")
@ArrayType(min = 1, type = IrisShapedGeneratorStyle.class) private boolean infiniteEnergy = false;
@Desc("Overlay additional noise on top of the interoplated terrain.") @MinNumber(0)
private KList<IrisShapedGeneratorStyle> overlayNoise = new KList<>(); @MaxNumber(10000)
@Desc("If true, the spawner system has infinite energy. This is NOT recommended because it would allow for mobs to keep spawning over and over without a rate limit") @Desc("This is the maximum energy you can have in a dimension")
private boolean infiniteEnergy = false; private double maximumEnergy = 1000;
@MinNumber(0) @MinNumber(0.0001)
@MaxNumber(10000) @MaxNumber(512)
@Desc("This is the maximum energy you can have in a dimension") @Desc("The rock zoom mostly for zooming in on a wispy palette")
private double maximumEnergy = 1000; private double rockZoom = 5;
@MinNumber(0.0001) @Desc("The palette of blocks for 'stone'")
@MaxNumber(512) private IrisMaterialPalette rockPalette = new IrisMaterialPalette().qclear().qadd("stone");
@Desc("The rock zoom mostly for zooming in on a wispy palette") @Desc("The palette of blocks for 'water'")
private double rockZoom = 5; private IrisMaterialPalette fluidPalette = new IrisMaterialPalette().qclear().qadd("water");
@Desc("The palette of blocks for 'stone'") @Desc("Remove cartographers so they do not crash the server (Iris worlds only)")
private IrisMaterialPalette rockPalette = new IrisMaterialPalette().qclear().qadd("stone"); private boolean removeCartographersDueToCrash = true;
@Desc("The palette of blocks for 'water'") @Desc("Notify players of cancelled cartographer villager in this radius in blocks (set to -1 to disable, -2 for everyone)")
private IrisMaterialPalette fluidPalette = new IrisMaterialPalette().qclear().qadd("water"); private int notifyPlayersOfCartographerCancelledRadius = 30;
@Desc("Remove cartographers so they do not crash the server (Iris worlds only)") @Desc("Collection of ores to be generated")
private boolean removeCartographersDueToCrash = true; @ArrayType(type = IrisOreGenerator.class, min = 1)
@Desc("Notify players of cancelled cartographer villager in this radius in blocks (set to -1 to disable, -2 for everyone)") private KList<IrisOreGenerator> ores = new KList<>();
private int notifyPlayersOfCartographerCancelledRadius = 30; @MinNumber(0)
@Desc("Collection of ores to be generated") @MaxNumber(318)
@ArrayType(type = IrisOreGenerator.class, min = 1) @Desc("The Subterrain Fluid Layer Height")
private KList<IrisOreGenerator> ores = new KList<>(); private int caveLavaHeight = 8;
@MinNumber(0)
@MaxNumber(318) public int getMaxHeight() {
@Desc("The Subterrain Fluid Layer Height") return (int) getDimensionHeight().getMax();
private int caveLavaHeight = 8; }
public int getMaxHeight() { public int getMinHeight() {
return (int) getDimensionHeight().getMax(); return (int) getDimensionHeight().getMin();
} }
public int getMinHeight() { public BlockData generateOres(int x, int y, int z, RNG rng, IrisData data) {
return (int) getDimensionHeight().getMin(); if (ores.isEmpty()) {
} return null;
}
public BlockData generateOres(int x, int y, int z, RNG rng, IrisData data) { BlockData b = null;
if (ores.isEmpty()) { for (IrisOreGenerator i : ores) {
return null;
} b = i.generate(x, y, z, rng, data);
BlockData b = null; if (b != null) {
for (IrisOreGenerator i : ores) { return b;
}
b = i.generate(x, y, z, rng, data); }
if (b != null) { return null;
return b; }
}
} public KList<Position2> getStrongholds(long seed) {
return null; return strongholdsCache.aquire(() -> {
} KList<Position2> pos = new KList<>();
int jump = strongholdJumpDistance;
public KList<Position2> getStrongholds(long seed) { RNG rng = new RNG((seed * 223) + 12945);
return strongholdsCache.aquire(() -> { for (int i = 0; i < maxStrongholds + 1; i++) {
KList<Position2> pos = new KList<>(); int m = i + 1;
int jump = strongholdJumpDistance; pos.add(new Position2(
RNG rng = new RNG((seed * 223) + 12945); (int) ((rng.i(jump * i) + (jump * i)) * (rng.b() ? -1D : 1D)),
for (int i = 0; i < maxStrongholds + 1; i++) { (int) ((rng.i(jump * i) + (jump * i)) * (rng.b() ? -1D : 1D))
int m = i + 1; ));
pos.add(new Position2( }
(int) ((rng.i(jump * i) + (jump * i)) * (rng.b() ? -1D : 1D)),
(int) ((rng.i(jump * i) + (jump * i)) * (rng.b() ? -1D : 1D)) pos.remove(0);
));
} return pos;
});
pos.remove(0); }
return pos; public int getFluidHeight() {
}); return fluidHeight - (int) dimensionHeight.getMin();
} }
public int getFluidHeight() { public CNG getCoordFracture(RNG rng, int signature) {
return fluidHeight - (int) dimensionHeight.getMin(); return coordFracture.aquire(() ->
} {
CNG coordFracture = CNG.signature(rng.nextParallelRNG(signature));
public CNG getCoordFracture(RNG rng, int signature) { coordFracture.scale(0.012 / coordFractureZoom);
return coordFracture.aquire(() -> return coordFracture;
{ });
CNG coordFracture = CNG.signature(rng.nextParallelRNG(signature)); }
coordFracture.scale(0.012 / coordFractureZoom);
return coordFracture; public double getDimensionAngle() {
}); return rad.aquire(() -> Math.toRadians(dimensionAngleDeg));
} }
public double getDimensionAngle() { public Environment getEnvironment() {
return rad.aquire(() -> Math.toRadians(dimensionAngleDeg)); return environment;
} }
public Environment getEnvironment() { public IrisRange getDimensionHeight() {
return environment; return smartVanillaHeight ? new IrisRange(-64, 320) : dimensionHeight;
} }
public IrisRange getDimensionHeight() { public boolean hasFocusRegion() {
return smartVanillaHeight ? new IrisRange(-64, 320) : dimensionHeight; return !focusRegion.equals("");
} }
public boolean hasFocusRegion() { public String getFocusRegion() {
return !focusRegion.equals(""); return focusRegion;
} }
public String getFocusRegion() { public double sinRotate() {
return focusRegion; return sinr.aquire(() -> Math.sin(getDimensionAngle()));
} }
public double sinRotate() { public double cosRotate() {
return sinr.aquire(() -> Math.sin(getDimensionAngle())); return cosr.aquire(() -> Math.cos(getDimensionAngle()));
} }
public double cosRotate() { public KList<IrisRegion> getAllRegions(DataProvider g) {
return cosr.aquire(() -> Math.cos(getDimensionAngle())); KList<IrisRegion> r = new KList<>();
}
for (String i : getRegions()) {
public KList<IrisRegion> getAllRegions(DataProvider g) { r.add(g.getData().getRegionLoader().load(i));
KList<IrisRegion> r = new KList<>(); }
for (String i : getRegions()) { return r;
r.add(g.getData().getRegionLoader().load(i)); }
}
public KList<IrisRegion> getAllAnyRegions() {
return r; KList<IrisRegion> r = new KList<>();
}
for (String i : getRegions()) {
public KList<IrisRegion> getAllAnyRegions() { r.add(IrisData.loadAnyRegion(i));
KList<IrisRegion> r = new KList<>(); }
for (String i : getRegions()) { return r;
r.add(IrisData.loadAnyRegion(i)); }
}
public KList<IrisBiome> getAllBiomes(DataProvider g) {
return r; return g.getData().getBiomeLoader().loadAll(g.getData().getBiomeLoader().getPossibleKeys());
} }
public KList<IrisBiome> getAllBiomes(DataProvider g) { public KList<IrisBiome> getAllAnyBiomes() {
return g.getData().getBiomeLoader().loadAll(g.getData().getBiomeLoader().getPossibleKeys()); KList<IrisBiome> r = new KList<>();
}
for (IrisRegion i : getAllAnyRegions()) {
public KList<IrisBiome> getAllAnyBiomes() { if (i == null) {
KList<IrisBiome> r = new KList<>(); continue;
}
for (IrisRegion i : getAllAnyRegions()) {
if (i == null) { r.addAll(i.getAllAnyBiomes());
continue; }
}
return r;
r.addAll(i.getAllAnyBiomes()); }
}
public IrisGeneratorStyle getBiomeStyle(InferredType type) {
return r; switch (type) {
} case CAVE:
return caveBiomeStyle;
public IrisGeneratorStyle getBiomeStyle(InferredType type) { case LAND:
switch (type) { return landBiomeStyle;
case CAVE: case SEA:
return caveBiomeStyle; return seaBiomeStyle;
case LAND: case SHORE:
return landBiomeStyle; return shoreBiomeStyle;
case SEA: default:
return seaBiomeStyle; break;
case SHORE: }
return shoreBiomeStyle;
default: return landBiomeStyle;
break; }
}
public boolean installDataPack(DataProvider data, File datapacks) {
return landBiomeStyle; boolean write = false;
} boolean changed = false;
public boolean installDataPack(DataProvider data, File datapacks) { IO.delete(new File(datapacks, "iris/data/" + getLoadKey().toLowerCase()));
boolean write = false;
boolean changed = false; for (IrisBiome i : getAllBiomes(data)) {
if (i.isCustom()) {
IO.delete(new File(datapacks, "iris/data/" + getLoadKey().toLowerCase())); write = true;
for (IrisBiome i : getAllBiomes(data)) { for (IrisBiomeCustom j : i.getCustomDerivitives()) {
if (i.isCustom()) { File output = new File(datapacks, "iris/data/" + getLoadKey().toLowerCase() + "/worldgen/biome/" + j.getId() + ".json");
write = true;
if (!output.exists()) {
for (IrisBiomeCustom j : i.getCustomDerivitives()) { changed = true;
File output = new File(datapacks, "iris/data/" + getLoadKey().toLowerCase() + "/worldgen/biome/" + j.getId() + ".json"); }
if (!output.exists()) { Iris.verbose(" Installing Data Pack Biome: " + output.getPath());
changed = true; output.getParentFile().mkdirs();
} try {
IO.writeAll(output, j.generateJson());
Iris.verbose(" Installing Data Pack Biome: " + output.getPath()); } catch (IOException e) {
output.getParentFile().mkdirs(); Iris.reportError(e);
try { e.printStackTrace();
IO.writeAll(output, j.generateJson()); }
} catch (IOException e) { }
Iris.reportError(e); }
e.printStackTrace(); }
}
} if (write) {
} File mcm = new File(datapacks, "iris/pack.mcmeta");
} try {
IO.writeAll(mcm, """
if (write) { {
File mcm = new File(datapacks, "iris/pack.mcmeta"); "pack": {
try { "description": "Iris Data Pack. This pack contains all installed Iris Packs' resources.",
IO.writeAll(mcm, """ "pack_format": 10
{ }
"pack": { }
"description": "Iris Data Pack. This pack contains all installed Iris Packs' resources.", """);
"pack_format": 10 } catch (IOException e) {
} Iris.reportError(e);
} e.printStackTrace();
"""); }
} catch (IOException e) { Iris.verbose(" Installing Data Pack MCMeta: " + mcm.getPath());
Iris.reportError(e); }
e.printStackTrace();
} return changed;
Iris.verbose(" Installing Data Pack MCMeta: " + mcm.getPath()); }
}
@Override
return changed; public String getFolderName() {
} return "dimensions";
}
@Override
public String getFolderName() { @Override
return "dimensions"; public String getTypeName() {
} return "Dimension";
}
@Override
public String getTypeName() { @Override
return "Dimension"; public void scanForErrors(JSONObject p, VolmitSender sender) {
}
}
@Override }
public void scanForErrors(JSONObject p, VolmitSender sender) {
}
}