mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2026-04-07 08:16:31 +00:00
Matter apis
This commit is contained in:
@@ -18,7 +18,7 @@
|
||||
|
||||
package com.volmit.iris.engine.object.annotations;
|
||||
|
||||
import com.volmit.iris.core.project.loader.LoaderRegistrant;
|
||||
import com.volmit.iris.core.project.loader.IrisRegistrant;
|
||||
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.Target;
|
||||
@@ -29,5 +29,5 @@ import static java.lang.annotation.RetentionPolicy.RUNTIME;
|
||||
@Retention(RUNTIME)
|
||||
@Target({PARAMETER, TYPE, FIELD})
|
||||
public @interface RegistryListResource {
|
||||
Class<? extends LoaderRegistrant> value();
|
||||
Class<? extends IrisRegistrant> value();
|
||||
}
|
||||
|
||||
@@ -21,11 +21,11 @@ package com.volmit.iris.engine.object.biome;
|
||||
import com.volmit.iris.Iris;
|
||||
import com.volmit.iris.core.gui.components.RenderType;
|
||||
import com.volmit.iris.core.project.loader.IrisData;
|
||||
import com.volmit.iris.core.project.loader.LoaderRegistrant;
|
||||
import com.volmit.iris.core.project.loader.IrisRegistrant;
|
||||
import com.volmit.iris.engine.IrisComplex;
|
||||
import com.volmit.iris.engine.data.cache.AtomicCache;
|
||||
import com.volmit.iris.engine.data.B;
|
||||
import com.volmit.iris.engine.data.DataProvider;
|
||||
import com.volmit.iris.util.data.B;
|
||||
import com.volmit.iris.util.data.DataProvider;
|
||||
import com.volmit.iris.engine.framework.Engine;
|
||||
import com.volmit.iris.engine.framework.IrisAccess;
|
||||
import com.volmit.iris.engine.object.block.IrisBlockDrops;
|
||||
@@ -38,9 +38,9 @@ import com.volmit.iris.engine.object.meta.IrisEffect;
|
||||
import com.volmit.iris.engine.object.noise.IrisGeneratorStyle;
|
||||
import com.volmit.iris.engine.object.noise.IrisSlopeClip;
|
||||
import com.volmit.iris.engine.object.noise.NoiseStyle;
|
||||
import com.volmit.iris.engine.object.objects.LoaderObject;
|
||||
import com.volmit.iris.engine.object.objects.IrisObject;
|
||||
import com.volmit.iris.engine.object.objects.IrisObjectPlacement;
|
||||
import com.volmit.iris.engine.object.spawners.LoaderSpawner;
|
||||
import com.volmit.iris.engine.object.spawners.IrisSpawner;
|
||||
import com.volmit.iris.util.noise.CNG;
|
||||
import com.volmit.iris.engine.object.annotations.*;
|
||||
import com.volmit.iris.engine.object.common.IRare;
|
||||
@@ -68,7 +68,7 @@ import java.awt.*;
|
||||
@Desc("Represents a biome in iris. Biomes are placed inside of regions and hold objects.\nA biome consists of layers (block palletes), decorations, objects & generators.")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
public class LoaderBiome extends LoaderRegistrant implements IRare {
|
||||
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.")
|
||||
@@ -80,7 +80,7 @@ public class LoaderBiome extends LoaderRegistrant implements IRare {
|
||||
|
||||
@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(LoaderSpawner.class)
|
||||
@RegistryListResource(IrisSpawner.class)
|
||||
private KList<String> entitySpawners = new KList<>();
|
||||
|
||||
@Desc("Add random chances for terrain features")
|
||||
@@ -146,7 +146,7 @@ public class LoaderBiome extends LoaderRegistrant implements IRare {
|
||||
@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(LoaderBiome.class)
|
||||
@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<>();
|
||||
@@ -155,7 +155,7 @@ public class LoaderBiome extends LoaderRegistrant implements IRare {
|
||||
@Desc("Jigsaw structures")
|
||||
private KList<IrisJigsawStructurePlacement> jigsawStructures = new KList<>();
|
||||
|
||||
@RegistryListResource(LoaderBiome.class)
|
||||
@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 = "";
|
||||
|
||||
@@ -207,8 +207,8 @@ public class LoaderBiome extends LoaderRegistrant implements IRare {
|
||||
private final transient AtomicCache<CNG> biomeGenerator = new AtomicCache<>();
|
||||
private final transient AtomicCache<Integer> maxHeight = new AtomicCache<>();
|
||||
private final transient AtomicCache<Integer> maxWithObjectHeight = new AtomicCache<>();
|
||||
private final transient AtomicCache<LoaderBiome> realCarveBiome = new AtomicCache<>();
|
||||
private final transient AtomicCache<KList<LoaderBiome>> realChildren = new AtomicCache<>();
|
||||
private final transient AtomicCache<IrisBiome> realCarveBiome = new AtomicCache<>();
|
||||
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<>();
|
||||
|
||||
@@ -263,10 +263,10 @@ public class LoaderBiome extends LoaderRegistrant implements IRare {
|
||||
}).get(loadKey);
|
||||
}
|
||||
|
||||
public LoaderBiome getRealCarvingBiome(IrisData data) {
|
||||
public IrisBiome getRealCarvingBiome(IrisData data) {
|
||||
return realCarveBiome.aquire(() ->
|
||||
{
|
||||
LoaderBiome biome = data.getBiomeLoader().load(getCarvingBiome());
|
||||
IrisBiome biome = data.getBiomeLoader().load(getCarvingBiome());
|
||||
|
||||
if (biome == null) {
|
||||
biome = this;
|
||||
@@ -445,7 +445,7 @@ public class LoaderBiome extends LoaderRegistrant implements IRare {
|
||||
int gg = 0;
|
||||
|
||||
for (IrisObjectPlacement i : getObjects()) {
|
||||
for (LoaderObject j : data.getObjectLoader().loadAll(i.getPlace())) {
|
||||
for (IrisObject j : data.getObjectLoader().loadAll(i.getPlace())) {
|
||||
gg = Math.max(gg, j.getH());
|
||||
}
|
||||
}
|
||||
@@ -454,7 +454,7 @@ public class LoaderBiome extends LoaderRegistrant implements IRare {
|
||||
});
|
||||
}
|
||||
|
||||
public LoaderBiome infer(InferredType t, InferredType type) {
|
||||
public IrisBiome infer(InferredType t, InferredType type) {
|
||||
setInferredType(t.equals(InferredType.DEFER) ? type : t);
|
||||
return this;
|
||||
}
|
||||
@@ -582,10 +582,10 @@ public class LoaderBiome extends LoaderRegistrant implements IRare {
|
||||
return customDerivitives.get(getBiomeGenerator(rng).fit(0, customDerivitives.size() - 1, x, y, z));
|
||||
}
|
||||
|
||||
public KList<LoaderBiome> getRealChildren(DataProvider g) {
|
||||
public KList<IrisBiome> getRealChildren(DataProvider g) {
|
||||
return realChildren.aquire(() ->
|
||||
{
|
||||
KList<LoaderBiome> realChildren = new KList<>();
|
||||
KList<IrisBiome> realChildren = new KList<>();
|
||||
|
||||
for (String i : getChildren()) {
|
||||
realChildren.add(g.getData().getBiomeLoader().load(i));
|
||||
@@ -602,7 +602,7 @@ public class LoaderBiome extends LoaderRegistrant implements IRare {
|
||||
|
||||
if (limit > 0) {
|
||||
for (String i : getChildren()) {
|
||||
LoaderBiome b = g.getData().getBiomeLoader().load(i);
|
||||
IrisBiome b = g.getData().getBiomeLoader().load(i);
|
||||
m.addAll(b.getAllChildren(g, limit));
|
||||
}
|
||||
}
|
||||
@@ -19,10 +19,10 @@
|
||||
package com.volmit.iris.engine.object.biome;
|
||||
|
||||
import com.volmit.iris.engine.data.cache.AtomicCache;
|
||||
import com.volmit.iris.engine.data.DataProvider;
|
||||
import com.volmit.iris.util.data.DataProvider;
|
||||
import com.volmit.iris.util.interpolation.IrisInterpolation;
|
||||
import com.volmit.iris.engine.object.annotations.*;
|
||||
import com.volmit.iris.engine.object.noise.LoaderGenerator;
|
||||
import com.volmit.iris.engine.object.noise.IrisGenerator;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
@@ -35,7 +35,7 @@ import lombok.experimental.Accessors;
|
||||
@Data
|
||||
public class IrisBiomeGeneratorLink {
|
||||
|
||||
@RegistryListResource(LoaderGenerator.class)
|
||||
@RegistryListResource(IrisGenerator.class)
|
||||
@Desc("The generator id")
|
||||
private String generator = "default";
|
||||
|
||||
@@ -53,15 +53,15 @@ public class IrisBiomeGeneratorLink {
|
||||
@Desc("The max block value (value + fluidHeight)")
|
||||
private int max = 0;
|
||||
|
||||
private final transient AtomicCache<LoaderGenerator> gen = new AtomicCache<>();
|
||||
private final transient AtomicCache<IrisGenerator> gen = new AtomicCache<>();
|
||||
|
||||
public LoaderGenerator getCachedGenerator(DataProvider g) {
|
||||
public IrisGenerator getCachedGenerator(DataProvider g) {
|
||||
return gen.aquire(() ->
|
||||
{
|
||||
LoaderGenerator gen = g.getData().getGeneratorLoader().load(getGenerator());
|
||||
IrisGenerator gen = g.getData().getGeneratorLoader().load(getGenerator());
|
||||
|
||||
if (gen == null) {
|
||||
gen = new LoaderGenerator();
|
||||
gen = new IrisGenerator();
|
||||
}
|
||||
|
||||
return gen;
|
||||
|
||||
@@ -19,9 +19,9 @@
|
||||
package com.volmit.iris.engine.object.biome;
|
||||
|
||||
import com.volmit.iris.engine.data.cache.AtomicCache;
|
||||
import com.volmit.iris.engine.data.DataProvider;
|
||||
import com.volmit.iris.util.data.DataProvider;
|
||||
import com.volmit.iris.engine.object.annotations.*;
|
||||
import com.volmit.iris.engine.object.objects.LoaderObject;
|
||||
import com.volmit.iris.engine.object.objects.IrisObject;
|
||||
import com.volmit.iris.engine.object.objects.IrisObjectPlacement;
|
||||
import com.volmit.iris.util.collection.KList;
|
||||
import com.volmit.iris.util.collection.KSet;
|
||||
@@ -36,13 +36,13 @@ import lombok.experimental.Accessors;
|
||||
@Desc("A biome mutation if a condition is met")
|
||||
@Data
|
||||
public class IrisBiomeMutation {
|
||||
@RegistryListResource(LoaderBiome.class)
|
||||
@RegistryListResource(IrisBiome.class)
|
||||
@Required
|
||||
@ArrayType(min = 1, type = String.class)
|
||||
@Desc("One of The following biomes or regions must show up")
|
||||
private KList<String> sideA = new KList<>();
|
||||
|
||||
@RegistryListResource(LoaderBiome.class)
|
||||
@RegistryListResource(IrisBiome.class)
|
||||
@Required
|
||||
@ArrayType(min = 1, type = String.class)
|
||||
@Desc("One of The following biomes or regions must show up")
|
||||
@@ -60,7 +60,7 @@ public class IrisBiomeMutation {
|
||||
@Desc("How many tries per chunk to check for this mutation")
|
||||
private int checks = 2;
|
||||
|
||||
@RegistryListResource(LoaderObject.class)
|
||||
@RegistryListResource(IrisObject.class)
|
||||
@ArrayType(min = 1, type = IrisObjectPlacement.class)
|
||||
@Desc("Objects define what schematics (iob files) iris will place in this biome mutation")
|
||||
private KList<IrisObjectPlacement> objects = new KList<>();
|
||||
|
||||
@@ -20,7 +20,7 @@ package com.volmit.iris.engine.object.biome;
|
||||
|
||||
import com.volmit.iris.core.project.loader.IrisData;
|
||||
import com.volmit.iris.engine.data.cache.AtomicCache;
|
||||
import com.volmit.iris.engine.object.block.LoaderBlockData;
|
||||
import com.volmit.iris.engine.object.block.IrisBlockData;
|
||||
import com.volmit.iris.engine.object.noise.IrisGeneratorStyle;
|
||||
import com.volmit.iris.engine.object.noise.IrisSlopeClip;
|
||||
import com.volmit.iris.engine.object.noise.NoiseStyle;
|
||||
@@ -66,9 +66,9 @@ public class IrisBiomePaletteLayer {
|
||||
private double zoom = 5;
|
||||
|
||||
@Required
|
||||
@ArrayType(min = 1, type = LoaderBlockData.class)
|
||||
@ArrayType(min = 1, type = IrisBlockData.class)
|
||||
@Desc("The palette of blocks to be used in this layer")
|
||||
private KList<LoaderBlockData> palette = new KList<LoaderBlockData>().qadd(new LoaderBlockData("GRASS_BLOCK"));
|
||||
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<>();
|
||||
@@ -98,8 +98,8 @@ public class IrisBiomePaletteLayer {
|
||||
});
|
||||
}
|
||||
|
||||
public KList<LoaderBlockData> add(String b) {
|
||||
palette.add(new LoaderBlockData(b));
|
||||
public KList<IrisBlockData> add(String b) {
|
||||
palette.add(new IrisBlockData(b));
|
||||
|
||||
return palette;
|
||||
}
|
||||
@@ -108,7 +108,7 @@ public class IrisBiomePaletteLayer {
|
||||
return blockData.aquire(() ->
|
||||
{
|
||||
KList<BlockData> blockData = new KList<>();
|
||||
for (LoaderBlockData ix : palette) {
|
||||
for (IrisBlockData ix : palette) {
|
||||
BlockData bx = ix.getBlockData(data);
|
||||
if (bx != null) {
|
||||
for (int i = 0; i < ix.getWeight(); i++) {
|
||||
|
||||
@@ -21,8 +21,8 @@ package com.volmit.iris.engine.object.block;
|
||||
import com.volmit.iris.Iris;
|
||||
import com.volmit.iris.core.project.loader.IrisData;
|
||||
import com.volmit.iris.engine.data.cache.AtomicCache;
|
||||
import com.volmit.iris.engine.data.B;
|
||||
import com.volmit.iris.core.project.loader.LoaderRegistrant;
|
||||
import com.volmit.iris.util.data.B;
|
||||
import com.volmit.iris.core.project.loader.IrisRegistrant;
|
||||
import com.volmit.iris.engine.object.annotations.*;
|
||||
import com.volmit.iris.util.collection.KList;
|
||||
import com.volmit.iris.util.collection.KMap;
|
||||
@@ -42,7 +42,7 @@ import java.util.Map;
|
||||
@Desc("Represents Block Data")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
public class LoaderBlockData extends LoaderRegistrant {
|
||||
public class IrisBlockData extends IrisRegistrant {
|
||||
@RegistryListBlockType
|
||||
@Required
|
||||
@Desc("The block to use")
|
||||
@@ -60,7 +60,7 @@ public class LoaderBlockData extends LoaderRegistrant {
|
||||
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 LoaderBlockData backup = null;
|
||||
private IrisBlockData backup = null;
|
||||
|
||||
@Desc("Optional properties for this block data such as 'waterlogged': true")
|
||||
private KMap<String, Object> data = new KMap<>();
|
||||
@@ -68,7 +68,7 @@ public class LoaderBlockData extends LoaderRegistrant {
|
||||
private final transient AtomicCache<BlockData> blockdata = new AtomicCache<>();
|
||||
private final transient AtomicCache<String> realProperties = new AtomicCache<>();
|
||||
|
||||
public LoaderBlockData(String b) {
|
||||
public IrisBlockData(String b) {
|
||||
this.block = b;
|
||||
}
|
||||
|
||||
@@ -95,7 +95,7 @@ public class LoaderBlockData extends LoaderRegistrant {
|
||||
{
|
||||
BlockData b = null;
|
||||
|
||||
LoaderBlockData customData = data.getBlockLoader().load(getBlock(), false);
|
||||
IrisBlockData customData = data.getBlockLoader().load(getBlock(), false);
|
||||
|
||||
if (customData != null) {
|
||||
b = customData.getBlockData(data);
|
||||
@@ -152,8 +152,8 @@ public class LoaderBlockData extends LoaderRegistrant {
|
||||
});
|
||||
}
|
||||
|
||||
public static LoaderBlockData from(String j) {
|
||||
LoaderBlockData b = new LoaderBlockData();
|
||||
public static IrisBlockData from(String j) {
|
||||
IrisBlockData b = new IrisBlockData();
|
||||
String m = j.toLowerCase().trim();
|
||||
|
||||
if (m.contains(":")) {
|
||||
@@ -40,9 +40,9 @@ import org.bukkit.inventory.ItemStack;
|
||||
@Data
|
||||
public class IrisBlockDrops {
|
||||
@Required
|
||||
@ArrayType(min = 1, type = LoaderBlockData.class)
|
||||
@ArrayType(min = 1, type = IrisBlockData.class)
|
||||
@Desc("The blocks that drop loot")
|
||||
private KList<LoaderBlockData> blocks = new KList<>();
|
||||
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;
|
||||
@@ -64,7 +64,7 @@ public class IrisBlockDrops {
|
||||
{
|
||||
KList<BlockData> b = new KList<>();
|
||||
|
||||
for (LoaderBlockData i : getBlocks()) {
|
||||
for (IrisBlockData i : getBlocks()) {
|
||||
BlockData dd = i.getBlockData(rdata);
|
||||
|
||||
if (dd != null) {
|
||||
|
||||
@@ -49,9 +49,9 @@ public class IrisMaterialPalette {
|
||||
private double zoom = 5;
|
||||
|
||||
@Required
|
||||
@ArrayType(min = 1, type = LoaderBlockData.class)
|
||||
@ArrayType(min = 1, type = IrisBlockData.class)
|
||||
@Desc("The palette of blocks to be used in this layer")
|
||||
private KList<LoaderBlockData> palette = new KList<LoaderBlockData>().qadd(new LoaderBlockData("STONE"));
|
||||
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<>();
|
||||
@@ -82,14 +82,14 @@ public class IrisMaterialPalette {
|
||||
return this;
|
||||
}
|
||||
|
||||
public KList<LoaderBlockData> add(String b) {
|
||||
palette.add(new LoaderBlockData(b));
|
||||
public KList<IrisBlockData> add(String b) {
|
||||
palette.add(new IrisBlockData(b));
|
||||
|
||||
return palette;
|
||||
}
|
||||
|
||||
public IrisMaterialPalette qadd(String b) {
|
||||
palette.add(new LoaderBlockData(b));
|
||||
palette.add(new IrisBlockData(b));
|
||||
|
||||
return this;
|
||||
}
|
||||
@@ -98,7 +98,7 @@ public class IrisMaterialPalette {
|
||||
return blockData.aquire(() ->
|
||||
{
|
||||
KList<BlockData> blockData = new KList<>();
|
||||
for (LoaderBlockData ix : palette) {
|
||||
for (IrisBlockData ix : palette) {
|
||||
BlockData bx = ix.getBlockData(rdata);
|
||||
if (bx != null) {
|
||||
for (int i = 0; i < ix.getWeight(); i++) {
|
||||
|
||||
@@ -20,8 +20,8 @@ package com.volmit.iris.engine.object.carve;
|
||||
|
||||
import com.volmit.iris.core.project.loader.IrisData;
|
||||
import com.volmit.iris.engine.data.cache.AtomicCache;
|
||||
import com.volmit.iris.engine.data.B;
|
||||
import com.volmit.iris.engine.object.block.LoaderBlockData;
|
||||
import com.volmit.iris.util.data.B;
|
||||
import com.volmit.iris.engine.object.block.IrisBlockData;
|
||||
import com.volmit.iris.engine.object.annotations.Desc;
|
||||
import com.volmit.iris.engine.object.annotations.MaxNumber;
|
||||
import com.volmit.iris.engine.object.annotations.MinNumber;
|
||||
@@ -49,7 +49,7 @@ public class IrisCaveFluid {
|
||||
|
||||
@Required
|
||||
@Desc("The fluid type that should spawn here")
|
||||
private LoaderBlockData fluidType = new LoaderBlockData("CAVE_AIR");
|
||||
private IrisBlockData fluidType = new IrisBlockData("CAVE_AIR");
|
||||
|
||||
private final transient AtomicCache<BlockData> fluidData = new AtomicCache<>();
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ package com.volmit.iris.engine.object.compat;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.volmit.iris.Iris;
|
||||
import com.volmit.iris.engine.data.B;
|
||||
import com.volmit.iris.util.data.B;
|
||||
import com.volmit.iris.util.collection.KList;
|
||||
import com.volmit.iris.util.io.IO;
|
||||
import com.volmit.iris.util.json.JSONObject;
|
||||
|
||||
@@ -20,7 +20,7 @@ package com.volmit.iris.engine.object.compat;
|
||||
|
||||
import com.volmit.iris.Iris;
|
||||
import com.volmit.iris.engine.data.cache.AtomicCache;
|
||||
import com.volmit.iris.engine.data.B;
|
||||
import com.volmit.iris.util.data.B;
|
||||
import com.volmit.iris.engine.object.annotations.Desc;
|
||||
import com.volmit.iris.engine.object.annotations.Required;
|
||||
import lombok.AllArgsConstructor;
|
||||
|
||||
@@ -20,7 +20,7 @@ package com.volmit.iris.engine.object.compat;
|
||||
|
||||
import com.volmit.iris.Iris;
|
||||
import com.volmit.iris.engine.data.cache.AtomicCache;
|
||||
import com.volmit.iris.engine.data.B;
|
||||
import com.volmit.iris.util.data.B;
|
||||
import com.volmit.iris.engine.object.annotations.Desc;
|
||||
import com.volmit.iris.engine.object.annotations.Required;
|
||||
import lombok.Data;
|
||||
|
||||
@@ -21,8 +21,8 @@ package com.volmit.iris.engine.object.decoration;
|
||||
import com.volmit.iris.Iris;
|
||||
import com.volmit.iris.core.project.loader.IrisData;
|
||||
import com.volmit.iris.engine.data.cache.AtomicCache;
|
||||
import com.volmit.iris.engine.object.biome.LoaderBiome;
|
||||
import com.volmit.iris.engine.object.block.LoaderBlockData;
|
||||
import com.volmit.iris.engine.object.biome.IrisBiome;
|
||||
import com.volmit.iris.engine.object.block.IrisBlockData;
|
||||
import com.volmit.iris.engine.object.noise.IrisGeneratorStyle;
|
||||
import com.volmit.iris.engine.object.noise.NoiseStyle;
|
||||
import com.volmit.iris.util.noise.CNG;
|
||||
@@ -82,13 +82,13 @@ public class IrisDecorator {
|
||||
private double chance = 0.1;
|
||||
|
||||
@Required
|
||||
@ArrayType(min = 1, type = LoaderBlockData.class)
|
||||
@ArrayType(min = 1, type = IrisBlockData.class)
|
||||
@Desc("The palette of blocks to pick from when this decorator needs to place.")
|
||||
private KList<LoaderBlockData> palette = new KList<LoaderBlockData>().qadd(new LoaderBlockData("grass"));
|
||||
private KList<IrisBlockData> palette = new KList<IrisBlockData>().qadd(new IrisBlockData("grass"));
|
||||
|
||||
@ArrayType(min = 1, type = LoaderBlockData.class)
|
||||
@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<LoaderBlockData> topPalette = new KList<>();
|
||||
private KList<IrisBlockData> topPalette = new KList<>();
|
||||
|
||||
@DependsOn("topPalette")
|
||||
@MinNumber(0.01)
|
||||
@@ -126,12 +126,12 @@ public class IrisDecorator {
|
||||
.scale(1D / variance.getZoom()));
|
||||
}
|
||||
|
||||
public KList<LoaderBlockData> add(String b) {
|
||||
palette.add(new LoaderBlockData(b));
|
||||
public KList<IrisBlockData> add(String b) {
|
||||
palette.add(new IrisBlockData(b));
|
||||
return palette;
|
||||
}
|
||||
|
||||
public BlockData getBlockData(LoaderBiome b, RNG rng, double x, double z, IrisData data) {
|
||||
public BlockData getBlockData(IrisBiome b, RNG rng, double x, double z, IrisData data) {
|
||||
if (getBlockData(data).isEmpty()) {
|
||||
Iris.warn("Empty Block Data for " + b.getName());
|
||||
return null;
|
||||
@@ -151,7 +151,7 @@ public class IrisDecorator {
|
||||
return null;
|
||||
}
|
||||
|
||||
public BlockData getBlockData100(LoaderBiome b, RNG rng, double x, double y, double z, IrisData data) {
|
||||
public BlockData getBlockData100(IrisBiome b, RNG rng, double x, double y, double z, IrisData data) {
|
||||
if (getBlockData(data).isEmpty()) {
|
||||
Iris.warn("Empty Block Data for " + b.getName());
|
||||
return null;
|
||||
@@ -174,7 +174,7 @@ public class IrisDecorator {
|
||||
return getVarianceGenerator(rng, data).fit(getBlockData(data), z, y, x).clone(); //X and Z must be switched
|
||||
}
|
||||
|
||||
public BlockData getBlockDataForTop(LoaderBiome b, RNG rng, double x, double y, double z, IrisData data) {
|
||||
public BlockData getBlockDataForTop(IrisBiome b, RNG rng, double x, double y, double z, IrisData data) {
|
||||
if (getBlockDataTops(data).isEmpty()) {
|
||||
return getBlockData100(b, rng, x, y, z, data);
|
||||
}
|
||||
@@ -197,7 +197,7 @@ public class IrisDecorator {
|
||||
return blockData.aquire(() ->
|
||||
{
|
||||
KList<BlockData> blockData = new KList<>();
|
||||
for (LoaderBlockData i : palette) {
|
||||
for (IrisBlockData i : palette) {
|
||||
BlockData bx = i.getBlockData(data);
|
||||
if (bx != null) {
|
||||
for (int n = 0; n < i.getWeight(); n++) {
|
||||
@@ -214,7 +214,7 @@ public class IrisDecorator {
|
||||
return blockDataTops.aquire(() ->
|
||||
{
|
||||
KList<BlockData> blockDataTops = new KList<>();
|
||||
for (LoaderBlockData i : topPalette) {
|
||||
for (IrisBlockData i : topPalette) {
|
||||
BlockData bx = i.getBlockData(data);
|
||||
if (bx != null) {
|
||||
for (int n = 0; n < i.getWeight(); n++) {
|
||||
|
||||
@@ -21,8 +21,8 @@ package com.volmit.iris.engine.object.deposits;
|
||||
import com.volmit.iris.core.project.loader.IrisData;
|
||||
import com.volmit.iris.engine.data.cache.AtomicCache;
|
||||
import com.volmit.iris.engine.object.annotations.*;
|
||||
import com.volmit.iris.engine.object.block.LoaderBlockData;
|
||||
import com.volmit.iris.engine.object.objects.LoaderObject;
|
||||
import com.volmit.iris.engine.object.block.IrisBlockData;
|
||||
import com.volmit.iris.engine.object.objects.IrisObject;
|
||||
import com.volmit.iris.util.collection.KList;
|
||||
import com.volmit.iris.util.math.RNG;
|
||||
import lombok.AllArgsConstructor;
|
||||
@@ -75,23 +75,23 @@ public class IrisDepositGenerator {
|
||||
private int minPerChunk = 1;
|
||||
|
||||
@Required
|
||||
@ArrayType(min = 1, type = LoaderBlockData.class)
|
||||
@ArrayType(min = 1, type = IrisBlockData.class)
|
||||
@Desc("The palette of blocks to be used in this deposit generator")
|
||||
private KList<LoaderBlockData> palette = new KList<>();
|
||||
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<LoaderObject>> objects = new AtomicCache<>();
|
||||
private final transient AtomicCache<KList<IrisObject>> objects = new AtomicCache<>();
|
||||
private final transient AtomicCache<KList<BlockData>> blockData = new AtomicCache<>();
|
||||
|
||||
public LoaderObject getClump(RNG rng, IrisData rdata) {
|
||||
KList<LoaderObject> objects = this.objects.aquire(() ->
|
||||
public IrisObject getClump(RNG rng, IrisData rdata) {
|
||||
KList<IrisObject> objects = this.objects.aquire(() ->
|
||||
{
|
||||
RNG rngv = rng.nextParallelRNG(3957778);
|
||||
KList<LoaderObject> objectsf = new KList<>();
|
||||
KList<IrisObject> objectsf = new KList<>();
|
||||
|
||||
for (int i = 0; i < varience; i++) {
|
||||
objectsf.add(generateClumpObject(rngv.nextParallelRNG(2349 * i + 3598), rdata));
|
||||
@@ -106,11 +106,11 @@ public class IrisDepositGenerator {
|
||||
return Math.min(11, (int) Math.round(Math.pow(maxSize, 1D / 3D)));
|
||||
}
|
||||
|
||||
private LoaderObject generateClumpObject(RNG rngv, IrisData rdata) {
|
||||
private IrisObject generateClumpObject(RNG rngv, IrisData rdata) {
|
||||
int s = rngv.i(minSize, maxSize);
|
||||
int dim = Math.min(11, (int) Math.round(Math.pow(maxSize, 1D / 3D)));
|
||||
int w = dim / 2;
|
||||
LoaderObject o = new LoaderObject(dim, dim, dim);
|
||||
IrisObject o = new IrisObject(dim, dim, dim);
|
||||
|
||||
if (s == 1) {
|
||||
o.getBlocks().put(o.getCenter(), nextBlock(rngv, rdata));
|
||||
@@ -135,7 +135,7 @@ public class IrisDepositGenerator {
|
||||
{
|
||||
KList<BlockData> blockData = new KList<>();
|
||||
|
||||
for (LoaderBlockData ix : palette) {
|
||||
for (IrisBlockData ix : palette) {
|
||||
BlockData bx = ix.getBlockData(rdata);
|
||||
|
||||
if (bx != null) {
|
||||
|
||||
@@ -20,11 +20,11 @@ package com.volmit.iris.engine.object.dimensional;
|
||||
|
||||
import com.volmit.iris.Iris;
|
||||
import com.volmit.iris.core.project.loader.IrisData;
|
||||
import com.volmit.iris.core.project.loader.LoaderRegistrant;
|
||||
import com.volmit.iris.core.project.loader.IrisRegistrant;
|
||||
import com.volmit.iris.engine.data.cache.AtomicCache;
|
||||
import com.volmit.iris.engine.data.DataProvider;
|
||||
import com.volmit.iris.util.data.DataProvider;
|
||||
import com.volmit.iris.engine.object.biome.InferredType;
|
||||
import com.volmit.iris.engine.object.biome.LoaderBiome;
|
||||
import com.volmit.iris.engine.object.biome.IrisBiome;
|
||||
import com.volmit.iris.engine.object.biome.IrisBiomeCustom;
|
||||
import com.volmit.iris.engine.object.biome.IrisBiomeMutation;
|
||||
import com.volmit.iris.engine.object.block.IrisBlockDrops;
|
||||
@@ -36,15 +36,15 @@ import com.volmit.iris.engine.object.carve.IrisCaverns;
|
||||
import com.volmit.iris.engine.object.deposits.IrisDepositGenerator;
|
||||
import com.volmit.iris.engine.object.feature.IrisFeaturePositional;
|
||||
import com.volmit.iris.engine.object.feature.IrisFeaturePotential;
|
||||
import com.volmit.iris.engine.object.jigsaw.LoaderJigsawStructure;
|
||||
import com.volmit.iris.engine.object.jigsaw.IrisJigsawStructure;
|
||||
import com.volmit.iris.engine.object.jigsaw.IrisJigsawStructurePlacement;
|
||||
import com.volmit.iris.engine.object.loot.IrisLootReference;
|
||||
import com.volmit.iris.engine.object.noise.IrisGeneratorStyle;
|
||||
import com.volmit.iris.engine.object.noise.IrisShapedGeneratorStyle;
|
||||
import com.volmit.iris.engine.object.noise.NoiseStyle;
|
||||
import com.volmit.iris.engine.object.objects.IrisObjectPlacement;
|
||||
import com.volmit.iris.engine.object.regional.LoaderRegion;
|
||||
import com.volmit.iris.engine.object.spawners.LoaderSpawner;
|
||||
import com.volmit.iris.engine.object.regional.IrisRegion;
|
||||
import com.volmit.iris.engine.object.spawners.IrisSpawner;
|
||||
import com.volmit.iris.engine.object.trees.IrisTreeSettings;
|
||||
import com.volmit.iris.util.noise.CNG;
|
||||
import com.volmit.iris.engine.object.annotations.*;
|
||||
@@ -71,7 +71,7 @@ import java.io.IOException;
|
||||
@Desc("Represents a dimension")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
public class LoaderDimension extends LoaderRegistrant {
|
||||
public class IrisDimension extends IrisRegistrant {
|
||||
public static final BlockData STONE = Material.STONE.createBlockData();
|
||||
public static final BlockData WATER = Material.WATER.createBlockData();
|
||||
|
||||
@@ -85,9 +85,9 @@ public class LoaderDimension extends LoaderRegistrant {
|
||||
private KList<IrisDimensionIndex> dimensionalComposite = new KList<>();
|
||||
|
||||
@Desc("Create an inverted dimension in the sky (like the nether)")
|
||||
private LoaderDimension sky = null;
|
||||
private IrisDimension sky = null;
|
||||
|
||||
@RegistryListResource(LoaderJigsawStructure.class)
|
||||
@RegistryListResource(IrisJigsawStructure.class)
|
||||
@Desc("If defined, Iris will place the given jigsaw structure where minecraft should place the overworld stronghold.")
|
||||
private String stronghold;
|
||||
|
||||
@@ -114,7 +114,7 @@ public class LoaderDimension extends LoaderRegistrant {
|
||||
|
||||
@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(LoaderSpawner.class)
|
||||
@RegistryListResource(IrisSpawner.class)
|
||||
private KList<String> entitySpawners = new KList<>();
|
||||
|
||||
@Desc("Add specific features in exact positions")
|
||||
@@ -218,7 +218,7 @@ public class LoaderDimension extends LoaderRegistrant {
|
||||
@Desc("The world environment")
|
||||
private Environment environment = Environment.NORMAL;
|
||||
|
||||
@RegistryListResource(LoaderRegion.class)
|
||||
@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")
|
||||
@@ -234,11 +234,11 @@ public class LoaderDimension extends LoaderRegistrant {
|
||||
@Desc("The fluid height for this dimension")
|
||||
private int fluidHeight = 63;
|
||||
|
||||
@RegistryListResource(LoaderBiome.class)
|
||||
@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(LoaderBiome.class)
|
||||
@RegistryListResource(IrisBiome.class)
|
||||
@Desc("Keep this either undefined or empty. Setting any region name into this will force iris to only generate the specified region. Great for testing.")
|
||||
private String focusRegion = "";
|
||||
|
||||
@@ -409,8 +409,8 @@ public class LoaderDimension extends LoaderRegistrant {
|
||||
return cosr.aquire(() -> Math.cos(getDimensionAngle()));
|
||||
}
|
||||
|
||||
public KList<LoaderRegion> getAllRegions(DataProvider g) {
|
||||
KList<LoaderRegion> r = new KList<>();
|
||||
public KList<IrisRegion> getAllRegions(DataProvider g) {
|
||||
KList<IrisRegion> r = new KList<>();
|
||||
|
||||
for (String i : getRegions()) {
|
||||
r.add(g.getData().getRegionLoader().load(i));
|
||||
@@ -419,8 +419,8 @@ public class LoaderDimension extends LoaderRegistrant {
|
||||
return r;
|
||||
}
|
||||
|
||||
public KList<LoaderRegion> getAllAnyRegions() {
|
||||
KList<LoaderRegion> r = new KList<>();
|
||||
public KList<IrisRegion> getAllAnyRegions() {
|
||||
KList<IrisRegion> r = new KList<>();
|
||||
|
||||
for (String i : getRegions()) {
|
||||
r.add(IrisData.loadAnyRegion(i));
|
||||
@@ -429,14 +429,14 @@ public class LoaderDimension extends LoaderRegistrant {
|
||||
return r;
|
||||
}
|
||||
|
||||
public KList<LoaderBiome> getAllBiomes(DataProvider g) {
|
||||
public KList<IrisBiome> getAllBiomes(DataProvider g) {
|
||||
return g.getData().getBiomeLoader().loadAll(g.getData().getBiomeLoader().getPossibleKeys());
|
||||
}
|
||||
|
||||
public KList<LoaderBiome> getAllAnyBiomes() {
|
||||
KList<LoaderBiome> r = new KList<>();
|
||||
public KList<IrisBiome> getAllAnyBiomes() {
|
||||
KList<IrisBiome> r = new KList<>();
|
||||
|
||||
for (LoaderRegion i : getAllAnyRegions()) {
|
||||
for (IrisRegion i : getAllAnyRegions()) {
|
||||
if (i == null) {
|
||||
continue;
|
||||
}
|
||||
@@ -474,7 +474,7 @@ public class LoaderDimension extends LoaderRegistrant {
|
||||
|
||||
IO.delete(new File(datapacks, "iris/data/" + getLoadKey()));
|
||||
|
||||
for (LoaderBiome i : getAllBiomes(data)) {
|
||||
for (IrisBiome i : getAllBiomes(data)) {
|
||||
if (i.isCustom()) {
|
||||
write = true;
|
||||
|
||||
@@ -524,7 +524,7 @@ public class LoaderDimension extends LoaderRegistrant {
|
||||
return true;
|
||||
}
|
||||
|
||||
for (LoaderRegion i : getAllRegions(data)) {
|
||||
for (IrisRegion i : getAllRegions(data)) {
|
||||
if (i.getFeatures().isNotEmpty()) {
|
||||
return true;
|
||||
}
|
||||
@@ -535,7 +535,7 @@ public class LoaderDimension extends LoaderRegistrant {
|
||||
}
|
||||
}
|
||||
|
||||
for (LoaderBiome j : i.getAllBiomes(data)) {
|
||||
for (IrisBiome j : i.getAllBiomes(data)) {
|
||||
if (j.getFeatures().isNotEmpty()) {
|
||||
return true;
|
||||
}
|
||||
@@ -47,7 +47,7 @@ public class IrisDimensionIndex {
|
||||
private boolean primary = false;
|
||||
|
||||
@Required
|
||||
@RegistryListResource(LoaderDimension.class)
|
||||
@RegistryListResource(IrisDimension.class)
|
||||
@MinNumber(1)
|
||||
@Desc("Name of dimension")
|
||||
private String dimension = "";
|
||||
|
||||
@@ -19,14 +19,14 @@
|
||||
package com.volmit.iris.engine.object.entity;
|
||||
|
||||
import com.volmit.iris.Iris;
|
||||
import com.volmit.iris.core.project.loader.LoaderRegistrant;
|
||||
import com.volmit.iris.core.project.loader.IrisRegistrant;
|
||||
import com.volmit.iris.engine.framework.Engine;
|
||||
import com.volmit.iris.engine.object.annotations.ArrayType;
|
||||
import com.volmit.iris.engine.object.annotations.Desc;
|
||||
import com.volmit.iris.engine.object.annotations.Required;
|
||||
import com.volmit.iris.engine.object.loot.IrisLoot;
|
||||
import com.volmit.iris.engine.object.loot.IrisLootReference;
|
||||
import com.volmit.iris.engine.object.loot.LoaderLootTable;
|
||||
import com.volmit.iris.engine.object.loot.IrisLootTable;
|
||||
import com.volmit.iris.engine.object.meta.InventorySlotType;
|
||||
import com.volmit.iris.engine.object.meta.IrisAttributeModifier;
|
||||
import com.volmit.iris.engine.object.meta.IrisEffect;
|
||||
@@ -65,7 +65,7 @@ import java.util.concurrent.atomic.AtomicReference;
|
||||
@Desc("Represents an iris entity.")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
public class LoaderEntity extends LoaderRegistrant {
|
||||
public class IrisEntity extends IrisRegistrant {
|
||||
@Required
|
||||
@Desc("The type of entity to spawn. To spawn a mythic mob, set this type to unknown and define mythic type.")
|
||||
private EntityType type = EntityType.UNKNOWN;
|
||||
@@ -119,8 +119,8 @@ public class LoaderEntity extends LoaderRegistrant {
|
||||
private IrisLoot offHand = null;
|
||||
|
||||
@Desc("Make other entities ride this entity")
|
||||
@ArrayType(min = 1, type = LoaderEntity.class)
|
||||
private KList<LoaderEntity> passengers = new KList<>();
|
||||
@ArrayType(min = 1, type = IrisEntity.class)
|
||||
private KList<IrisEntity> passengers = new KList<>();
|
||||
|
||||
@Desc("Attribute modifiers for this entity")
|
||||
@ArrayType(min = 1, type = IrisAttributeModifier.class)
|
||||
@@ -130,7 +130,7 @@ public class LoaderEntity extends LoaderRegistrant {
|
||||
private IrisLootReference loot = new IrisLootReference();
|
||||
|
||||
@Desc("If specified, this entity will be leashed by this entity. I.e. THIS ENTITY Leashed by SPECIFIED. This has no effect on EnderDragons, Withers, Players, or Bats.Non-living entities excluding leashes will not persist as leashholders.")
|
||||
private LoaderEntity leashHolder = null;
|
||||
private IrisEntity leashHolder = null;
|
||||
|
||||
@Desc("If specified, this entity will spawn with an effect")
|
||||
private IrisEffect spawnEffect = null;
|
||||
@@ -171,7 +171,7 @@ public class LoaderEntity extends LoaderRegistrant {
|
||||
e.setPersistent(isKeepEntity());
|
||||
|
||||
int gg = 0;
|
||||
for (LoaderEntity i : passengers) {
|
||||
for (IrisEntity i : passengers) {
|
||||
Entity passenger = i.spawn(gen, at, rng.nextParallelRNG(234858 + gg++));
|
||||
if (!Bukkit.isPrimaryThread()) {
|
||||
J.s(() -> e.addPassenger(passenger));
|
||||
@@ -193,7 +193,7 @@ public class LoaderEntity extends LoaderRegistrant {
|
||||
l.setLootTable(new LootTable() {
|
||||
@Override
|
||||
public NamespacedKey getKey() {
|
||||
return new NamespacedKey(Iris.instance, "loot-" + LoaderEntity.this.hashCode());
|
||||
return new NamespacedKey(Iris.instance, "loot-" + IrisEntity.this.hashCode());
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -201,7 +201,7 @@ public class LoaderEntity extends LoaderRegistrant {
|
||||
KList<ItemStack> items = new KList<>();
|
||||
|
||||
for (String fi : getLoot().getTables()) {
|
||||
LoaderLootTable i = gen.getData().getLootLoader().load(fi);
|
||||
IrisLootTable i = gen.getData().getLootLoader().load(fi);
|
||||
items.addAll(i.getLoot(gen.isStudio(), false, rng.nextParallelRNG(345911), InventorySlotType.STORAGE, at.getBlockX(), at.getBlockY(), at.getBlockZ(), 8, 4));
|
||||
}
|
||||
|
||||
@@ -24,8 +24,8 @@ import com.volmit.iris.engine.data.cache.AtomicCache;
|
||||
import com.volmit.iris.engine.framework.Engine;
|
||||
import com.volmit.iris.engine.framework.EngineFramework;
|
||||
import com.volmit.iris.engine.modifier.IrisCaveModifier;
|
||||
import com.volmit.iris.engine.object.biome.LoaderBiome;
|
||||
import com.volmit.iris.engine.object.spawners.LoaderSpawner;
|
||||
import com.volmit.iris.engine.object.biome.IrisBiome;
|
||||
import com.volmit.iris.engine.object.spawners.IrisSpawner;
|
||||
import com.volmit.iris.engine.object.annotations.Desc;
|
||||
import com.volmit.iris.engine.object.annotations.MinNumber;
|
||||
import com.volmit.iris.engine.object.annotations.RegistryListResource;
|
||||
@@ -49,7 +49,7 @@ import org.bukkit.entity.Entity;
|
||||
@Desc("Represents an entity spawn during initial chunk generation")
|
||||
@Data
|
||||
public class IrisEntitySpawn implements IRare {
|
||||
@RegistryListResource(LoaderEntity.class)
|
||||
@RegistryListResource(IrisEntity.class)
|
||||
@Required
|
||||
@Desc("The entity")
|
||||
private String entity = "";
|
||||
@@ -69,9 +69,9 @@ public class IrisEntitySpawn implements IRare {
|
||||
@Desc("The max of this entity to spawn")
|
||||
private int maxSpawns = 1;
|
||||
|
||||
private transient LoaderSpawner referenceSpawner;
|
||||
private transient IrisSpawner referenceSpawner;
|
||||
private final transient AtomicCache<RNG> rng = new AtomicCache<>();
|
||||
private final transient AtomicCache<LoaderEntity> ent = 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));
|
||||
@@ -88,7 +88,7 @@ public class IrisEntitySpawn implements IRare {
|
||||
case CAVE -> {
|
||||
IrisComplex comp = gen.getFramework().getComplex();
|
||||
EngineFramework frame = gen.getFramework();
|
||||
LoaderBiome cave = comp.getCaveBiomeStream().get(x, z);
|
||||
IrisBiome cave = comp.getCaveBiomeStream().get(x, z);
|
||||
KList<Location> r = new KList<>();
|
||||
if (cave != null) {
|
||||
for (CaveResult i : ((IrisCaveModifier) frame.getCaveModifier()).genCaves(x, z)) {
|
||||
@@ -116,7 +116,7 @@ public class IrisEntitySpawn implements IRare {
|
||||
return s;
|
||||
}
|
||||
|
||||
public LoaderEntity getRealEntity(Engine g) {
|
||||
public IrisEntity getRealEntity(Engine g) {
|
||||
return ent.aquire(() -> g.getData().getEntityLoader().load(getEntity()));
|
||||
}
|
||||
|
||||
@@ -134,7 +134,7 @@ public class IrisEntitySpawn implements IRare {
|
||||
|
||||
private Entity spawn100(Engine g, Location at) {
|
||||
try {
|
||||
LoaderEntity irisEntity = getRealEntity(g);
|
||||
IrisEntity irisEntity = getRealEntity(g);
|
||||
|
||||
if (!irisEntity.getSurface().matches(at.clone().subtract(0, 1, 0).getBlock().getState())) return null; //Make sure it can spawn on the block
|
||||
|
||||
|
||||
@@ -40,7 +40,7 @@ import org.bukkit.event.entity.EntitySpawnEvent;
|
||||
@Desc("Represents an entity spawn")
|
||||
@Data
|
||||
public class IrisEntitySpawnOverride {
|
||||
@RegistryListResource(LoaderEntity.class)
|
||||
@RegistryListResource(IrisEntity.class)
|
||||
@Required
|
||||
@Desc("The entity")
|
||||
private String entity = "";
|
||||
@@ -57,7 +57,7 @@ public class IrisEntitySpawnOverride {
|
||||
private int rarity = 1;
|
||||
|
||||
private final transient AtomicCache<RNG> rng = new AtomicCache<>();
|
||||
private final transient AtomicCache<LoaderEntity> ent = new AtomicCache<>();
|
||||
private final transient AtomicCache<IrisEntity> ent = new AtomicCache<>();
|
||||
|
||||
|
||||
public Entity on(Engine g, Location at, EntityType t, EntitySpawnEvent ee) {
|
||||
@@ -89,7 +89,7 @@ public class IrisEntitySpawnOverride {
|
||||
return null;
|
||||
}
|
||||
|
||||
public LoaderEntity getRealEntity(Engine g) {
|
||||
public IrisEntity getRealEntity(Engine g) {
|
||||
return ent.aquire(() -> g.getData().getEntityLoader().load(getEntity()));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,8 +22,8 @@ import com.google.gson.Gson;
|
||||
import com.volmit.iris.engine.data.cache.AtomicCache;
|
||||
import com.volmit.iris.util.interpolation.InterpolationMethod;
|
||||
import com.volmit.iris.util.interpolation.IrisInterpolation;
|
||||
import com.volmit.iris.engine.object.biome.LoaderBiome;
|
||||
import com.volmit.iris.engine.object.spawners.LoaderSpawner;
|
||||
import com.volmit.iris.engine.object.biome.IrisBiome;
|
||||
import com.volmit.iris.engine.object.spawners.IrisSpawner;
|
||||
import com.volmit.iris.engine.object.annotations.*;
|
||||
import com.volmit.iris.engine.object.noise.IrisGeneratorStyle;
|
||||
import com.volmit.iris.util.collection.KList;
|
||||
@@ -50,7 +50,7 @@ public class IrisFeature {
|
||||
@Desc("The chance an object that should be place actually will place. Set to below 1 to affect objects in this zone")
|
||||
private double objectChance = 1;
|
||||
|
||||
@RegistryListResource(LoaderBiome.class)
|
||||
@RegistryListResource(IrisBiome.class)
|
||||
@Desc("Apply a custom biome here")
|
||||
private String customBiome = null;
|
||||
|
||||
@@ -85,7 +85,7 @@ public class IrisFeature {
|
||||
@Desc("Fracture the radius ring with additional noise")
|
||||
private IrisGeneratorStyle fractureRadius = null;
|
||||
|
||||
@RegistryListResource(LoaderSpawner.class)
|
||||
@RegistryListResource(IrisSpawner.class)
|
||||
@ArrayType(min = 1, type = String.class)
|
||||
@Desc("Within this noise feature, use the following spawners")
|
||||
private KList<String> entitySpawners = new KList<>();
|
||||
|
||||
@@ -22,7 +22,7 @@ import com.google.gson.Gson;
|
||||
import com.volmit.iris.core.project.loader.IrisData;
|
||||
import com.volmit.iris.engine.data.cache.AtomicCache;
|
||||
import com.volmit.iris.util.interpolation.IrisInterpolation;
|
||||
import com.volmit.iris.engine.object.biome.LoaderBiome;
|
||||
import com.volmit.iris.engine.object.biome.IrisBiome;
|
||||
import com.volmit.iris.engine.object.annotations.Desc;
|
||||
import com.volmit.iris.engine.object.annotations.Required;
|
||||
import com.volmit.iris.util.documentation.BlockCoordinates;
|
||||
@@ -125,10 +125,10 @@ public class IrisFeaturePositional {
|
||||
return M.lerp(1, getFeature().getObjectChance(), getStrength(x, z, rng, data));
|
||||
}
|
||||
|
||||
public LoaderBiome filter(double x, double z, LoaderBiome biome, RNG rng) {
|
||||
public IrisBiome filter(double x, double z, IrisBiome biome, RNG rng) {
|
||||
if (getFeature().getCustomBiome() != null) {
|
||||
if (getStrength(x, z, rng, biome.getLoader()) >= getFeature().getBiomeStrengthThreshold()) {
|
||||
LoaderBiome b = biome.getLoader().getBiomeLoader().load(getFeature().getCustomBiome());
|
||||
IrisBiome b = biome.getLoader().getBiomeLoader().load(getFeature().getCustomBiome());
|
||||
b.setInferredType(biome.getInferredType());
|
||||
return b;
|
||||
}
|
||||
|
||||
@@ -21,13 +21,13 @@ package com.volmit.iris.engine.object.jigsaw;
|
||||
import com.volmit.iris.Iris;
|
||||
import com.volmit.iris.engine.data.cache.AtomicCache;
|
||||
import com.volmit.iris.engine.object.basic.IrisPosition;
|
||||
import com.volmit.iris.core.project.loader.LoaderRegistrant;
|
||||
import com.volmit.iris.core.project.loader.IrisRegistrant;
|
||||
import com.volmit.iris.engine.object.objects.ObjectPlaceMode;
|
||||
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.objects.LoaderObject;
|
||||
import com.volmit.iris.engine.object.objects.IrisObject;
|
||||
import com.volmit.iris.engine.object.objects.IrisObjectPlacement;
|
||||
import com.volmit.iris.util.collection.KList;
|
||||
import lombok.AllArgsConstructor;
|
||||
@@ -47,8 +47,8 @@ import java.io.IOException;
|
||||
@Desc("Represents a structure tile")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
public class LoaderJigsawPiece extends LoaderRegistrant {
|
||||
@RegistryListResource(LoaderObject.class)
|
||||
public class IrisJigsawPiece extends IrisRegistrant {
|
||||
@RegistryListResource(IrisObject.class)
|
||||
@Required
|
||||
@Desc("The object this piece represents")
|
||||
private String object = "";
|
||||
@@ -67,7 +67,7 @@ public class LoaderJigsawPiece extends LoaderRegistrant {
|
||||
public int getMax2dDimension() {
|
||||
return max2dDim.aquire(() -> {
|
||||
try {
|
||||
BlockVector v = LoaderObject.sampleSize(getLoader().getObjectLoader().findFile(getObject()));
|
||||
BlockVector v = IrisObject.sampleSize(getLoader().getObjectLoader().findFile(getObject()));
|
||||
return Math.max(v.getBlockX(), v.getBlockZ());
|
||||
} catch (IOException e) {
|
||||
Iris.reportError(e);
|
||||
@@ -81,7 +81,7 @@ public class LoaderJigsawPiece extends LoaderRegistrant {
|
||||
public int getMax3dDimension() {
|
||||
return max3dDim.aquire(() -> {
|
||||
try {
|
||||
BlockVector v = LoaderObject.sampleSize(getLoader().getObjectLoader().findFile(getObject()));
|
||||
BlockVector v = IrisObject.sampleSize(getLoader().getObjectLoader().findFile(getObject()));
|
||||
return Math.max(Math.max(v.getBlockX(), v.getBlockZ()), v.getBlockY());
|
||||
} catch (IOException e) {
|
||||
Iris.reportError(e);
|
||||
@@ -103,8 +103,8 @@ public class LoaderJigsawPiece extends LoaderRegistrant {
|
||||
return null;
|
||||
}
|
||||
|
||||
public LoaderJigsawPiece copy() {
|
||||
LoaderJigsawPiece p = new LoaderJigsawPiece();
|
||||
public IrisJigsawPiece copy() {
|
||||
IrisJigsawPiece p = new IrisJigsawPiece();
|
||||
p.setObject(getObject());
|
||||
p.setLoader(getLoader());
|
||||
p.setLoadKey(getLoadKey());
|
||||
@@ -19,7 +19,7 @@
|
||||
package com.volmit.iris.engine.object.jigsaw;
|
||||
|
||||
import com.volmit.iris.engine.object.objects.IrisDirection;
|
||||
import com.volmit.iris.engine.object.entity.LoaderEntity;
|
||||
import com.volmit.iris.engine.object.entity.IrisEntity;
|
||||
import com.volmit.iris.engine.object.basic.IrisPosition;
|
||||
import com.volmit.iris.engine.object.annotations.*;
|
||||
import com.volmit.iris.util.collection.KList;
|
||||
@@ -52,13 +52,13 @@ public class IrisJigsawPieceConnector {
|
||||
@Desc("If set to true, this connector is allowed to place pieces inside of it's own piece. For example if you are adding a light post, or house on top of a path piece, you would set this to true to allow the piece to collide with the path bounding box.")
|
||||
private boolean innerConnector = false;
|
||||
|
||||
@RegistryListResource(LoaderJigsawPool.class)
|
||||
@RegistryListResource(IrisJigsawPool.class)
|
||||
@Desc("Pick piece pools to place onto this connector")
|
||||
@ArrayType(type = String.class, min = 1)
|
||||
@Required
|
||||
private KList<String> pools = new KList<>();
|
||||
|
||||
@RegistryListResource(LoaderEntity.class)
|
||||
@RegistryListResource(IrisEntity.class)
|
||||
@Desc("Pick an entity to spawn on this connector")
|
||||
private String spawnEntity;
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ import lombok.experimental.Accessors;
|
||||
@Desc("Represents a jigsaw placement")
|
||||
@Data
|
||||
public class IrisJigsawPlacement {
|
||||
@RegistryListResource(LoaderJigsawStructure.class)
|
||||
@RegistryListResource(IrisJigsawStructure.class)
|
||||
@Required
|
||||
@Desc("The jigsaw structure to use")
|
||||
private String structure = "";
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
|
||||
package com.volmit.iris.engine.object.jigsaw;
|
||||
|
||||
import com.volmit.iris.core.project.loader.LoaderRegistrant;
|
||||
import com.volmit.iris.core.project.loader.IrisRegistrant;
|
||||
import com.volmit.iris.engine.object.annotations.ArrayType;
|
||||
import com.volmit.iris.engine.object.annotations.Desc;
|
||||
import com.volmit.iris.engine.object.annotations.RegistryListResource;
|
||||
@@ -38,8 +38,8 @@ import lombok.experimental.Accessors;
|
||||
@Desc("Represents a structure piece pool")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
public class LoaderJigsawPool extends LoaderRegistrant {
|
||||
@RegistryListResource(LoaderJigsawPiece.class)
|
||||
public class IrisJigsawPool extends IrisRegistrant {
|
||||
@RegistryListResource(IrisJigsawPiece.class)
|
||||
@Required
|
||||
@ArrayType(min = 1, type = String.class)
|
||||
@Desc("A list of structure piece pools")
|
||||
@@ -21,7 +21,7 @@ package com.volmit.iris.engine.object.jigsaw;
|
||||
import com.volmit.iris.Iris;
|
||||
import com.volmit.iris.engine.data.cache.AtomicCache;
|
||||
import com.volmit.iris.engine.object.feature.IrisFeature;
|
||||
import com.volmit.iris.core.project.loader.LoaderRegistrant;
|
||||
import com.volmit.iris.core.project.loader.IrisRegistrant;
|
||||
import com.volmit.iris.engine.object.annotations.*;
|
||||
import com.volmit.iris.util.collection.KList;
|
||||
import lombok.AllArgsConstructor;
|
||||
@@ -38,8 +38,8 @@ import lombok.experimental.Accessors;
|
||||
@Desc("Represents a jigsaw structure")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
public class LoaderJigsawStructure extends LoaderRegistrant {
|
||||
@RegistryListResource(LoaderJigsawPiece.class)
|
||||
public class IrisJigsawStructure extends IrisRegistrant {
|
||||
@RegistryListResource(IrisJigsawPiece.class)
|
||||
@Required
|
||||
@ArrayType(min = 1, type = String.class)
|
||||
@Desc("The starting pieces. Randomly chooses a starting piece, then connects pieces using the pools define in the starting piece.")
|
||||
@@ -66,7 +66,7 @@ public class LoaderJigsawStructure extends LoaderRegistrant {
|
||||
return;
|
||||
}
|
||||
|
||||
LoaderJigsawPool pool = getLoader().getJigsawPoolLoader().load(p);
|
||||
IrisJigsawPool pool = getLoader().getJigsawPoolLoader().load(p);
|
||||
|
||||
if (pool == null) {
|
||||
Iris.warn("Can't find jigsaw pool: " + p);
|
||||
@@ -81,7 +81,7 @@ public class LoaderJigsawStructure extends LoaderRegistrant {
|
||||
}
|
||||
|
||||
private void loadPiece(String p, KList<String> pools, KList<String> pieces) {
|
||||
LoaderJigsawPiece piece = getLoader().getJigsawPieceLoader().load(p);
|
||||
IrisJigsawPiece piece = getLoader().getJigsawPieceLoader().load(p);
|
||||
|
||||
if (piece == null) {
|
||||
Iris.warn("Can't find jigsaw piece: " + p);
|
||||
@@ -36,7 +36,7 @@ import lombok.experimental.Accessors;
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
public class IrisJigsawStructurePlacement {
|
||||
@RegistryListResource(LoaderJigsawStructure.class)
|
||||
@RegistryListResource(IrisJigsawStructure.class)
|
||||
@Required
|
||||
@Desc("The structure to place")
|
||||
private String structure;
|
||||
|
||||
@@ -20,7 +20,7 @@ package com.volmit.iris.engine.object.loot;
|
||||
|
||||
import com.volmit.iris.Iris;
|
||||
import com.volmit.iris.engine.data.cache.AtomicCache;
|
||||
import com.volmit.iris.engine.data.B;
|
||||
import com.volmit.iris.util.data.B;
|
||||
import com.volmit.iris.engine.object.meta.InventorySlotType;
|
||||
import com.volmit.iris.engine.object.meta.IrisAttributeModifier;
|
||||
import com.volmit.iris.engine.object.meta.IrisEnchantment;
|
||||
@@ -195,7 +195,7 @@ public class IrisLoot {
|
||||
return new ItemStack(Material.AIR);
|
||||
}
|
||||
|
||||
public ItemStack get(boolean debug, boolean giveSomething, LoaderLootTable table, RNG rng, int x, int y, int z) {
|
||||
public ItemStack get(boolean debug, boolean giveSomething, IrisLootTable table, RNG rng, int x, int y, int z) {
|
||||
if (debug) {
|
||||
chance.reset();
|
||||
}
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
package com.volmit.iris.engine.object.loot;
|
||||
|
||||
import com.volmit.iris.engine.data.cache.AtomicCache;
|
||||
import com.volmit.iris.engine.data.DataProvider;
|
||||
import com.volmit.iris.util.data.DataProvider;
|
||||
import com.volmit.iris.engine.object.annotations.ArrayType;
|
||||
import com.volmit.iris.engine.object.annotations.Desc;
|
||||
import com.volmit.iris.engine.object.annotations.MinNumber;
|
||||
@@ -39,7 +39,7 @@ public class IrisLootReference {
|
||||
@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(LoaderLootTable.class)
|
||||
@RegistryListResource(IrisLootTable.class)
|
||||
@ArrayType(min = 1, type = String.class)
|
||||
@Desc("Add loot table registries here")
|
||||
private KList<String> tables = new KList<>();
|
||||
@@ -48,12 +48,12 @@ public class IrisLootReference {
|
||||
@Desc("Increase the chance of loot in this area")
|
||||
private double multiplier = 1D;
|
||||
|
||||
private final transient AtomicCache<KList<LoaderLootTable>> tt = new AtomicCache<>();
|
||||
private final transient AtomicCache<KList<IrisLootTable>> tt = new AtomicCache<>();
|
||||
|
||||
public KList<LoaderLootTable> getLootTables(DataProvider g) {
|
||||
public KList<IrisLootTable> getLootTables(DataProvider g) {
|
||||
return tt.aquire(() ->
|
||||
{
|
||||
KList<LoaderLootTable> t = new KList<>();
|
||||
KList<IrisLootTable> t = new KList<>();
|
||||
|
||||
for (String i : tables) {
|
||||
t.add(g.getData().getLootLoader().load(i));
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
package com.volmit.iris.engine.object.loot;
|
||||
|
||||
import com.volmit.iris.engine.object.meta.InventorySlotType;
|
||||
import com.volmit.iris.core.project.loader.LoaderRegistrant;
|
||||
import com.volmit.iris.core.project.loader.IrisRegistrant;
|
||||
import com.volmit.iris.engine.object.annotations.ArrayType;
|
||||
import com.volmit.iris.engine.object.annotations.Desc;
|
||||
import com.volmit.iris.engine.object.annotations.MinNumber;
|
||||
@@ -41,7 +41,7 @@ import org.bukkit.inventory.ItemStack;
|
||||
@Desc("Represents a loot table. Biomes, Regions & Objects can add or replace the virtual table with these loot tables")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
public class LoaderLootTable extends LoaderRegistrant {
|
||||
public class IrisLootTable extends IrisRegistrant {
|
||||
@Required
|
||||
@Desc("The name of this loot table")
|
||||
@MinNumber(2)
|
||||
@@ -1,245 +0,0 @@
|
||||
/*
|
||||
* Iris is a World Generator for Minecraft Bukkit Servers
|
||||
* Copyright (c) 2021 Arcane Arts (Volmit Software)
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.volmit.iris.engine.object.matter;
|
||||
|
||||
import com.volmit.iris.util.data.Varint;
|
||||
import com.volmit.iris.util.math.BlockPosition;
|
||||
|
||||
import java.io.*;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.function.Function;
|
||||
|
||||
/**
|
||||
* When Red Matter isn't enough
|
||||
*
|
||||
* UVI width
|
||||
* UVI height
|
||||
* UVI depth
|
||||
* UVI sliceCount
|
||||
* UTF author
|
||||
* UVL createdAt
|
||||
* UVI version
|
||||
* UTF sliceType (canonical class name)
|
||||
* UVI nodeCount (for each slice)
|
||||
* UVI position [(z * w * h) + (y * w) + x]
|
||||
* ??? nodeData
|
||||
*
|
||||
*/
|
||||
public interface Matter {
|
||||
int VERSION = 1;
|
||||
|
||||
/**
|
||||
* Get the header information
|
||||
* @return the header info
|
||||
*/
|
||||
MatterHeader getHeader();
|
||||
|
||||
/**
|
||||
* Get the width of this matter
|
||||
* @return the width
|
||||
*/
|
||||
int getWidth();
|
||||
|
||||
/**
|
||||
* Get the height of this matter
|
||||
* @return the height
|
||||
*/
|
||||
int getHeight();
|
||||
|
||||
/**
|
||||
* Get the depth of this matter
|
||||
* @return the depth
|
||||
*/
|
||||
int getDepth();
|
||||
|
||||
/**
|
||||
* Get the center of this matter
|
||||
* @return the center
|
||||
*/
|
||||
default BlockPosition getCenter()
|
||||
{
|
||||
return new BlockPosition(getCenterX(), getCenterY(), getCenterZ());
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a slice from the given type
|
||||
* @param type the type class
|
||||
* @param matter the matter this slice will go into (size provider)
|
||||
* @param <T> the type
|
||||
* @return the slice (or null if not supported)
|
||||
*/
|
||||
<T> MatterSlice<T> createSlice(Class<T> type, Matter matter);
|
||||
|
||||
/**
|
||||
* Get the size of this matter
|
||||
* @return the size
|
||||
*/
|
||||
default BlockPosition getSize()
|
||||
{
|
||||
return new BlockPosition(getWidth(), getHeight(), getDepth());
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the center X of this matter
|
||||
* @return the center X
|
||||
*/
|
||||
default int getCenterX()
|
||||
{
|
||||
return Math.round(getWidth() / 2);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the center Y of this matter
|
||||
* @return the center Y
|
||||
*/
|
||||
default int getCenterY()
|
||||
{
|
||||
return Math.round(getHeight() / 2);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the center Z of this matter
|
||||
* @return the center Z
|
||||
*/
|
||||
default int getCenterZ()
|
||||
{
|
||||
return Math.round(getDepth() / 2);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the slice for the given type
|
||||
* @param t the type class
|
||||
* @param <T> the type
|
||||
* @return the slice or null
|
||||
*/
|
||||
default <T> MatterSlice<T> getSlice(Class<T> t)
|
||||
{
|
||||
return (MatterSlice<T>) getSliceMap().get(t);
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete the slice for the given type
|
||||
* @param c the type class
|
||||
* @param <T> the type
|
||||
* @return the deleted slice, or null if it diddn't exist
|
||||
*/
|
||||
default <T> MatterSlice<T> deleteSlice(Class<?> c)
|
||||
{
|
||||
return (MatterSlice<T>) getSliceMap().remove(c);
|
||||
}
|
||||
|
||||
/**
|
||||
* Put a given slice type
|
||||
* @param c the slice type class
|
||||
* @param slice the slice to assign to the type
|
||||
* @param <T> the slice type
|
||||
* @return the overwritten slice if there was an existing slice of that type
|
||||
*/
|
||||
default <T> MatterSlice<T> putSlice(Class<?> c, MatterSlice<T> slice)
|
||||
{
|
||||
return (MatterSlice<T>) getSliceMap().put(c, slice);
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if a slice exists for a given type
|
||||
* @param c the slice class type
|
||||
* @return true if it exists
|
||||
*/
|
||||
default boolean hasSlice(Class<?> c)
|
||||
{
|
||||
return getSlice(c) != null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove all slices
|
||||
*/
|
||||
default void clearSlices()
|
||||
{
|
||||
getSliceMap().clear();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the set backing the slice map keys (slice types)
|
||||
* @return the slice types
|
||||
*/
|
||||
default Set<Class<?>> getSliceTypes()
|
||||
{
|
||||
return getSliceMap().keySet();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get all slices
|
||||
* @return the real slice map
|
||||
*/
|
||||
Map<Class<?>, MatterSlice<?>> getSliceMap();
|
||||
|
||||
/**
|
||||
* Writes the data to the output stream. The data will be flushed to the provided output
|
||||
* stream however the provided stream will NOT BE CLOSED, so be sure to actually close it
|
||||
* @param out the output stream
|
||||
* @throws IOException shit happens yo
|
||||
*/
|
||||
default void write(OutputStream out) throws IOException
|
||||
{
|
||||
DataOutputStream dos = new DataOutputStream(out);
|
||||
// Write size
|
||||
Varint.writeUnsignedVarInt(getWidth(), dos);
|
||||
Varint.writeUnsignedVarInt(getHeight(), dos);
|
||||
Varint.writeUnsignedVarInt(getDepth(), dos);
|
||||
dos.writeByte(getSliceTypes().size() + Byte.MIN_VALUE);
|
||||
getHeader().write(dos);
|
||||
|
||||
for(Class<?> i : getSliceTypes())
|
||||
{
|
||||
getSlice(i).write(dos);
|
||||
}
|
||||
|
||||
dos.flush();
|
||||
}
|
||||
|
||||
/**
|
||||
* Reads the input stream into a matter object using a matter factory.
|
||||
* Does not close the input stream. Be a man, close it yourself.
|
||||
* @param in the input stream
|
||||
* @param matterFactory the matter factory (size) -> new MatterImpl(size);
|
||||
* @return the matter object
|
||||
* @throws IOException shit happens yo
|
||||
*/
|
||||
static Matter read(InputStream in, Function<BlockPosition, Matter> matterFactory) throws IOException, ClassNotFoundException {
|
||||
DataInputStream din = new DataInputStream(in);
|
||||
// Read size into new matter object
|
||||
Matter matter = matterFactory.apply(new BlockPosition(
|
||||
Varint.readUnsignedVarInt(din),
|
||||
Varint.readUnsignedVarInt(din),
|
||||
Varint.readUnsignedVarInt(din)));
|
||||
int sliceCount = din.readByte() - Byte.MIN_VALUE;
|
||||
matter.getHeader().read(din);
|
||||
|
||||
while(sliceCount-- > 0)
|
||||
{
|
||||
Class<?> type = Class.forName(din.readUTF());
|
||||
MatterSlice<?> slice = matter.createSlice(type, matter);
|
||||
slice.read(din);
|
||||
matter.putSlice(type, slice);
|
||||
}
|
||||
|
||||
return matter;
|
||||
}
|
||||
}
|
||||
@@ -1,48 +0,0 @@
|
||||
/*
|
||||
* Iris is a World Generator for Minecraft Bukkit Servers
|
||||
* Copyright (c) 2021 Arcane Arts (Volmit Software)
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.volmit.iris.engine.object.matter;
|
||||
|
||||
import com.volmit.iris.util.data.Varint;
|
||||
import com.volmit.iris.util.math.M;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.DataInputStream;
|
||||
import java.io.DataOutputStream;
|
||||
import java.io.IOException;
|
||||
|
||||
@Data
|
||||
public class MatterHeader {
|
||||
private String author = "anonymous";
|
||||
private long createdAt = M.ms();
|
||||
private int version = Matter.VERSION;
|
||||
|
||||
public void write(DataOutputStream out) throws IOException
|
||||
{
|
||||
out.writeUTF(author);
|
||||
Varint.writeUnsignedVarLong(createdAt, out);
|
||||
Varint.writeUnsignedVarInt(version, out);
|
||||
}
|
||||
|
||||
public void read(DataInputStream din) throws IOException
|
||||
{
|
||||
setAuthor(din.readUTF());
|
||||
setCreatedAt(Varint.readUnsignedVarLong(din));
|
||||
setVersion(Varint.readUnsignedVarInt(din));
|
||||
}
|
||||
}
|
||||
@@ -1,83 +0,0 @@
|
||||
/*
|
||||
* Iris is a World Generator for Minecraft Bukkit Servers
|
||||
* Copyright (c) 2021 Arcane Arts (Volmit Software)
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.volmit.iris.engine.object.matter;
|
||||
|
||||
import com.volmit.iris.util.hunk.Hunk;
|
||||
import com.volmit.iris.util.hunk.storage.StorageHunk;
|
||||
import com.volmit.iris.util.collection.KMap;
|
||||
import com.volmit.iris.util.function.Consumer4;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
@SuppressWarnings({"DefaultAnnotationParam", "Lombok"})
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
public class MatterHunk<T> extends StorageHunk<T> implements Hunk<T> {
|
||||
private final Map<Integer, T> data;
|
||||
|
||||
public MatterHunk(int w, int h, int d) {
|
||||
super(w, h, d);
|
||||
data = new KMap<>();
|
||||
}
|
||||
|
||||
public int getCount()
|
||||
{
|
||||
return data.size();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setRaw(int x, int y, int z, T t) {
|
||||
if (t == null) {
|
||||
data.remove(index(x, y, z));
|
||||
return;
|
||||
}
|
||||
|
||||
data.put(index(x, y, z), t);
|
||||
}
|
||||
|
||||
private Integer index(int x, int y, int z) {
|
||||
return (z * getWidth() * getHeight()) + (y * getWidth()) + x;
|
||||
}
|
||||
|
||||
@Override
|
||||
public synchronized Hunk<T> iterateSync(Consumer4<Integer, Integer, Integer, T> c) {
|
||||
int idx, z;
|
||||
|
||||
for (Map.Entry<Integer, T> g : data.entrySet()) {
|
||||
idx = g.getKey();
|
||||
z = idx / (getWidth() * getHeight());
|
||||
idx -= (z * getWidth() * getHeight());
|
||||
c.accept(idx % getWidth(), idx / getWidth(), z, g.getValue());
|
||||
}
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void empty(T b) {
|
||||
data.clear();
|
||||
}
|
||||
|
||||
@Override
|
||||
public T getRaw(int x, int y, int z) {
|
||||
return data.get(index(x, y, z));
|
||||
}
|
||||
}
|
||||
@@ -1,64 +0,0 @@
|
||||
/*
|
||||
* Iris is a World Generator for Minecraft Bukkit Servers
|
||||
* Copyright (c) 2021 Arcane Arts (Volmit Software)
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.volmit.iris.engine.object.matter;
|
||||
|
||||
import com.volmit.iris.engine.data.cache.Cache;
|
||||
import com.volmit.iris.util.hunk.Hunk;
|
||||
import com.volmit.iris.util.data.Varint;
|
||||
|
||||
import java.io.DataInputStream;
|
||||
import java.io.DataOutputStream;
|
||||
import java.io.IOException;
|
||||
|
||||
public interface MatterSlice<T> extends Hunk<T>
|
||||
{
|
||||
Class<T> getType();
|
||||
|
||||
void writeNode(T b, DataOutputStream dos) throws IOException;
|
||||
|
||||
T readNode(DataInputStream din) throws IOException;
|
||||
|
||||
default void write(DataOutputStream dos) throws IOException
|
||||
{
|
||||
int w = getWidth();
|
||||
int h = getHeight();
|
||||
MatterHunk<?> mapped = (MatterHunk<?>) this;
|
||||
dos.writeUTF(getType().getCanonicalName());
|
||||
Varint.writeUnsignedVarInt(mapped.getCount(), dos);
|
||||
iterateSyncIO((x,y,z,b) -> {
|
||||
Varint.writeUnsignedVarInt((z * w * h) + (y * w) + x, dos);
|
||||
writeNode(b, dos);
|
||||
});
|
||||
}
|
||||
|
||||
default void read(DataInputStream din) throws IOException
|
||||
{
|
||||
int nodes = Varint.readUnsignedVarInt(din);
|
||||
int w = getWidth();
|
||||
int h = getHeight();
|
||||
int d = getDepth();
|
||||
int[] pos;
|
||||
|
||||
while(nodes-- > 0)
|
||||
{
|
||||
pos = Cache.to3D(Varint.readUnsignedVarInt(din), w, h);
|
||||
setRaw(pos[0], pos[1], pos[2], readNode(din));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -18,11 +18,11 @@
|
||||
|
||||
package com.volmit.iris.engine.object.mods;
|
||||
|
||||
import com.volmit.iris.engine.object.biome.LoaderBiome;
|
||||
import com.volmit.iris.engine.object.regional.LoaderRegion;
|
||||
import com.volmit.iris.core.project.loader.LoaderRegistrant;
|
||||
import com.volmit.iris.engine.object.biome.IrisBiome;
|
||||
import com.volmit.iris.engine.object.regional.IrisRegion;
|
||||
import com.volmit.iris.core.project.loader.IrisRegistrant;
|
||||
import com.volmit.iris.engine.object.annotations.*;
|
||||
import com.volmit.iris.engine.object.objects.LoaderObject;
|
||||
import com.volmit.iris.engine.object.objects.IrisObject;
|
||||
import com.volmit.iris.engine.object.objects.IrisObjectReplace;
|
||||
import com.volmit.iris.util.collection.KList;
|
||||
import lombok.AllArgsConstructor;
|
||||
@@ -38,7 +38,7 @@ import lombok.experimental.Accessors;
|
||||
@Desc("Represents a dimension")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
public class LoaderMod extends LoaderRegistrant {
|
||||
public class IrisMod extends IrisRegistrant {
|
||||
@MinNumber(2)
|
||||
@Required
|
||||
@Desc("The human readable name of this dimension")
|
||||
@@ -53,22 +53,22 @@ public class LoaderMod extends LoaderRegistrant {
|
||||
private int overrideFluidHeight = -1;
|
||||
|
||||
@Desc("A list of biomes to remove")
|
||||
@RegistryListResource(LoaderBiome.class)
|
||||
@RegistryListResource(IrisBiome.class)
|
||||
@ArrayType(type = String.class, min = 1)
|
||||
private KList<String> removeBiomes = new KList<>();
|
||||
|
||||
@Desc("A list of objects to remove")
|
||||
@RegistryListResource(LoaderObject.class)
|
||||
@RegistryListResource(IrisObject.class)
|
||||
@ArrayType(type = String.class, min = 1)
|
||||
private KList<String> removeObjects = new KList<>();
|
||||
|
||||
@Desc("A list of regions to remove")
|
||||
@RegistryListResource(LoaderRegion.class)
|
||||
@RegistryListResource(IrisRegion.class)
|
||||
@ArrayType(type = String.class, min = 1)
|
||||
private KList<String> removeRegions = new KList<>();
|
||||
|
||||
@Desc("A list of regions to inject")
|
||||
@RegistryListResource(LoaderRegion.class)
|
||||
@RegistryListResource(IrisRegion.class)
|
||||
@ArrayType(type = String.class, min = 1)
|
||||
private KList<String> injectRegions = new KList<>();
|
||||
|
||||
@@ -18,8 +18,8 @@
|
||||
|
||||
package com.volmit.iris.engine.object.mods;
|
||||
|
||||
import com.volmit.iris.engine.object.biome.LoaderBiome;
|
||||
import com.volmit.iris.engine.object.regional.LoaderRegion;
|
||||
import com.volmit.iris.engine.object.biome.IrisBiome;
|
||||
import com.volmit.iris.engine.object.regional.IrisRegion;
|
||||
import com.volmit.iris.engine.object.annotations.ArrayType;
|
||||
import com.volmit.iris.engine.object.annotations.Desc;
|
||||
import com.volmit.iris.engine.object.annotations.RegistryListResource;
|
||||
@@ -38,12 +38,12 @@ import lombok.experimental.Accessors;
|
||||
public class IrisModBiomeInjector {
|
||||
@Required
|
||||
@Desc("The region to find")
|
||||
@RegistryListResource(LoaderRegion.class)
|
||||
@RegistryListResource(IrisRegion.class)
|
||||
private String region = "";
|
||||
|
||||
@Required
|
||||
@Desc("A biome to inject into the region")
|
||||
@RegistryListResource(LoaderBiome.class)
|
||||
@RegistryListResource(IrisBiome.class)
|
||||
@ArrayType(type = String.class, min = 1)
|
||||
private KList<String> inject = new KList<>();
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
|
||||
package com.volmit.iris.engine.object.mods;
|
||||
|
||||
import com.volmit.iris.engine.object.biome.LoaderBiome;
|
||||
import com.volmit.iris.engine.object.biome.IrisBiome;
|
||||
import com.volmit.iris.engine.object.annotations.ArrayType;
|
||||
import com.volmit.iris.engine.object.annotations.Desc;
|
||||
import com.volmit.iris.engine.object.annotations.RegistryListResource;
|
||||
@@ -37,12 +37,12 @@ import lombok.experimental.Accessors;
|
||||
public class IrisModBiomeReplacer {
|
||||
@Required
|
||||
@Desc("A list of biomes to find")
|
||||
@RegistryListResource(LoaderBiome.class)
|
||||
@RegistryListResource(IrisBiome.class)
|
||||
@ArrayType(type = String.class, min = 1)
|
||||
private KList<String> find = new KList<>();
|
||||
|
||||
@Required
|
||||
@Desc("A biome to replace it with")
|
||||
@RegistryListResource(LoaderBiome.class)
|
||||
@RegistryListResource(IrisBiome.class)
|
||||
private String replace = "";
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
|
||||
package com.volmit.iris.engine.object.mods;
|
||||
|
||||
import com.volmit.iris.engine.object.biome.LoaderBiome;
|
||||
import com.volmit.iris.engine.object.biome.IrisBiome;
|
||||
import com.volmit.iris.engine.object.noise.IrisGeneratorStyle;
|
||||
import com.volmit.iris.engine.object.noise.NoiseStyle;
|
||||
import com.volmit.iris.engine.object.annotations.ArrayType;
|
||||
@@ -47,6 +47,6 @@ public class IrisModNoiseStyleReplacer {
|
||||
|
||||
@Required
|
||||
@Desc("A noise style to replace it with")
|
||||
@RegistryListResource(LoaderBiome.class)
|
||||
@RegistryListResource(IrisBiome.class)
|
||||
private IrisGeneratorStyle replace = new IrisGeneratorStyle();
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
|
||||
package com.volmit.iris.engine.object.mods;
|
||||
|
||||
import com.volmit.iris.engine.object.biome.LoaderBiome;
|
||||
import com.volmit.iris.engine.object.biome.IrisBiome;
|
||||
import com.volmit.iris.engine.object.annotations.ArrayType;
|
||||
import com.volmit.iris.engine.object.annotations.Desc;
|
||||
import com.volmit.iris.engine.object.annotations.RegistryListResource;
|
||||
@@ -38,7 +38,7 @@ import lombok.experimental.Accessors;
|
||||
public class IrisModObjectPlacementBiomeInjector {
|
||||
@Required
|
||||
@Desc("The biome to find")
|
||||
@RegistryListResource(LoaderBiome.class)
|
||||
@RegistryListResource(IrisBiome.class)
|
||||
private String biome = "";
|
||||
|
||||
@Required
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
|
||||
package com.volmit.iris.engine.object.mods;
|
||||
|
||||
import com.volmit.iris.engine.object.regional.LoaderRegion;
|
||||
import com.volmit.iris.engine.object.regional.IrisRegion;
|
||||
import com.volmit.iris.engine.object.annotations.ArrayType;
|
||||
import com.volmit.iris.engine.object.annotations.Desc;
|
||||
import com.volmit.iris.engine.object.annotations.RegistryListResource;
|
||||
@@ -38,7 +38,7 @@ import lombok.experimental.Accessors;
|
||||
public class IrisModObjectPlacementRegionInjector {
|
||||
@Required
|
||||
@Desc("The biome to find")
|
||||
@RegistryListResource(LoaderRegion.class)
|
||||
@RegistryListResource(IrisRegion.class)
|
||||
private String biome = "";
|
||||
|
||||
@Required
|
||||
|
||||
@@ -18,12 +18,12 @@
|
||||
|
||||
package com.volmit.iris.engine.object.mods;
|
||||
|
||||
import com.volmit.iris.engine.object.biome.LoaderBiome;
|
||||
import com.volmit.iris.engine.object.biome.IrisBiome;
|
||||
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.objects.LoaderObject;
|
||||
import com.volmit.iris.engine.object.objects.IrisObject;
|
||||
import com.volmit.iris.util.collection.KList;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
@@ -38,12 +38,12 @@ import lombok.experimental.Accessors;
|
||||
public class IrisModObjectReplacer {
|
||||
@Required
|
||||
@Desc("A list of objects to find")
|
||||
@RegistryListResource(LoaderObject.class)
|
||||
@RegistryListResource(IrisObject.class)
|
||||
@ArrayType(type = String.class, min = 1)
|
||||
private KList<String> find = new KList<>();
|
||||
|
||||
@Required
|
||||
@Desc("An object to replace it with")
|
||||
@RegistryListResource(LoaderBiome.class)
|
||||
@RegistryListResource(IrisBiome.class)
|
||||
private String replace = "";
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
|
||||
package com.volmit.iris.engine.object.mods;
|
||||
|
||||
import com.volmit.iris.engine.object.regional.LoaderRegion;
|
||||
import com.volmit.iris.engine.object.regional.IrisRegion;
|
||||
import com.volmit.iris.engine.object.annotations.ArrayType;
|
||||
import com.volmit.iris.engine.object.annotations.Desc;
|
||||
import com.volmit.iris.engine.object.annotations.RegistryListResource;
|
||||
@@ -37,12 +37,12 @@ import lombok.experimental.Accessors;
|
||||
public class IrisModRegionReplacer {
|
||||
@Required
|
||||
@Desc("A list of regions to find")
|
||||
@RegistryListResource(LoaderRegion.class)
|
||||
@RegistryListResource(IrisRegion.class)
|
||||
@ArrayType(type = String.class, min = 1)
|
||||
private KList<String> find = new KList<>();
|
||||
|
||||
@Required
|
||||
@Desc("A region to replace it with")
|
||||
@RegistryListResource(LoaderRegion.class)
|
||||
@RegistryListResource(IrisRegion.class)
|
||||
private String replace = "";
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@ import com.dfsek.paralithic.eval.parser.Parser;
|
||||
import com.dfsek.paralithic.eval.parser.Scope;
|
||||
import com.volmit.iris.Iris;
|
||||
import com.volmit.iris.engine.data.cache.AtomicCache;
|
||||
import com.volmit.iris.core.project.loader.LoaderRegistrant;
|
||||
import com.volmit.iris.core.project.loader.IrisRegistrant;
|
||||
import com.volmit.iris.engine.object.annotations.ArrayType;
|
||||
import com.volmit.iris.engine.object.annotations.Desc;
|
||||
import com.volmit.iris.engine.object.annotations.Required;
|
||||
@@ -44,7 +44,7 @@ import lombok.experimental.Accessors;
|
||||
@Desc("Represents an Iris Expression")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
public class LoaderExpression extends LoaderRegistrant {
|
||||
public class IrisExpression extends IrisRegistrant {
|
||||
private static final Parser parser = new Parser();
|
||||
|
||||
@ArrayType(type = IrisExpressionLoad.class, min = 1)
|
||||
@@ -21,7 +21,7 @@ package com.volmit.iris.engine.object.noise;
|
||||
import com.volmit.iris.Iris;
|
||||
import com.volmit.iris.engine.data.cache.AtomicCache;
|
||||
import com.volmit.iris.util.interpolation.IrisInterpolation;
|
||||
import com.volmit.iris.core.project.loader.LoaderRegistrant;
|
||||
import com.volmit.iris.core.project.loader.IrisRegistrant;
|
||||
import com.volmit.iris.util.noise.CellGenerator;
|
||||
import com.volmit.iris.engine.object.annotations.*;
|
||||
import com.volmit.iris.engine.object.common.IRare;
|
||||
@@ -42,7 +42,7 @@ import java.util.List;
|
||||
@Desc("Represents a composite generator of noise gens")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
public class LoaderGenerator extends LoaderRegistrant {
|
||||
public class IrisGenerator extends IrisRegistrant {
|
||||
@MinNumber(0.001)
|
||||
@Desc("The zoom or frequency.")
|
||||
private double zoom = 1;
|
||||
@@ -270,7 +270,7 @@ public class LoaderGenerator extends LoaderRegistrant {
|
||||
return (Math.round((v * 255D) / cliffHeight) * cliffHeight) / 255D;
|
||||
}
|
||||
|
||||
public LoaderGenerator rescale(double scale) {
|
||||
public IrisGenerator rescale(double scale) {
|
||||
zoom /= scale;
|
||||
return this;
|
||||
}
|
||||
@@ -46,7 +46,7 @@ public class IrisGeneratorStyle {
|
||||
private double zoom = 1;
|
||||
|
||||
@Desc("Instead of using the style property, use a custom expression to represent this style.")
|
||||
@RegistryListResource(LoaderExpression.class)
|
||||
@RegistryListResource(IrisExpression.class)
|
||||
private String expression = null;
|
||||
|
||||
@MinNumber(0.00001)
|
||||
@@ -79,7 +79,7 @@ public class IrisGeneratorStyle {
|
||||
return cng.aquire(() ->
|
||||
{
|
||||
if (getExpression() != null) {
|
||||
LoaderExpression e = data.getExpressionLoader().load(getExpression());
|
||||
IrisExpression e = data.getExpressionLoader().load(getExpression());
|
||||
|
||||
if (e != null) {
|
||||
CNG cng = new CNG(rng, new ExpressionNoise(rng, e), 1D, 1)
|
||||
|
||||
@@ -21,11 +21,11 @@ package com.volmit.iris.engine.object.objects;
|
||||
import com.volmit.iris.Iris;
|
||||
import com.volmit.iris.core.project.loader.IrisData;
|
||||
import com.volmit.iris.engine.data.cache.AtomicCache;
|
||||
import com.volmit.iris.engine.data.B;
|
||||
import com.volmit.iris.util.data.B;
|
||||
import com.volmit.iris.engine.framework.placer.HeightmapObjectPlacer;
|
||||
import com.volmit.iris.util.interpolation.IrisInterpolation;
|
||||
import com.volmit.iris.engine.object.basic.IrisPosition;
|
||||
import com.volmit.iris.core.project.loader.LoaderRegistrant;
|
||||
import com.volmit.iris.core.project.loader.IrisRegistrant;
|
||||
import com.volmit.iris.engine.object.common.CarveResult;
|
||||
import com.volmit.iris.engine.object.common.IObjectPlacer;
|
||||
import com.volmit.iris.engine.object.tile.TileData;
|
||||
@@ -58,7 +58,7 @@ import java.util.function.Consumer;
|
||||
@Accessors(chain = true)
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
public class LoaderObject extends LoaderRegistrant {
|
||||
public class IrisObject extends IrisRegistrant {
|
||||
private static final Vector HALF = new Vector(0.5, 0.5, 0.5);
|
||||
private static final BlockData AIR = B.get("CAVE_AIR");
|
||||
private static final BlockData VAIR = B.get("VOID_AIR");
|
||||
@@ -77,7 +77,7 @@ public class LoaderObject extends LoaderRegistrant {
|
||||
private transient AtomicCache<AxisAlignedBB> aabb = new AtomicCache<>();
|
||||
|
||||
|
||||
public LoaderObject(int w, int h, int d) {
|
||||
public IrisObject(int w, int h, int d) {
|
||||
blocks = new KMap<>();
|
||||
states = new KMap<>();
|
||||
this.w = w;
|
||||
@@ -86,7 +86,7 @@ public class LoaderObject extends LoaderRegistrant {
|
||||
center = new BlockVector(w / 2, h / 2, d / 2);
|
||||
}
|
||||
|
||||
public LoaderObject() {
|
||||
public IrisObject() {
|
||||
this(0, 0, 0);
|
||||
}
|
||||
|
||||
@@ -214,8 +214,8 @@ public class LoaderObject extends LoaderRegistrant {
|
||||
lock.unlock();
|
||||
}
|
||||
|
||||
public synchronized LoaderObject copy() {
|
||||
LoaderObject o = new LoaderObject(w, h, d);
|
||||
public synchronized IrisObject copy() {
|
||||
IrisObject o = new IrisObject(w, h, d);
|
||||
o.setLoadKey(o.getLoadKey());
|
||||
o.setCenter(getCenter().clone());
|
||||
|
||||
@@ -317,7 +317,7 @@ public class LoaderObject extends LoaderRegistrant {
|
||||
dos.writeShort(i.getBlockX());
|
||||
dos.writeShort(i.getBlockY());
|
||||
dos.writeShort(i.getBlockZ());
|
||||
dos.writeShort(palette.indexOf(Objects.requireNonNull(getBlocks().get(i)).getAsString()));
|
||||
dos.writeShort(palette.indexOf(getBlocks().get(i).getAsString()));
|
||||
}
|
||||
|
||||
dos.writeInt(getStates().size());
|
||||
@@ -325,7 +325,7 @@ public class LoaderObject extends LoaderRegistrant {
|
||||
dos.writeShort(i.getBlockX());
|
||||
dos.writeShort(i.getBlockY());
|
||||
dos.writeShort(i.getBlockZ());
|
||||
Objects.requireNonNull(getStates().get(i)).toBinary(dos);
|
||||
getStates().get(i).toBinary(dos);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -717,8 +717,8 @@ public class LoaderObject extends LoaderRegistrant {
|
||||
return y;
|
||||
}
|
||||
|
||||
public LoaderObject rotateCopy(IrisObjectRotation rt) {
|
||||
LoaderObject copy = copy();
|
||||
public IrisObject rotateCopy(IrisObjectRotation rt) {
|
||||
IrisObject copy = copy();
|
||||
copy.rotate(rt, 0, 0, 0);
|
||||
return copy;
|
||||
}
|
||||
@@ -780,7 +780,7 @@ public class LoaderObject extends LoaderRegistrant {
|
||||
}
|
||||
}
|
||||
|
||||
public LoaderObject scaled(double scale, IrisObjectPlacementScaleInterpolator interpolation) {
|
||||
public IrisObject scaled(double scale, IrisObjectPlacementScaleInterpolator interpolation) {
|
||||
Vector sm1 = new Vector(scale - 1, scale - 1, scale - 1);
|
||||
scale = Math.max(0.001, Math.min(50, scale));
|
||||
if (scale < 1) {
|
||||
@@ -802,7 +802,7 @@ public class LoaderObject extends LoaderRegistrant {
|
||||
center = center.setZ(center.getBlockZ() + 0.5);
|
||||
}
|
||||
|
||||
LoaderObject oo = new LoaderObject((int) Math.ceil((w * scale) + (scale * 2)), (int) Math.ceil((h * scale) + (scale * 2)), (int) Math.ceil((d * scale) + (scale * 2)));
|
||||
IrisObject oo = new IrisObject((int) Math.ceil((w * scale) + (scale * 2)), (int) Math.ceil((h * scale) + (scale * 2)), (int) Math.ceil((d * scale) + (scale * 2)));
|
||||
|
||||
for (Map.Entry<BlockVector, BlockData> entry : blocks.entrySet()) {
|
||||
BlockData bd = entry.getValue();
|
||||
@@ -20,8 +20,8 @@ package com.volmit.iris.engine.object.objects;
|
||||
|
||||
import com.volmit.iris.core.project.loader.IrisData;
|
||||
import com.volmit.iris.engine.data.cache.AtomicCache;
|
||||
import com.volmit.iris.engine.object.block.LoaderBlockData;
|
||||
import com.volmit.iris.engine.object.loot.LoaderLootTable;
|
||||
import com.volmit.iris.engine.object.block.IrisBlockData;
|
||||
import com.volmit.iris.engine.object.loot.IrisLootTable;
|
||||
import com.volmit.iris.engine.object.annotations.ArrayType;
|
||||
import com.volmit.iris.engine.object.annotations.Desc;
|
||||
import com.volmit.iris.engine.object.annotations.RegistryListResource;
|
||||
@@ -39,16 +39,16 @@ import org.bukkit.block.data.BlockData;
|
||||
@Desc("Represents loot within this object or jigsaw piece")
|
||||
@Data
|
||||
public class IrisObjectLoot {
|
||||
@ArrayType(min = 1, type = LoaderBlockData.class)
|
||||
@ArrayType(min = 1, type = IrisBlockData.class)
|
||||
@Desc("The list of blocks this loot table should apply to")
|
||||
private KList<LoaderBlockData> filter = new KList<>();
|
||||
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(LoaderLootTable.class)
|
||||
@RegistryListResource(IrisLootTable.class)
|
||||
private String name;
|
||||
|
||||
@Desc("The weight of this loot table being chosen")
|
||||
@@ -61,7 +61,7 @@ public class IrisObjectLoot {
|
||||
{
|
||||
KList<BlockData> b = new KList<>();
|
||||
|
||||
for (LoaderBlockData i : filter) {
|
||||
for (IrisBlockData i : filter) {
|
||||
BlockData bx = i.getBlockData(rdata);
|
||||
|
||||
if (bx != null) {
|
||||
|
||||
@@ -21,11 +21,11 @@ package com.volmit.iris.engine.object.objects;
|
||||
import com.volmit.iris.Iris;
|
||||
import com.volmit.iris.core.project.loader.IrisData;
|
||||
import com.volmit.iris.engine.data.cache.AtomicCache;
|
||||
import com.volmit.iris.engine.data.B;
|
||||
import com.volmit.iris.engine.data.DataProvider;
|
||||
import com.volmit.iris.util.data.B;
|
||||
import com.volmit.iris.util.data.DataProvider;
|
||||
import com.volmit.iris.util.interpolation.InterpolationMethod;
|
||||
import com.volmit.iris.engine.object.feature.IrisFeaturePotential;
|
||||
import com.volmit.iris.engine.object.loot.LoaderLootTable;
|
||||
import com.volmit.iris.engine.object.loot.IrisLootTable;
|
||||
import com.volmit.iris.engine.object.noise.CarvingMode;
|
||||
import com.volmit.iris.engine.object.noise.IrisGeneratorStyle;
|
||||
import com.volmit.iris.engine.object.noise.IrisNoiseGenerator;
|
||||
@@ -54,7 +54,7 @@ import org.bukkit.block.data.BlockData;
|
||||
@Desc("Represents an iris object placer. It places objects.")
|
||||
@Data
|
||||
public class IrisObjectPlacement {
|
||||
@RegistryListResource(LoaderObject.class)
|
||||
@RegistryListResource(IrisObject.class)
|
||||
@Required
|
||||
@ArrayType(min = 1, type = String.class)
|
||||
@Desc("List of objects to place")
|
||||
@@ -214,7 +214,7 @@ public class IrisObjectPlacement {
|
||||
return 0;
|
||||
}
|
||||
|
||||
public LoaderObject getObject(DataProvider g, RNG random) {
|
||||
public IrisObject getObject(DataProvider g, RNG random) {
|
||||
if (place.isEmpty()) {
|
||||
return null;
|
||||
}
|
||||
@@ -243,9 +243,9 @@ public class IrisObjectPlacement {
|
||||
}
|
||||
|
||||
private static class TableCache {
|
||||
final transient WeightedRandom<LoaderLootTable> global = new WeightedRandom<>();
|
||||
final transient KMap<Material, WeightedRandom<LoaderLootTable>> basic = new KMap<>();
|
||||
final transient KMap<Material, KMap<BlockData, WeightedRandom<LoaderLootTable>>> exact = new KMap<>();
|
||||
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) {
|
||||
@@ -253,7 +253,7 @@ public class IrisObjectPlacement {
|
||||
TableCache tc = new TableCache();
|
||||
|
||||
for (IrisObjectLoot loot : getLoot()) {
|
||||
LoaderLootTable table = manager.getLootLoader().load(loot.getName());
|
||||
IrisLootTable table = manager.getLootLoader().load(loot.getName());
|
||||
if (table == null) {
|
||||
Iris.warn("Couldn't find loot table " + loot.getName());
|
||||
continue;
|
||||
@@ -297,11 +297,11 @@ public class IrisObjectPlacement {
|
||||
* @param dataManager Iris Data Manager
|
||||
* @return The loot table it should use.
|
||||
*/
|
||||
public LoaderLootTable getTable(BlockData data, IrisData dataManager) {
|
||||
public IrisLootTable getTable(BlockData data, IrisData dataManager) {
|
||||
TableCache cache = getCache(dataManager);
|
||||
|
||||
if (B.isStorageChest(data)) {
|
||||
LoaderLootTable picked = null;
|
||||
IrisLootTable picked = null;
|
||||
if (cache.exact.containsKey(data.getMaterial()) && cache.exact.containsKey(data)) {
|
||||
picked = cache.exact.get(data.getMaterial()).get(data).pullRandom();
|
||||
} else if (cache.basic.containsKey(data.getMaterial())) {
|
||||
|
||||
@@ -20,7 +20,7 @@ package com.volmit.iris.engine.object.objects;
|
||||
|
||||
import com.volmit.iris.core.project.loader.IrisData;
|
||||
import com.volmit.iris.engine.data.cache.AtomicCache;
|
||||
import com.volmit.iris.engine.object.block.LoaderBlockData;
|
||||
import com.volmit.iris.engine.object.block.IrisBlockData;
|
||||
import com.volmit.iris.engine.object.block.IrisMaterialPalette;
|
||||
import com.volmit.iris.util.noise.CNG;
|
||||
import com.volmit.iris.engine.object.annotations.*;
|
||||
@@ -38,10 +38,10 @@ import org.bukkit.block.data.BlockData;
|
||||
@Desc("Find and replace object materials")
|
||||
@Data
|
||||
public class IrisObjectReplace {
|
||||
@ArrayType(min = 1, type = LoaderBlockData.class)
|
||||
@ArrayType(min = 1, type = IrisBlockData.class)
|
||||
@Required
|
||||
@Desc("Find this block")
|
||||
private KList<LoaderBlockData> find = new KList<>();
|
||||
private KList<IrisBlockData> find = new KList<>();
|
||||
|
||||
@Required
|
||||
@Desc("Replace it with this block palette")
|
||||
@@ -64,7 +64,7 @@ public class IrisObjectReplace {
|
||||
{
|
||||
KList<BlockData> b = new KList<>();
|
||||
|
||||
for (LoaderBlockData i : find) {
|
||||
for (IrisBlockData i : find) {
|
||||
BlockData bx = i.getBlockData(rdata);
|
||||
|
||||
if (bx != null) {
|
||||
|
||||
@@ -21,7 +21,7 @@ package com.volmit.iris.engine.object.objects;
|
||||
import com.volmit.iris.Iris;
|
||||
import com.volmit.iris.engine.object.annotations.Desc;
|
||||
import com.volmit.iris.engine.object.basic.IrisPosition;
|
||||
import com.volmit.iris.engine.object.jigsaw.LoaderJigsawPiece;
|
||||
import com.volmit.iris.engine.object.jigsaw.IrisJigsawPiece;
|
||||
import com.volmit.iris.engine.object.jigsaw.IrisJigsawPieceConnector;
|
||||
import com.volmit.iris.util.collection.KList;
|
||||
import lombok.AllArgsConstructor;
|
||||
@@ -66,7 +66,7 @@ public class IrisObjectRotation {
|
||||
return getRotation(spin, zAxis);
|
||||
}
|
||||
|
||||
public LoaderObject rotateCopy(LoaderObject e) {
|
||||
public IrisObject rotateCopy(IrisObject e) {
|
||||
if (e == null) {
|
||||
return null;
|
||||
}
|
||||
@@ -74,8 +74,8 @@ public class IrisObjectRotation {
|
||||
return e.rotateCopy(this);
|
||||
}
|
||||
|
||||
public LoaderJigsawPiece rotateCopy(LoaderJigsawPiece v) {
|
||||
LoaderJigsawPiece piece = v.copy();
|
||||
public IrisJigsawPiece rotateCopy(IrisJigsawPiece v) {
|
||||
IrisJigsawPiece piece = v.copy();
|
||||
for (IrisJigsawPieceConnector i : piece.getConnectors()) {
|
||||
i.setPosition(rotate(i.getPosition()));
|
||||
i.setDirection(rotate(i.getDirection()));
|
||||
|
||||
@@ -53,8 +53,8 @@ public class IrisObjectScale {
|
||||
@Desc("If this object is scaled up beyond its origin size, specify a 3D interpolator")
|
||||
private IrisObjectPlacementScaleInterpolator interpolation = IrisObjectPlacementScaleInterpolator.NONE;
|
||||
|
||||
private static transient ConcurrentLinkedHashMap<LoaderObject, KList<LoaderObject>> cache
|
||||
= new ConcurrentLinkedHashMap.Builder<LoaderObject, KList<LoaderObject>>()
|
||||
private static transient ConcurrentLinkedHashMap<IrisObject, KList<IrisObject>> cache
|
||||
= new ConcurrentLinkedHashMap.Builder<IrisObject, KList<IrisObject>>()
|
||||
.initialCapacity(64)
|
||||
.maximumWeightedCapacity(1024)
|
||||
.concurrencyLevel(32)
|
||||
@@ -78,7 +78,7 @@ public class IrisObjectScale {
|
||||
return mx;
|
||||
}
|
||||
|
||||
public LoaderObject get(RNG rng, LoaderObject origin) {
|
||||
public IrisObject get(RNG rng, IrisObject origin) {
|
||||
if (shouldScale()) {
|
||||
return origin;
|
||||
}
|
||||
@@ -88,7 +88,7 @@ public class IrisObjectScale {
|
||||
return v;
|
||||
}
|
||||
|
||||
KList<LoaderObject> c = new KList<>();
|
||||
KList<IrisObject> c = new KList<>();
|
||||
for (double i = minimumScale; i < maximumScale; i += (maximumScale - minimumScale) / (double) (Math.min(variations, 32))) {
|
||||
c.add(origin.scaled(i, getInterpolation()));
|
||||
}
|
||||
|
||||
@@ -42,7 +42,7 @@ public class IrisRareObject {
|
||||
@Desc("The rarity is 1 in X")
|
||||
private int rarity = 1;
|
||||
|
||||
@RegistryListResource(LoaderObject.class)
|
||||
@RegistryListResource(IrisObject.class)
|
||||
@Required
|
||||
@Desc("The object to place if rarity check passed")
|
||||
private String object = "";
|
||||
|
||||
@@ -21,11 +21,11 @@ package com.volmit.iris.engine.object.regional;
|
||||
import com.volmit.iris.Iris;
|
||||
import com.volmit.iris.core.gui.components.RenderType;
|
||||
import com.volmit.iris.core.project.loader.IrisData;
|
||||
import com.volmit.iris.core.project.loader.LoaderRegistrant;
|
||||
import com.volmit.iris.core.project.loader.IrisRegistrant;
|
||||
import com.volmit.iris.engine.data.cache.AtomicCache;
|
||||
import com.volmit.iris.engine.data.DataProvider;
|
||||
import com.volmit.iris.util.data.DataProvider;
|
||||
import com.volmit.iris.engine.object.biome.InferredType;
|
||||
import com.volmit.iris.engine.object.biome.LoaderBiome;
|
||||
import com.volmit.iris.engine.object.biome.IrisBiome;
|
||||
import com.volmit.iris.engine.object.block.IrisBlockDrops;
|
||||
import com.volmit.iris.engine.object.deposits.IrisDepositGenerator;
|
||||
import com.volmit.iris.engine.object.feature.IrisFeaturePotential;
|
||||
@@ -35,7 +35,7 @@ import com.volmit.iris.engine.object.meta.IrisEffect;
|
||||
import com.volmit.iris.engine.object.noise.IrisGeneratorStyle;
|
||||
import com.volmit.iris.engine.object.noise.NoiseStyle;
|
||||
import com.volmit.iris.engine.object.objects.IrisObjectPlacement;
|
||||
import com.volmit.iris.engine.object.spawners.LoaderSpawner;
|
||||
import com.volmit.iris.engine.object.spawners.IrisSpawner;
|
||||
import com.volmit.iris.util.noise.CNG;
|
||||
import com.volmit.iris.engine.object.annotations.*;
|
||||
import com.volmit.iris.engine.object.common.IRare;
|
||||
@@ -62,7 +62,7 @@ import java.util.Random;
|
||||
@Desc("Represents an iris region")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
public class LoaderRegion extends LoaderRegistrant implements IRare {
|
||||
public class IrisRegion extends IrisRegistrant implements IRare {
|
||||
@MinNumber(2)
|
||||
@Required
|
||||
@Desc("The name of the region")
|
||||
@@ -82,7 +82,7 @@ public class LoaderRegion extends LoaderRegistrant implements IRare {
|
||||
|
||||
@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(LoaderSpawner.class)
|
||||
@RegistryListResource(IrisSpawner.class)
|
||||
private KList<String> entitySpawners = new KList<>();
|
||||
|
||||
@MinNumber(1)
|
||||
@@ -147,35 +147,35 @@ public class LoaderRegion extends LoaderRegistrant implements IRare {
|
||||
@Desc("The biome implosion ratio, how much to implode biomes into children (chance)")
|
||||
private double biomeImplosionRatio = 0.4;
|
||||
|
||||
@RegistryListResource(LoaderBiome.class)
|
||||
@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(LoaderBiome.class)
|
||||
@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(LoaderBiome.class)
|
||||
@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(LoaderBiome.class)
|
||||
@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> riverBiomes = new KList<>();
|
||||
|
||||
@RegistryListResource(LoaderBiome.class)
|
||||
@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> lakeBiomes = new KList<>();
|
||||
|
||||
@RegistryListResource(LoaderBiome.class)
|
||||
@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<>();
|
||||
@@ -228,12 +228,12 @@ public class LoaderRegion extends LoaderRegistrant implements IRare {
|
||||
private final transient AtomicCache<KList<String>> cacheRidge = new AtomicCache<>();
|
||||
private final transient AtomicCache<KList<String>> cacheSpot = new AtomicCache<>();
|
||||
private final transient AtomicCache<CNG> shoreHeightGenerator = new AtomicCache<>();
|
||||
private final transient AtomicCache<KList<LoaderBiome>> realLandBiomes = new AtomicCache<>();
|
||||
private final transient AtomicCache<KList<LoaderBiome>> realLakeBiomes = new AtomicCache<>();
|
||||
private final transient AtomicCache<KList<LoaderBiome>> realRiverBiomes = new AtomicCache<>();
|
||||
private final transient AtomicCache<KList<LoaderBiome>> realSeaBiomes = new AtomicCache<>();
|
||||
private final transient AtomicCache<KList<LoaderBiome>> realShoreBiomes = new AtomicCache<>();
|
||||
private final transient AtomicCache<KList<LoaderBiome>> realCaveBiomes = new AtomicCache<>();
|
||||
private final transient AtomicCache<KList<IrisBiome>> realLandBiomes = new AtomicCache<>();
|
||||
private final transient AtomicCache<KList<IrisBiome>> realLakeBiomes = new AtomicCache<>();
|
||||
private final transient AtomicCache<KList<IrisBiome>> realRiverBiomes = new AtomicCache<>();
|
||||
private final transient AtomicCache<KList<IrisBiome>> realSeaBiomes = new AtomicCache<>();
|
||||
private final transient AtomicCache<KList<IrisBiome>> realShoreBiomes = new AtomicCache<>();
|
||||
private final transient AtomicCache<KList<IrisBiome>> realCaveBiomes = new AtomicCache<>();
|
||||
private final transient AtomicCache<CNG> lakeGen = new AtomicCache<>();
|
||||
private final transient AtomicCache<CNG> riverGen = new AtomicCache<>();
|
||||
private final transient AtomicCache<CNG> riverChanceGen = new AtomicCache<>();
|
||||
@@ -364,8 +364,8 @@ public class LoaderRegion extends LoaderRegistrant implements IRare {
|
||||
return names;
|
||||
}
|
||||
|
||||
public KList<LoaderBiome> getAllBiomes(DataProvider g) {
|
||||
KMap<String, LoaderBiome> b = new KMap<>();
|
||||
public KList<IrisBiome> getAllBiomes(DataProvider g) {
|
||||
KMap<String, IrisBiome> b = new KMap<>();
|
||||
KSet<String> names = getAllBiomeIds();
|
||||
|
||||
while (!names.isEmpty()) {
|
||||
@@ -375,7 +375,7 @@ public class LoaderRegion extends LoaderRegistrant implements IRare {
|
||||
continue;
|
||||
}
|
||||
|
||||
LoaderBiome biome = g.getData().getBiomeLoader().load(i);
|
||||
IrisBiome biome = g.getData().getBiomeLoader().load(i);
|
||||
|
||||
names.remove(i);
|
||||
if (biome == null) {
|
||||
@@ -391,7 +391,7 @@ public class LoaderRegion extends LoaderRegistrant implements IRare {
|
||||
return b.v();
|
||||
}
|
||||
|
||||
public KList<LoaderBiome> getBiomes(DataProvider g, InferredType type) {
|
||||
public KList<IrisBiome> getBiomes(DataProvider g, InferredType type) {
|
||||
if (type.equals(InferredType.LAND)) {
|
||||
return getRealLandBiomes(g);
|
||||
} else if (type.equals(InferredType.SEA)) {
|
||||
@@ -409,10 +409,10 @@ public class LoaderRegion extends LoaderRegistrant implements IRare {
|
||||
return new KList<>();
|
||||
}
|
||||
|
||||
public KList<LoaderBiome> getRealCaveBiomes(DataProvider g) {
|
||||
public KList<IrisBiome> getRealCaveBiomes(DataProvider g) {
|
||||
return realCaveBiomes.aquire(() ->
|
||||
{
|
||||
KList<LoaderBiome> realCaveBiomes = new KList<>();
|
||||
KList<IrisBiome> realCaveBiomes = new KList<>();
|
||||
|
||||
for (String i : getCaveBiomes()) {
|
||||
realCaveBiomes.add(g.getData().getBiomeLoader().load(i));
|
||||
@@ -422,10 +422,10 @@ public class LoaderRegion extends LoaderRegistrant implements IRare {
|
||||
});
|
||||
}
|
||||
|
||||
public KList<LoaderBiome> getRealLakeBiomes(DataProvider g) {
|
||||
public KList<IrisBiome> getRealLakeBiomes(DataProvider g) {
|
||||
return realLakeBiomes.aquire(() ->
|
||||
{
|
||||
KList<LoaderBiome> realLakeBiomes = new KList<>();
|
||||
KList<IrisBiome> realLakeBiomes = new KList<>();
|
||||
|
||||
for (String i : getLakeBiomes()) {
|
||||
realLakeBiomes.add(g.getData().getBiomeLoader().load(i));
|
||||
@@ -435,10 +435,10 @@ public class LoaderRegion extends LoaderRegistrant implements IRare {
|
||||
});
|
||||
}
|
||||
|
||||
public KList<LoaderBiome> getRealRiverBiomes(DataProvider g) {
|
||||
public KList<IrisBiome> getRealRiverBiomes(DataProvider g) {
|
||||
return realRiverBiomes.aquire(() ->
|
||||
{
|
||||
KList<LoaderBiome> realRiverBiomes = new KList<>();
|
||||
KList<IrisBiome> realRiverBiomes = new KList<>();
|
||||
|
||||
for (String i : getRiverBiomes()) {
|
||||
realRiverBiomes.add(g.getData().getBiomeLoader().load(i));
|
||||
@@ -448,10 +448,10 @@ public class LoaderRegion extends LoaderRegistrant implements IRare {
|
||||
});
|
||||
}
|
||||
|
||||
public KList<LoaderBiome> getRealShoreBiomes(DataProvider g) {
|
||||
public KList<IrisBiome> getRealShoreBiomes(DataProvider g) {
|
||||
return realShoreBiomes.aquire(() ->
|
||||
{
|
||||
KList<LoaderBiome> realShoreBiomes = new KList<>();
|
||||
KList<IrisBiome> realShoreBiomes = new KList<>();
|
||||
|
||||
for (String i : getShoreBiomes()) {
|
||||
realShoreBiomes.add(g.getData().getBiomeLoader().load(i));
|
||||
@@ -461,10 +461,10 @@ public class LoaderRegion extends LoaderRegistrant implements IRare {
|
||||
});
|
||||
}
|
||||
|
||||
public KList<LoaderBiome> getRealSeaBiomes(DataProvider g) {
|
||||
public KList<IrisBiome> getRealSeaBiomes(DataProvider g) {
|
||||
return realSeaBiomes.aquire(() ->
|
||||
{
|
||||
KList<LoaderBiome> realSeaBiomes = new KList<>();
|
||||
KList<IrisBiome> realSeaBiomes = new KList<>();
|
||||
|
||||
for (String i : getSeaBiomes()) {
|
||||
realSeaBiomes.add(g.getData().getBiomeLoader().load(i));
|
||||
@@ -474,10 +474,10 @@ public class LoaderRegion extends LoaderRegistrant implements IRare {
|
||||
});
|
||||
}
|
||||
|
||||
public KList<LoaderBiome> getRealLandBiomes(DataProvider g) {
|
||||
public KList<IrisBiome> getRealLandBiomes(DataProvider g) {
|
||||
return realLandBiomes.aquire(() ->
|
||||
{
|
||||
KList<LoaderBiome> realLandBiomes = new KList<>();
|
||||
KList<IrisBiome> realLandBiomes = new KList<>();
|
||||
|
||||
for (String i : getLandBiomes()) {
|
||||
realLandBiomes.add(g.getData().getBiomeLoader().load(i));
|
||||
@@ -487,8 +487,8 @@ public class LoaderRegion extends LoaderRegistrant implements IRare {
|
||||
});
|
||||
}
|
||||
|
||||
public KList<LoaderBiome> getAllAnyBiomes() {
|
||||
KMap<String, LoaderBiome> b = new KMap<>();
|
||||
public KList<IrisBiome> getAllAnyBiomes() {
|
||||
KMap<String, IrisBiome> b = new KMap<>();
|
||||
KSet<String> names = new KSet<>();
|
||||
names.addAll(landBiomes);
|
||||
names.addAll(caveBiomes);
|
||||
@@ -506,7 +506,7 @@ public class LoaderRegion extends LoaderRegistrant implements IRare {
|
||||
continue;
|
||||
}
|
||||
|
||||
LoaderBiome biome = IrisData.loadAnyBiome(i);
|
||||
IrisBiome biome = IrisData.loadAnyBiome(i);
|
||||
|
||||
names.remove(i);
|
||||
if (biome == null) {
|
||||
@@ -528,11 +528,11 @@ public class LoaderRegion extends LoaderRegistrant implements IRare {
|
||||
Random rand = new Random(getName().hashCode() + getAllBiomeIds().hashCode());
|
||||
RandomColor randomColor = new RandomColor(rand);
|
||||
|
||||
KList<LoaderBiome> biomes = getRealLandBiomes(dataProvider);
|
||||
KList<IrisBiome> biomes = getRealLandBiomes(dataProvider);
|
||||
|
||||
while (biomes.size() > 0) {
|
||||
int index = rand.nextInt(biomes.size());
|
||||
LoaderBiome biome = biomes.get(index);
|
||||
IrisBiome biome = biomes.get(index);
|
||||
|
||||
if (biome.getVanillaDerivative() != null) {
|
||||
RandomColor.Color col = VanillaBiomeMap.getColorType(biome.getVanillaDerivative());
|
||||
@@ -20,7 +20,7 @@ package com.volmit.iris.engine.object.regional;
|
||||
|
||||
import com.volmit.iris.engine.data.cache.AtomicCache;
|
||||
import com.volmit.iris.engine.object.biome.InferredType;
|
||||
import com.volmit.iris.engine.object.biome.LoaderBiome;
|
||||
import com.volmit.iris.engine.object.biome.IrisBiome;
|
||||
import com.volmit.iris.engine.object.biome.IrisBiomePaletteLayer;
|
||||
import com.volmit.iris.util.noise.CellGenerator;
|
||||
import com.volmit.iris.engine.object.annotations.*;
|
||||
@@ -36,7 +36,7 @@ import lombok.experimental.Accessors;
|
||||
@Desc("A ridge config")
|
||||
@Data
|
||||
public class IrisRegionRidge {
|
||||
@RegistryListResource(LoaderBiome.class)
|
||||
@RegistryListResource(IrisBiome.class)
|
||||
@Required
|
||||
@Desc("The biome name")
|
||||
private String biome = "";
|
||||
|
||||
@@ -20,7 +20,7 @@ package com.volmit.iris.engine.object.regional;
|
||||
|
||||
import com.volmit.iris.engine.data.cache.AtomicCache;
|
||||
import com.volmit.iris.engine.object.biome.InferredType;
|
||||
import com.volmit.iris.engine.object.biome.LoaderBiome;
|
||||
import com.volmit.iris.engine.object.biome.IrisBiome;
|
||||
import com.volmit.iris.engine.object.biome.IrisBiomePaletteLayer;
|
||||
import com.volmit.iris.util.noise.CellGenerator;
|
||||
import com.volmit.iris.engine.object.annotations.Desc;
|
||||
@@ -39,7 +39,7 @@ import lombok.experimental.Accessors;
|
||||
@Desc("A spot config")
|
||||
@Data
|
||||
public class IrisRegionSpot {
|
||||
@RegistryListResource(LoaderBiome.class)
|
||||
@RegistryListResource(IrisBiome.class)
|
||||
@Required
|
||||
@Desc("The biome to be placed")
|
||||
private String biome = "";
|
||||
|
||||
@@ -19,12 +19,12 @@
|
||||
package com.volmit.iris.engine.object.spawners;
|
||||
|
||||
import com.volmit.iris.engine.object.basic.IrisRate;
|
||||
import com.volmit.iris.core.project.loader.LoaderRegistrant;
|
||||
import com.volmit.iris.core.project.loader.IrisRegistrant;
|
||||
import com.volmit.iris.engine.object.basic.IrisTimeBlock;
|
||||
import com.volmit.iris.engine.object.basic.IrisWeather;
|
||||
import com.volmit.iris.engine.object.annotations.ArrayType;
|
||||
import com.volmit.iris.engine.object.annotations.Desc;
|
||||
import com.volmit.iris.engine.object.biome.LoaderBiome;
|
||||
import com.volmit.iris.engine.object.biome.IrisBiome;
|
||||
import com.volmit.iris.engine.object.entity.IrisEntitySpawn;
|
||||
import com.volmit.iris.util.collection.KList;
|
||||
import lombok.AllArgsConstructor;
|
||||
@@ -40,7 +40,7 @@ import org.bukkit.World;
|
||||
@AllArgsConstructor
|
||||
@Desc("Represents an entity spawn during initial chunk generation")
|
||||
@Data
|
||||
public class LoaderSpawner extends LoaderRegistrant {
|
||||
public class IrisSpawner extends IrisRegistrant {
|
||||
@ArrayType(min = 1, type = IrisEntitySpawn.class)
|
||||
@Desc("The entity spawns to add")
|
||||
private KList<IrisEntitySpawn> spawns = new KList<>();
|
||||
@@ -60,7 +60,7 @@ public class LoaderSpawner extends LoaderRegistrant {
|
||||
@Desc("Where should these spawns be placed")
|
||||
private IrisSpawnGroup group = IrisSpawnGroup.NORMAL;
|
||||
|
||||
public boolean isValid(LoaderBiome biome) {
|
||||
public boolean isValid(IrisBiome biome) {
|
||||
return switch (group) {
|
||||
case NORMAL -> switch (biome.getInferredType()) {
|
||||
case SHORE, SEA, CAVE, RIVER, LAKE, DEFER -> false;
|
||||
@@ -18,8 +18,8 @@
|
||||
|
||||
package com.volmit.iris.engine.object.tile;
|
||||
|
||||
import com.volmit.iris.engine.data.nbt.tag.CompoundTag;
|
||||
import com.volmit.iris.engine.data.nbt.tag.ListTag;
|
||||
import com.volmit.iris.util.nbt.tag.CompoundTag;
|
||||
import com.volmit.iris.util.nbt.tag.ListTag;
|
||||
import lombok.Data;
|
||||
import org.bukkit.DyeColor;
|
||||
import org.bukkit.Material;
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
package com.volmit.iris.engine.object.tile;
|
||||
|
||||
import com.volmit.iris.Iris;
|
||||
import com.volmit.iris.engine.data.nbt.tag.CompoundTag;
|
||||
import com.volmit.iris.util.nbt.tag.CompoundTag;
|
||||
import com.volmit.iris.util.collection.KList;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.block.BlockState;
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
|
||||
package com.volmit.iris.engine.object.tile;
|
||||
|
||||
import com.volmit.iris.engine.data.nbt.tag.CompoundTag;
|
||||
import com.volmit.iris.util.nbt.tag.CompoundTag;
|
||||
import lombok.Data;
|
||||
import org.bukkit.DyeColor;
|
||||
import org.bukkit.block.Sign;
|
||||
|
||||
@@ -18,8 +18,8 @@
|
||||
|
||||
package com.volmit.iris.engine.object.tile;
|
||||
|
||||
import com.volmit.iris.engine.data.nbt.tag.CompoundTag;
|
||||
import com.volmit.iris.engine.data.nbt.tag.ListTag;
|
||||
import com.volmit.iris.util.nbt.tag.CompoundTag;
|
||||
import com.volmit.iris.util.nbt.tag.ListTag;
|
||||
import lombok.Data;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.block.CreatureSpawner;
|
||||
|
||||
Reference in New Issue
Block a user