9
0
mirror of https://github.com/VolmitSoftware/Iris.git synced 2025-12-28 03:29:06 +00:00
This commit is contained in:
cyberpwn
2021-09-08 08:46:25 -04:00
parent 0c8c7157f6
commit d25633e213
233 changed files with 5791 additions and 5553 deletions

View File

@@ -23,7 +23,13 @@ import com.volmit.iris.Iris;
import com.volmit.iris.core.loader.IrisData;
import com.volmit.iris.engine.data.cache.Cache;
import com.volmit.iris.engine.framework.Engine;
import com.volmit.iris.engine.object.*;
import com.volmit.iris.engine.object.InferredType;
import com.volmit.iris.engine.object.IrisBiome;
import com.volmit.iris.engine.object.IrisDecorationPart;
import com.volmit.iris.engine.object.IrisDecorator;
import com.volmit.iris.engine.object.IrisFeaturePositional;
import com.volmit.iris.engine.object.IrisGenerator;
import com.volmit.iris.engine.object.IrisRegion;
import com.volmit.iris.util.collection.KList;
import com.volmit.iris.util.collection.KMap;
import com.volmit.iris.util.data.DataProvider;
@@ -41,11 +47,11 @@ import java.util.UUID;
@Data
public class IrisComplex implements DataProvider {
private static final BlockData AIR = Material.AIR.createBlockData();
private RNG rng;
private double fluidHeight;
private IrisData data;
private KList<IrisGenerator> generators;
private static final BlockData AIR = Material.AIR.createBlockData();
private ProceduralStream<IrisRegion> regionStream;
private ProceduralStream<Double> regionStyleStream;
private ProceduralStream<Double> regionIdentityStream;
@@ -81,24 +87,6 @@ public class IrisComplex implements DataProvider {
private ProceduralStream<BlockData> fluidStream;
private IrisBiome focus;
public ProceduralStream<IrisBiome> getBiomeStream(InferredType type) {
switch (type) {
case CAVE:
return caveBiomeStream;
case LAND:
return landBiomeStream;
case SEA:
return seaBiomeStream;
case SHORE:
return shoreBiomeStream;
case DEFER:
default:
break;
}
return null;
}
public IrisComplex(Engine engine) {
this(engine, false);
}
@@ -316,6 +304,24 @@ public class IrisComplex implements DataProvider {
//@done
}
public ProceduralStream<IrisBiome> getBiomeStream(InferredType type) {
switch (type) {
case CAVE:
return caveBiomeStream;
case LAND:
return landBiomeStream;
case SEA:
return seaBiomeStream;
case SHORE:
return shoreBiomeStream;
case DEFER:
default:
break;
}
return null;
}
private IrisRegion findRegion(IrisBiome focus, Engine engine) {
for (IrisRegion i : engine.getDimension().getAllRegions(engine)) {
if (i.getAllBiomeIds().contains(focus.getLoadKey())) {
@@ -327,7 +333,7 @@ public class IrisComplex implements DataProvider {
}
private IrisDecorator decorateFor(IrisBiome b, double x, double z, IrisDecorationPart part) {
RNG rngc = new RNG(Cache.key(((int)x), ((int)z)));
RNG rngc = new RNG(Cache.key(((int) x), ((int) z)));
for (IrisDecorator i : b.getDecorators()) {
if (!i.getPartOf().equals(part)) {

View File

@@ -29,14 +29,25 @@ import com.volmit.iris.engine.actuator.IrisBiomeActuator;
import com.volmit.iris.engine.actuator.IrisDecorantActuator;
import com.volmit.iris.engine.actuator.IrisTerrainNormalActuator;
import com.volmit.iris.engine.data.cache.AtomicCache;
import com.volmit.iris.engine.framework.*;
import com.volmit.iris.engine.framework.Engine;
import com.volmit.iris.engine.framework.EngineEffects;
import com.volmit.iris.engine.framework.EngineMetrics;
import com.volmit.iris.engine.framework.EngineStage;
import com.volmit.iris.engine.framework.EngineTarget;
import com.volmit.iris.engine.framework.EngineWorldManager;
import com.volmit.iris.engine.framework.SeedManager;
import com.volmit.iris.engine.framework.WrongEngineBroException;
import com.volmit.iris.engine.mantle.EngineMantle;
import com.volmit.iris.engine.modifier.IrisBodyModifier;
import com.volmit.iris.engine.modifier.IrisCarveModifier;
import com.volmit.iris.engine.modifier.IrisDepositModifier;
import com.volmit.iris.engine.modifier.IrisPerfectionModifier;
import com.volmit.iris.engine.modifier.IrisPostModifier;
import com.volmit.iris.engine.object.*;
import com.volmit.iris.engine.object.IrisBiome;
import com.volmit.iris.engine.object.IrisBiomePaletteLayer;
import com.volmit.iris.engine.object.IrisDecorator;
import com.volmit.iris.engine.object.IrisEngineData;
import com.volmit.iris.engine.object.IrisObjectPlacement;
import com.volmit.iris.engine.scripting.EngineExecutionEnvironment;
import com.volmit.iris.util.atomics.AtomicRollingSequence;
import com.volmit.iris.util.collection.KList;
@@ -75,30 +86,30 @@ public class IrisEngine implements Engine {
private final AtomicLong lastGPS;
private final EngineTarget target;
private final IrisContext context;
private EngineEffects effects;
private final EngineMantle mantle;
private final ChronoLatch perSecondLatch;
private final ChronoLatch perSecondBudLatch;
private EngineExecutionEnvironment execution;
private EngineWorldManager worldManager;
private volatile int parallelism;
private final EngineMetrics metrics;
private volatile int minHeight;
private final boolean studio;
private boolean failing;
private boolean closed;
private int cacheId;
private final KList<EngineStage> stages;
private final AtomicRollingSequence wallClock;
private final int art;
private double maxBiomeObjectDensity;
private double maxBiomeLayerDensity;
private double maxBiomeDecoratorDensity;
private IrisComplex complex;
private final AtomicCache<IrisEngineData> engineData = new AtomicCache<>();
private final AtomicBoolean cleaning;
private final ChronoLatch cleanLatch;
private final SeedManager seedManager;
private EngineEffects effects;
private EngineExecutionEnvironment execution;
private EngineWorldManager worldManager;
private volatile int parallelism;
private volatile int minHeight;
private boolean failing;
private boolean closed;
private int cacheId;
private double maxBiomeObjectDensity;
private double maxBiomeLayerDensity;
private double maxBiomeDecoratorDensity;
private IrisComplex complex;
public IrisEngine(EngineTarget target, boolean studio) {
this.studio = studio;
@@ -134,8 +145,7 @@ public class IrisEngine implements Engine {
}
private void verifySeed() {
if(getEngineData().getSeed() != null && getEngineData().getSeed() != target.getWorld().getRawWorldSeed())
{
if (getEngineData().getSeed() != null && getEngineData().getSeed() != target.getWorld().getRawWorldSeed()) {
target.getWorld().setRawWorldSeed(getEngineData().getSeed());
}
}
@@ -447,8 +457,7 @@ public class IrisEngine implements Engine {
}
}
} else {
for(EngineStage i : stages)
{
for (EngineStage i : stages) {
i.generate(x, z, blocks, vbiomes, multicore);
}
}

View File

@@ -23,8 +23,19 @@ import com.volmit.iris.engine.data.cache.AtomicCache;
import com.volmit.iris.engine.framework.Engine;
import com.volmit.iris.engine.mantle.EngineMantle;
import com.volmit.iris.engine.mantle.MantleComponent;
import com.volmit.iris.engine.mantle.components.*;
import com.volmit.iris.engine.object.*;
import com.volmit.iris.engine.mantle.components.MantleCarvingComponent;
import com.volmit.iris.engine.mantle.components.MantleFeatureComponent;
import com.volmit.iris.engine.mantle.components.MantleFluidBodyComponent;
import com.volmit.iris.engine.mantle.components.MantleJigsawComponent;
import com.volmit.iris.engine.mantle.components.MantleObjectComponent;
import com.volmit.iris.engine.object.IrisBiome;
import com.volmit.iris.engine.object.IrisDepositGenerator;
import com.volmit.iris.engine.object.IrisFeaturePotential;
import com.volmit.iris.engine.object.IrisJigsawStructurePlacement;
import com.volmit.iris.engine.object.IrisObject;
import com.volmit.iris.engine.object.IrisObjectPlacement;
import com.volmit.iris.engine.object.IrisObjectScale;
import com.volmit.iris.engine.object.IrisRegion;
import com.volmit.iris.util.collection.KList;
import com.volmit.iris.util.collection.KMap;
import com.volmit.iris.util.collection.KSet;

View File

@@ -22,7 +22,15 @@ import com.volmit.iris.Iris;
import com.volmit.iris.engine.data.cache.Cache;
import com.volmit.iris.engine.framework.Engine;
import com.volmit.iris.engine.framework.EngineAssignedWorldManager;
import com.volmit.iris.engine.object.*;
import com.volmit.iris.engine.object.IRare;
import com.volmit.iris.engine.object.IrisBiome;
import com.volmit.iris.engine.object.IrisBlockDrops;
import com.volmit.iris.engine.object.IrisEngineChunkData;
import com.volmit.iris.engine.object.IrisEngineData;
import com.volmit.iris.engine.object.IrisEngineSpawnerCooldown;
import com.volmit.iris.engine.object.IrisEntitySpawn;
import com.volmit.iris.engine.object.IrisRegion;
import com.volmit.iris.engine.object.IrisSpawner;
import com.volmit.iris.util.collection.KList;
import com.volmit.iris.util.collection.KMap;
import com.volmit.iris.util.format.Form;
@@ -56,13 +64,13 @@ public class IrisWorldManager extends EngineAssignedWorldManager {
private final int id;
private final KMap<Long, Long> chunkCooldowns;
private final KList<Runnable> updateQueue = new KList<>();
private double energy = 25;
private int entityCount = 0;
private final ChronoLatch cl;
private final ChronoLatch clw;
private final ChronoLatch ecl;
private final ChronoLatch cln;
private final ChronoLatch chunkUpdater;
private double energy = 25;
private int entityCount = 0;
private long charge = 0;
private int actuallySpawned = 0;
private int cooldown = 0;

View File

@@ -18,7 +18,11 @@
package com.volmit.iris.engine.actuator;
import com.volmit.iris.engine.decorator.*;
import com.volmit.iris.engine.decorator.IrisCeilingDecorator;
import com.volmit.iris.engine.decorator.IrisSeaFloorDecorator;
import com.volmit.iris.engine.decorator.IrisSeaSurfaceDecorator;
import com.volmit.iris.engine.decorator.IrisShoreLineDecorator;
import com.volmit.iris.engine.decorator.IrisSurfaceDecorator;
import com.volmit.iris.engine.framework.Engine;
import com.volmit.iris.engine.framework.EngineAssignedActuator;
import com.volmit.iris.engine.framework.EngineDecorator;

View File

@@ -25,10 +25,6 @@ public interface Cache<V> {
return key(chunk.getX(), chunk.getZ());
}
int getId();
V get(int x, int z);
static long key(int x, int z) {
return (((long) x) << 32) | (z & 0xffffffffL);
}
@@ -52,4 +48,8 @@ public interface Cache<V> {
final int x = idx % w;
return new int[]{x, y, z};
}
int getId();
V get(int x, int z);
}

View File

@@ -34,8 +34,8 @@ import org.bukkit.material.MaterialData;
@SuppressWarnings("deprecation")
public class LinkedTerrainChunk implements TerrainChunk {
private final IrisBiomeStorage biome3D;
private ChunkData rawChunkData;
private final BiomeGrid storage;
private ChunkData rawChunkData;
@Setter
private boolean unsafe = false;

View File

@@ -46,18 +46,11 @@ public class MCATerrainChunk implements TerrainChunk {
return injector;
}
@Override
public void setRaw(ChunkGenerator.ChunkData data) {
}
@Override
public Biome getBiome(int x, int z) {
return Biome.THE_VOID;
}
@Override
public Biome getBiome(int x, int y, int z) {
return Biome.THE_VOID;
@@ -99,7 +92,6 @@ public class MCATerrainChunk implements TerrainChunk {
mcaChunk.setBlockStateAt(xx, y, zz, NBTWorld.getCompound(blockData), false);
}
@Override
public org.bukkit.block.data.BlockData getBlockData(int x, int y, int z) {
if (y > getMaxHeight()) {
@@ -118,6 +110,11 @@ public class MCATerrainChunk implements TerrainChunk {
return null;
}
@Override
public void setRaw(ChunkGenerator.ChunkData data) {
}
@Override
public void inject(ChunkGenerator.BiomeGrid biome) {

View File

@@ -46,8 +46,6 @@ public interface TerrainChunk extends BiomeGrid, ChunkData {
BiomeBaseInjector getBiomeBaseInjector();
void setRaw(ChunkData data);
/**
* Get biome at x, z within chunk being generated
*
@@ -129,5 +127,7 @@ public interface TerrainChunk extends BiomeGrid, ChunkData {
ChunkData getRaw();
void setRaw(ChunkData data);
void inject(BiomeGrid biome);
}

View File

@@ -18,7 +18,12 @@
package com.volmit.iris.engine.data.io;
import java.io.*;
import java.io.BufferedInputStream;
import java.io.ByteArrayInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
public interface Deserializer<T> {

View File

@@ -18,7 +18,12 @@
package com.volmit.iris.engine.data.io;
import java.io.*;
import java.io.BufferedOutputStream;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;
public interface Serializer<T> {

View File

@@ -18,7 +18,13 @@
package com.volmit.iris.engine.data.io;
import java.io.*;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.Reader;
import java.io.StringReader;
public interface StringDeserializer<T> extends Deserializer<T> {

View File

@@ -18,7 +18,13 @@
package com.volmit.iris.engine.data.io;
import java.io.*;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.io.OutputStream;
import java.io.OutputStreamWriter;
import java.io.StringWriter;
import java.io.Writer;
public interface StringSerializer<T> extends Serializer<T> {

View File

@@ -26,7 +26,18 @@ import com.volmit.iris.engine.IrisComplex;
import com.volmit.iris.engine.data.cache.Cache;
import com.volmit.iris.engine.data.chunk.TerrainChunk;
import com.volmit.iris.engine.mantle.EngineMantle;
import com.volmit.iris.engine.object.*;
import com.volmit.iris.engine.object.InventorySlotType;
import com.volmit.iris.engine.object.IrisBiome;
import com.volmit.iris.engine.object.IrisColor;
import com.volmit.iris.engine.object.IrisDimension;
import com.volmit.iris.engine.object.IrisEngineData;
import com.volmit.iris.engine.object.IrisLootMode;
import com.volmit.iris.engine.object.IrisLootReference;
import com.volmit.iris.engine.object.IrisLootTable;
import com.volmit.iris.engine.object.IrisObjectPlacement;
import com.volmit.iris.engine.object.IrisPosition;
import com.volmit.iris.engine.object.IrisRegion;
import com.volmit.iris.engine.object.IrisWorld;
import com.volmit.iris.engine.scripting.EngineExecutionEnvironment;
import com.volmit.iris.util.collection.KList;
import com.volmit.iris.util.collection.KMap;
@@ -63,7 +74,7 @@ import org.bukkit.inventory.Inventory;
import org.bukkit.inventory.InventoryHolder;
import org.bukkit.inventory.ItemStack;
import java.awt.*;
import java.awt.Color;
import java.util.Arrays;
import java.util.UUID;
import java.util.concurrent.atomic.AtomicBoolean;
@@ -75,7 +86,7 @@ import java.util.function.Consumer;
public interface Engine extends DataProvider, Fallible, LootProvider, BlockUpdater, Renderer, Hotloadable {
KList<EngineStage> getStages();
public void registerStage(EngineStage stage);
void registerStage(EngineStage stage);
IrisComplex getComplex();
@@ -107,22 +118,22 @@ public interface Engine extends DataProvider, Fallible, LootProvider, BlockUpdat
EngineWorldManager getWorldManager();
void setParallelism(int parallelism);
default UUID getBiomeID(int x, int z) {
return getComplex().getBaseBiomeIDStream().get(x, z);
}
int getParallelism();
EngineTarget getTarget();
void setParallelism(int parallelism);
void setMinHeight(int min);
EngineTarget getTarget();
default int getMinHeight() {
return getTarget().getWorld().minHeight();
}
void setMinHeight(int min);
@BlockCoordinates
double modifyX(double x);

View File

@@ -34,16 +34,6 @@ public class EngineData {
private String lastVersion;
private List<IrisPosition> strongholdPositions;
public void save(File f) {
try {
f.getParentFile().mkdirs();
IO.writeAll(f, new Gson().toJson(this));
} catch (IOException e) {
Iris.reportError(e);
e.printStackTrace();
}
}
public static EngineData load(File f) {
try {
f.getParentFile().mkdirs();
@@ -55,4 +45,14 @@ public class EngineData {
return new EngineData();
}
public void save(File f) {
try {
f.getParentFile().mkdirs();
IO.writeAll(f, new Gson().toJson(this));
} catch (IOException e) {
Iris.reportError(e);
e.printStackTrace();
}
}
}

View File

@@ -28,8 +28,7 @@ public interface EngineStage {
void generate(int x, int z, Hunk<BlockData> blocks, Hunk<Biome> biomes, boolean multicore);
default void close() {
if(this instanceof EngineComponent c)
{
if (this instanceof EngineComponent c) {
c.close();
}
}

View File

@@ -27,9 +27,9 @@ import lombok.Data;
@Data
public class EngineTarget {
private final MultiBurst burster;
private final IrisData data;
private IrisDimension dimension;
private IrisWorld world;
private final IrisData data;
public EngineTarget(IrisWorld world, IrisDimension dimension, IrisData data) {
this.world = world;

View File

@@ -23,19 +23,14 @@ import com.volmit.iris.util.math.RNG;
import com.volmit.iris.util.noise.CNG;
import lombok.AccessLevel;
import lombok.Data;
import lombok.Getter;
import lombok.Setter;
@Data
public class SeedManager
{
public class SeedManager {
////////////////////////////////////////////////////////////////////
private static final String IRIS_SIGNATURE = "Iris World Generator";
private static final long IRIS_TERRAIN_VERSION = 1;
////////////////////////////////////////////////////////////////////
@Setter(AccessLevel.NONE)
private long fullMixedSeed;
private final RNG rlock;
private final CNG soup;
private final long seed;
@@ -56,9 +51,10 @@ public class SeedManager
private final long deposit;
private final long post;
private final long bodies;
@Setter(AccessLevel.NONE)
private long fullMixedSeed;
public SeedManager(long seed)
{
public SeedManager(long seed) {
soup = createSoup(seed);
rlock = new RNG(Double.doubleToLongBits(soup.fitDouble(Double.MIN_VALUE, Double.MAX_VALUE, seed + 1337, seed * 69, seed)));
this.seed = seed;
@@ -81,8 +77,7 @@ public class SeedManager
bodies = of("bodies");
}
private long of(String name)
{
private long of(String name) {
RNG rng = new RNG(name + IRIS_SIGNATURE + "::" + IRIS_TERRAIN_VERSION + ((seed + rlock.imax()) * rlock.lmax()));
long f = rlock.imax() * ((rlock.chance(0.5) ? 1 : -1) * (name.hashCode() + Double.doubleToLongBits(soup.fitDouble(Double.MIN_VALUE, Double.MAX_VALUE, rng.imax(), rng.imax(), rng.imax()))));
fullMixedSeed += (f * rlock.imax());
@@ -97,8 +92,7 @@ public class SeedManager
RNG e = new RNG((IRIS_TERRAIN_VERSION * 42) + IRIS_SIGNATURE);
double gsoup = 0;
int gk = a.i(1_000, 10_000);
for(char i : (a.s(4) + b.s(4) + c.s(4) + d.s(4) + e.s(4)).toCharArray())
{
for (char i : (a.s(4) + b.s(4) + c.s(4) + d.s(4) + e.s(4)).toCharArray()) {
gsoup += ((gk * b.d(3, Math.PI)) / c.d(10, 18 * Math.E)) + 6_549;
gsoup *= d.d(90.5, 1_234_567);
gsoup += e.d(39.95, 99.25);

View File

@@ -21,7 +21,16 @@ package com.volmit.iris.engine.jigsaw;
import com.volmit.iris.core.loader.IrisData;
import com.volmit.iris.core.tools.IrisToolbelt;
import com.volmit.iris.engine.framework.Engine;
import com.volmit.iris.engine.object.*;
import com.volmit.iris.engine.object.IObjectPlacer;
import com.volmit.iris.engine.object.InventorySlotType;
import com.volmit.iris.engine.object.IrisJigsawPiece;
import com.volmit.iris.engine.object.IrisJigsawPieceConnector;
import com.volmit.iris.engine.object.IrisLootTable;
import com.volmit.iris.engine.object.IrisObject;
import com.volmit.iris.engine.object.IrisObjectRotation;
import com.volmit.iris.engine.object.IrisObjectTranslate;
import com.volmit.iris.engine.object.IrisPosition;
import com.volmit.iris.engine.object.TileData;
import com.volmit.iris.engine.platform.PlatformChunkGenerator;
import com.volmit.iris.util.collection.KList;
import com.volmit.iris.util.math.AxisAlignedBB;

View File

@@ -22,7 +22,19 @@ import com.googlecode.concurrentlinkedhashmap.ConcurrentLinkedHashMap;
import com.volmit.iris.Iris;
import com.volmit.iris.core.loader.IrisData;
import com.volmit.iris.engine.data.cache.Cache;
import com.volmit.iris.engine.object.*;
import com.volmit.iris.engine.object.IObjectPlacer;
import com.volmit.iris.engine.object.IrisDirection;
import com.volmit.iris.engine.object.IrisFeature;
import com.volmit.iris.engine.object.IrisFeaturePositional;
import com.volmit.iris.engine.object.IrisFeaturePotential;
import com.volmit.iris.engine.object.IrisJigsawPiece;
import com.volmit.iris.engine.object.IrisJigsawPieceConnector;
import com.volmit.iris.engine.object.IrisJigsawStructure;
import com.volmit.iris.engine.object.IrisObject;
import com.volmit.iris.engine.object.IrisObjectPlacement;
import com.volmit.iris.engine.object.IrisObjectRotation;
import com.volmit.iris.engine.object.IrisPosition;
import com.volmit.iris.engine.object.ObjectPlaceMode;
import com.volmit.iris.util.collection.KList;
import com.volmit.iris.util.interpolation.InterpolationMethod;
import com.volmit.iris.util.mantle.Mantle;
@@ -35,6 +47,12 @@ import java.util.function.Consumer;
@Data
public class PlannedStructure {
private static transient ConcurrentLinkedHashMap<String, IrisObject> objectRotationCache
= new ConcurrentLinkedHashMap.Builder<String, IrisObject>()
.initialCapacity(64)
.maximumWeightedCapacity(1024)
.concurrencyLevel(32)
.build();
private KList<PlannedPiece> pieces;
private IrisJigsawStructure structure;
private IrisPosition position;
@@ -42,12 +60,6 @@ public class PlannedStructure {
private RNG rng;
private boolean verbose;
private boolean terminating;
private static transient ConcurrentLinkedHashMap<String, IrisObject> objectRotationCache
= new ConcurrentLinkedHashMap.Builder<String, IrisObject>()
.initialCapacity(64)
.maximumWeightedCapacity(1024)
.concurrencyLevel(32)
.build();
public PlannedStructure(IrisJigsawStructure structure, IrisPosition position, RNG rng) {
terminating = false;
@@ -137,12 +149,9 @@ public class PlannedStructure {
e.set(xx, 0, zz, new IrisFeaturePositional(xx, zz, f));
}
if(options.getAddFeatures().isNotEmpty())
{
for (IrisFeaturePotential j : options.getAddFeatures())
{
if(rngf.nextInt(j.getRarity()) == 0)
{
if (options.getAddFeatures().isNotEmpty()) {
for (IrisFeaturePotential j : options.getAddFeatures()) {
if (rngf.nextInt(j.getRarity()) == 0) {
e.set(xx, 0, zz, new IrisFeaturePositional(xx, zz, j.getZone()));
}
}

View File

@@ -23,7 +23,11 @@ import com.volmit.iris.core.loader.IrisData;
import com.volmit.iris.engine.IrisComplex;
import com.volmit.iris.engine.framework.Engine;
import com.volmit.iris.engine.framework.EngineTarget;
import com.volmit.iris.engine.object.*;
import com.volmit.iris.engine.object.IObjectPlacer;
import com.volmit.iris.engine.object.IrisDimension;
import com.volmit.iris.engine.object.IrisFeaturePositional;
import com.volmit.iris.engine.object.IrisPosition;
import com.volmit.iris.engine.object.TileData;
import com.volmit.iris.util.collection.KList;
import com.volmit.iris.util.data.B;
import com.volmit.iris.util.documentation.BlockCoordinates;

View File

@@ -65,6 +65,62 @@ public class MantleWriter implements IObjectPlacer {
}
}
private static Set<IrisPosition> getBallooned(Set<IrisPosition> vset, double radius) {
Set<IrisPosition> returnset = new HashSet<>();
int ceilrad = (int) Math.ceil(radius);
for (IrisPosition v : vset) {
int tipx = v.getX();
int tipy = v.getY();
int tipz = v.getZ();
for (int loopx = tipx - ceilrad; loopx <= tipx + ceilrad; loopx++) {
for (int loopy = tipy - ceilrad; loopy <= tipy + ceilrad; loopy++) {
for (int loopz = tipz - ceilrad; loopz <= tipz + ceilrad; loopz++) {
if (hypot(loopx - tipx, loopy - tipy, loopz - tipz) <= radius) {
returnset.add(new IrisPosition(loopx, loopy, loopz));
}
}
}
}
}
return returnset;
}
private static Set<IrisPosition> getHollowed(Set<IrisPosition> vset) {
Set<IrisPosition> returnset = new KSet<>();
for (IrisPosition v : vset) {
double x = v.getX();
double y = v.getY();
double z = v.getZ();
if (!(vset.contains(new IrisPosition(x + 1, y, z))
&& vset.contains(new IrisPosition(x - 1, y, z))
&& vset.contains(new IrisPosition(x, y + 1, z))
&& vset.contains(new IrisPosition(x, y - 1, z))
&& vset.contains(new IrisPosition(x, y, z + 1))
&& vset.contains(new IrisPosition(x, y, z - 1)))) {
returnset.add(v);
}
}
return returnset;
}
private static double hypot(double... pars) {
double sum = 0;
for (double d : pars) {
sum += Math.pow(d, 2);
}
return Math.sqrt(sum);
}
private static double lengthSq(double x, double y, double z) {
return (x * x) + (y * y) + (z * z);
}
private static double lengthSq(double x, double z) {
return (x * x) + (z * z);
}
public <T> void setData(int x, int y, int z, T t) {
if (t == null) {
return;
@@ -307,7 +363,6 @@ public class MantleWriter implements IObjectPlacer {
setLine(ImmutableList.of(a, b), radius, filled, data);
}
public <T> void setLine(List<IrisPosition> vectors, double radius, boolean filled, T data) {
setLineConsumer(vectors, radius, filled, (_x, _y, _z) -> data);
}
@@ -489,62 +544,6 @@ public class MantleWriter implements IObjectPlacer {
}
}
private static Set<IrisPosition> getBallooned(Set<IrisPosition> vset, double radius) {
Set<IrisPosition> returnset = new HashSet<>();
int ceilrad = (int) Math.ceil(radius);
for (IrisPosition v : vset) {
int tipx = v.getX();
int tipy = v.getY();
int tipz = v.getZ();
for (int loopx = tipx - ceilrad; loopx <= tipx + ceilrad; loopx++) {
for (int loopy = tipy - ceilrad; loopy <= tipy + ceilrad; loopy++) {
for (int loopz = tipz - ceilrad; loopz <= tipz + ceilrad; loopz++) {
if (hypot(loopx - tipx, loopy - tipy, loopz - tipz) <= radius) {
returnset.add(new IrisPosition(loopx, loopy, loopz));
}
}
}
}
}
return returnset;
}
private static Set<IrisPosition> getHollowed(Set<IrisPosition> vset) {
Set<IrisPosition> returnset = new KSet<>();
for (IrisPosition v : vset) {
double x = v.getX();
double y = v.getY();
double z = v.getZ();
if (!(vset.contains(new IrisPosition(x + 1, y, z))
&& vset.contains(new IrisPosition(x - 1, y, z))
&& vset.contains(new IrisPosition(x, y + 1, z))
&& vset.contains(new IrisPosition(x, y - 1, z))
&& vset.contains(new IrisPosition(x, y, z + 1))
&& vset.contains(new IrisPosition(x, y, z - 1)))) {
returnset.add(v);
}
}
return returnset;
}
private static double hypot(double... pars) {
double sum = 0;
for (double d : pars) {
sum += Math.pow(d, 2);
}
return Math.sqrt(sum);
}
private static double lengthSq(double x, double y, double z) {
return (x * x) + (y * y) + (z * z);
}
private static double lengthSq(double x, double z) {
return (x * x) + (z * z);
}
public boolean isWithin(Vector pos) {
return isWithin(pos.getBlockX(), pos.getBlockY(), pos.getBlockZ());
}

View File

@@ -23,7 +23,13 @@ import com.volmit.iris.engine.jigsaw.PlannedStructure;
import com.volmit.iris.engine.mantle.EngineMantle;
import com.volmit.iris.engine.mantle.IrisMantleComponent;
import com.volmit.iris.engine.mantle.MantleWriter;
import com.volmit.iris.engine.object.*;
import com.volmit.iris.engine.object.IrisBiome;
import com.volmit.iris.engine.object.IrisFeaturePositional;
import com.volmit.iris.engine.object.IrisJigsawStructure;
import com.volmit.iris.engine.object.IrisJigsawStructurePlacement;
import com.volmit.iris.engine.object.IrisPosition;
import com.volmit.iris.engine.object.IrisRegion;
import com.volmit.iris.engine.object.NoiseStyle;
import com.volmit.iris.util.documentation.BlockCoordinates;
import com.volmit.iris.util.documentation.ChunkCoordinates;
import com.volmit.iris.util.mantle.MantleFlag;
@@ -112,8 +118,7 @@ public class MantleJigsawComponent extends IrisMantleComponent {
writer.setData(position.getX(), 0, position.getZ(),
new IrisFeaturePositional(position.getX(), position.getZ(), structure.getFeature()));
if(structure.getFeature().getEntitySpawners().isNotEmpty())
{
if (structure.getFeature().getEntitySpawners().isNotEmpty()) {
Iris.info("Placed Structure MAIN SPAWN " + structure.getFeature().getEntitySpawners().get(0) + " @R " + structure.getFeature().getBlockRadius());
}
}

View File

@@ -23,7 +23,13 @@ import com.volmit.iris.engine.data.cache.Cache;
import com.volmit.iris.engine.mantle.EngineMantle;
import com.volmit.iris.engine.mantle.IrisMantleComponent;
import com.volmit.iris.engine.mantle.MantleWriter;
import com.volmit.iris.engine.object.*;
import com.volmit.iris.engine.object.IrisBiome;
import com.volmit.iris.engine.object.IrisFeature;
import com.volmit.iris.engine.object.IrisFeaturePositional;
import com.volmit.iris.engine.object.IrisFeaturePotential;
import com.volmit.iris.engine.object.IrisObject;
import com.volmit.iris.engine.object.IrisObjectPlacement;
import com.volmit.iris.engine.object.IrisRegion;
import com.volmit.iris.util.documentation.BlockCoordinates;
import com.volmit.iris.util.documentation.ChunkCoordinates;
import com.volmit.iris.util.mantle.MantleFlag;

View File

@@ -18,35 +18,13 @@
package com.volmit.iris.engine.modifier;
import com.volmit.iris.engine.IrisEngine;
import com.volmit.iris.engine.actuator.IrisDecorantActuator;
import com.volmit.iris.engine.data.cache.Cache;
import com.volmit.iris.engine.framework.Engine;
import com.volmit.iris.engine.framework.EngineAssignedModifier;
import com.volmit.iris.engine.object.InferredType;
import com.volmit.iris.engine.object.IrisBiome;
import com.volmit.iris.engine.object.IrisDecorationPart;
import com.volmit.iris.engine.object.IrisDecorator;
import com.volmit.iris.engine.object.IrisPosition;
import com.volmit.iris.util.collection.KList;
import com.volmit.iris.util.collection.KMap;
import com.volmit.iris.util.data.B;
import com.volmit.iris.util.function.Consumer4;
import com.volmit.iris.util.hunk.Hunk;
import com.volmit.iris.util.mantle.Mantle;
import com.volmit.iris.util.mantle.MantleChunk;
import com.volmit.iris.util.math.M;
import com.volmit.iris.util.math.RNG;
import com.volmit.iris.util.matter.MatterCavern;
import com.volmit.iris.util.matter.slices.MarkerMatter;
import com.volmit.iris.util.scheduling.PrecisionStopwatch;
import lombok.Data;
import org.bukkit.Material;
import org.bukkit.block.data.BlockData;
import java.util.Objects;
import java.util.function.Supplier;
public class IrisBodyModifier extends EngineAssignedModifier<BlockData> {
private final RNG rng;
private final BlockData AIR = Material.CAVE_AIR.createBlockData();

View File

@@ -18,12 +18,15 @@
package com.volmit.iris.engine.modifier;
import com.volmit.iris.engine.IrisEngine;
import com.volmit.iris.engine.actuator.IrisDecorantActuator;
import com.volmit.iris.engine.data.cache.Cache;
import com.volmit.iris.engine.framework.Engine;
import com.volmit.iris.engine.framework.EngineAssignedModifier;
import com.volmit.iris.engine.object.*;
import com.volmit.iris.engine.object.InferredType;
import com.volmit.iris.engine.object.IrisBiome;
import com.volmit.iris.engine.object.IrisDecorationPart;
import com.volmit.iris.engine.object.IrisDecorator;
import com.volmit.iris.engine.object.IrisPosition;
import com.volmit.iris.util.collection.KList;
import com.volmit.iris.util.collection.KMap;
import com.volmit.iris.util.data.B;

View File

@@ -18,27 +18,17 @@
package com.volmit.iris.engine.modifier;
import com.volmit.iris.Iris;
import com.volmit.iris.engine.framework.Engine;
import com.volmit.iris.engine.framework.EngineAssignedModifier;
import com.volmit.iris.engine.object.IrisBiome;
import com.volmit.iris.util.data.B;
import com.volmit.iris.util.data.HeightMap;
import com.volmit.iris.util.format.Form;
import com.volmit.iris.util.hunk.Hunk;
import com.volmit.iris.util.math.RNG;
import com.volmit.iris.util.scheduling.PrecisionStopwatch;
import net.minecraft.world.level.block.TallSeagrassBlock;
import org.bukkit.Material;
import org.bukkit.block.data.Bisected;
import org.bukkit.block.data.BlockData;
import org.bukkit.block.data.Levelled;
import org.bukkit.block.data.Waterlogged;
import org.bukkit.block.data.type.Slab;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.atomic.AtomicInteger;
public class IrisPerfectionModifier extends EngineAssignedModifier<BlockData> {
private static final BlockData AIR = B.get("AIR");
@@ -59,87 +49,65 @@ public class IrisPerfectionModifier extends EngineAssignedModifier<BlockData> {
List<Integer> surfaces = new ArrayList<>();
List<Integer> ceilings = new ArrayList<>();
while(changed)
{
while (changed) {
passes++;
changed = false;
for(int i = 0; i < 16; i++)
{
for(int j = 0; j < 16; j++)
{
for (int i = 0; i < 16; i++) {
for (int j = 0; j < 16; j++) {
surfaces.clear();
ceilings.clear();
int top = getHeight(output, i, j);
boolean inside = true;
surfaces.add(top);
for(int k = top; k >= 0; k--)
{
for (int k = top; k >= 0; k--) {
BlockData b = output.get(i, k, j);
boolean now = b != null && !(B.isAir(b) || B.isFluid(b));
if(now != inside)
{
if (now != inside) {
inside = now;
if(inside)
{
if (inside) {
surfaces.add(k);
}
else
{
ceilings.add(k+1);
} else {
ceilings.add(k + 1);
}
}
}
for(int k : surfaces)
{
for (int k : surfaces) {
BlockData tip = output.get(i, k, j);
if(tip == null)
{
if (tip == null) {
continue;
}
boolean remove = false;
boolean remove2 = false;
if(B.isDecorant(tip))
{
BlockData bel = output.get(i, k-1, j);
if (B.isDecorant(tip)) {
BlockData bel = output.get(i, k - 1, j);
if(bel == null)
{
if (bel == null) {
remove = true;
}
else if(!B.canPlaceOnto(tip.getMaterial(), bel.getMaterial()))
{
} else if (!B.canPlaceOnto(tip.getMaterial(), bel.getMaterial())) {
remove = true;
}
else if(bel instanceof Bisected)
{
BlockData bb = output.get(i, k-2, j);
if(bb == null || !B.canPlaceOnto(bel.getMaterial(), bb.getMaterial()))
{
} else if (bel instanceof Bisected) {
BlockData bb = output.get(i, k - 2, j);
if (bb == null || !B.canPlaceOnto(bel.getMaterial(), bb.getMaterial())) {
remove = true;
remove2 = true;
}
}
if(remove)
{
if (remove) {
changed = true;
changes++;
output.set(i, k, j, AIR);
if(remove2)
{
if (remove2) {
changes++;
output.set(i, k-1, j, AIR);
output.set(i, k - 1, j, AIR);
}
}
}
@@ -152,12 +120,10 @@ public class IrisPerfectionModifier extends EngineAssignedModifier<BlockData> {
}
private int getHeight(Hunk<BlockData> output, int x, int z) {
for(int i = output.getHeight()-1; i >= 0; i--)
{
for (int i = output.getHeight() - 1; i >= 0; i--) {
BlockData b = output.get(x, i, z);
if(b != null && !B.isAir(b) && !B.isFluid(b))
{
if (b != null && !B.isAir(b) && !B.isFluid(b)) {
return i;
}
}

View File

@@ -65,6 +65,15 @@ public class HeadlessWorld {
}
}
public static HeadlessWorld from(World world) {
return new HeadlessWorld(world.getName(), IrisToolbelt.access(world)
.getEngine().getTarget().getDimension(), world.getSeed());
}
public static HeadlessWorld from(String name, String dimension, long seed) {
return new HeadlessWorld(name, IrisData.loadAnyDimension(dimension), seed);
}
@SuppressWarnings("ConstantConditions")
public HeadlessGenerator generate() {
Engine e = null;
@@ -92,13 +101,4 @@ public class HeadlessWorld {
world.realWorld(w);
return w;
}
public static HeadlessWorld from(World world) {
return new HeadlessWorld(world.getName(), IrisToolbelt.access(world)
.getEngine().getTarget().getDimension(), world.getSeed());
}
public static HeadlessWorld from(String name, String dimension, long seed) {
return new HeadlessWorld(name, IrisData.loadAnyDimension(dimension), seed);
}
}

View File

@@ -19,9 +19,9 @@
package com.volmit.iris.engine.object;
public interface IRare {
int getRarity();
static int get(Object v) {
return v instanceof IRare ? Math.max(1, ((IRare) v).getRarity()) : 1;
}
int getRarity();
}

View File

@@ -18,7 +18,11 @@
package com.volmit.iris.engine.object;
import com.volmit.iris.engine.object.annotations.*;
import com.volmit.iris.engine.object.annotations.Desc;
import com.volmit.iris.engine.object.annotations.MaxNumber;
import com.volmit.iris.engine.object.annotations.MinNumber;
import com.volmit.iris.engine.object.annotations.Required;
import com.volmit.iris.engine.object.annotations.Snippet;
import com.volmit.iris.util.math.RNG;
import lombok.AllArgsConstructor;
import lombok.Data;

View File

@@ -18,7 +18,12 @@
package com.volmit.iris.engine.object;
import com.volmit.iris.engine.object.annotations.*;
import com.volmit.iris.engine.object.annotations.DependsOn;
import com.volmit.iris.engine.object.annotations.Desc;
import com.volmit.iris.engine.object.annotations.MaxNumber;
import com.volmit.iris.engine.object.annotations.MinNumber;
import com.volmit.iris.engine.object.annotations.Required;
import com.volmit.iris.engine.object.annotations.Snippet;
import com.volmit.iris.util.math.M;
import lombok.AllArgsConstructor;
import lombok.Data;

View File

@@ -25,7 +25,13 @@ import com.volmit.iris.core.loader.IrisRegistrant;
import com.volmit.iris.engine.IrisComplex;
import com.volmit.iris.engine.data.cache.AtomicCache;
import com.volmit.iris.engine.framework.Engine;
import com.volmit.iris.engine.object.annotations.*;
import com.volmit.iris.engine.object.annotations.ArrayType;
import com.volmit.iris.engine.object.annotations.DependsOn;
import com.volmit.iris.engine.object.annotations.Desc;
import com.volmit.iris.engine.object.annotations.MaxNumber;
import com.volmit.iris.engine.object.annotations.MinNumber;
import com.volmit.iris.engine.object.annotations.RegistryListResource;
import com.volmit.iris.engine.object.annotations.Required;
import com.volmit.iris.util.collection.KList;
import com.volmit.iris.util.collection.KMap;
import com.volmit.iris.util.collection.KSet;
@@ -46,7 +52,7 @@ import org.bukkit.Material;
import org.bukkit.block.Biome;
import org.bukkit.block.data.BlockData;
import java.awt.*;
import java.awt.Color;
@SuppressWarnings("DefaultAnnotationParam")
@Accessors(chain = true)
@@ -56,140 +62,6 @@ import java.awt.*;
@Data
@EqualsAndHashCode(callSuper = false)
public class IrisBiome extends IrisRegistrant implements IRare {
@MinNumber(2)
@Required
@Desc("This is the human readable name for this biome. This can and should be different than the file name. This is not used for loading biomes in other objects.")
private String name = "A Biome";
@ArrayType(min = 1, type = IrisBiomeCustom.class)
@Desc("If the biome type custom is defined, specify this")
private KList<IrisBiomeCustom> customDerivitives;
@Desc("Spawn Entities in this area over time. Iris will continually replenish these mobs just like vanilla does.")
@ArrayType(min = 1, type = String.class)
@RegistryListResource(IrisSpawner.class)
private KList<String> entitySpawners = new KList<>();
@Desc("Add random chances for terrain features")
@ArrayType(min = 1, type = IrisFeaturePotential.class)
private KList<IrisFeaturePotential> features = new KList<>();
@ArrayType(min = 1, type = IrisEffect.class)
@Desc("Effects are ambient effects such as potion effects, random sounds, or even particles around each player. All of these effects are played via packets so two players won't see/hear each others effects.\nDue to performance reasons, effects will play around the player even if where the effect was played is no longer in the biome the player is in.")
private KList<IrisEffect> effects = new KList<>();
@DependsOn({"biomeStyle", "biomeZoom", "biomeScatter"})
@Desc("This changes the dispersion of the biome colors if multiple derivatives are chosen.")
private IrisGeneratorStyle biomeStyle = NoiseStyle.SIMPLEX.style();
@ArrayType(min = 1, type = IrisBlockDrops.class)
@Desc("Define custom block drops for this biome")
private KList<IrisBlockDrops> blockDrops = new KList<>();
@Desc("Reference loot tables in this area")
private IrisLootReference loot = new IrisLootReference();
@MinNumber(0.0001)
@DependsOn({"biomeStyle", "biomeZoom", "biomeScatter"})
@Desc("This zooms in the biome colors if multiple derivatives are chosen")
private double biomeZoom = 1;
@Desc("Layers no longer descend from the surface block, they descend from the max possible height the biome can produce (constant) creating mesa like layers.")
private boolean lockLayers = false;
@Desc("The max layers to iterate below the surface for locked layer biomes (mesa).")
private int lockLayersMax = 7;
@Desc("Carving configuration for the dimension")
private IrisCarving carving = new IrisCarving();
@Desc("Configuration of fluid bodies such as rivers & lakes")
private IrisFluidBodies fluidBodies = new IrisFluidBodies();
@MinNumber(1)
@MaxNumber(512)
@Desc("The rarity of this biome (integer)")
private int rarity = 1;
@Desc("A color for visualizing this biome with a color. I.e. #F13AF5. This will show up on the map.")
private String color = null;
@Required
@Desc("The raw derivative of this biome. This is required or the terrain will not properly generate. Use any vanilla biome type. Look in examples/biome-list.txt")
private Biome derivative = Biome.THE_VOID;
@Required
@Desc("Override the derivative when vanilla places structures to this derivative. This is useful for example if you have an ocean biome, but you have set the derivative to desert to get a brown-ish color. To prevent desert structures from spawning on top of your ocean, you can set your vanillaDerivative to ocean, to allow for vanilla structures. Not defining this value will simply select the derivative.")
private Biome vanillaDerivative = null;
@ArrayType(min = 1, type = Biome.class)
@Desc("You can instead specify multiple biome derivatives to randomly scatter colors in this biome")
private KList<Biome> biomeScatter = new KList<>();
@ArrayType(min = 1, type = Biome.class)
@Desc("Since 1.13 supports 3D biomes, you can add different derivative colors for anything above the terrain. (Think swampy tree leaves with a desert looking grass surface)")
private KList<Biome> biomeSkyScatter = new KList<>();
@DependsOn({"children"})
@Desc("If this biome has children biomes, and the gen layer chooses one of this biomes children, how much smaller will it be (inside of this biome). Higher values means a smaller biome relative to this biome's size. Set higher than 1.0 and below 3.0 for best results.")
private double childShrinkFactor = 1.5;
@DependsOn({"children"})
@Desc("If this biome has children biomes, and the gen layer chooses one of this biomes children, How will it be shaped?")
private IrisGeneratorStyle childStyle = NoiseStyle.CELLULAR_IRIS_DOUBLE.style();
@RegistryListResource(IrisBiome.class)
@ArrayType(min = 1, type = String.class)
@Desc("List any biome names (file names without.json) here as children. Portions of this biome can sometimes morph into their children. Iris supports cyclic relationships such as A > B > A > B. Iris will stop checking 9 biomes down the tree.")
private KList<String> children = new KList<>();
@ArrayType(min = 1, type = IrisJigsawStructurePlacement.class)
@Desc("Jigsaw structures")
private KList<IrisJigsawStructurePlacement> jigsawStructures = new KList<>();
@RegistryListResource(IrisBiome.class)
@Desc("The carving biome. If specified the biome will be used when under a carving instead of this current biome.")
private String carvingBiome = "";
@Desc("The default slab if iris decides to place a slab in this biome. Default is no slab.")
private IrisBiomePaletteLayer slab = new IrisBiomePaletteLayer().zero();
@Desc("The default wall if iris decides to place a wall higher than 2 blocks (steep hills or possibly cliffs)")
private IrisBiomePaletteLayer wall = new IrisBiomePaletteLayer().zero();
@Required
@ArrayType(min = 1, type = IrisBiomePaletteLayer.class)
@Desc("This defines the layers of materials in this biome. Each layer has a palette and min/max height and some other properties. Usually a grassy/sandy layer then a dirt layer then a stone layer. Iris will fill in the remaining blocks below your layers with stone.")
private KList<IrisBiomePaletteLayer> layers = new KList<IrisBiomePaletteLayer>().qadd(new IrisBiomePaletteLayer());
@Required
@ArrayType(min = 1, type = IrisBiomePaletteLayer.class)
@Desc("This defines the layers of materials in this biome. Each layer has a palette and min/max height and some other properties. Usually a grassy/sandy layer then a dirt layer then a stone layer. Iris will fill in the remaining blocks below your layers with stone.")
private KList<IrisBiomePaletteLayer> caveCeilingLayers = new KList<IrisBiomePaletteLayer>().qadd(new IrisBiomePaletteLayer());
@ArrayType(min = 1, type = IrisBiomePaletteLayer.class)
@Desc("This defines the layers of materials in this biome. Each layer has a palette and min/max height and some other properties. Usually a grassy/sandy layer then a dirt layer then a stone layer. Iris will fill in the remaining blocks below your layers with stone.")
private KList<IrisBiomePaletteLayer> seaLayers = new KList<>();
@ArrayType(min = 1, type = IrisDecorator.class)
@Desc("Decorators are used for things like tall grass, bisected flowers, and even kelp or cactus (random heights)")
private KList<IrisDecorator> decorators = new KList<>();
@ArrayType(min = 1, type = IrisObjectPlacement.class)
@Desc("Objects define what schematics (iob files) iris will place in this biome")
private KList<IrisObjectPlacement> objects = new KList<>();
@Required
@ArrayType(min = 1, type = IrisBiomeGeneratorLink.class)
@Desc("Generators for this biome. Multiple generators with different interpolation sizes will mix with other biomes how you would expect. This defines your biome height relative to the fluid height. Use negative for oceans.")
private KList<IrisBiomeGeneratorLink> generators = new KList<IrisBiomeGeneratorLink>().qadd(new IrisBiomeGeneratorLink());
@ArrayType(min = 1, type = IrisDepositGenerator.class)
@Desc("Define biome deposit generators that add onto the existing regional and global deposit generators")
private KList<IrisDepositGenerator> deposits = new KList<>();
private transient InferredType inferredType;
private static final BlockData BARRIER = Material.BARRIER.createBlockData();
private final transient AtomicCache<KMap<String, IrisBiomeGeneratorLink>> genCache = new AtomicCache<>();
private final transient AtomicCache<KMap<String, Integer>> genCacheMax = new AtomicCache<>();
@@ -209,6 +81,106 @@ public class IrisBiome extends IrisRegistrant implements IRare {
private final transient AtomicCache<KList<IrisBiome>> realChildren = new AtomicCache<>();
private final transient AtomicCache<KList<CNG>> layerHeightGenerators = new AtomicCache<>();
private final transient AtomicCache<KList<CNG>> layerSeaHeightGenerators = new AtomicCache<>();
@MinNumber(2)
@Required
@Desc("This is the human readable name for this biome. This can and should be different than the file name. This is not used for loading biomes in other objects.")
private String name = "A Biome";
@ArrayType(min = 1, type = IrisBiomeCustom.class)
@Desc("If the biome type custom is defined, specify this")
private KList<IrisBiomeCustom> customDerivitives;
@Desc("Spawn Entities in this area over time. Iris will continually replenish these mobs just like vanilla does.")
@ArrayType(min = 1, type = String.class)
@RegistryListResource(IrisSpawner.class)
private KList<String> entitySpawners = new KList<>();
@Desc("Add random chances for terrain features")
@ArrayType(min = 1, type = IrisFeaturePotential.class)
private KList<IrisFeaturePotential> features = new KList<>();
@ArrayType(min = 1, type = IrisEffect.class)
@Desc("Effects are ambient effects such as potion effects, random sounds, or even particles around each player. All of these effects are played via packets so two players won't see/hear each others effects.\nDue to performance reasons, effects will play around the player even if where the effect was played is no longer in the biome the player is in.")
private KList<IrisEffect> effects = new KList<>();
@DependsOn({"biomeStyle", "biomeZoom", "biomeScatter"})
@Desc("This changes the dispersion of the biome colors if multiple derivatives are chosen.")
private IrisGeneratorStyle biomeStyle = NoiseStyle.SIMPLEX.style();
@ArrayType(min = 1, type = IrisBlockDrops.class)
@Desc("Define custom block drops for this biome")
private KList<IrisBlockDrops> blockDrops = new KList<>();
@Desc("Reference loot tables in this area")
private IrisLootReference loot = new IrisLootReference();
@MinNumber(0.0001)
@DependsOn({"biomeStyle", "biomeZoom", "biomeScatter"})
@Desc("This zooms in the biome colors if multiple derivatives are chosen")
private double biomeZoom = 1;
@Desc("Layers no longer descend from the surface block, they descend from the max possible height the biome can produce (constant) creating mesa like layers.")
private boolean lockLayers = false;
@Desc("The max layers to iterate below the surface for locked layer biomes (mesa).")
private int lockLayersMax = 7;
@Desc("Carving configuration for the dimension")
private IrisCarving carving = new IrisCarving();
@Desc("Configuration of fluid bodies such as rivers & lakes")
private IrisFluidBodies fluidBodies = new IrisFluidBodies();
@MinNumber(1)
@MaxNumber(512)
@Desc("The rarity of this biome (integer)")
private int rarity = 1;
@Desc("A color for visualizing this biome with a color. I.e. #F13AF5. This will show up on the map.")
private String color = null;
@Required
@Desc("The raw derivative of this biome. This is required or the terrain will not properly generate. Use any vanilla biome type. Look in examples/biome-list.txt")
private Biome derivative = Biome.THE_VOID;
@Required
@Desc("Override the derivative when vanilla places structures to this derivative. This is useful for example if you have an ocean biome, but you have set the derivative to desert to get a brown-ish color. To prevent desert structures from spawning on top of your ocean, you can set your vanillaDerivative to ocean, to allow for vanilla structures. Not defining this value will simply select the derivative.")
private Biome vanillaDerivative = null;
@ArrayType(min = 1, type = Biome.class)
@Desc("You can instead specify multiple biome derivatives to randomly scatter colors in this biome")
private KList<Biome> biomeScatter = new KList<>();
@ArrayType(min = 1, type = Biome.class)
@Desc("Since 1.13 supports 3D biomes, you can add different derivative colors for anything above the terrain. (Think swampy tree leaves with a desert looking grass surface)")
private KList<Biome> biomeSkyScatter = new KList<>();
@DependsOn({"children"})
@Desc("If this biome has children biomes, and the gen layer chooses one of this biomes children, how much smaller will it be (inside of this biome). Higher values means a smaller biome relative to this biome's size. Set higher than 1.0 and below 3.0 for best results.")
private double childShrinkFactor = 1.5;
@DependsOn({"children"})
@Desc("If this biome has children biomes, and the gen layer chooses one of this biomes children, How will it be shaped?")
private IrisGeneratorStyle childStyle = NoiseStyle.CELLULAR_IRIS_DOUBLE.style();
@RegistryListResource(IrisBiome.class)
@ArrayType(min = 1, type = String.class)
@Desc("List any biome names (file names without.json) here as children. Portions of this biome can sometimes morph into their children. Iris supports cyclic relationships such as A > B > A > B. Iris will stop checking 9 biomes down the tree.")
private KList<String> children = new KList<>();
@ArrayType(min = 1, type = IrisJigsawStructurePlacement.class)
@Desc("Jigsaw structures")
private KList<IrisJigsawStructurePlacement> jigsawStructures = new KList<>();
@RegistryListResource(IrisBiome.class)
@Desc("The carving biome. If specified the biome will be used when under a carving instead of this current biome.")
private String carvingBiome = "";
@Desc("The default slab if iris decides to place a slab in this biome. Default is no slab.")
private IrisBiomePaletteLayer slab = new IrisBiomePaletteLayer().zero();
@Desc("The default wall if iris decides to place a wall higher than 2 blocks (steep hills or possibly cliffs)")
private IrisBiomePaletteLayer wall = new IrisBiomePaletteLayer().zero();
@Required
@ArrayType(min = 1, type = IrisBiomePaletteLayer.class)
@Desc("This defines the layers of materials in this biome. Each layer has a palette and min/max height and some other properties. Usually a grassy/sandy layer then a dirt layer then a stone layer. Iris will fill in the remaining blocks below your layers with stone.")
private KList<IrisBiomePaletteLayer> layers = new KList<IrisBiomePaletteLayer>().qadd(new IrisBiomePaletteLayer());
@Required
@ArrayType(min = 1, type = IrisBiomePaletteLayer.class)
@Desc("This defines the layers of materials in this biome. Each layer has a palette and min/max height and some other properties. Usually a grassy/sandy layer then a dirt layer then a stone layer. Iris will fill in the remaining blocks below your layers with stone.")
private KList<IrisBiomePaletteLayer> caveCeilingLayers = new KList<IrisBiomePaletteLayer>().qadd(new IrisBiomePaletteLayer());
@ArrayType(min = 1, type = IrisBiomePaletteLayer.class)
@Desc("This defines the layers of materials in this biome. Each layer has a palette and min/max height and some other properties. Usually a grassy/sandy layer then a dirt layer then a stone layer. Iris will fill in the remaining blocks below your layers with stone.")
private KList<IrisBiomePaletteLayer> seaLayers = new KList<>();
@ArrayType(min = 1, type = IrisDecorator.class)
@Desc("Decorators are used for things like tall grass, bisected flowers, and even kelp or cactus (random heights)")
private KList<IrisDecorator> decorators = new KList<>();
@ArrayType(min = 1, type = IrisObjectPlacement.class)
@Desc("Objects define what schematics (iob files) iris will place in this biome")
private KList<IrisObjectPlacement> objects = new KList<>();
@Required
@ArrayType(min = 1, type = IrisBiomeGeneratorLink.class)
@Desc("Generators for this biome. Multiple generators with different interpolation sizes will mix with other biomes how you would expect. This defines your biome height relative to the fluid height. Use negative for oceans.")
private KList<IrisBiomeGeneratorLink> generators = new KList<IrisBiomeGeneratorLink>().qadd(new IrisBiomeGeneratorLink());
@ArrayType(min = 1, type = IrisDepositGenerator.class)
@Desc("Define biome deposit generators that add onto the existing regional and global deposit generators")
private KList<IrisDepositGenerator> deposits = new KList<>();
private transient InferredType inferredType;
public Biome getVanillaDerivative() {
return vanillaDerivative == null ? derivative : vanillaDerivative;

View File

@@ -19,7 +19,13 @@
package com.volmit.iris.engine.object;
import com.volmit.iris.Iris;
import com.volmit.iris.engine.object.annotations.*;
import com.volmit.iris.engine.object.annotations.ArrayType;
import com.volmit.iris.engine.object.annotations.DependsOn;
import com.volmit.iris.engine.object.annotations.Desc;
import com.volmit.iris.engine.object.annotations.MaxNumber;
import com.volmit.iris.engine.object.annotations.MinNumber;
import com.volmit.iris.engine.object.annotations.Required;
import com.volmit.iris.engine.object.annotations.Snippet;
import com.volmit.iris.util.collection.KList;
import com.volmit.iris.util.collection.KMap;
import com.volmit.iris.util.json.JSONArray;
@@ -29,7 +35,7 @@ import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import java.awt.*;
import java.awt.Color;
import java.util.Locale;
@Snippet("custom-biome")

View File

@@ -18,7 +18,11 @@
package com.volmit.iris.engine.object;
import com.volmit.iris.engine.object.annotations.*;
import com.volmit.iris.engine.object.annotations.Desc;
import com.volmit.iris.engine.object.annotations.MaxNumber;
import com.volmit.iris.engine.object.annotations.MinNumber;
import com.volmit.iris.engine.object.annotations.Required;
import com.volmit.iris.engine.object.annotations.Snippet;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

View File

@@ -18,7 +18,11 @@
package com.volmit.iris.engine.object;
import com.volmit.iris.engine.object.annotations.*;
import com.volmit.iris.engine.object.annotations.Desc;
import com.volmit.iris.engine.object.annotations.MaxNumber;
import com.volmit.iris.engine.object.annotations.MinNumber;
import com.volmit.iris.engine.object.annotations.Required;
import com.volmit.iris.engine.object.annotations.Snippet;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

View File

@@ -19,7 +19,13 @@
package com.volmit.iris.engine.object;
import com.volmit.iris.engine.data.cache.AtomicCache;
import com.volmit.iris.engine.object.annotations.*;
import com.volmit.iris.engine.object.annotations.DependsOn;
import com.volmit.iris.engine.object.annotations.Desc;
import com.volmit.iris.engine.object.annotations.MaxNumber;
import com.volmit.iris.engine.object.annotations.MinNumber;
import com.volmit.iris.engine.object.annotations.RegistryListResource;
import com.volmit.iris.engine.object.annotations.Required;
import com.volmit.iris.engine.object.annotations.Snippet;
import com.volmit.iris.util.data.DataProvider;
import com.volmit.iris.util.interpolation.IrisInterpolation;
import lombok.AllArgsConstructor;
@@ -35,17 +41,16 @@ import lombok.experimental.Accessors;
@Data
public class IrisBiomeGeneratorLink {
private final transient AtomicCache<IrisGenerator> gen = new AtomicCache<>();
@RegistryListResource(IrisGenerator.class)
@Desc("The generator id")
private String generator = "default";
@DependsOn({"min", "max"})
@Required
@MinNumber(-256) // TODO: WARNING HEIGHT
@MaxNumber(256) // TODO: WARNING HEIGHT
@Desc("The min block value (value + fluidHeight)")
private int min = 0;
@DependsOn({"min", "max"})
@Required
@MinNumber(-256) // TODO: WARNING HEIGHT
@@ -53,8 +58,6 @@ public class IrisBiomeGeneratorLink {
@Desc("The max block value (value + fluidHeight)")
private int max = 0;
private final transient AtomicCache<IrisGenerator> gen = new AtomicCache<>();
public IrisGenerator getCachedGenerator(DataProvider g) {
return gen.aquire(() ->
{

View File

@@ -20,7 +20,13 @@ package com.volmit.iris.engine.object;
import com.volmit.iris.core.loader.IrisData;
import com.volmit.iris.engine.data.cache.AtomicCache;
import com.volmit.iris.engine.object.annotations.*;
import com.volmit.iris.engine.object.annotations.ArrayType;
import com.volmit.iris.engine.object.annotations.DependsOn;
import com.volmit.iris.engine.object.annotations.Desc;
import com.volmit.iris.engine.object.annotations.MaxNumber;
import com.volmit.iris.engine.object.annotations.MinNumber;
import com.volmit.iris.engine.object.annotations.Required;
import com.volmit.iris.engine.object.annotations.Snippet;
import com.volmit.iris.util.collection.KList;
import com.volmit.iris.util.math.RNG;
import com.volmit.iris.util.noise.CNG;
@@ -37,40 +43,33 @@ import org.bukkit.block.data.BlockData;
@Desc("A layer of surface / subsurface material in biomes")
@Data
public class IrisBiomePaletteLayer {
private final transient AtomicCache<KList<BlockData>> blockData = new AtomicCache<>();
private final transient AtomicCache<CNG> layerGenerator = new AtomicCache<>();
private final transient AtomicCache<CNG> heightGenerator = new AtomicCache<>();
@Desc("The style of noise")
private IrisGeneratorStyle style = NoiseStyle.STATIC.style();
@DependsOn({"minHeight", "maxHeight"})
@MinNumber(0)
@MaxNumber(256) // TODO: WARNING HEIGHT
@Desc("The min thickness of this layer")
private int minHeight = 1;
@DependsOn({"minHeight", "maxHeight"})
@MinNumber(1)
@MaxNumber(256) // TODO: WARNING HEIGHT
@Desc("The max thickness of this layer")
private int maxHeight = 1;
@Desc("If set, this layer will change size depending on the slope. If in bounds, the layer will get larger (taller) the closer to the center of this slope clip it is. If outside of the slipe's bounds, this layer will not show.")
private IrisSlopeClip slopeCondition = new IrisSlopeClip();
@MinNumber(0.0001)
@Desc("The terrain zoom mostly for zooming in on a wispy palette")
private double zoom = 5;
@Required
@ArrayType(min = 1, type = IrisBlockData.class)
@Desc("The palette of blocks to be used in this layer")
private KList<IrisBlockData> palette = new KList<IrisBlockData>().qadd(new IrisBlockData("GRASS_BLOCK"));
private final transient AtomicCache<KList<BlockData>> blockData = new AtomicCache<>();
private final transient AtomicCache<CNG> layerGenerator = new AtomicCache<>();
private final transient AtomicCache<CNG> heightGenerator = new AtomicCache<>();
public CNG getHeightGenerator(RNG rng, IrisData data) {
return heightGenerator.aquire(() -> CNG.signature(rng.nextParallelRNG(minHeight * maxHeight + getBlockData(data).size())));
}

View File

@@ -22,7 +22,11 @@ import com.volmit.iris.Iris;
import com.volmit.iris.core.loader.IrisData;
import com.volmit.iris.core.loader.IrisRegistrant;
import com.volmit.iris.engine.data.cache.AtomicCache;
import com.volmit.iris.engine.object.annotations.*;
import com.volmit.iris.engine.object.annotations.Desc;
import com.volmit.iris.engine.object.annotations.MaxNumber;
import com.volmit.iris.engine.object.annotations.MinNumber;
import com.volmit.iris.engine.object.annotations.RegistryListBlockType;
import com.volmit.iris.engine.object.annotations.Required;
import com.volmit.iris.util.collection.KList;
import com.volmit.iris.util.collection.KMap;
import com.volmit.iris.util.data.B;
@@ -45,32 +49,77 @@ import java.util.Map;
@Data
@EqualsAndHashCode(callSuper = false)
public class IrisBlockData extends IrisRegistrant {
private final transient AtomicCache<BlockData> blockdata = new AtomicCache<>();
private final transient AtomicCache<String> realProperties = new AtomicCache<>();
@RegistryListBlockType
@Required
@Desc("The block to use")
private String block = "air";
@Desc("Debug this block by printing it to the console when it's used. Must have debug turned on in settings.")
private boolean debug = false;
@MinNumber(1)
@MaxNumber(1000)
@Desc("The weight is used when this block data is inside of a list of blockdata. A weight of two is just as if you placed two of the same block data values in the same list making it more common when randomly picked.")
private int weight = 1;
@Desc("If the block cannot be created on this version, Iris will attempt to use this backup block data instead.")
private IrisBlockData backup = null;
@Desc("Optional properties for this block data such as 'waterlogged': true")
private KMap<String, Object> data = new KMap<>();
private final transient AtomicCache<BlockData> blockdata = new AtomicCache<>();
private final transient AtomicCache<String> realProperties = new AtomicCache<>();
public IrisBlockData(String b) {
this.block = b;
}
public static IrisBlockData from(String j) {
IrisBlockData b = new IrisBlockData();
String v = j.toLowerCase().trim();
if (v.contains("[")) {
KList<String> props = new KList<>();
String rp = v.split("\\Q[\\E")[1].replaceAll("\\Q]\\E", "");
b.setBlock(v.split("\\Q[\\E")[0]);
if (rp.contains(",")) {
props.add(rp.split("\\Q,\\E"));
} else {
props.add(rp);
}
for (String i : props) {
Object kg = filter(i.split("\\Q=\\E")[1]);
b.data.put(i.split("\\Q=\\E")[0], kg);
}
} else {
b.setBlock(v);
}
return b;
}
private static Object filter(String string) {
if (string.equals("true")) {
return true;
}
if (string.equals("false")) {
return false;
}
try {
return Integer.parseInt(string);
} catch (Throwable ignored) {
// Checks
}
try {
return Double.valueOf(string).intValue();
} catch (Throwable ignored) {
// Checks
}
return string;
}
public String computeProperties(KMap<String, Object> data) {
if (data.isEmpty()) {
return "";
@@ -159,56 +208,6 @@ public class IrisBlockData extends IrisRegistrant {
return "minecraft:" + dat;
}
public static IrisBlockData from(String j) {
IrisBlockData b = new IrisBlockData();
String v = j.toLowerCase().trim();
if (v.contains("[")) {
KList<String> props = new KList<>();
String rp = v.split("\\Q[\\E")[1].replaceAll("\\Q]\\E", "");
b.setBlock(v.split("\\Q[\\E")[0]);
if (rp.contains(",")) {
props.add(rp.split("\\Q,\\E"));
} else {
props.add(rp);
}
for (String i : props) {
Object kg = filter(i.split("\\Q=\\E")[1]);
b.data.put(i.split("\\Q=\\E")[0], kg);
}
} else {
b.setBlock(v);
}
return b;
}
private static Object filter(String string) {
if (string.equals("true")) {
return true;
}
if (string.equals("false")) {
return false;
}
try {
return Integer.parseInt(string);
} catch (Throwable ignored) {
// Checks
}
try {
return Double.valueOf(string).intValue();
} catch (Throwable ignored) {
// Checks
}
return string;
}
@Override
public String getFolderName() {
return "blocks";

View File

@@ -40,26 +40,21 @@ import org.bukkit.inventory.ItemStack;
@Desc("Represents a block drop list")
@Data
public class IrisBlockDrops {
private final transient AtomicCache<KList<BlockData>> data = new AtomicCache<>();
@Required
@ArrayType(min = 1, type = IrisBlockData.class)
@Desc("The blocks that drop loot")
private KList<IrisBlockData> blocks = new KList<>();
@Desc("If exact blocks is set to true, minecraft:barrel[axis=x] will only drop for that axis. When exact is false (default) any barrel will drop the defined drops.")
private boolean exactBlocks = false;
@Desc("Add in specific items to drop")
@ArrayType(min = 1, type = IrisLoot.class)
private KList<IrisLoot> drops = new KList<>();
@Desc("If this is in a biome, setting skipParents to true will ignore the drops in the region and dimension for this block type. The default (false) will allow all three nodes to fire and add to a list of drops.")
private boolean skipParents = false;
@Desc("Removes the default vanilla block drops and only drops the given items & any parent loot tables specified for this block type.")
private boolean replaceVanillaDrops = false;
private final transient AtomicCache<KList<BlockData>> data = new AtomicCache<>();
public boolean shouldDropFor(BlockData data, IrisData rdata) {
KList<BlockData> list = this.data.aquire(() ->
{

View File

@@ -23,7 +23,11 @@ import com.volmit.iris.core.loader.IrisData;
import com.volmit.iris.engine.data.cache.AtomicCache;
import com.volmit.iris.engine.framework.Engine;
import com.volmit.iris.engine.mantle.MantleWriter;
import com.volmit.iris.engine.object.annotations.*;
import com.volmit.iris.engine.object.annotations.Desc;
import com.volmit.iris.engine.object.annotations.MinNumber;
import com.volmit.iris.engine.object.annotations.RegistryListResource;
import com.volmit.iris.engine.object.annotations.Required;
import com.volmit.iris.engine.object.annotations.Snippet;
import com.volmit.iris.util.math.RNG;
import lombok.AllArgsConstructor;
import lombok.Data;
@@ -39,26 +43,22 @@ import java.util.concurrent.atomic.AtomicBoolean;
@Desc("Translate objects")
@Data
public class IrisCavePlacer implements IRare {
private transient final AtomicCache<IrisCave> caveCache = new AtomicCache<>();
private transient final AtomicBoolean fail = new AtomicBoolean(false);
@Required
@Desc("Typically a 1 in RARITY on a per chunk/fork basis")
@MinNumber(1)
private int rarity = 15;
@MinNumber(1)
@Required
@Desc("The cave to place")
@RegistryListResource(IrisCave.class)
private String cave;
@Desc("If set to true, this cave is allowed to break the surface")
private boolean breakSurface = true;
@Desc("The height range this cave can spawn at. If breakSurface is false, the output of this range will be clamped by the current world height to prevent surface breaking.")
private IrisStyledRange caveStartHeight = new IrisStyledRange(13, 120, new IrisGeneratorStyle(NoiseStyle.STATIC));
private transient final AtomicCache<IrisCave> caveCache = new AtomicCache<>();
private transient final AtomicBoolean fail = new AtomicBoolean(false);
public IrisCave getRealCave(IrisData data) {
return caveCache.aquire(() -> data.getCaveLoader().load(getCave()));
}

View File

@@ -28,7 +28,7 @@ import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import java.awt.*;
import java.awt.Color;
@Snippet("color")
@Accessors(chain = true)
@@ -36,48 +36,24 @@ import java.awt.*;
@Desc("Represents a color")
@Data
public class IrisColor {
private final transient AtomicCache<Color> color = new AtomicCache<>();
@MaxNumber(7)
@MinNumber(6)
@Desc("Pass in a 6 digit hexadecimal color to fill R G and B values. You can also include the # symbol, but it's not required.")
private String hex = null;
@MaxNumber(255)
@MinNumber(0)
@Desc("Represents the red channel. Only define this if you are not defining the hex value.")
private int red = 0;
@MaxNumber(255)
@MinNumber(0)
@Desc("Represents the green channel. Only define this if you are not defining the hex value.")
private int green = 0;
@MaxNumber(255)
@MinNumber(0)
@Desc("Represents the blue channel. Only define this if you are not defining the hex value.")
private int blue = 0;
private final transient AtomicCache<Color> color = new AtomicCache<>();
public Color getColor() {
return color.aquire(() -> {
if (hex != null) {
String v = (hex.startsWith("#") ? hex : "#" + hex).trim();
try {
return Color.decode(v);
} catch (Throwable e) {
Iris.reportError(e);
}
}
return new Color(red, green, blue);
});
}
public org.bukkit.Color getBukkitColor() {
return org.bukkit.Color.fromRGB(getColor().getRGB());
}
public static Color blend(Color... c) {
if (c == null || c.length <= 0) {
return null;
@@ -104,6 +80,26 @@ public class IrisColor {
return new Color(a << 24 | r << 16 | g << 8 | b);
}
public Color getColor() {
return color.aquire(() -> {
if (hex != null) {
String v = (hex.startsWith("#") ? hex : "#" + hex).trim();
try {
return Color.decode(v);
} catch (Throwable e) {
Iris.reportError(e);
}
}
return new Color(red, green, blue);
});
}
public org.bukkit.Color getBukkitColor() {
return org.bukkit.Color.fromRGB(getColor().getRGB());
}
public int getAsRGB() {
if (hex != null) {
try {

View File

@@ -42,114 +42,6 @@ public class IrisCompat {
itemFilters = getDefaultItemCompatabilityFilters();
}
public BlockData getBlock(String n) {
String buf = n;
int err = 16;
BlockData tx = B.getOrNull(buf);
if (tx != null) {
return tx;
}
searching:
while (true) {
if (err-- <= 0) {
return B.get("STONE");
}
for (IrisCompatabilityBlockFilter i : blockFilters) {
if (i.getWhen().equalsIgnoreCase(buf)) {
BlockData b = i.getReplace();
if (b != null) {
return b;
}
buf = i.getSupplement();
continue searching;
}
}
return B.get("STONE");
}
}
public Material getItem(String n) {
String buf = n;
int err = 16;
Material txf = B.getMaterialOrNull(buf);
if (txf != null) {
return txf;
}
int nomore = 64;
searching:
while (true) {
if (nomore < 0) {
return B.getMaterial("STONE");
}
nomore--;
if (err-- <= 0) {
break;
}
for (IrisCompatabilityItemFilter i : itemFilters) {
if (i.getWhen().equalsIgnoreCase(buf)) {
Material b = i.getReplace();
if (b != null) {
return b;
}
buf = i.getSupplement();
continue searching;
}
}
break;
}
buf = n;
BlockData tx = B.getOrNull(buf);
if (tx != null) {
return tx.getMaterial();
}
nomore = 64;
searching:
while (true) {
if (nomore < 0) {
return B.getMaterial("STONE");
}
nomore--;
if (err-- <= 0) {
return B.getMaterial("STONE");
}
for (IrisCompatabilityBlockFilter i : blockFilters) {
if (i.getWhen().equalsIgnoreCase(buf)) {
BlockData b = i.getReplace();
if (b != null) {
return b.getMaterial();
}
buf = i.getSupplement();
continue searching;
}
}
return B.getMaterial("STONE");
}
}
public static IrisCompat configured(File f) {
IrisCompat def = new IrisCompat();
String defa = new JSONObject(new Gson().toJson(def)).toString(4);
@@ -365,4 +257,112 @@ public class IrisCompat {
return filters;
}
public BlockData getBlock(String n) {
String buf = n;
int err = 16;
BlockData tx = B.getOrNull(buf);
if (tx != null) {
return tx;
}
searching:
while (true) {
if (err-- <= 0) {
return B.get("STONE");
}
for (IrisCompatabilityBlockFilter i : blockFilters) {
if (i.getWhen().equalsIgnoreCase(buf)) {
BlockData b = i.getReplace();
if (b != null) {
return b;
}
buf = i.getSupplement();
continue searching;
}
}
return B.get("STONE");
}
}
public Material getItem(String n) {
String buf = n;
int err = 16;
Material txf = B.getMaterialOrNull(buf);
if (txf != null) {
return txf;
}
int nomore = 64;
searching:
while (true) {
if (nomore < 0) {
return B.getMaterial("STONE");
}
nomore--;
if (err-- <= 0) {
break;
}
for (IrisCompatabilityItemFilter i : itemFilters) {
if (i.getWhen().equalsIgnoreCase(buf)) {
Material b = i.getReplace();
if (b != null) {
return b;
}
buf = i.getSupplement();
continue searching;
}
}
break;
}
buf = n;
BlockData tx = B.getOrNull(buf);
if (tx != null) {
return tx.getMaterial();
}
nomore = 64;
searching:
while (true) {
if (nomore < 0) {
return B.getMaterial("STONE");
}
nomore--;
if (err-- <= 0) {
return B.getMaterial("STONE");
}
for (IrisCompatabilityBlockFilter i : blockFilters) {
if (i.getWhen().equalsIgnoreCase(buf)) {
BlockData b = i.getReplace();
if (b != null) {
return b.getMaterial();
}
buf = i.getSupplement();
continue searching;
}
}
return B.getMaterial("STONE");
}
}
}

View File

@@ -35,20 +35,17 @@ import org.bukkit.block.data.BlockData;
@Desc("Find and replace object materials for compatability")
@Data
public class IrisCompatabilityBlockFilter {
private final transient AtomicCache<BlockData> findData = new AtomicCache<>(true);
private final transient AtomicCache<BlockData> replaceData = new AtomicCache<>(true);
@Required
@Desc("When iris sees this block, and it's not reconized")
private String when = "";
@Required
@Desc("Replace it with this block. Dont worry if this block is also not reconized, iris repeat this compat check.")
private String supplement = "";
@Desc("If exact is true, it compares block data for example minecraft:some_log[axis=x]")
private boolean exact = false;
private final transient AtomicCache<BlockData> findData = new AtomicCache<>(true);
private final transient AtomicCache<BlockData> replaceData = new AtomicCache<>(true);
public IrisCompatabilityBlockFilter(String when, String supplement) {
this(when, supplement, false);
}

View File

@@ -33,17 +33,15 @@ import org.bukkit.Material;
@Desc("Find and replace object items for compatability")
@Data
public class IrisCompatabilityItemFilter {
private final transient AtomicCache<Material> findData = new AtomicCache<>(true);
private final transient AtomicCache<Material> replaceData = new AtomicCache<>(true);
@Required
@Desc("When iris sees this block, and it's not reconized")
private String when = "";
@Required
@Desc("Replace it with this block. Dont worry if this block is also not reconized, iris repeat this compat check.")
private String supplement = "";
private final transient AtomicCache<Material> findData = new AtomicCache<>(true);
private final transient AtomicCache<Material> replaceData = new AtomicCache<>(true);
public IrisCompatabilityItemFilter(String when, String supplement) {
this.when = when;
this.supplement = supplement;

View File

@@ -21,7 +21,13 @@ package com.volmit.iris.engine.object;
import com.volmit.iris.Iris;
import com.volmit.iris.core.loader.IrisData;
import com.volmit.iris.engine.data.cache.AtomicCache;
import com.volmit.iris.engine.object.annotations.*;
import com.volmit.iris.engine.object.annotations.ArrayType;
import com.volmit.iris.engine.object.annotations.DependsOn;
import com.volmit.iris.engine.object.annotations.Desc;
import com.volmit.iris.engine.object.annotations.MaxNumber;
import com.volmit.iris.engine.object.annotations.MinNumber;
import com.volmit.iris.engine.object.annotations.Required;
import com.volmit.iris.engine.object.annotations.Snippet;
import com.volmit.iris.util.collection.KList;
import com.volmit.iris.util.math.RNG;
import com.volmit.iris.util.noise.CNG;
@@ -38,71 +44,58 @@ import org.bukkit.block.data.BlockData;
@Desc("A biome decorator is used for placing flowers, grass, cacti and so on")
@Data
public class IrisDecorator {
private final transient AtomicCache<CNG> layerGenerator = new AtomicCache<>();
private final transient AtomicCache<CNG> varianceGenerator = new AtomicCache<>();
private final transient AtomicCache<CNG> heightGenerator = new AtomicCache<>();
private final transient AtomicCache<KList<BlockData>> blockData = new AtomicCache<>();
private final transient AtomicCache<KList<BlockData>> blockDataTops = new AtomicCache<>();
@Desc("The varience dispersion is used when multiple blocks are put in the palette. Scatter scrambles them, Wispy shows streak-looking varience")
private IrisGeneratorStyle variance = NoiseStyle.STATIC.style();
@Desc("Forcefully place this decorant anywhere it is supposed to go even if it should not go on a specific surface block. For example, you could force tallgrass to place on top of stone by using this.")
private boolean forcePlace = false;
@DependsOn({"scaleStack", "stackMin", "stackMax"})
@Desc("If stackMax is set to true, use this to limit its max height for large caverns")
private int absoluteMaxStack = 30;
@Desc("Dispersion is used to pick places to spawn. Scatter randomly places them (vanilla) or Wispy for a streak like patch system.")
private IrisGeneratorStyle style = NoiseStyle.STATIC.style();
@DependsOn({"stackMin", "stackMax"})
@Desc("If this decorator has a height more than 1 this changes how it picks the height between your maxes. Scatter = random, Wispy = wavy heights")
private IrisGeneratorStyle heightVariance = NoiseStyle.STATIC.style();
@Desc("Tells iris where this decoration is a part of. I.e. SHORE_LINE or SEA_SURFACE")
private IrisDecorationPart partOf = IrisDecorationPart.NONE;
@DependsOn({"stackMin", "stackMax"})
@MinNumber(1)
@MaxNumber(256) // TODO: WARNING HEIGHT
@Desc("The minimum repeat stack height (setting to 3 would stack 3 of <block> on top of each other")
private int stackMin = 1;
@DependsOn({"stackMin", "stackMax"})
@MinNumber(1)
@MaxNumber(256) // TODO: WARNING HEIGHT
@Desc("The maximum repeat stack height")
private int stackMax = 1;
@DependsOn({"stackMin", "stackMax"})
@Desc("Changes stackMin and stackMin from being absolute block heights and instead uses them as a percentage to scale the stack based on the cave height" +
"\n\nWithin a cave, setting them stackMin/max to 50 would make the stack 50% of the cave height")
private boolean scaleStack = false;
@Required
@MinNumber(0)
@MaxNumber(1)
@Desc("The chance for this decorator to decorate at a given X,Y coordinate. This is hit 256 times per chunk (per surface block)")
// TODO: WARNING HEIGHT
private double chance = 0.1;
@Required
@ArrayType(min = 1, type = IrisBlockData.class)
@Desc("The palette of blocks to pick from when this decorator needs to place.")
private KList<IrisBlockData> palette = new KList<IrisBlockData>().qadd(new IrisBlockData("grass"));
@ArrayType(min = 1, type = IrisBlockData.class)
@Desc("The palette of blocks used at the very top of a 'stackMax' of higher than 1. For example, bamboo tops.")
private KList<IrisBlockData> topPalette = new KList<>();
@DependsOn("topPalette")
@MinNumber(0.01)
@MaxNumber(1.0)
@Desc("When the stack passes the top threshold, the top palette will start being used instead of the normal palette.")
private double topThreshold = 1.0;
private final transient AtomicCache<CNG> layerGenerator = new AtomicCache<>();
private final transient AtomicCache<CNG> varianceGenerator = new AtomicCache<>();
private final transient AtomicCache<CNG> heightGenerator = new AtomicCache<>();
private final transient AtomicCache<KList<BlockData>> blockData = new AtomicCache<>();
private final transient AtomicCache<KList<BlockData>> blockDataTops = new AtomicCache<>();
public int getHeight(RNG rng, double x, double z, IrisData data) {
if (stackMin == stackMax) {
return stackMin;

View File

@@ -20,7 +20,12 @@ package com.volmit.iris.engine.object;
import com.volmit.iris.core.loader.IrisData;
import com.volmit.iris.engine.data.cache.AtomicCache;
import com.volmit.iris.engine.object.annotations.*;
import com.volmit.iris.engine.object.annotations.ArrayType;
import com.volmit.iris.engine.object.annotations.Desc;
import com.volmit.iris.engine.object.annotations.MaxNumber;
import com.volmit.iris.engine.object.annotations.MinNumber;
import com.volmit.iris.engine.object.annotations.Required;
import com.volmit.iris.engine.object.annotations.Snippet;
import com.volmit.iris.util.collection.KList;
import com.volmit.iris.util.math.RNG;
import lombok.AllArgsConstructor;
@@ -37,55 +42,47 @@ import org.bukkit.util.BlockVector;
@Desc("Creates ore & other block deposits underground")
@Data
public class IrisDepositGenerator {
private final transient AtomicCache<KList<IrisObject>> objects = new AtomicCache<>();
private final transient AtomicCache<KList<BlockData>> blockData = new AtomicCache<>();
@Required
@MinNumber(0)
@MaxNumber(256) // TODO: WARNING HEIGHT
@Desc("The minimum height this deposit can generate at")
private int minHeight = 7;
@Required
@MinNumber(0)
@MaxNumber(256) // TODO: WARNING HEIGHT
@Desc("The maximum height this deposit can generate at")
private int maxHeight = 55;
@Required
@MinNumber(1)
@MaxNumber(8192)
@Desc("The minimum amount of deposit blocks per clump")
private int minSize = 3;
@Required
@MinNumber(1)
@MaxNumber(8192)
@Desc("The maximum amount of deposit blocks per clump")
private int maxSize = 64;
@Required
@MinNumber(1)
@MaxNumber(128)
@Desc("The maximum amount of clumps per chunk")
private int maxPerChunk = 3;
@Required
@MinNumber(0)
@MaxNumber(128)
@Desc("The minimum amount of clumps per chunk")
private int minPerChunk = 1;
@Required
@ArrayType(min = 1, type = IrisBlockData.class)
@Desc("The palette of blocks to be used in this deposit generator")
private KList<IrisBlockData> palette = new KList<>();
@MinNumber(1)
@MaxNumber(64)
@Desc("Ore varience is how many different objects clumps iris will create")
private int varience = 3;
private final transient AtomicCache<KList<IrisObject>> objects = new AtomicCache<>();
private final transient AtomicCache<KList<BlockData>> blockData = new AtomicCache<>();
public IrisObject getClump(RNG rng, IrisData rdata) {
KList<IrisObject> objects = this.objects.aquire(() ->
{

View File

@@ -22,7 +22,12 @@ import com.volmit.iris.Iris;
import com.volmit.iris.core.loader.IrisData;
import com.volmit.iris.core.loader.IrisRegistrant;
import com.volmit.iris.engine.data.cache.AtomicCache;
import com.volmit.iris.engine.object.annotations.*;
import com.volmit.iris.engine.object.annotations.ArrayType;
import com.volmit.iris.engine.object.annotations.Desc;
import com.volmit.iris.engine.object.annotations.MaxNumber;
import com.volmit.iris.engine.object.annotations.MinNumber;
import com.volmit.iris.engine.object.annotations.RegistryListResource;
import com.volmit.iris.engine.object.annotations.Required;
import com.volmit.iris.util.collection.KList;
import com.volmit.iris.util.data.DataProvider;
import com.volmit.iris.util.io.IO;
@@ -53,224 +58,6 @@ import java.io.IOException;
public class IrisDimension extends IrisRegistrant {
public static final BlockData STONE = Material.STONE.createBlockData();
public static final BlockData WATER = Material.WATER.createBlockData();
@MinNumber(2)
@Required
@Desc("The human readable name of this dimension")
private String name = "A Dimension";
@RegistryListResource(IrisJigsawStructure.class)
@Desc("If defined, Iris will place the given jigsaw structure where minecraft should place the overworld stronghold.")
private String stronghold;
@Desc("If set to true, Iris will remove chunks to allow visualizing cross sections of chunks easily")
private boolean debugChunkCrossSections = false;
@Desc("Vertically split up the biome palettes with 3 air blocks in between to visualize them")
private boolean explodeBiomePalettes = false;
@Desc("Studio Mode for testing different parts of the world")
private StudioMode studioMode = StudioMode.NORMAL;
@MinNumber(1)
@MaxNumber(16)
@Desc("Customize the palette height explosion")
private int explodeBiomePaletteSize = 3;
@MinNumber(2)
@MaxNumber(16)
@Desc("Every X/Z % debugCrossSectionsMod == 0 cuts the chunk")
private int debugCrossSectionsMod = 3;
@Desc("The average distance between strongholds")
private int strongholdJumpDistance = 1280;
@Desc("Define the maximum strongholds to place")
private int maxStrongholds = 14;
@Desc("Improves the biome grid variation by shuffling the cell grid more depending on the seed. This makes biomes across multiple seeds look far different than before.")
private boolean aggressiveBiomeReshuffle = false;
@Desc("Tree growth override settings")
private IrisTreeSettings treeSettings = new IrisTreeSettings();
@Desc("Upon joining this world, Iris will send a resource pack request to the client. If they have previously selected yes, it will auto-switch depending on which dimension they go to.")
private String resourcePack = "";
@Desc("Spawn Entities in this dimension over time. Iris will continually replenish these mobs just like vanilla does.")
@ArrayType(min = 1, type = String.class)
@RegistryListResource(IrisSpawner.class)
private KList<String> entitySpawners = new KList<>();
@Desc("Add specific features in exact positions")
@ArrayType(min = 1, type = IrisFeaturePositional.class)
private KList<IrisFeaturePositional> specificFeatures = new KList<>();
@Desc("Add random chances for terrain features")
@ArrayType(min = 1, type = IrisFeaturePotential.class)
private KList<IrisFeaturePotential> features = new KList<>();
@Desc("Reference loot tables in this area")
private IrisLootReference loot = new IrisLootReference();
@MinNumber(0)
@Desc("The version of this dimension. Changing this will stop users from accidentally upgrading (and breaking their worlds).")
private int version = 1;
@ArrayType(min = 1, type = IrisBlockDrops.class)
@Desc("Define custom block drops for this dimension")
private KList<IrisBlockDrops> blockDrops = new KList<>();
@Desc("Should bedrock be generated or not.")
private boolean bedrock = true;
@MinNumber(0)
@MaxNumber(1)
@Desc("The land chance. Up to 1.0 for total land or 0.0 for total sea")
private double landChance = 0.625;
@Desc("The placement style of regions")
private IrisGeneratorStyle regionStyle = NoiseStyle.CELLULAR_IRIS_DOUBLE.style();
@Desc("The placement style of land/sea")
private IrisGeneratorStyle continentalStyle = NoiseStyle.CELLULAR_IRIS_DOUBLE.style();
@Desc("The placement style of biomes")
private IrisGeneratorStyle landBiomeStyle = NoiseStyle.CELLULAR_IRIS_DOUBLE.style();
@Desc("The placement style of biomes")
private IrisGeneratorStyle shoreBiomeStyle = NoiseStyle.CELLULAR_IRIS_DOUBLE.style();
@Desc("The placement style of biomes")
private IrisGeneratorStyle seaBiomeStyle = NoiseStyle.CELLULAR_IRIS_DOUBLE.style();
@Desc("The placement style of biomes")
private IrisGeneratorStyle caveBiomeStyle = NoiseStyle.CELLULAR_IRIS_DOUBLE.style();
@Desc("Instead of filling objects with air, fills them with cobweb so you can see them")
private boolean debugSmartBore = false;
@Desc("Generate decorations or not")
private boolean decorate = true;
@Desc("Use post processing or not")
private boolean postProcessing = true;
@Desc("Add slabs in post processing")
private boolean postProcessingSlabs = true;
@Desc("Add painted walls in post processing")
private boolean postProcessingWalls = true;
@Desc("Carving configuration for the dimension")
private IrisCarving carving = new IrisCarving();
@Desc("Configuration of fluid bodies such as rivers & lakes")
private IrisFluidBodies fluidBodies = new IrisFluidBodies();
@Desc("The world environment")
private Environment environment = Environment.NORMAL;
@RegistryListResource(IrisRegion.class)
@Required
@ArrayType(min = 1, type = String.class)
@Desc("Define all of the regions to include in this dimension. Dimensions -> Regions -> Biomes -> Objects etc")
private KList<String> regions = new KList<>();
@ArrayType(min = 1, type = IrisJigsawStructurePlacement.class)
@Desc("Jigsaw structures")
private KList<IrisJigsawStructurePlacement> jigsawStructures = new KList<>();
@Required
@MinNumber(0)
@MaxNumber(255)
@Desc("The fluid height for this dimension")
private int fluidHeight = 63;
@RegistryListResource(IrisBiome.class)
@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 focus = "";
@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.")
private String focusRegion = "";
@MinNumber(0.0001)
@MaxNumber(512)
@Desc("Zoom in or out the biome size. Higher = bigger biomes")
private double biomeZoom = 5D;
@MinNumber(0.0001)
@MaxNumber(512)
@Desc("Zoom in or out the terrain. This stretches the terrain. Due to performance improvements, Higher than 2.0 may cause weird rounding artifacts. Lower = more terrain changes per block. Its a true zoom-out.")
private double terrainZoom = 1D;
@MinNumber(0)
@MaxNumber(360)
@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 dimensionAngleDeg = 0;
@MinNumber(0)
@MaxNumber(8192)
@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 double coordFractureDistance = 20;
@MinNumber(0.0001)
@MaxNumber(512)
@Desc("Coordinate fracturing zoom. Higher = less frequent warping, Lower = more frequent and rapid warping / swirls.")
private double coordFractureZoom = 8;
@MinNumber(0.0001)
@MaxNumber(512)
@Desc("This zooms in the land space")
private double landZoom = 1;
@MinNumber(0.0001)
@MaxNumber(512)
@Desc("This zooms oceanic biomes")
private double seaZoom = 1;
@MinNumber(0.0001)
@MaxNumber(512)
@Desc("Zoom in continents")
private double continentZoom = 1;
@MinNumber(0.0001)
@MaxNumber(512)
@Desc("Change the size of regions")
private double regionZoom = 1;
@Desc("Disable this to stop placing objects, entities, features & updates")
private boolean useMantle = true;
@Desc("Prevent Leaf decay as if placed in creative mode")
private boolean preventLeafDecay = false;
@ArrayType(min = 1, type = IrisDepositGenerator.class)
@Desc("Define global deposit generators")
private KList<IrisDepositGenerator> deposits = new KList<>();
@ArrayType(min = 1, type = IrisShapedGeneratorStyle.class)
@Desc("Overlay additional noise on top of the interoplated terrain.")
private KList<IrisShapedGeneratorStyle> overlayNoise = 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")
private boolean infiniteEnergy = false;
@MinNumber(0.0001)
@MaxNumber(512)
@Desc("The rock zoom mostly for zooming in on a wispy palette")
private double rockZoom = 5;
@Desc("The palette of blocks for 'stone'")
private IrisMaterialPalette rockPalette = new IrisMaterialPalette().qclear().qadd("stone");
@Desc("The palette of blocks for 'water'")
private IrisMaterialPalette fluidPalette = new IrisMaterialPalette().qclear().qadd("water");
@Desc("Cartographer map trade overrides")
private IrisVillagerOverride patchCartographers = new IrisVillagerOverride().setDisableTrade(false);
private final transient AtomicCache<Position2> parallaxSize = new AtomicCache<>();
private final transient AtomicCache<CNG> rockLayerGenerator = new AtomicCache<>();
private final transient AtomicCache<CNG> fluidLayerGenerator = new AtomicCache<>();
@@ -280,6 +67,166 @@ public class IrisDimension extends IrisRegistrant {
private final transient AtomicCache<Double> rad = new AtomicCache<>();
private final transient AtomicCache<Boolean> featuresUsed = new AtomicCache<>();
private final transient AtomicCache<KList<Position2>> strongholdsCache = new AtomicCache<>();
@MinNumber(2)
@Required
@Desc("The human readable name of this dimension")
private String name = "A Dimension";
@RegistryListResource(IrisJigsawStructure.class)
@Desc("If defined, Iris will place the given jigsaw structure where minecraft should place the overworld stronghold.")
private String stronghold;
@Desc("If set to true, Iris will remove chunks to allow visualizing cross sections of chunks easily")
private boolean debugChunkCrossSections = false;
@Desc("Vertically split up the biome palettes with 3 air blocks in between to visualize them")
private boolean explodeBiomePalettes = false;
@Desc("Studio Mode for testing different parts of the world")
private StudioMode studioMode = StudioMode.NORMAL;
@MinNumber(1)
@MaxNumber(16)
@Desc("Customize the palette height explosion")
private int explodeBiomePaletteSize = 3;
@MinNumber(2)
@MaxNumber(16)
@Desc("Every X/Z % debugCrossSectionsMod == 0 cuts the chunk")
private int debugCrossSectionsMod = 3;
@Desc("The average distance between strongholds")
private int strongholdJumpDistance = 1280;
@Desc("Define the maximum strongholds to place")
private int maxStrongholds = 14;
@Desc("Improves the biome grid variation by shuffling the cell grid more depending on the seed. This makes biomes across multiple seeds look far different than before.")
private boolean aggressiveBiomeReshuffle = false;
@Desc("Tree growth override settings")
private IrisTreeSettings treeSettings = new IrisTreeSettings();
@Desc("Upon joining this world, Iris will send a resource pack request to the client. If they have previously selected yes, it will auto-switch depending on which dimension they go to.")
private String resourcePack = "";
@Desc("Spawn Entities in this dimension over time. Iris will continually replenish these mobs just like vanilla does.")
@ArrayType(min = 1, type = String.class)
@RegistryListResource(IrisSpawner.class)
private KList<String> entitySpawners = new KList<>();
@Desc("Add specific features in exact positions")
@ArrayType(min = 1, type = IrisFeaturePositional.class)
private KList<IrisFeaturePositional> specificFeatures = new KList<>();
@Desc("Add random chances for terrain features")
@ArrayType(min = 1, type = IrisFeaturePotential.class)
private KList<IrisFeaturePotential> features = new KList<>();
@Desc("Reference loot tables in this area")
private IrisLootReference loot = new IrisLootReference();
@MinNumber(0)
@Desc("The version of this dimension. Changing this will stop users from accidentally upgrading (and breaking their worlds).")
private int version = 1;
@ArrayType(min = 1, type = IrisBlockDrops.class)
@Desc("Define custom block drops for this dimension")
private KList<IrisBlockDrops> blockDrops = new KList<>();
@Desc("Should bedrock be generated or not.")
private boolean bedrock = true;
@MinNumber(0)
@MaxNumber(1)
@Desc("The land chance. Up to 1.0 for total land or 0.0 for total sea")
private double landChance = 0.625;
@Desc("The placement style of regions")
private IrisGeneratorStyle regionStyle = NoiseStyle.CELLULAR_IRIS_DOUBLE.style();
@Desc("The placement style of land/sea")
private IrisGeneratorStyle continentalStyle = NoiseStyle.CELLULAR_IRIS_DOUBLE.style();
@Desc("The placement style of biomes")
private IrisGeneratorStyle landBiomeStyle = NoiseStyle.CELLULAR_IRIS_DOUBLE.style();
@Desc("The placement style of biomes")
private IrisGeneratorStyle shoreBiomeStyle = NoiseStyle.CELLULAR_IRIS_DOUBLE.style();
@Desc("The placement style of biomes")
private IrisGeneratorStyle seaBiomeStyle = NoiseStyle.CELLULAR_IRIS_DOUBLE.style();
@Desc("The placement style of biomes")
private IrisGeneratorStyle caveBiomeStyle = NoiseStyle.CELLULAR_IRIS_DOUBLE.style();
@Desc("Instead of filling objects with air, fills them with cobweb so you can see them")
private boolean debugSmartBore = false;
@Desc("Generate decorations or not")
private boolean decorate = true;
@Desc("Use post processing or not")
private boolean postProcessing = true;
@Desc("Add slabs in post processing")
private boolean postProcessingSlabs = true;
@Desc("Add painted walls in post processing")
private boolean postProcessingWalls = true;
@Desc("Carving configuration for the dimension")
private IrisCarving carving = new IrisCarving();
@Desc("Configuration of fluid bodies such as rivers & lakes")
private IrisFluidBodies fluidBodies = new IrisFluidBodies();
@Desc("The world environment")
private Environment environment = Environment.NORMAL;
@RegistryListResource(IrisRegion.class)
@Required
@ArrayType(min = 1, type = String.class)
@Desc("Define all of the regions to include in this dimension. Dimensions -> Regions -> Biomes -> Objects etc")
private KList<String> regions = new KList<>();
@ArrayType(min = 1, type = IrisJigsawStructurePlacement.class)
@Desc("Jigsaw structures")
private KList<IrisJigsawStructurePlacement> jigsawStructures = new KList<>();
@Required
@MinNumber(0)
@MaxNumber(255)
@Desc("The fluid height for this dimension")
private int fluidHeight = 63;
@RegistryListResource(IrisBiome.class)
@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 focus = "";
@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.")
private String focusRegion = "";
@MinNumber(0.0001)
@MaxNumber(512)
@Desc("Zoom in or out the biome size. Higher = bigger biomes")
private double biomeZoom = 5D;
@MinNumber(0.0001)
@MaxNumber(512)
@Desc("Zoom in or out the terrain. This stretches the terrain. Due to performance improvements, Higher than 2.0 may cause weird rounding artifacts. Lower = more terrain changes per block. Its a true zoom-out.")
private double terrainZoom = 1D;
@MinNumber(0)
@MaxNumber(360)
@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 dimensionAngleDeg = 0;
@MinNumber(0)
@MaxNumber(8192)
@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 double coordFractureDistance = 20;
@MinNumber(0.0001)
@MaxNumber(512)
@Desc("Coordinate fracturing zoom. Higher = less frequent warping, Lower = more frequent and rapid warping / swirls.")
private double coordFractureZoom = 8;
@MinNumber(0.0001)
@MaxNumber(512)
@Desc("This zooms in the land space")
private double landZoom = 1;
@MinNumber(0.0001)
@MaxNumber(512)
@Desc("This zooms oceanic biomes")
private double seaZoom = 1;
@MinNumber(0.0001)
@MaxNumber(512)
@Desc("Zoom in continents")
private double continentZoom = 1;
@MinNumber(0.0001)
@MaxNumber(512)
@Desc("Change the size of regions")
private double regionZoom = 1;
@Desc("Disable this to stop placing objects, entities, features & updates")
private boolean useMantle = true;
@Desc("Prevent Leaf decay as if placed in creative mode")
private boolean preventLeafDecay = false;
@ArrayType(min = 1, type = IrisDepositGenerator.class)
@Desc("Define global deposit generators")
private KList<IrisDepositGenerator> deposits = new KList<>();
@ArrayType(min = 1, type = IrisShapedGeneratorStyle.class)
@Desc("Overlay additional noise on top of the interoplated terrain.")
private KList<IrisShapedGeneratorStyle> overlayNoise = 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")
private boolean infiniteEnergy = false;
@MinNumber(0.0001)
@MaxNumber(512)
@Desc("The rock zoom mostly for zooming in on a wispy palette")
private double rockZoom = 5;
@Desc("The palette of blocks for 'stone'")
private IrisMaterialPalette rockPalette = new IrisMaterialPalette().qclear().qadd("stone");
@Desc("The palette of blocks for 'water'")
private IrisMaterialPalette fluidPalette = new IrisMaterialPalette().qclear().qadd("water");
@Desc("Cartographer map trade overrides")
private IrisVillagerOverride patchCartographers = new IrisVillagerOverride().setDisableTrade(false);
public KList<Position2> getStrongholds(long seed) {
return strongholdsCache.aquire(() -> {

View File

@@ -59,6 +59,13 @@ public enum IrisDirection {
private final int z;
private final CuboidDirection f;
IrisDirection(int x, int y, int z, CuboidDirection f) {
this.x = x;
this.y = y;
this.z = z;
this.f = f;
}
public static IrisDirection getDirection(BlockFace f) {
return switch (f) {
case DOWN -> DOWN_NEGATIVE_Y;
@@ -92,23 +99,6 @@ public enum IrisDirection {
}
@Override
public String toString() {
return switch (this) {
case DOWN_NEGATIVE_Y -> "Down";
case EAST_POSITIVE_X -> "East";
case NORTH_NEGATIVE_Z -> "North";
case SOUTH_POSITIVE_Z -> "South";
case UP_POSITIVE_Y -> "Up";
case WEST_NEGATIVE_X -> "West";
};
}
public boolean isVertical() {
return equals(DOWN_NEGATIVE_Y) || equals(UP_POSITIVE_Y);
}
public static IrisDirection closest(Vector v) {
double m = Double.MAX_VALUE;
IrisDirection s = null;
@@ -160,75 +150,6 @@ public enum IrisDirection {
return s;
}
public Vector toVector() {
return new Vector(x, y, z);
}
public boolean isCrooked(IrisDirection to) {
if (equals(to.reverse())) {
return false;
}
return !equals(to);
}
IrisDirection(int x, int y, int z, CuboidDirection f) {
this.x = x;
this.y = y;
this.z = z;
this.f = f;
}
public Vector angle(Vector initial, IrisDirection d) {
calculatePermutations();
for (Map.Entry<GBiset<IrisDirection, IrisDirection>, DOP> entry : permute.entrySet()) {
GBiset<IrisDirection, IrisDirection> i = entry.getKey();
if (i.getA().equals(this) && i.getB().equals(d)) {
return entry.getValue().op(initial);
}
}
return initial;
}
public IrisDirection reverse() {
switch (this) {
case DOWN_NEGATIVE_Y:
return UP_POSITIVE_Y;
case EAST_POSITIVE_X:
return WEST_NEGATIVE_X;
case NORTH_NEGATIVE_Z:
return SOUTH_POSITIVE_Z;
case SOUTH_POSITIVE_Z:
return NORTH_NEGATIVE_Z;
case UP_POSITIVE_Y:
return DOWN_NEGATIVE_Y;
case WEST_NEGATIVE_X:
return EAST_POSITIVE_X;
default:
break;
}
return EAST_POSITIVE_X;
}
public int x() {
return x;
}
public int y() {
return y;
}
public int z() {
return z;
}
public CuboidDirection f() {
return f;
}
public static KList<IrisDirection> news() {
return new KList<IrisDirection>().add(NORTH_NEGATIVE_Z, EAST_POSITIVE_X, WEST_NEGATIVE_X, SOUTH_POSITIVE_Z);
}
@@ -277,32 +198,6 @@ public enum IrisDirection {
}
}
/**
* Get the byte value represented in some directional blocks
*
* @return the byte value
*/
public byte byteValue() {
switch (this) {
case DOWN_NEGATIVE_Y:
return 0;
case EAST_POSITIVE_X:
return 5;
case NORTH_NEGATIVE_Z:
return 2;
case SOUTH_POSITIVE_Z:
return 3;
case UP_POSITIVE_Y:
return 1;
case WEST_NEGATIVE_X:
return 4;
default:
break;
}
return -1;
}
public static void calculatePermutations() {
if (permute != null) {
return;
@@ -391,6 +286,111 @@ public enum IrisDirection {
}
}
@Override
public String toString() {
return switch (this) {
case DOWN_NEGATIVE_Y -> "Down";
case EAST_POSITIVE_X -> "East";
case NORTH_NEGATIVE_Z -> "North";
case SOUTH_POSITIVE_Z -> "South";
case UP_POSITIVE_Y -> "Up";
case WEST_NEGATIVE_X -> "West";
};
}
public boolean isVertical() {
return equals(DOWN_NEGATIVE_Y) || equals(UP_POSITIVE_Y);
}
public Vector toVector() {
return new Vector(x, y, z);
}
public boolean isCrooked(IrisDirection to) {
if (equals(to.reverse())) {
return false;
}
return !equals(to);
}
public Vector angle(Vector initial, IrisDirection d) {
calculatePermutations();
for (Map.Entry<GBiset<IrisDirection, IrisDirection>, DOP> entry : permute.entrySet()) {
GBiset<IrisDirection, IrisDirection> i = entry.getKey();
if (i.getA().equals(this) && i.getB().equals(d)) {
return entry.getValue().op(initial);
}
}
return initial;
}
public IrisDirection reverse() {
switch (this) {
case DOWN_NEGATIVE_Y:
return UP_POSITIVE_Y;
case EAST_POSITIVE_X:
return WEST_NEGATIVE_X;
case NORTH_NEGATIVE_Z:
return SOUTH_POSITIVE_Z;
case SOUTH_POSITIVE_Z:
return NORTH_NEGATIVE_Z;
case UP_POSITIVE_Y:
return DOWN_NEGATIVE_Y;
case WEST_NEGATIVE_X:
return EAST_POSITIVE_X;
default:
break;
}
return EAST_POSITIVE_X;
}
public int x() {
return x;
}
public int y() {
return y;
}
public int z() {
return z;
}
public CuboidDirection f() {
return f;
}
/**
* Get the byte value represented in some directional blocks
*
* @return the byte value
*/
public byte byteValue() {
switch (this) {
case DOWN_NEGATIVE_Y:
return 0;
case EAST_POSITIVE_X:
return 5;
case NORTH_NEGATIVE_Z:
return 2;
case SOUTH_POSITIVE_Z:
return 3;
case UP_POSITIVE_Y:
return 1;
case WEST_NEGATIVE_X:
return 4;
default:
break;
}
return -1;
}
public BlockFace getFace() {
return switch (this) {
case DOWN_NEGATIVE_Y -> BlockFace.DOWN;

View File

@@ -21,7 +21,12 @@ package com.volmit.iris.engine.object;
import com.volmit.iris.Iris;
import com.volmit.iris.engine.data.cache.AtomicCache;
import com.volmit.iris.engine.framework.Engine;
import com.volmit.iris.engine.object.annotations.*;
import com.volmit.iris.engine.object.annotations.DependsOn;
import com.volmit.iris.engine.object.annotations.Desc;
import com.volmit.iris.engine.object.annotations.MaxNumber;
import com.volmit.iris.engine.object.annotations.MinNumber;
import com.volmit.iris.engine.object.annotations.Required;
import com.volmit.iris.engine.object.annotations.Snippet;
import com.volmit.iris.util.math.RNG;
import com.volmit.iris.util.scheduling.ChronoLatch;
import com.volmit.iris.util.scheduling.J;
@@ -45,132 +50,108 @@ import org.bukkit.util.Vector;
@Desc("An iris effect")
@Data
public class IrisEffect {
private final transient AtomicCache<PotionEffectType> pt = new AtomicCache<>();
private final transient AtomicCache<ChronoLatch> latch = new AtomicCache<>();
@Desc("The potion effect to apply in this area")
private String potionEffect = "";
@Desc("The particle effect to apply in the area")
private Particle particleEffect = null;
@DependsOn({"particleEffect"})
@MinNumber(-32)
@MaxNumber(32)
@Desc("Randomly offset from the surface to this surface+value")
private int particleOffset = 0;
@DependsOn({"particleEffect"})
@MinNumber(-8)
@MaxNumber(8)
@Desc("The alt x, usually represents motion if the particle count is zero. Otherwise an offset.")
private double particleAltX = 0;
@DependsOn({"particleEffect"})
@MinNumber(-8)
@MaxNumber(8)
@Desc("The alt y, usually represents motion if the particle count is zero. Otherwise an offset.")
private double particleAltY = 0;
@DependsOn({"particleEffect"})
@MinNumber(-8)
@MaxNumber(8)
@Desc("The alt z, usually represents motion if the particle count is zero. Otherwise an offset.")
private double particleAltZ = 0;
@DependsOn({"particleEffect"})
@Desc("Randomize the altX by -altX to altX")
private boolean randomAltX = true;
@DependsOn({"particleEffect"})
@Desc("Randomize the altY by -altY to altY")
private boolean randomAltY = false;
@DependsOn({"particleEffect"})
@Desc("Randomize the altZ by -altZ to altZ")
private boolean randomAltZ = true;
@Desc("The sound to play")
private Sound sound = null;
@DependsOn({"sound"})
@MinNumber(0)
@MaxNumber(512)
@Desc("The max distance from the player the sound will play")
private int soundDistance = 12;
@DependsOn({"sound", "maxPitch"})
@MinNumber(0.01)
@MaxNumber(1.99)
@Desc("The minimum sound pitch")
private double minPitch = 0.5D;
@DependsOn({"sound", "minVolume"})
@MinNumber(0.01)
@MaxNumber(1.99)
@Desc("The max sound pitch")
private double maxPitch = 1.5D;
@DependsOn({"sound"})
@MinNumber(0.001)
@MaxNumber(512)
@Desc("The sound volume.")
private double volume = 1.5D;
@DependsOn({"particleEffect"})
@MinNumber(0)
@MaxNumber(512)
@Desc("The particle count. Try setting to zero for using the alt xyz to a motion value instead of an offset")
private int particleCount = 0;
@DependsOn({"particleEffect"})
@MinNumber(0)
@MaxNumber(64)
@Desc("How far away from the player particles can play")
private int particleDistance = 20;
@DependsOn({"particleEffect"})
@MinNumber(0)
@MaxNumber(128)
@Desc("How wide the particles can play (player's view left and right) RADIUS")
private int particleDistanceWidth = 24;
@DependsOn({"particleEffect"})
@Desc("An extra value for some particles... Which bukkit doesn't even document.")
private double extra = 0;
@DependsOn({"potionEffect"})
@MinNumber(-1)
@MaxNumber(1024)
@Desc("The Potion Strength or -1 to disable")
private int potionStrength = -1;
@DependsOn({"potionEffect", "potionTicksMin"})
@MinNumber(1)
@Desc("The max time the potion will last for")
private int potionTicksMax = 155;
@DependsOn({"potionEffect", "potionTicksMax"})
@MinNumber(1)
@Desc("The min time the potion will last for")
private int potionTicksMin = 75;
@Required
@MinNumber(0)
@Desc("The effect interval in milliseconds")
private int interval = 150;
@DependsOn({"particleEffect"})
@MinNumber(0)
@MaxNumber(16)
@Desc("The effect distance start away")
private int particleAway = 5;
@Required
@MinNumber(1)
@Desc("The chance is 1 in CHANCE per interval")
private int chance = 50;
private final transient AtomicCache<PotionEffectType> pt = new AtomicCache<>();
private final transient AtomicCache<ChronoLatch> latch = new AtomicCache<>();
public boolean canTick() {
return latch.aquire(() -> new ChronoLatch(interval)).flip();
}

View File

@@ -21,7 +21,11 @@ package com.volmit.iris.engine.object;
import com.volmit.iris.engine.data.cache.AtomicCache;
import com.volmit.iris.engine.framework.Engine;
import com.volmit.iris.engine.mantle.MantleWriter;
import com.volmit.iris.engine.object.annotations.*;
import com.volmit.iris.engine.object.annotations.Desc;
import com.volmit.iris.engine.object.annotations.MinNumber;
import com.volmit.iris.engine.object.annotations.RegistryListResource;
import com.volmit.iris.engine.object.annotations.Required;
import com.volmit.iris.engine.object.annotations.Snippet;
import com.volmit.iris.util.math.RNG;
import com.volmit.iris.util.matter.MatterCavern;
import com.volmit.iris.util.matter.slices.CavernMatter;
@@ -31,24 +35,20 @@ import lombok.Data;
@Desc("Represents an procedural eliptical shape")
@Data
public class IrisElipsoid implements IRare {
private transient final AtomicCache<MatterCavern> matterNodeCache = new AtomicCache<>();
@Required
@Desc("Typically a 1 in RARITY on a per fork basis")
@MinNumber(1)
private int rarity = 1;
@RegistryListResource(IrisBiome.class)
@Desc("Force this cave to only generate the specified custom biome")
private String customBiome = "";
@Desc("The styled random radius for x")
private IrisStyledRange xRadius = new IrisStyledRange(1, 5, new IrisGeneratorStyle(NoiseStyle.STATIC));
@Desc("The styled random radius for y")
private IrisStyledRange yRadius = new IrisStyledRange(1, 5, new IrisGeneratorStyle(NoiseStyle.STATIC));
@Desc("The styled random radius for z")
private IrisStyledRange zRadius = new IrisStyledRange(1, 5, new IrisGeneratorStyle(NoiseStyle.STATIC));
private transient final AtomicCache<MatterCavern> matterNodeCache = new AtomicCache<>();
@SuppressWarnings("SuspiciousNameCombination")
public void generate(RNG rng, Engine engine, MantleWriter writer, int x, int y, int z) {

View File

@@ -19,7 +19,11 @@
package com.volmit.iris.engine.object;
import com.volmit.iris.Iris;
import com.volmit.iris.engine.object.annotations.*;
import com.volmit.iris.engine.object.annotations.Desc;
import com.volmit.iris.engine.object.annotations.MaxNumber;
import com.volmit.iris.engine.object.annotations.MinNumber;
import com.volmit.iris.engine.object.annotations.Required;
import com.volmit.iris.engine.object.annotations.Snippet;
import com.volmit.iris.util.math.RNG;
import lombok.AllArgsConstructor;
import lombok.Data;

View File

@@ -21,7 +21,11 @@ package com.volmit.iris.engine.object;
import com.volmit.iris.Iris;
import com.volmit.iris.core.loader.IrisRegistrant;
import com.volmit.iris.engine.framework.Engine;
import com.volmit.iris.engine.object.annotations.*;
import com.volmit.iris.engine.object.annotations.ArrayType;
import com.volmit.iris.engine.object.annotations.Desc;
import com.volmit.iris.engine.object.annotations.RegistryListResource;
import com.volmit.iris.engine.object.annotations.RegistryListSpecialEntity;
import com.volmit.iris.engine.object.annotations.Required;
import com.volmit.iris.util.collection.KList;
import com.volmit.iris.util.format.C;
import com.volmit.iris.util.json.JSONObject;
@@ -36,10 +40,20 @@ import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import org.bukkit.*;
import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.NamespacedKey;
import org.bukkit.Particle;
import org.bukkit.Sound;
import org.bukkit.attribute.Attributable;
import org.bukkit.entity.*;
import org.bukkit.entity.Ageable;
import org.bukkit.entity.Entity;
import org.bukkit.entity.EntityType;
import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Mob;
import org.bukkit.entity.Panda;
import org.bukkit.entity.Panda.Gene;
import org.bukkit.entity.Villager;
import org.bukkit.inventory.Inventory;
import org.bukkit.inventory.ItemStack;
import org.bukkit.loot.LootContext;

View File

@@ -21,7 +21,11 @@ package com.volmit.iris.engine.object;
import com.volmit.iris.Iris;
import com.volmit.iris.engine.data.cache.AtomicCache;
import com.volmit.iris.engine.framework.Engine;
import com.volmit.iris.engine.object.annotations.*;
import com.volmit.iris.engine.object.annotations.Desc;
import com.volmit.iris.engine.object.annotations.MinNumber;
import com.volmit.iris.engine.object.annotations.RegistryListResource;
import com.volmit.iris.engine.object.annotations.Required;
import com.volmit.iris.engine.object.annotations.Snippet;
import com.volmit.iris.util.format.C;
import com.volmit.iris.util.math.RNG;
import com.volmit.iris.util.matter.slices.MarkerMatter;
@@ -40,29 +44,24 @@ import org.bukkit.entity.Entity;
@Desc("Represents an entity spawn during initial chunk generation")
@Data
public class IrisEntitySpawn implements IRare {
private final transient AtomicCache<RNG> rng = new AtomicCache<>();
private final transient AtomicCache<IrisEntity> ent = new AtomicCache<>();
@RegistryListResource(IrisEntity.class)
@Required
@Desc("The entity")
private String entity = "";
@Desc("The energy multiplier when calculating spawn energy usage")
private double energyMultiplier = 1;
@MinNumber(1)
@Desc("The 1 in RARITY chance for this entity to spawn")
private int rarity = 1;
@MinNumber(1)
@Desc("The minumum of this entity to spawn")
private int minSpawns = 1;
@MinNumber(1)
@Desc("The max of this entity to spawn")
private int maxSpawns = 1;
private transient IrisSpawner referenceSpawner;
private final transient AtomicCache<RNG> rng = new AtomicCache<>();
private final transient AtomicCache<IrisEntity> ent = new AtomicCache<>();
public int spawn(Engine gen, Chunk c, RNG rng) {
int spawns = minSpawns == maxSpawns ? minSpawns : rng.i(Math.min(minSpawns, maxSpawns), Math.max(minSpawns, maxSpawns));

View File

@@ -20,7 +20,13 @@ package com.volmit.iris.engine.object;
import com.google.gson.Gson;
import com.volmit.iris.engine.data.cache.AtomicCache;
import com.volmit.iris.engine.object.annotations.*;
import com.volmit.iris.engine.object.annotations.ArrayType;
import com.volmit.iris.engine.object.annotations.Desc;
import com.volmit.iris.engine.object.annotations.MaxNumber;
import com.volmit.iris.engine.object.annotations.MinNumber;
import com.volmit.iris.engine.object.annotations.RegistryListResource;
import com.volmit.iris.engine.object.annotations.Required;
import com.volmit.iris.engine.object.annotations.Snippet;
import com.volmit.iris.util.collection.KList;
import com.volmit.iris.util.interpolation.InterpolationMethod;
import com.volmit.iris.util.interpolation.IrisInterpolation;
@@ -89,6 +95,10 @@ public class IrisFeature {
private transient AtomicCache<Double> actualRadius = new AtomicCache<>();
public static IrisFeature read(DataInputStream s) throws IOException {
return new Gson().fromJson(s.readUTF(), IrisFeature.class);
}
public double getActualRadius() {
return actualRadius.aquire(() -> {
double o = 0;
@@ -101,10 +111,6 @@ public class IrisFeature {
});
}
public static IrisFeature read(DataInputStream s) throws IOException {
return new Gson().fromJson(s.readUTF(), IrisFeature.class);
}
public void write(DataOutputStream s) throws IOException {
s.writeUTF(new Gson().toJson(this));
}

View File

@@ -42,12 +42,7 @@ import java.io.IOException;
@NoArgsConstructor
@Desc("Represents an Iris zone")
public class IrisFeaturePositional {
public IrisFeaturePositional(int x, int z, IrisFeature feature) {
this.x = x;
this.z = z;
this.feature = feature;
}
private static double BLOCK = 1D / 256D; // TODO: WARNING HEIGHT
@Required
@Desc("The x coordinate of this zone")
private int x;
@@ -61,7 +56,11 @@ public class IrisFeaturePositional {
private IrisFeature feature;
private transient AtomicCache<NoiseProvider> provider = new AtomicCache<>();
private static double BLOCK = 1D / 256D; // TODO: WARNING HEIGHT
public IrisFeaturePositional(int x, int z, IrisFeature feature) {
this.x = x;
this.z = z;
this.feature = feature;
}
public static IrisFeaturePositional read(DataInputStream s) throws IOException {
String sx = s.readUTF();

View File

@@ -21,7 +21,11 @@ package com.volmit.iris.engine.object;
import com.volmit.iris.Iris;
import com.volmit.iris.core.loader.IrisRegistrant;
import com.volmit.iris.engine.data.cache.AtomicCache;
import com.volmit.iris.engine.object.annotations.*;
import com.volmit.iris.engine.object.annotations.ArrayType;
import com.volmit.iris.engine.object.annotations.Desc;
import com.volmit.iris.engine.object.annotations.MaxNumber;
import com.volmit.iris.engine.object.annotations.MinNumber;
import com.volmit.iris.engine.object.annotations.Required;
import com.volmit.iris.util.collection.KList;
import com.volmit.iris.util.interpolation.IrisInterpolation;
import com.volmit.iris.util.json.JSONObject;
@@ -44,66 +48,51 @@ import java.util.List;
@Data
@EqualsAndHashCode(callSuper = false)
public class IrisGenerator extends IrisRegistrant {
private final transient AtomicCache<CellGenerator> cellGen = new AtomicCache<>();
@MinNumber(0.001)
@Desc("The zoom or frequency.")
private double zoom = 1;
@MinNumber(0)
@Desc("The opacity, essentially a multiplier on the output.")
private double opacity = 1;
@Desc("Multiply the compsites instead of adding them")
private boolean multiplicitive = false;
@MinNumber(0.001)
@Desc("The size of the cell fractures")
private double cellFractureZoom = 1D;
@MinNumber(0)
@Desc("Cell Fracture Coordinate Shuffling")
private double cellFractureShuffle = 12D;
@Desc("The height of fracture cells. Set to 0 to disable")
private double cellFractureHeight = 0D;
@MinNumber(0)
@MaxNumber(1)
@Desc("How big are the cells (X,Z) relative to the veins that touch them. Between 0 and 1. 0.1 means thick veins, small cells.")
private double cellPercentSize = 0.75D;
@Desc("The offset to shift this noise x")
private double offsetX = 0;
@Desc("The offset to shift this noise z")
private double offsetZ = 0;
@Required
@Desc("The seed for this generator")
private long seed = 1;
@Required
@Desc("The interpolator to use when smoothing this generator into other regions & generators")
private IrisInterpolator interpolator = new IrisInterpolator();
@MinNumber(0)
@MaxNumber(8192)
@Desc("Cliff Height Max. Disable with 0 for min and max")
private double cliffHeightMax = 0;
@MinNumber(0)
@MaxNumber(8192)
@Desc("Cliff Height Min. Disable with 0 for min and max")
private double cliffHeightMin = 0;
@ArrayType(min = 1, type = IrisNoiseGenerator.class)
@Desc("The list of noise gens this gen contains.")
private KList<IrisNoiseGenerator> composite = new KList<>();
@Desc("The noise gen for cliff height.")
private IrisNoiseGenerator cliffHeightGenerator = new IrisNoiseGenerator();
private final transient AtomicCache<CellGenerator> cellGen = new AtomicCache<>();
public double getMax() {
return opacity;
}

View File

@@ -20,7 +20,11 @@ package com.volmit.iris.engine.object;
import com.volmit.iris.core.loader.IrisData;
import com.volmit.iris.engine.data.cache.AtomicCache;
import com.volmit.iris.engine.object.annotations.*;
import com.volmit.iris.engine.object.annotations.Desc;
import com.volmit.iris.engine.object.annotations.MaxNumber;
import com.volmit.iris.engine.object.annotations.MinNumber;
import com.volmit.iris.engine.object.annotations.RegistryListResource;
import com.volmit.iris.engine.object.annotations.Snippet;
import com.volmit.iris.util.math.RNG;
import com.volmit.iris.util.noise.CNG;
import com.volmit.iris.util.noise.ExpressionNoise;
@@ -36,34 +40,27 @@ import lombok.experimental.Accessors;
@Desc("A gen style")
@Data
public class IrisGeneratorStyle {
private final transient AtomicCache<CNG> cng = new AtomicCache<>();
@Desc("The chance is 1 in CHANCE per interval")
private NoiseStyle style = NoiseStyle.FLAT;
@MinNumber(0.00001)
@Desc("The zoom of this style")
private double zoom = 1;
@Desc("Instead of using the style property, use a custom expression to represent this style.")
@RegistryListResource(IrisExpression.class)
private String expression = null;
@MinNumber(0.00001)
@Desc("The Output multiplier. Only used if parent is fracture.")
private double multiplier = 1;
@Desc("If set to true, each dimension will be fractured with a different order of input coordinates. This is usually 2 or 3 times slower than normal.")
private boolean axialFracturing = false;
@Desc("Apply a generator to the coordinate field fed into this parent generator. I.e. Distort your generator with another generator.")
private IrisGeneratorStyle fracture = null;
@MinNumber(0.01562)
@MaxNumber(64)
@Desc("The exponent")
private double exponent = 1;
private final transient AtomicCache<CNG> cng = new AtomicCache<>();
public IrisGeneratorStyle(NoiseStyle s) {
this.style = s;
}

View File

@@ -18,7 +18,11 @@
package com.volmit.iris.engine.object;
import com.volmit.iris.engine.object.annotations.*;
import com.volmit.iris.engine.object.annotations.Desc;
import com.volmit.iris.engine.object.annotations.MaxNumber;
import com.volmit.iris.engine.object.annotations.MinNumber;
import com.volmit.iris.engine.object.annotations.Required;
import com.volmit.iris.engine.object.annotations.Snippet;
import com.volmit.iris.util.function.NoiseProvider;
import com.volmit.iris.util.interpolation.InterpolationMethod;
import com.volmit.iris.util.interpolation.IrisInterpolation;

View File

@@ -18,7 +18,11 @@
package com.volmit.iris.engine.object;
import com.volmit.iris.engine.object.annotations.*;
import com.volmit.iris.engine.object.annotations.Desc;
import com.volmit.iris.engine.object.annotations.MaxNumber;
import com.volmit.iris.engine.object.annotations.MinNumber;
import com.volmit.iris.engine.object.annotations.Required;
import com.volmit.iris.engine.object.annotations.Snippet;
import com.volmit.iris.util.function.NoiseProvider3;
import com.volmit.iris.util.interpolation.InterpolationMethod3D;
import com.volmit.iris.util.interpolation.IrisInterpolation;

View File

@@ -18,7 +18,14 @@
package com.volmit.iris.engine.object;
import com.volmit.iris.engine.object.annotations.*;
import com.volmit.iris.engine.object.annotations.ArrayType;
import com.volmit.iris.engine.object.annotations.DependsOn;
import com.volmit.iris.engine.object.annotations.Desc;
import com.volmit.iris.engine.object.annotations.MaxNumber;
import com.volmit.iris.engine.object.annotations.MinNumber;
import com.volmit.iris.engine.object.annotations.RegistryListResource;
import com.volmit.iris.engine.object.annotations.Required;
import com.volmit.iris.engine.object.annotations.Snippet;
import com.volmit.iris.util.collection.KList;
import lombok.AllArgsConstructor;
import lombok.Data;

View File

@@ -18,7 +18,11 @@
package com.volmit.iris.engine.object;
import com.volmit.iris.engine.object.annotations.*;
import com.volmit.iris.engine.object.annotations.Desc;
import com.volmit.iris.engine.object.annotations.MinNumber;
import com.volmit.iris.engine.object.annotations.RegistryListResource;
import com.volmit.iris.engine.object.annotations.Required;
import com.volmit.iris.engine.object.annotations.Snippet;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

View File

@@ -21,7 +21,12 @@ package com.volmit.iris.engine.object;
import com.volmit.iris.Iris;
import com.volmit.iris.core.loader.IrisRegistrant;
import com.volmit.iris.engine.data.cache.AtomicCache;
import com.volmit.iris.engine.object.annotations.*;
import com.volmit.iris.engine.object.annotations.ArrayType;
import com.volmit.iris.engine.object.annotations.Desc;
import com.volmit.iris.engine.object.annotations.MaxNumber;
import com.volmit.iris.engine.object.annotations.MinNumber;
import com.volmit.iris.engine.object.annotations.RegistryListResource;
import com.volmit.iris.engine.object.annotations.Required;
import com.volmit.iris.util.collection.KList;
import com.volmit.iris.util.json.JSONObject;
import com.volmit.iris.util.plugin.VolmitSender;

View File

@@ -21,7 +21,11 @@ package com.volmit.iris.engine.object;
import com.volmit.iris.core.loader.IrisData;
import com.volmit.iris.engine.framework.Engine;
import com.volmit.iris.engine.mantle.MantleWriter;
import com.volmit.iris.engine.object.annotations.*;
import com.volmit.iris.engine.object.annotations.Desc;
import com.volmit.iris.engine.object.annotations.MinNumber;
import com.volmit.iris.engine.object.annotations.RegistryListResource;
import com.volmit.iris.engine.object.annotations.Required;
import com.volmit.iris.engine.object.annotations.Snippet;
import com.volmit.iris.util.collection.KList;
import com.volmit.iris.util.math.RNG;
import com.volmit.iris.util.matter.MatterFluidBody;

View File

@@ -20,7 +20,13 @@ package com.volmit.iris.engine.object;
import com.volmit.iris.Iris;
import com.volmit.iris.engine.data.cache.AtomicCache;
import com.volmit.iris.engine.object.annotations.*;
import com.volmit.iris.engine.object.annotations.ArrayType;
import com.volmit.iris.engine.object.annotations.Desc;
import com.volmit.iris.engine.object.annotations.MaxNumber;
import com.volmit.iris.engine.object.annotations.MinNumber;
import com.volmit.iris.engine.object.annotations.RegistryListItemType;
import com.volmit.iris.engine.object.annotations.Required;
import com.volmit.iris.engine.object.annotations.Snippet;
import com.volmit.iris.util.collection.KList;
import com.volmit.iris.util.data.B;
import com.volmit.iris.util.format.C;
@@ -40,7 +46,7 @@ import org.bukkit.inventory.meta.ItemMeta;
import org.bukkit.inventory.meta.LeatherArmorMeta;
import org.bukkit.material.Colorable;
import java.awt.*;
import java.awt.Color;
@Snippet("loot")
@Accessors(chain = true)
@@ -49,70 +55,54 @@ import java.awt.*;
@Desc("Represents a loot entry")
@Data
public class IrisLoot {
private final transient AtomicCache<CNG> chance = new AtomicCache<>();
@Desc("The target inventory slot types to fill this loot with")
private InventorySlotType slotTypes = InventorySlotType.STORAGE;
@MinNumber(1)
@Desc("The sub rarity of this loot. Calculated after this loot table has been picked.")
private int rarity = 1;
@MinNumber(1)
@Desc("Minimum amount of this loot")
private int minAmount = 1;
@MinNumber(1)
@Desc("Maximum amount of this loot")
private int maxAmount = 1;
@MinNumber(1)
@Desc("The display name of this item")
private String displayName = null;
@MinNumber(0)
@MaxNumber(1)
@Desc("Minimum durability percent")
private double minDurability = 0;
@MinNumber(0)
@MaxNumber(1)
@Desc("Maximum durability percent")
private double maxDurability = 1;
@Desc("Define a custom model identifier 1.14+ only")
private Integer customModel = null;
@Desc("Set this to true to prevent it from being broken")
private boolean unbreakable = false;
@ArrayType(min = 1, type = ItemFlag.class)
@Desc("The item flags to add")
private KList<ItemFlag> itemFlags = new KList<>();
@Desc("Apply enchantments to this item")
@ArrayType(min = 1, type = IrisEnchantment.class)
private KList<IrisEnchantment> enchantments = new KList<>();
@Desc("Apply attribute modifiers to this item")
@ArrayType(min = 1, type = IrisAttributeModifier.class)
private KList<IrisAttributeModifier> attributes = new KList<>();
@ArrayType(min = 1, type = String.class)
@Desc("Add lore to this item")
private KList<String> lore = new KList<>();
@RegistryListItemType
@Required
@Desc("This is the item or block type. Does not accept minecraft:*. Only materials such as DIAMOND_SWORD or DIRT.")
private String type = "";
@Desc("The dye color")
private DyeColor dyeColor = null;
@Desc("The leather armor color")
private String leatherColor = null;
private final transient AtomicCache<CNG> chance = new AtomicCache<>();
public Material getType() {
return B.getMaterial(type);
}

View File

@@ -19,7 +19,11 @@
package com.volmit.iris.engine.object;
import com.volmit.iris.engine.data.cache.AtomicCache;
import com.volmit.iris.engine.object.annotations.*;
import com.volmit.iris.engine.object.annotations.ArrayType;
import com.volmit.iris.engine.object.annotations.Desc;
import com.volmit.iris.engine.object.annotations.MinNumber;
import com.volmit.iris.engine.object.annotations.RegistryListResource;
import com.volmit.iris.engine.object.annotations.Snippet;
import com.volmit.iris.util.collection.KList;
import com.volmit.iris.util.data.DataProvider;
import lombok.AllArgsConstructor;
@@ -34,20 +38,17 @@ import lombok.experimental.Accessors;
@Desc("Represents a loot entry")
@Data
public class IrisLootReference {
private final transient AtomicCache<KList<IrisLootTable>> tt = new AtomicCache<>();
@Desc("Add = add on top of parent tables, Replace = clear first then add these. Clear = Remove all and dont add loot from this or parent.")
private IrisLootMode mode = IrisLootMode.ADD;
@RegistryListResource(IrisLootTable.class)
@ArrayType(min = 1, type = String.class)
@Desc("Add loot table registries here")
private KList<String> tables = new KList<>();
@MinNumber(0)
@Desc("Increase the chance of loot in this area")
private double multiplier = 1D;
private final transient AtomicCache<KList<IrisLootTable>> tt = new AtomicCache<>();
public KList<IrisLootTable> getLootTables(DataProvider g) {
return tt.aquire(() ->
{

View File

@@ -20,7 +20,11 @@ package com.volmit.iris.engine.object;
import com.volmit.iris.core.loader.IrisData;
import com.volmit.iris.engine.data.cache.AtomicCache;
import com.volmit.iris.engine.object.annotations.*;
import com.volmit.iris.engine.object.annotations.ArrayType;
import com.volmit.iris.engine.object.annotations.Desc;
import com.volmit.iris.engine.object.annotations.MinNumber;
import com.volmit.iris.engine.object.annotations.Required;
import com.volmit.iris.engine.object.annotations.Snippet;
import com.volmit.iris.util.collection.KList;
import com.volmit.iris.util.math.RNG;
import com.volmit.iris.util.noise.CNG;
@@ -37,22 +41,19 @@ import org.bukkit.block.data.BlockData;
@Desc("A palette of materials")
@Data
public class IrisMaterialPalette {
private final transient AtomicCache<KList<BlockData>> blockData = new AtomicCache<>();
private final transient AtomicCache<CNG> layerGenerator = new AtomicCache<>();
private final transient AtomicCache<CNG> heightGenerator = new AtomicCache<>();
@Desc("The style of noise")
private IrisGeneratorStyle style = NoiseStyle.STATIC.style();
@MinNumber(0.0001)
@Desc("The terrain zoom mostly for zooming in on a wispy palette")
private double zoom = 5;
@Required
@ArrayType(min = 1, type = IrisBlockData.class)
@Desc("The palette of blocks to be used in this layer")
private KList<IrisBlockData> palette = new KList<IrisBlockData>().qadd(new IrisBlockData("STONE"));
private final transient AtomicCache<KList<BlockData>> blockData = new AtomicCache<>();
private final transient AtomicCache<CNG> layerGenerator = new AtomicCache<>();
private final transient AtomicCache<CNG> heightGenerator = new AtomicCache<>();
public BlockData get(RNG rng, double x, double y, double z, IrisData rdata) {
if (getBlockData(rdata).isEmpty()) {
return null;

View File

@@ -19,7 +19,12 @@
package com.volmit.iris.engine.object;
import com.volmit.iris.core.loader.IrisRegistrant;
import com.volmit.iris.engine.object.annotations.*;
import com.volmit.iris.engine.object.annotations.ArrayType;
import com.volmit.iris.engine.object.annotations.Desc;
import com.volmit.iris.engine.object.annotations.MaxNumber;
import com.volmit.iris.engine.object.annotations.MinNumber;
import com.volmit.iris.engine.object.annotations.RegistryListResource;
import com.volmit.iris.engine.object.annotations.Required;
import com.volmit.iris.util.collection.KList;
import com.volmit.iris.util.json.JSONObject;
import com.volmit.iris.util.plugin.VolmitSender;

View File

@@ -18,7 +18,11 @@
package com.volmit.iris.engine.object;
import com.volmit.iris.engine.object.annotations.*;
import com.volmit.iris.engine.object.annotations.ArrayType;
import com.volmit.iris.engine.object.annotations.Desc;
import com.volmit.iris.engine.object.annotations.RegistryListResource;
import com.volmit.iris.engine.object.annotations.Required;
import com.volmit.iris.engine.object.annotations.Snippet;
import com.volmit.iris.util.collection.KList;
import lombok.AllArgsConstructor;
import lombok.Data;

View File

@@ -18,7 +18,11 @@
package com.volmit.iris.engine.object;
import com.volmit.iris.engine.object.annotations.*;
import com.volmit.iris.engine.object.annotations.ArrayType;
import com.volmit.iris.engine.object.annotations.Desc;
import com.volmit.iris.engine.object.annotations.RegistryListResource;
import com.volmit.iris.engine.object.annotations.Required;
import com.volmit.iris.engine.object.annotations.Snippet;
import com.volmit.iris.util.collection.KList;
import lombok.AllArgsConstructor;
import lombok.Data;

View File

@@ -18,7 +18,11 @@
package com.volmit.iris.engine.object;
import com.volmit.iris.engine.object.annotations.*;
import com.volmit.iris.engine.object.annotations.ArrayType;
import com.volmit.iris.engine.object.annotations.Desc;
import com.volmit.iris.engine.object.annotations.RegistryListResource;
import com.volmit.iris.engine.object.annotations.Required;
import com.volmit.iris.engine.object.annotations.Snippet;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

View File

@@ -18,7 +18,11 @@
package com.volmit.iris.engine.object;
import com.volmit.iris.engine.object.annotations.*;
import com.volmit.iris.engine.object.annotations.ArrayType;
import com.volmit.iris.engine.object.annotations.Desc;
import com.volmit.iris.engine.object.annotations.RegistryListResource;
import com.volmit.iris.engine.object.annotations.Required;
import com.volmit.iris.engine.object.annotations.Snippet;
import com.volmit.iris.util.collection.KList;
import lombok.AllArgsConstructor;
import lombok.Data;

View File

@@ -18,7 +18,11 @@
package com.volmit.iris.engine.object;
import com.volmit.iris.engine.object.annotations.*;
import com.volmit.iris.engine.object.annotations.ArrayType;
import com.volmit.iris.engine.object.annotations.Desc;
import com.volmit.iris.engine.object.annotations.RegistryListResource;
import com.volmit.iris.engine.object.annotations.Required;
import com.volmit.iris.engine.object.annotations.Snippet;
import com.volmit.iris.util.collection.KList;
import lombok.AllArgsConstructor;
import lombok.Data;

View File

@@ -18,7 +18,11 @@
package com.volmit.iris.engine.object;
import com.volmit.iris.engine.object.annotations.*;
import com.volmit.iris.engine.object.annotations.ArrayType;
import com.volmit.iris.engine.object.annotations.Desc;
import com.volmit.iris.engine.object.annotations.RegistryListResource;
import com.volmit.iris.engine.object.annotations.Required;
import com.volmit.iris.engine.object.annotations.Snippet;
import com.volmit.iris.util.collection.KList;
import lombok.AllArgsConstructor;
import lombok.Data;

View File

@@ -18,7 +18,11 @@
package com.volmit.iris.engine.object;
import com.volmit.iris.engine.object.annotations.*;
import com.volmit.iris.engine.object.annotations.ArrayType;
import com.volmit.iris.engine.object.annotations.Desc;
import com.volmit.iris.engine.object.annotations.RegistryListResource;
import com.volmit.iris.engine.object.annotations.Required;
import com.volmit.iris.engine.object.annotations.Snippet;
import com.volmit.iris.util.collection.KList;
import lombok.AllArgsConstructor;
import lombok.Data;

View File

@@ -20,7 +20,12 @@ package com.volmit.iris.engine.object;
import com.volmit.iris.core.loader.IrisData;
import com.volmit.iris.engine.data.cache.AtomicCache;
import com.volmit.iris.engine.object.annotations.*;
import com.volmit.iris.engine.object.annotations.ArrayType;
import com.volmit.iris.engine.object.annotations.Desc;
import com.volmit.iris.engine.object.annotations.MaxNumber;
import com.volmit.iris.engine.object.annotations.MinNumber;
import com.volmit.iris.engine.object.annotations.Required;
import com.volmit.iris.engine.object.annotations.Snippet;
import com.volmit.iris.util.collection.KList;
import com.volmit.iris.util.interpolation.IrisInterpolation;
import com.volmit.iris.util.math.RNG;
@@ -37,60 +42,45 @@ import lombok.experimental.Accessors;
@Desc("A noise generator")
@Data
public class IrisNoiseGenerator {
private final transient AtomicCache<CNG> generator = new AtomicCache<>();
@MinNumber(0.0001)
@Desc("The coordinate input zoom")
private double zoom = 1;
@Desc("Reverse the output. So that noise = -noise + opacity")
private boolean negative = false;
@MinNumber(0)
@MaxNumber(1)
@Desc("The output multiplier")
private double opacity = 1;
@Desc("Coordinate offset x")
private double offsetX = 0;
@Desc("Height output offset y. Avoid using with terrain generation.")
private double offsetY = 0;
@Desc("Coordinate offset z")
private double offsetZ = 0;
@Required
@Desc("The seed")
private long seed = 0;
@Desc("Apply a parametric curve on the output")
private boolean parametric = false;
@Desc("Apply a bezier curve on the output")
private boolean bezier = false;
@Desc("Apply a sin-center curve on the output (0, and 1 = 0 and 0.5 = 1.0 using a sinoid shape.)")
private boolean sinCentered = false;
@Desc("The exponent noise^EXPONENT")
private double exponent = 1;
@Desc("Enable / disable. Outputs offsetY if disabled")
private boolean enabled = true;
@Required
@Desc("The Noise Style")
private IrisGeneratorStyle style = NoiseStyle.IRIS.style();
@MinNumber(1)
@Desc("Multiple octaves for multple generators of changing zooms added together")
private int octaves = 1;
@ArrayType(min = 1, type = IrisNoiseGenerator.class)
@Desc("Apply a child noise generator to fracture the input coordinates of this generator")
private KList<IrisNoiseGenerator> fracture = new KList<>();
private final transient AtomicCache<CNG> generator = new AtomicCache<>();
public IrisNoiseGenerator(boolean enabled) {
this();
this.enabled = enabled;

View File

@@ -49,8 +49,19 @@ import org.bukkit.block.data.type.Leaves;
import org.bukkit.util.BlockVector;
import org.bukkit.util.Vector;
import java.io.*;
import java.util.*;
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.function.Consumer;
@SuppressWarnings("DefaultAnnotationParam")
@@ -62,7 +73,15 @@ public class IrisObject extends IrisRegistrant {
protected static final BlockData VAIR = B.get("VOID_AIR");
protected static final BlockData VAIR_DEBUG = B.get("COBWEB");
protected static final BlockData[] SNOW_LAYERS = new BlockData[]{B.get("minecraft:snow[layers=1]"), B.get("minecraft:snow[layers=2]"), B.get("minecraft:snow[layers=3]"), B.get("minecraft:snow[layers=4]"), B.get("minecraft:snow[layers=5]"), B.get("minecraft:snow[layers=6]"), B.get("minecraft:snow[layers=7]"), B.get("minecraft:snow[layers=8]")};
protected transient final IrisLock readLock = new IrisLock("read-conclock");
@Getter
@Setter
protected transient volatile boolean smartBored = false;
@Getter
@Setter
protected transient IrisLock lock = new IrisLock("Preloadcache");
@Setter
protected transient AtomicCache<AxisAlignedBB> aabb = new AtomicCache<>();
private KMap<BlockVector, BlockData> blocks;
private KMap<BlockVector, TileData<? extends TileState>> states;
@Getter
@@ -74,18 +93,9 @@ public class IrisObject extends IrisRegistrant {
@Getter
@Setter
private int h;
protected transient final IrisLock readLock = new IrisLock("read-conclock");
@Getter
@Setter
private transient BlockVector center;
@Getter
@Setter
protected transient volatile boolean smartBored = false;
@Getter
@Setter
protected transient IrisLock lock = new IrisLock("Preloadcache");
@Setter
protected transient AtomicCache<AxisAlignedBB> aabb = new AtomicCache<>();
public IrisObject(int w, int h, int d) {
blocks = new KMap<>();
@@ -100,10 +110,6 @@ public class IrisObject extends IrisRegistrant {
this(0, 0, 0);
}
public AxisAlignedBB getAABB() {
return aabb.aquire(() -> getAABBFor(new BlockVector(w, h, d)));
}
public static BlockVector getCenterForSize(BlockVector size) {
return new BlockVector(size.getX() / 2, size.getY() / 2, size.getZ() / 2);
}
@@ -114,6 +120,38 @@ public class IrisObject extends IrisRegistrant {
new IrisPosition(new BlockVector(size.getX() - 1, size.getY() - 1, size.getZ() - 1).subtract(center).toBlockVector()));
}
@SuppressWarnings({"resource", "RedundantSuppression"})
public static BlockVector sampleSize(File file) throws IOException {
FileInputStream in = new FileInputStream(file);
DataInputStream din = new DataInputStream(in);
BlockVector bv = new BlockVector(din.readInt(), din.readInt(), din.readInt());
Iris.later(din::close);
return bv;
}
private static List<BlockVector> blocksBetweenTwoPoints(Vector loc1, Vector loc2) {
List<BlockVector> locations = new ArrayList<>();
int topBlockX = Math.max(loc1.getBlockX(), loc2.getBlockX());
int bottomBlockX = Math.min(loc1.getBlockX(), loc2.getBlockX());
int topBlockY = Math.max(loc1.getBlockY(), loc2.getBlockY());
int bottomBlockY = Math.min(loc1.getBlockY(), loc2.getBlockY());
int topBlockZ = Math.max(loc1.getBlockZ(), loc2.getBlockZ());
int bottomBlockZ = Math.min(loc1.getBlockZ(), loc2.getBlockZ());
for (int x = bottomBlockX; x <= topBlockX; x++) {
for (int z = bottomBlockZ; z <= topBlockZ; z++) {
for (int y = bottomBlockY; y <= topBlockY; y++) {
locations.add(new BlockVector(x, y, z));
}
}
}
return locations;
}
public AxisAlignedBB getAABB() {
return aabb.aquire(() -> getAABBFor(new BlockVector(w, h, d)));
}
public void ensureSmartBored(boolean debug) {
if (smartBored) {
return;
@@ -240,15 +278,6 @@ public class IrisObject extends IrisRegistrant {
return o;
}
@SuppressWarnings({"resource", "RedundantSuppression"})
public static BlockVector sampleSize(File file) throws IOException {
FileInputStream in = new FileInputStream(file);
DataInputStream din = new DataInputStream(in);
BlockVector bv = new BlockVector(din.readInt(), din.readInt(), din.readInt());
Iris.later(din::close);
return bv;
}
public void readLegacy(InputStream in) throws IOException {
DataInputStream din = new DataInputStream(in);
this.w = din.readInt();
@@ -471,7 +500,7 @@ public class IrisObject extends IrisRegistrant {
for (int j = z - (rotatedDimensions.getBlockZ() / 2) + offset.getBlockZ(); j <= z + (rotatedDimensions.getBlockZ() / 2) + offset.getBlockZ(); j++) {
int h = placer.getHighest(i, j, getLoader(), config.isUnderwater()) + rty;
if (placer.isCarved(i, h, j) || placer.isCarved(i, h-1, j) || placer.isCarved(i, h-2, j) || placer.isCarved(i, h-3, j)) {
if (placer.isCarved(i, h, j) || placer.isCarved(i, h - 1, j) || placer.isCarved(i, h - 2, j) || placer.isCarved(i, h - 3, j)) {
bail = true;
break;
}
@@ -489,7 +518,7 @@ public class IrisObject extends IrisRegistrant {
for (int j = z - (rotatedDimensions.getBlockZ() / 2) + offset.getBlockZ(); j <= z + (rotatedDimensions.getBlockZ() / 2) + offset.getBlockZ(); j += (rotatedDimensions.getBlockZ() / 2) + 1) {
int h = placer.getHighest(i, j, getLoader(), config.isUnderwater()) + rty;
if (placer.isCarved(i, h, j) || placer.isCarved(i, h-1, j) || placer.isCarved(i, h-2, j) || placer.isCarved(i, h-3, j)) {
if (placer.isCarved(i, h, j) || placer.isCarved(i, h - 1, j) || placer.isCarved(i, h - 2, j) || placer.isCarved(i, h - 3, j)) {
bail = true;
break;
}
@@ -507,7 +536,7 @@ public class IrisObject extends IrisRegistrant {
for (int i = x - (rotatedDimensions.getBlockX() / 2) + offset.getBlockX(); i <= x + (rotatedDimensions.getBlockX() / 2) + offset.getBlockX(); i++) {
for (int j = z - (rotatedDimensions.getBlockZ() / 2) + offset.getBlockZ(); j <= z + (rotatedDimensions.getBlockZ() / 2) + offset.getBlockZ(); j++) {
int h = placer.getHighest(i, j, getLoader(), config.isUnderwater()) + rty;
if (placer.isCarved(i, h, j) || placer.isCarved(i, h-1, j) || placer.isCarved(i, h-2, j) || placer.isCarved(i, h-3, j)) {
if (placer.isCarved(i, h, j) || placer.isCarved(i, h - 1, j) || placer.isCarved(i, h - 2, j) || placer.isCarved(i, h - 3, j)) {
bail = true;
break;
}
@@ -524,7 +553,7 @@ public class IrisObject extends IrisRegistrant {
for (int i = x - (rotatedDimensions.getBlockX() / 2) + offset.getBlockX(); i <= x + (rotatedDimensions.getBlockX() / 2) + offset.getBlockX(); i += (rotatedDimensions.getBlockX() / 2) + 1) {
for (int j = z - (rotatedDimensions.getBlockZ() / 2) + offset.getBlockZ(); j <= z + (rotatedDimensions.getBlockZ() / 2) + offset.getBlockZ(); j += (rotatedDimensions.getBlockZ() / 2) + 1) {
int h = placer.getHighest(i, j, getLoader(), config.isUnderwater()) + rty;
if (placer.isCarved(i, h, j) || placer.isCarved(i, h-1, j) || placer.isCarved(i, h-2, j) || placer.isCarved(i, h-3, j)) {
if (placer.isCarved(i, h, j) || placer.isCarved(i, h - 1, j) || placer.isCarved(i, h - 2, j) || placer.isCarved(i, h - 3, j)) {
bail = true;
break;
}
@@ -535,20 +564,20 @@ public class IrisObject extends IrisRegistrant {
}
} else if (config.getMode().equals(ObjectPlaceMode.PAINT)) {
y = placer.getHighest(x, z, getLoader(), config.isUnderwater()) + rty;
if (placer.isCarved(x, y, z) || placer.isCarved(x, y-1, z)|| placer.isCarved(x, y-2, z)|| placer.isCarved(x, y-3, z)) {
if (placer.isCarved(x, y, z) || placer.isCarved(x, y - 1, z) || placer.isCarved(x, y - 2, z) || placer.isCarved(x, y - 3, z)) {
bail = true;
}
}
} else {
y = yv;
if (placer.isCarved(x, y, z) || placer.isCarved(x, y-1, z)|| placer.isCarved(x, y-2, z)|| placer.isCarved(x, y-3, z)) {
if (placer.isCarved(x, y, z) || placer.isCarved(x, y - 1, z) || placer.isCarved(x, y - 2, z) || placer.isCarved(x, y - 3, z)) {
bail = true;
}
}
if (yv >= 0 && config.isBottom()) {
y += Math.floorDiv(h, 2);
bail = placer.isCarved(x, y, z) || placer.isCarved(x, y-1, z)|| placer.isCarved(x, y-2, z)|| placer.isCarved(x, y-3, z);
bail = placer.isCarved(x, y, z) || placer.isCarved(x, y - 1, z) || placer.isCarved(x, y - 2, z) || placer.isCarved(x, y - 3, z);
}
if (bail) {
@@ -991,25 +1020,6 @@ public class IrisObject extends IrisRegistrant {
return r;
}
private static List<BlockVector> blocksBetweenTwoPoints(Vector loc1, Vector loc2) {
List<BlockVector> locations = new ArrayList<>();
int topBlockX = Math.max(loc1.getBlockX(), loc2.getBlockX());
int bottomBlockX = Math.min(loc1.getBlockX(), loc2.getBlockX());
int topBlockY = Math.max(loc1.getBlockY(), loc2.getBlockY());
int bottomBlockY = Math.min(loc1.getBlockY(), loc2.getBlockY());
int topBlockZ = Math.max(loc1.getBlockZ(), loc2.getBlockZ());
int bottomBlockZ = Math.min(loc1.getBlockZ(), loc2.getBlockZ());
for (int x = bottomBlockX; x <= topBlockX; x++) {
for (int z = bottomBlockZ; z <= topBlockZ; z++) {
for (int y = bottomBlockY; y <= topBlockY; y++) {
locations.add(new BlockVector(x, y, z));
}
}
}
return locations;
}
public int volume() {
return blocks.size();
}

View File

@@ -20,7 +20,11 @@ package com.volmit.iris.engine.object;
import com.volmit.iris.core.loader.IrisData;
import com.volmit.iris.engine.data.cache.AtomicCache;
import com.volmit.iris.engine.object.annotations.*;
import com.volmit.iris.engine.object.annotations.ArrayType;
import com.volmit.iris.engine.object.annotations.Desc;
import com.volmit.iris.engine.object.annotations.RegistryListResource;
import com.volmit.iris.engine.object.annotations.Required;
import com.volmit.iris.engine.object.annotations.Snippet;
import com.volmit.iris.util.collection.KList;
import lombok.AllArgsConstructor;
import lombok.Data;
@@ -35,23 +39,19 @@ import org.bukkit.block.data.BlockData;
@Desc("Represents loot within this object or jigsaw piece")
@Data
public class IrisObjectLoot {
private final transient AtomicCache<KList<BlockData>> filterCache = new AtomicCache<>();
@ArrayType(min = 1, type = IrisBlockData.class)
@Desc("The list of blocks this loot table should apply to")
private KList<IrisBlockData> filter = new KList<>();
@Desc("Exactly match the block data or not")
private boolean exact = false;
@Desc("The loot table name")
@Required
@RegistryListResource(IrisLootTable.class)
private String name;
@Desc("The weight of this loot table being chosen")
private int weight = 1;
private final transient AtomicCache<KList<BlockData>> filterCache = new AtomicCache<>();
public KList<BlockData> getFilter(IrisData rdata) {
return filterCache.aquire(() ->
{

View File

@@ -21,7 +21,13 @@ package com.volmit.iris.engine.object;
import com.volmit.iris.Iris;
import com.volmit.iris.core.loader.IrisData;
import com.volmit.iris.engine.data.cache.AtomicCache;
import com.volmit.iris.engine.object.annotations.*;
import com.volmit.iris.engine.object.annotations.ArrayType;
import com.volmit.iris.engine.object.annotations.Desc;
import com.volmit.iris.engine.object.annotations.MaxNumber;
import com.volmit.iris.engine.object.annotations.MinNumber;
import com.volmit.iris.engine.object.annotations.RegistryListResource;
import com.volmit.iris.engine.object.annotations.Required;
import com.volmit.iris.engine.object.annotations.Snippet;
import com.volmit.iris.util.collection.KList;
import com.volmit.iris.util.collection.KMap;
import com.volmit.iris.util.data.B;
@@ -47,114 +53,88 @@ import org.bukkit.block.data.BlockData;
@Desc("Represents an iris object placer. It places objects.")
@Data
public class IrisObjectPlacement {
private final transient AtomicCache<CNG> surfaceWarp = new AtomicCache<>();
@RegistryListResource(IrisObject.class)
@Required
@ArrayType(min = 1, type = String.class)
@Desc("List of objects to place")
private KList<String> place = new KList<>();
@Desc("Rotate this objects placement")
private IrisObjectRotation rotation = new IrisObjectRotation();
@Desc("Limit the max height or min height of placement.")
private IrisObjectLimit clamp = new IrisObjectLimit();
@ArrayType(min = 1, type = IrisFeaturePotential.class)
@Desc("Place additional noise features in the object's place location")
private KList<IrisFeaturePotential> addFeatures = new KList<>();
@MinNumber(0)
@MaxNumber(1)
@Desc("The maximum layer level of a snow filter overtop of this placement. Set to 0 to disable. Max of 1.")
private double snow = 0;
@MinNumber(0)
@MaxNumber(1)
@Desc("The chance for this to place in a chunk. If you need multiple per chunk, set this to 1 and use density.")
private double chance = 1;
@MinNumber(1)
@Desc("If the chance check passes, place this many in a single chunk")
private int density = 1;
@MaxNumber(64)
@MinNumber(0)
@Desc("If the place mode is set to stilt, you can over-stilt it even further into the ground. Especially useful when using fast stilt due to inaccuracies.")
private int overStilt = 0;
@MaxNumber(64)
@MinNumber(0)
@Desc("When bore is enabled, expand max-y of the cuboid it removes")
private int boreExtendMaxY = 0;
@MaxNumber(64)
@MinNumber(-1)
@Desc("When bore is enabled, lower min-y of the cuboid it removes")
private int boreExtendMinY = 0;
@MaxNumber(64)
@MinNumber(4)
@Desc("When vacuum is enabled, define the interpolation radius")
private int vacuumInterpolationRadius = 16;
@MaxNumber(64)
@MinNumber(4)
@Desc("When vacuum is enabled, define the interpolation method")
private InterpolationMethod vacuumInterpolationMethod = InterpolationMethod.BILINEAR_STARCAST_9;
@Desc("If set to true, objects will place on the terrain height, ignoring the water surface.")
private boolean underwater = false;
@Desc("If set to true, objects will place in carvings (such as underground) or under an overhang.")
private CarvingMode carvingSupport = CarvingMode.SURFACE_ONLY;
@Desc("If this is defined, this object wont place on the terrain heightmap, but instead on this virtual heightmap")
private IrisNoiseGenerator heightmap;
@Desc("If set to true, Iris will try to fill the insides of 'rooms' and 'pockets' where air should fit based off of raytrace checks. This prevents a village house placing in an area where a tree already exists, and instead replaces the parts of the tree where the interior of the structure is. \n\nThis operation does not affect warmed-up generation speed however it does slow down loading objects.")
private boolean smartBore = false;
@Desc("If set to true, Blocks placed underwater that could be waterlogged are waterlogged.")
private boolean waterloggable = false;
@Desc("If set to true, objects will place on the fluid height level Such as boats.")
private boolean onwater = false;
@Desc("If set to true, this object will only place parts of itself where blocks already exist. Warning: Melding is very performance intensive!")
private boolean meld = false;
@Desc("If set to true, this object will place from the ground up instead of height checks when not y locked to the surface. This is not compatable with X and Z axis rotations (it may look off)")
private boolean bottom = false;
@Desc("If set to true, air will be placed before the schematic places.")
private boolean bore = false;
@Desc("Use a generator to warp the field of coordinates. Using simplex for example would make a square placement warp like a flag")
private IrisGeneratorStyle warp = new IrisGeneratorStyle(NoiseStyle.FLAT);
@Desc("If the place mode is set to CENTER_HEIGHT_RIGID and you have an X/Z translation, Turning on translate center will also translate the center height check.")
private boolean translateCenter = false;
@Desc("The placement mode")
private ObjectPlaceMode mode = ObjectPlaceMode.CENTER_HEIGHT;
@ArrayType(min = 1, type = IrisObjectReplace.class)
@Desc("Find and replace blocks")
private KList<IrisObjectReplace> edit = new KList<>();
@Desc("Translate this object's placement")
private IrisObjectTranslate translate = new IrisObjectTranslate();
@Desc("Scale Objects")
private IrisObjectScale scale = new IrisObjectScale();
@ArrayType(min = 1, type = IrisObjectLoot.class)
@Desc("The loot tables to apply to these objects")
private KList<IrisObjectLoot> loot = new KList<>();
@Desc("This object / these objects override the following trees when they grow...")
@ArrayType(min = 1, type = IrisTree.class)
private KList<IrisTree> trees = new KList<>();
private transient AtomicCache<TableCache> cache = new AtomicCache<>();
public IrisObjectPlacement toPlacement(String... place) {
IrisObjectPlacement p = new IrisObjectPlacement();
@@ -184,8 +164,6 @@ public class IrisObjectPlacement {
return p;
}
private final transient AtomicCache<CNG> surfaceWarp = new AtomicCache<>();
public CNG getSurfaceWarp(RNG rng, IrisData data) {
return surfaceWarp.aquire(() ->
getWarp().create(rng, data));
@@ -223,8 +201,6 @@ public class IrisObjectPlacement {
return isVacuum() || getAddFeatures().isNotEmpty();
}
private transient AtomicCache<TableCache> cache = new AtomicCache<>();
public boolean matches(IrisTreeSize size, TreeType type) {
for (IrisTree i : getTrees()) {
if (i.matches(size, type)) {
@@ -235,12 +211,6 @@ public class IrisObjectPlacement {
return false;
}
private static class TableCache {
final transient WeightedRandom<IrisLootTable> global = new WeightedRandom<>();
final transient KMap<Material, WeightedRandom<IrisLootTable>> basic = new KMap<>();
final transient KMap<Material, KMap<BlockData, WeightedRandom<IrisLootTable>>> exact = new KMap<>();
}
private TableCache getCache(IrisData manager) {
return cache.aquire(() -> {
TableCache tc = new TableCache();
@@ -308,4 +278,10 @@ public class IrisObjectPlacement {
return null;
}
private static class TableCache {
final transient WeightedRandom<IrisLootTable> global = new WeightedRandom<>();
final transient KMap<Material, WeightedRandom<IrisLootTable>> basic = new KMap<>();
final transient KMap<Material, KMap<BlockData, WeightedRandom<IrisLootTable>>> exact = new KMap<>();
}
}

View File

@@ -20,7 +20,12 @@ package com.volmit.iris.engine.object;
import com.volmit.iris.core.loader.IrisData;
import com.volmit.iris.engine.data.cache.AtomicCache;
import com.volmit.iris.engine.object.annotations.*;
import com.volmit.iris.engine.object.annotations.ArrayType;
import com.volmit.iris.engine.object.annotations.Desc;
import com.volmit.iris.engine.object.annotations.MaxNumber;
import com.volmit.iris.engine.object.annotations.MinNumber;
import com.volmit.iris.engine.object.annotations.Required;
import com.volmit.iris.engine.object.annotations.Snippet;
import com.volmit.iris.util.collection.KList;
import com.volmit.iris.util.math.RNG;
import com.volmit.iris.util.noise.CNG;
@@ -37,27 +42,23 @@ import org.bukkit.block.data.BlockData;
@Desc("Find and replace object materials")
@Data
public class IrisObjectReplace {
private final transient AtomicCache<CNG> replaceGen = new AtomicCache<>();
private final transient AtomicCache<KList<BlockData>> findData = new AtomicCache<>();
private final transient AtomicCache<KList<BlockData>> replaceData = new AtomicCache<>();
@ArrayType(min = 1, type = IrisBlockData.class)
@Required
@Desc("Find this block")
private KList<IrisBlockData> find = new KList<>();
@Required
@Desc("Replace it with this block palette")
private IrisMaterialPalette replace = new IrisMaterialPalette();
@Desc("Exactly match the block data or not")
private boolean exact = false;
@MinNumber(0)
@MaxNumber(1)
@Desc("Modifies the chance the block is replaced")
private float chance = 1;
private final transient AtomicCache<CNG> replaceGen = new AtomicCache<>();
private final transient AtomicCache<KList<BlockData>> findData = new AtomicCache<>();
private final transient AtomicCache<KList<BlockData>> replaceData = new AtomicCache<>();
public KList<BlockData> getFind(IrisData rdata) {
return findData.aquire(() ->
{

View File

@@ -29,7 +29,11 @@ import lombok.experimental.Accessors;
import org.bukkit.Axis;
import org.bukkit.Material;
import org.bukkit.block.BlockFace;
import org.bukkit.block.data.*;
import org.bukkit.block.data.BlockData;
import org.bukkit.block.data.Directional;
import org.bukkit.block.data.MultipleFacing;
import org.bukkit.block.data.Orientable;
import org.bukkit.block.data.Rotatable;
import org.bukkit.util.BlockVector;
import java.util.List;
@@ -53,6 +57,28 @@ public class IrisObjectRotation {
@Desc("The z axis rotation")
private IrisAxisRotationClamp zAxis = new IrisAxisRotationClamp();
public static IrisObjectRotation of(double x, double y, double z) {
IrisObjectRotation rt = new IrisObjectRotation();
IrisAxisRotationClamp rtx = new IrisAxisRotationClamp();
IrisAxisRotationClamp rty = new IrisAxisRotationClamp();
IrisAxisRotationClamp rtz = new IrisAxisRotationClamp();
rt.setEnabled(x != 0 || y != 0 || z != 0);
rt.setXAxis(rtx);
rt.setYAxis(rty);
rt.setZAxis(rtz);
rtx.setEnabled(x != 0);
rty.setEnabled(y != 0);
rtz.setEnabled(z != 0);
rtx.setInterval(90);
rty.setInterval(90);
rtz.setInterval(90);
rtx.minMax(x);
rty.minMax(y);
rtz.minMax(z);
return rt;
}
public double getYRotation(int spin) {
return getRotation(spin, yAxis);
}
@@ -83,7 +109,6 @@ public class IrisObjectRotation {
return piece;
}
public BlockVector rotate(BlockVector direction) {
return rotate(direction, 0, 0, 0);
}
@@ -93,28 +118,6 @@ public class IrisObjectRotation {
return IrisDirection.closest(v);
}
public static IrisObjectRotation of(double x, double y, double z) {
IrisObjectRotation rt = new IrisObjectRotation();
IrisAxisRotationClamp rtx = new IrisAxisRotationClamp();
IrisAxisRotationClamp rty = new IrisAxisRotationClamp();
IrisAxisRotationClamp rtz = new IrisAxisRotationClamp();
rt.setEnabled(x != 0 || y != 0 || z != 0);
rt.setXAxis(rtx);
rt.setYAxis(rty);
rt.setZAxis(rtz);
rtx.setEnabled(x != 0);
rty.setEnabled(y != 0);
rtz.setEnabled(z != 0);
rtx.setInterval(90);
rty.setInterval(90);
rtz.setInterval(90);
rtx.minMax(x);
rty.minMax(y);
rtz.minMax(z);
return rt;
}
public double getRotation(int spin, IrisAxisRotationClamp clamp) {
if (!enabled) {
return 0;

View File

@@ -37,30 +37,26 @@ import lombok.experimental.Accessors;
@Desc("Scale objects")
@Data
public class IrisObjectScale {
@MinNumber(1)
@MaxNumber(32)
@Desc("Iris Objects are scaled and cached to speed up placements. Because of this extra memory is used, so we evenly distribute variations across the defined scale range, then pick one randomly. If the differences is small, use a lower number. For more possibilities on the scale spectrum, increase this at the cost of memory.")
private int variations = 7;
@MinNumber(0.01)
@MaxNumber(50)
@Desc("The minimum scale")
private double minimumScale = 1;
@MinNumber(0.01)
@MaxNumber(50)
@Desc("The maximum height for placement (top of object)")
private double maximumScale = 1;
@Desc("If this object is scaled up beyond its origin size, specify a 3D interpolator")
private IrisObjectPlacementScaleInterpolator interpolation = IrisObjectPlacementScaleInterpolator.NONE;
private static transient ConcurrentLinkedHashMap<IrisObject, KList<IrisObject>> cache
= new ConcurrentLinkedHashMap.Builder<IrisObject, KList<IrisObject>>()
.initialCapacity(64)
.maximumWeightedCapacity(1024)
.concurrencyLevel(32)
.build();
@MinNumber(1)
@MaxNumber(32)
@Desc("Iris Objects are scaled and cached to speed up placements. Because of this extra memory is used, so we evenly distribute variations across the defined scale range, then pick one randomly. If the differences is small, use a lower number. For more possibilities on the scale spectrum, increase this at the cost of memory.")
private int variations = 7;
@MinNumber(0.01)
@MaxNumber(50)
@Desc("The minimum scale")
private double minimumScale = 1;
@MinNumber(0.01)
@MaxNumber(50)
@Desc("The maximum height for placement (top of object)")
private double maximumScale = 1;
@Desc("If this object is scaled up beyond its origin size, specify a 3D interpolator")
private IrisObjectPlacementScaleInterpolator interpolation = IrisObjectPlacementScaleInterpolator.NONE;
public boolean shouldScale() {
return ((minimumScale == maximumScale) && maximumScale == 1) || variations <= 0;

View File

@@ -18,7 +18,11 @@
package com.volmit.iris.engine.object;
import com.volmit.iris.engine.object.annotations.*;
import com.volmit.iris.engine.object.annotations.Desc;
import com.volmit.iris.engine.object.annotations.MaxNumber;
import com.volmit.iris.engine.object.annotations.MinNumber;
import com.volmit.iris.engine.object.annotations.Required;
import com.volmit.iris.engine.object.annotations.Snippet;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

View File

@@ -20,7 +20,11 @@ package com.volmit.iris.engine.object;
import com.volmit.iris.Iris;
import com.volmit.iris.engine.data.cache.AtomicCache;
import com.volmit.iris.engine.object.annotations.*;
import com.volmit.iris.engine.object.annotations.Desc;
import com.volmit.iris.engine.object.annotations.MaxNumber;
import com.volmit.iris.engine.object.annotations.MinNumber;
import com.volmit.iris.engine.object.annotations.Required;
import com.volmit.iris.engine.object.annotations.Snippet;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
@@ -37,29 +41,24 @@ import org.bukkit.potion.PotionEffectType;
@Desc("An iris potion effect")
@Data
public class IrisPotionEffect {
private final transient AtomicCache<PotionEffectType> pt = new AtomicCache<>();
@Required
@Desc("The potion effect to apply in this area")
private String potionEffect = "";
@Required
@MinNumber(-1)
@MaxNumber(1024)
@Desc("The Potion Strength or -1 to disable")
private int strength = -1;
@Required
@MinNumber(1)
@Desc("The time the potion will last for")
private int ticks = 200;
@Desc("Is the effect ambient")
private boolean ambient = false;
@Desc("Is the effect showing particles")
private boolean particles = true;
private final transient AtomicCache<PotionEffectType> pt = new AtomicCache<>();
public PotionEffectType getRealType() {
return pt.aquire(() ->
{

View File

@@ -21,7 +21,11 @@ package com.volmit.iris.engine.object;
import com.volmit.iris.engine.data.cache.AtomicCache;
import com.volmit.iris.engine.framework.Engine;
import com.volmit.iris.engine.mantle.MantleWriter;
import com.volmit.iris.engine.object.annotations.*;
import com.volmit.iris.engine.object.annotations.Desc;
import com.volmit.iris.engine.object.annotations.MinNumber;
import com.volmit.iris.engine.object.annotations.RegistryListResource;
import com.volmit.iris.engine.object.annotations.Required;
import com.volmit.iris.engine.object.annotations.Snippet;
import com.volmit.iris.util.math.RNG;
import com.volmit.iris.util.matter.MatterCavern;
import com.volmit.iris.util.matter.slices.CavernMatter;
@@ -31,20 +35,17 @@ import lombok.Data;
@Desc("Represents an procedural eliptical shape")
@Data
public class IrisPyramid implements IRare {
private transient final AtomicCache<MatterCavern> matterNodeCache = new AtomicCache<>();
@Required
@Desc("Typically a 1 in RARITY on a per fork basis")
@MinNumber(1)
private int rarity = 1;
@RegistryListResource(IrisBiome.class)
@Desc("Force this cave to only generate the specified custom biome")
private String customBiome = "";
@Desc("The styled random radius for x")
private IrisStyledRange baseWidth = new IrisStyledRange(1, 5, new IrisGeneratorStyle(NoiseStyle.STATIC));
private transient final AtomicCache<MatterCavern> matterNodeCache = new AtomicCache<>();
public void generate(RNG rng, Engine engine, MantleWriter writer, int x, int y, int z) {
writer.setPyramid(x, y, z, matterNodeCache.aquire(() -> CavernMatter.get(getCustomBiome(), 0)),
(int) baseWidth.get(rng, z, y, engine.getData()), true);

View File

@@ -18,7 +18,11 @@
package com.volmit.iris.engine.object;
import com.volmit.iris.engine.object.annotations.*;
import com.volmit.iris.engine.object.annotations.Desc;
import com.volmit.iris.engine.object.annotations.MinNumber;
import com.volmit.iris.engine.object.annotations.RegistryListResource;
import com.volmit.iris.engine.object.annotations.Required;
import com.volmit.iris.engine.object.annotations.Snippet;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;

View File

@@ -23,7 +23,11 @@ import com.volmit.iris.core.loader.IrisData;
import com.volmit.iris.engine.data.cache.AtomicCache;
import com.volmit.iris.engine.framework.Engine;
import com.volmit.iris.engine.mantle.MantleWriter;
import com.volmit.iris.engine.object.annotations.*;
import com.volmit.iris.engine.object.annotations.Desc;
import com.volmit.iris.engine.object.annotations.MinNumber;
import com.volmit.iris.engine.object.annotations.RegistryListResource;
import com.volmit.iris.engine.object.annotations.Required;
import com.volmit.iris.engine.object.annotations.Snippet;
import com.volmit.iris.util.math.RNG;
import lombok.AllArgsConstructor;
import lombok.Data;
@@ -39,20 +43,18 @@ import java.util.concurrent.atomic.AtomicBoolean;
@Desc("Translate objects")
@Data
public class IrisRavinePlacer implements IRare {
private transient final AtomicCache<IrisRavine> ravineCache = new AtomicCache<>();
private transient final AtomicBoolean fail = new AtomicBoolean(false);
@Required
@Desc("Typically a 1 in RARITY on a per chunk/fork basis")
@MinNumber(1)
private int rarity = 15;
@MinNumber(1)
@Required
@Desc("The ravine to place")
@RegistryListResource(IrisRavine.class)
private String ravine;
private transient final AtomicCache<IrisRavine> ravineCache = new AtomicCache<>();
private transient final AtomicBoolean fail = new AtomicBoolean(false);
public IrisRavine getRealRavine(IrisData data) {
return ravineCache.aquire(() -> data.getRavineLoader().load(getRavine()));
}

View File

@@ -23,7 +23,12 @@ import com.volmit.iris.core.gui.components.RenderType;
import com.volmit.iris.core.loader.IrisData;
import com.volmit.iris.core.loader.IrisRegistrant;
import com.volmit.iris.engine.data.cache.AtomicCache;
import com.volmit.iris.engine.object.annotations.*;
import com.volmit.iris.engine.object.annotations.ArrayType;
import com.volmit.iris.engine.object.annotations.Desc;
import com.volmit.iris.engine.object.annotations.MaxNumber;
import com.volmit.iris.engine.object.annotations.MinNumber;
import com.volmit.iris.engine.object.annotations.RegistryListResource;
import com.volmit.iris.engine.object.annotations.Required;
import com.volmit.iris.util.collection.KList;
import com.volmit.iris.util.collection.KMap;
import com.volmit.iris.util.collection.KSet;
@@ -40,7 +45,7 @@ import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import java.awt.*;
import java.awt.Color;
import java.util.Random;
@@ -52,146 +57,6 @@ import java.util.Random;
@Data
@EqualsAndHashCode(callSuper = false)
public class IrisRegion extends IrisRegistrant implements IRare {
@MinNumber(2)
@Required
@Desc("The name of the region")
private String name = "A Region";
@ArrayType(min = 1, type = IrisJigsawStructurePlacement.class)
@Desc("Jigsaw structures")
private KList<IrisJigsawStructurePlacement> jigsawStructures = new KList<>();
@Desc("Add random chances for terrain features")
@ArrayType(min = 1, type = IrisFeaturePotential.class)
private KList<IrisFeaturePotential> features = new KList<>();
@ArrayType(min = 1, type = IrisEffect.class)
@Desc("Effects are ambient effects such as potion effects, random sounds, or even particles around each player. All of these effects are played via packets so two players won't see/hear each others effects.\nDue to performance reasons, effects will play arround the player even if where the effect was played is no longer in the biome the player is in.")
private KList<IrisEffect> effects = new KList<>();
@Desc("Spawn Entities in this region over time. Iris will continually replenish these mobs just like vanilla does.")
@ArrayType(min = 1, type = String.class)
@RegistryListResource(IrisSpawner.class)
private KList<String> entitySpawners = new KList<>();
@MinNumber(1)
@MaxNumber(128)
@Desc("The rarity of the region")
private int rarity = 1;
@ArrayType(min = 1, type = IrisBlockDrops.class)
@Desc("Define custom block drops for this region")
private KList<IrisBlockDrops> blockDrops = new KList<>();
@MinNumber(0.0001)
@MaxNumber(1)
@Desc("The shore ration (How much percent of land should be a shore)")
private double shoreRatio = 0.13;
@ArrayType(min = 1, type = IrisObjectPlacement.class)
@Desc("Objects define what schematics (iob files) iris will place in this region")
private KList<IrisObjectPlacement> objects = new KList<>();
@MinNumber(0)
@Desc("The min shore height")
private double shoreHeightMin = 1.2;
@Desc("Reference loot tables in this area")
private IrisLootReference loot = new IrisLootReference();
@MinNumber(0)
@Desc("The the max shore height")
private double shoreHeightMax = 3.2;
@MinNumber(0.0001)
@Desc("The varience of the shore height")
private double shoreHeightZoom = 3.14;
@MinNumber(0.0001)
@Desc("How large land biomes are in this region")
private double landBiomeZoom = 1;
@MinNumber(0.0001)
@Desc("How large shore biomes are in this region")
private double shoreBiomeZoom = 1;
@MinNumber(0.0001)
@Desc("How large sea biomes are in this region")
private double seaBiomeZoom = 1;
@MinNumber(0.0001)
@Desc("How large cave biomes are in this region")
private double caveBiomeZoom = 1;
@MinNumber(0.0001)
@MaxNumber(1)
@Desc("The biome implosion ratio, how much to implode biomes into children (chance)")
private double biomeImplosionRatio = 0.4;
@Desc("Carving configuration for the dimension")
private IrisCarving carving = new IrisCarving();
@Desc("Configuration of fluid bodies such as rivers & lakes")
private IrisFluidBodies fluidBodies = new IrisFluidBodies();
@RegistryListResource(IrisBiome.class)
@Required
@ArrayType(min = 1, type = String.class)
@Desc("A list of root-level biomes in this region. Don't specify child biomes of other biomes here. Just the root parents.")
private KList<String> landBiomes = new KList<>();
@RegistryListResource(IrisBiome.class)
@Required
@ArrayType(min = 1, type = String.class)
@Desc("A list of root-level biomes in this region. Don't specify child biomes of other biomes here. Just the root parents.")
private KList<String> seaBiomes = new KList<>();
@RegistryListResource(IrisBiome.class)
@Required
@ArrayType(min = 1, type = String.class)
@Desc("A list of root-level biomes in this region. Don't specify child biomes of other biomes here. Just the root parents.")
private KList<String> shoreBiomes = new KList<>();
@RegistryListResource(IrisBiome.class)
@ArrayType(min = 1, type = String.class)
@Desc("A list of root-level biomes in this region. Don't specify child biomes of other biomes here. Just the root parents.")
private KList<String> caveBiomes = new KList<>();
@ArrayType(min = 1, type = IrisDepositGenerator.class)
@Desc("Define regional deposit generators that add onto the global deposit generators")
private KList<IrisDepositGenerator> deposits = new KList<>();
@Desc("The style of rivers")
private IrisGeneratorStyle riverStyle = NoiseStyle.VASCULAR_THIN.style().zoomed(7.77);
@Desc("The style of lakes")
private IrisGeneratorStyle lakeStyle = NoiseStyle.CELLULAR_IRIS_THICK.style();
@Desc("The style of river chances")
private IrisGeneratorStyle riverChanceStyle = NoiseStyle.SIMPLEX.style().zoomed(4);
@Desc("Generate lakes in this region")
private boolean lakes = true;
@Desc("Generate rivers in this region")
private boolean rivers = true;
@MinNumber(1)
@Desc("Generate lakes in this region")
private int lakeRarity = 22;
@MinNumber(1)
@Desc("Generate rivers in this region")
private int riverRarity = 3;
@MinNumber(0)
@MaxNumber(1)
@Desc("Generate rivers in this region")
private double riverThickness = 0.1;
@Desc("A color for visualizing this region with a color. I.e. #F13AF5. This will show up on the map.")
private String color = null;
private final transient AtomicCache<KList<IrisObjectPlacement>> surfaceObjectsCache = new AtomicCache<>();
private final transient AtomicCache<KList<IrisObjectPlacement>> carveObjectsCache = new AtomicCache<>();
private final transient AtomicCache<KList<String>> cacheRidge = new AtomicCache<>();
@@ -207,6 +72,112 @@ public class IrisRegion extends IrisRegistrant implements IRare {
private final transient AtomicCache<CNG> riverGen = new AtomicCache<>();
private final transient AtomicCache<CNG> riverChanceGen = new AtomicCache<>();
private final transient AtomicCache<Color> cacheColor = new AtomicCache<>();
@MinNumber(2)
@Required
@Desc("The name of the region")
private String name = "A Region";
@ArrayType(min = 1, type = IrisJigsawStructurePlacement.class)
@Desc("Jigsaw structures")
private KList<IrisJigsawStructurePlacement> jigsawStructures = new KList<>();
@Desc("Add random chances for terrain features")
@ArrayType(min = 1, type = IrisFeaturePotential.class)
private KList<IrisFeaturePotential> features = new KList<>();
@ArrayType(min = 1, type = IrisEffect.class)
@Desc("Effects are ambient effects such as potion effects, random sounds, or even particles around each player. All of these effects are played via packets so two players won't see/hear each others effects.\nDue to performance reasons, effects will play arround the player even if where the effect was played is no longer in the biome the player is in.")
private KList<IrisEffect> effects = new KList<>();
@Desc("Spawn Entities in this region over time. Iris will continually replenish these mobs just like vanilla does.")
@ArrayType(min = 1, type = String.class)
@RegistryListResource(IrisSpawner.class)
private KList<String> entitySpawners = new KList<>();
@MinNumber(1)
@MaxNumber(128)
@Desc("The rarity of the region")
private int rarity = 1;
@ArrayType(min = 1, type = IrisBlockDrops.class)
@Desc("Define custom block drops for this region")
private KList<IrisBlockDrops> blockDrops = new KList<>();
@MinNumber(0.0001)
@MaxNumber(1)
@Desc("The shore ration (How much percent of land should be a shore)")
private double shoreRatio = 0.13;
@ArrayType(min = 1, type = IrisObjectPlacement.class)
@Desc("Objects define what schematics (iob files) iris will place in this region")
private KList<IrisObjectPlacement> objects = new KList<>();
@MinNumber(0)
@Desc("The min shore height")
private double shoreHeightMin = 1.2;
@Desc("Reference loot tables in this area")
private IrisLootReference loot = new IrisLootReference();
@MinNumber(0)
@Desc("The the max shore height")
private double shoreHeightMax = 3.2;
@MinNumber(0.0001)
@Desc("The varience of the shore height")
private double shoreHeightZoom = 3.14;
@MinNumber(0.0001)
@Desc("How large land biomes are in this region")
private double landBiomeZoom = 1;
@MinNumber(0.0001)
@Desc("How large shore biomes are in this region")
private double shoreBiomeZoom = 1;
@MinNumber(0.0001)
@Desc("How large sea biomes are in this region")
private double seaBiomeZoom = 1;
@MinNumber(0.0001)
@Desc("How large cave biomes are in this region")
private double caveBiomeZoom = 1;
@MinNumber(0.0001)
@MaxNumber(1)
@Desc("The biome implosion ratio, how much to implode biomes into children (chance)")
private double biomeImplosionRatio = 0.4;
@Desc("Carving configuration for the dimension")
private IrisCarving carving = new IrisCarving();
@Desc("Configuration of fluid bodies such as rivers & lakes")
private IrisFluidBodies fluidBodies = new IrisFluidBodies();
@RegistryListResource(IrisBiome.class)
@Required
@ArrayType(min = 1, type = String.class)
@Desc("A list of root-level biomes in this region. Don't specify child biomes of other biomes here. Just the root parents.")
private KList<String> landBiomes = new KList<>();
@RegistryListResource(IrisBiome.class)
@Required
@ArrayType(min = 1, type = String.class)
@Desc("A list of root-level biomes in this region. Don't specify child biomes of other biomes here. Just the root parents.")
private KList<String> seaBiomes = new KList<>();
@RegistryListResource(IrisBiome.class)
@Required
@ArrayType(min = 1, type = String.class)
@Desc("A list of root-level biomes in this region. Don't specify child biomes of other biomes here. Just the root parents.")
private KList<String> shoreBiomes = new KList<>();
@RegistryListResource(IrisBiome.class)
@ArrayType(min = 1, type = String.class)
@Desc("A list of root-level biomes in this region. Don't specify child biomes of other biomes here. Just the root parents.")
private KList<String> caveBiomes = new KList<>();
@ArrayType(min = 1, type = IrisDepositGenerator.class)
@Desc("Define regional deposit generators that add onto the global deposit generators")
private KList<IrisDepositGenerator> deposits = new KList<>();
@Desc("The style of rivers")
private IrisGeneratorStyle riverStyle = NoiseStyle.VASCULAR_THIN.style().zoomed(7.77);
@Desc("The style of lakes")
private IrisGeneratorStyle lakeStyle = NoiseStyle.CELLULAR_IRIS_THICK.style();
@Desc("The style of river chances")
private IrisGeneratorStyle riverChanceStyle = NoiseStyle.SIMPLEX.style().zoomed(4);
@Desc("Generate lakes in this region")
private boolean lakes = true;
@Desc("Generate rivers in this region")
private boolean rivers = true;
@MinNumber(1)
@Desc("Generate lakes in this region")
private int lakeRarity = 22;
@MinNumber(1)
@Desc("Generate rivers in this region")
private int riverRarity = 3;
@MinNumber(0)
@MaxNumber(1)
@Desc("Generate rivers in this region")
private double riverThickness = 0.1;
@Desc("A color for visualizing this region with a color. I.e. #F13AF5. This will show up on the map.")
private String color = null;
public String getName() {
return name;

View File

@@ -21,7 +21,11 @@ package com.volmit.iris.engine.object;
import com.volmit.iris.core.loader.IrisData;
import com.volmit.iris.engine.framework.Engine;
import com.volmit.iris.engine.mantle.MantleWriter;
import com.volmit.iris.engine.object.annotations.*;
import com.volmit.iris.engine.object.annotations.Desc;
import com.volmit.iris.engine.object.annotations.MinNumber;
import com.volmit.iris.engine.object.annotations.RegistryListResource;
import com.volmit.iris.engine.object.annotations.Required;
import com.volmit.iris.engine.object.annotations.Snippet;
import com.volmit.iris.util.collection.KList;
import com.volmit.iris.util.math.RNG;
import com.volmit.iris.util.matter.MatterFluidBody;

View File

@@ -19,7 +19,11 @@
package com.volmit.iris.engine.object;
import com.volmit.iris.core.loader.IrisData;
import com.volmit.iris.engine.object.annotations.*;
import com.volmit.iris.engine.object.annotations.Desc;
import com.volmit.iris.engine.object.annotations.MaxNumber;
import com.volmit.iris.engine.object.annotations.MinNumber;
import com.volmit.iris.engine.object.annotations.Required;
import com.volmit.iris.engine.object.annotations.Snippet;
import com.volmit.iris.util.math.RNG;
import lombok.AllArgsConstructor;
import lombok.Data;
@@ -49,10 +53,6 @@ public class IrisShapedGeneratorStyle {
@Desc("The max block value")
private int max = 0;
public double get(RNG rng, IrisData data, double... dim) {
return generator.create(rng, data).fitDouble(min, max, dim);
}
public IrisShapedGeneratorStyle(NoiseStyle style, int min, int max) {
this(style);
this.min = min;
@@ -63,6 +63,10 @@ public class IrisShapedGeneratorStyle {
this.generator = new IrisGeneratorStyle(style);
}
public double get(RNG rng, IrisData data, double... dim) {
return generator.create(rng, data).fitDouble(min, max, dim);
}
public boolean isFlat() {
return min == max || getGenerator().isFlat();
}

View File

@@ -21,7 +21,11 @@ package com.volmit.iris.engine.object;
import com.volmit.iris.engine.data.cache.AtomicCache;
import com.volmit.iris.engine.framework.Engine;
import com.volmit.iris.engine.mantle.MantleWriter;
import com.volmit.iris.engine.object.annotations.*;
import com.volmit.iris.engine.object.annotations.Desc;
import com.volmit.iris.engine.object.annotations.MinNumber;
import com.volmit.iris.engine.object.annotations.RegistryListResource;
import com.volmit.iris.engine.object.annotations.Required;
import com.volmit.iris.engine.object.annotations.Snippet;
import com.volmit.iris.util.math.RNG;
import com.volmit.iris.util.matter.MatterCavern;
import com.volmit.iris.util.matter.slices.CavernMatter;
@@ -31,20 +35,17 @@ import lombok.Data;
@Desc("Represents an procedural eliptical shape")
@Data
public class IrisSphere implements IRare {
private transient final AtomicCache<MatterCavern> matterNodeCache = new AtomicCache<>();
@Required
@Desc("Typically a 1 in RARITY on a per fork basis")
@MinNumber(1)
private int rarity = 1;
@RegistryListResource(IrisBiome.class)
@Desc("Force this cave to only generate the specified custom biome")
private String customBiome = "";
@Desc("The styled random radius for x")
private IrisStyledRange radius = new IrisStyledRange(1, 5, new IrisGeneratorStyle(NoiseStyle.STATIC));
private transient final AtomicCache<MatterCavern> matterNodeCache = new AtomicCache<>();
public void generate(RNG rng, Engine engine, MantleWriter writer, int x, int y, int z) {
writer.setSphere(x, y, z, radius.get(rng, z, y, engine.getData()), true, matterNodeCache.aquire(() -> CavernMatter.get(getCustomBiome(), 0)));
}

View File

@@ -18,7 +18,11 @@
package com.volmit.iris.engine.object;
import com.volmit.iris.engine.object.annotations.*;
import com.volmit.iris.engine.object.annotations.ArrayType;
import com.volmit.iris.engine.object.annotations.DependsOn;
import com.volmit.iris.engine.object.annotations.Desc;
import com.volmit.iris.engine.object.annotations.Required;
import com.volmit.iris.engine.object.annotations.Snippet;
import com.volmit.iris.util.collection.KList;
import lombok.AllArgsConstructor;
import lombok.Data;

View File

@@ -20,7 +20,12 @@ package com.volmit.iris.engine.object;
import com.volmit.iris.Iris;
import com.volmit.iris.engine.object.annotations.*;
import com.volmit.iris.engine.object.annotations.Desc;
import com.volmit.iris.engine.object.annotations.MaxNumber;
import com.volmit.iris.engine.object.annotations.MinNumber;
import com.volmit.iris.engine.object.annotations.RegistryListItemType;
import com.volmit.iris.engine.object.annotations.Required;
import com.volmit.iris.engine.object.annotations.Snippet;
import com.volmit.iris.util.collection.KList;
import com.volmit.iris.util.math.RNG;
import lombok.AllArgsConstructor;

View File

@@ -21,7 +21,11 @@ package com.volmit.iris.engine.object;
import com.volmit.iris.Iris;
import com.volmit.iris.core.tools.IrisToolbelt;
import com.volmit.iris.util.collection.KList;
import lombok.*;
import lombok.AccessLevel;
import lombok.Builder;
import lombok.Data;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;
import org.bukkit.Bukkit;
import org.bukkit.Location;
@@ -63,13 +67,11 @@ public class IrisWorld {
.environment(world.getEnvironment());
}
public long getRawWorldSeed()
{
public long getRawWorldSeed() {
return seed;
}
public void setRawWorldSeed(long seed)
{
public void setRawWorldSeed(long seed) {
this.seed = seed;
}

View File

@@ -22,7 +22,7 @@ import java.lang.annotation.Retention;
import java.lang.annotation.Target;
import static java.lang.annotation.ElementType.*;
import static java.lang.annotation.RetentionPolicy.RUNTIME;
import static java.lang.annotation.RetentionPolicy.*;
@Retention(RUNTIME)
@Target({PARAMETER, TYPE, FIELD})

View File

@@ -21,8 +21,8 @@ package com.volmit.iris.engine.object.annotations;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;
import static java.lang.annotation.ElementType.FIELD;
import static java.lang.annotation.RetentionPolicy.RUNTIME;
import static java.lang.annotation.ElementType.*;
import static java.lang.annotation.RetentionPolicy.*;
@Retention(RUNTIME)
@Target({FIELD})

View File

@@ -22,7 +22,7 @@ import java.lang.annotation.Retention;
import java.lang.annotation.Target;
import static java.lang.annotation.ElementType.*;
import static java.lang.annotation.RetentionPolicy.RUNTIME;
import static java.lang.annotation.RetentionPolicy.*;
@Retention(RUNTIME)
@Target({PARAMETER, TYPE, FIELD})

View File

@@ -21,8 +21,8 @@ package com.volmit.iris.engine.object.annotations;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;
import static java.lang.annotation.ElementType.FIELD;
import static java.lang.annotation.RetentionPolicy.RUNTIME;
import static java.lang.annotation.ElementType.*;
import static java.lang.annotation.RetentionPolicy.*;
@Retention(RUNTIME)
@Target({FIELD})

View File

@@ -21,8 +21,8 @@ package com.volmit.iris.engine.object.annotations;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;
import static java.lang.annotation.ElementType.FIELD;
import static java.lang.annotation.RetentionPolicy.RUNTIME;
import static java.lang.annotation.ElementType.*;
import static java.lang.annotation.RetentionPolicy.*;
@Retention(RUNTIME)
@Target({FIELD})

View File

@@ -22,7 +22,7 @@ import java.lang.annotation.Retention;
import java.lang.annotation.Target;
import static java.lang.annotation.ElementType.*;
import static java.lang.annotation.RetentionPolicy.RUNTIME;
import static java.lang.annotation.RetentionPolicy.*;
@Retention(RUNTIME)
@Target({PARAMETER, TYPE, FIELD})

View File

@@ -22,7 +22,7 @@ import java.lang.annotation.Retention;
import java.lang.annotation.Target;
import static java.lang.annotation.ElementType.*;
import static java.lang.annotation.RetentionPolicy.RUNTIME;
import static java.lang.annotation.RetentionPolicy.*;
@Retention(RUNTIME)
@Target({PARAMETER, TYPE, FIELD})

Some files were not shown because too many files have changed in this diff Show More