God dammit lombok

This commit is contained in:
Daniel Mills 2020-09-09 22:25:34 -04:00
parent 087ab3815f
commit 5bd22f25b8
66 changed files with 427 additions and 872 deletions

File diff suppressed because one or more lines are too long

View File

@ -207,17 +207,8 @@ public class Iris extends MortarPlugin
@Override
public ChunkGenerator getDefaultWorldGenerator(String worldName, String id)
{
//@builder
return createProvisionBukkit(IrisGenConfiguration.builder()
.threads(IrisSettings.get().threads)
.target(TerrainTarget
.builder()
.environment(Environment.NORMAL)
.folder(new File(worldName))
.name(worldName)
.seed(worldName.hashCode())
.build()
).build());
// @NoArgsConstructor
return createProvisionBukkit(IrisGenConfiguration.builder().threads(IrisSettings.get().threads).target(TerrainTarget.builder().environment(Environment.NORMAL).folder(new File(worldName)).name(worldName).seed(worldName.hashCode()).build()).build());
//@done
}
@ -347,32 +338,13 @@ public class Iris extends MortarPlugin
public void splash()
{
//@builder
// @NoArgsConstructor
String padd = Form.repeat(" ", 8);
String padd2 = Form.repeat(" ", 4);
String[] info = {
"",
"",
"",
"",
"",
padd2 + C.GREEN + " Iris",
padd2 + C.GRAY + " by "+C.randomColor()+"V"+C.randomColor()+"o"+C.randomColor()+"l"+C.randomColor()+"m"+C.randomColor()+"i"+C.randomColor()+"t"+C.randomColor()+"S"+C.randomColor()+"o"+C.randomColor()+"f"+C.randomColor()+"t"+C.randomColor()+"w"+C.randomColor()+"a"+C.randomColor()+"r"+C.randomColor()+"e",
padd2 + C.GRAY + " v" + getDescription().getVersion(),
String[] info = {"", "", "", "", "", padd2 + C.GREEN + " Iris", padd2 + C.GRAY + " by " + C.randomColor() + "V" + C.randomColor() + "o" + C.randomColor() + "l" + C.randomColor() + "m" + C.randomColor() + "i" + C.randomColor() + "t" + C.randomColor() + "S" + C.randomColor() + "o" + C.randomColor() + "f" + C.randomColor() + "t" + C.randomColor() + "w" + C.randomColor() + "a" + C.randomColor() + "r" + C.randomColor() + "e", padd2 + C.GRAY + " v" + getDescription().getVersion(),
};
String[] splash = {padd + C.GRAY + " @@@@@@@@@@@@@@" + C.DARK_GRAY + "@@@", padd + C.GRAY + " @@&&&&&&&&&" + C.DARK_GRAY + "&&&&&&" + C.GREEN + " .(((()))). ", padd + C.GRAY + "@@@&&&&&&&&" + C.DARK_GRAY + "&&&&&" + C.GREEN + " .((((((())))))). ", padd + C.GRAY + "@@@&&&&&" + C.DARK_GRAY + "&&&&&&&" + C.GREEN + " ((((((((())))))))) " + C.GRAY + " @", padd + C.GRAY + "@@@&&&&" + C.DARK_GRAY + "@@@@@&" + C.GREEN + " ((((((((-))))))))) " + C.GRAY + " @@", padd + C.GRAY + "@@@&&" + C.GREEN + " ((((((({ })))))))) " + C.GRAY + " &&@@@", padd + C.GRAY + "@@" + C.GREEN + " ((((((((-))))))))) " + C.DARK_GRAY + "&@@@@@" + C.GRAY + "&&&&@@@", padd + C.GRAY + "@" + C.GREEN + " ((((((((())))))))) " + C.DARK_GRAY + "&&&&&" + C.GRAY + "&&&&&&&@@@", padd + C.GRAY + "" + C.GREEN + " '((((((()))))))' " + C.DARK_GRAY + "&&&&&" + C.GRAY + "&&&&&&&&@@@", padd + C.GRAY + "" + C.GREEN + " '(((())))' " + C.DARK_GRAY + "%%&&&&&&" + C.GRAY + "&&&&&&&@@", padd + C.GRAY + " " + C.DARK_GRAY + "@@@" + C.GRAY + "@@@@@@@@@@@@@@"
};
String[] splash = {
padd + C.GRAY + " @@@@@@@@@@@@@@"+ C.DARK_GRAY +"@@@",
padd + C.GRAY + " @@&&&&&&&&&"+ C.DARK_GRAY +"&&&&&&" + C.GREEN + " .(((()))). ",
padd + C.GRAY + "@@@&&&&&&&&"+ C.DARK_GRAY +"&&&&&" + C.GREEN + " .((((((())))))). ",
padd + C.GRAY + "@@@&&&&&"+ C.DARK_GRAY +"&&&&&&&" + C.GREEN + " ((((((((())))))))) " + C.GRAY + " @",
padd + C.GRAY + "@@@&&&&"+ C.DARK_GRAY +"@@@@@&" + C.GREEN + " ((((((((-))))))))) " + C.GRAY + " @@",
padd + C.GRAY + "@@@&&" + C.GREEN + " ((((((({ })))))))) " + C.GRAY + " &&@@@",
padd + C.GRAY + "@@" + C.GREEN + " ((((((((-))))))))) " + C.DARK_GRAY + "&@@@@@"+ C.GRAY +"&&&&@@@",
padd + C.GRAY + "@" + C.GREEN + " ((((((((())))))))) " + C.DARK_GRAY + "&&&&&"+ C.GRAY +"&&&&&&&@@@",
padd + C.GRAY + "" + C.GREEN + " '((((((()))))))' " + C.DARK_GRAY + "&&&&&"+ C.GRAY +"&&&&&&&&@@@",
padd + C.GRAY + "" + C.GREEN + " '(((())))' " + C.DARK_GRAY + "%%&&&&&&"+ C.GRAY +"&&&&&&&@@",
padd + C.GRAY + " "+C.DARK_GRAY+"@@@"+C.GRAY+"@@@@@@@@@@@@@@"
};
//@done
Iris.info(Bukkit.getVersion());
Iris.info(Bukkit.getBukkitVersion() + " bk");

View File

@ -142,7 +142,7 @@ public class CommandIrisCreate extends MortarCommand
}
sender.sendMessage(worldName + " type installed. Generating Spawn Area...");
//@builder
//@NoArgsConstructor
ProvisionBukkit gen = Iris.instance.createProvisionBukkit(
IrisGenConfiguration.builder()
.threads(IrisSettings.get().threads)

View File

@ -1,13 +1,16 @@
package com.volmit.iris.gen.layer;
import com.volmit.iris.Iris;
import com.volmit.iris.gen.ContextualTerrainProvider;
import com.volmit.iris.noise.CNG;
import com.volmit.iris.object.InferredType;
import com.volmit.iris.object.IrisBiome;
import com.volmit.iris.object.IrisGeneratorStyle;
import com.volmit.iris.object.IrisRegion;
import com.volmit.iris.util.RNG;
import lombok.Data;
import lombok.NonNull;
@Data
public class BiomeDataProvider
@ -16,11 +19,19 @@ public class BiomeDataProvider
private CNG generator;
private GenLayerBiome layer;
public BiomeDataProvider(GenLayerBiome layer, InferredType type, RNG rng)
public BiomeDataProvider(@NonNull GenLayerBiome layer, @NonNull InferredType type, @NonNull RNG rng)
{
this.type = type;
this.layer = layer;
generator = layer.getIris().getDimension().getBiomeStyle(type).create(rng.nextParallelRNG(4645079 + (type.ordinal() * 23845)));
IrisGeneratorStyle b = layer.getIris().getDimension().getBiomeStyle(type);
if(b == null)
{
Iris.error("BIOME STYLE IS NULL FOR " + type);
}
generator = b.create(rng.nextParallelRNG(4645079 + (type.ordinal() * 23845)));
}
public IrisBiome generatePureData(ContextualTerrainProvider g, double bx, double bz, int rawX, int rawZ, IrisRegion regionData)

View File

@ -15,6 +15,7 @@ import com.volmit.iris.util.RNG;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NonNull;
@Data
@EqualsAndHashCode(callSuper = false)
@ -32,7 +33,7 @@ public class GenLayerBiome extends GenLayer
private BiomeDataProvider lakeProvider;
private DimensionalTerrainProvider iris;
public GenLayerBiome(DimensionalTerrainProvider iris, RNG rng)
public GenLayerBiome(@NonNull DimensionalTerrainProvider iris, @NonNull RNG rng)
{
super(iris, rng);
this.iris = iris;

View File

@ -29,7 +29,7 @@ public class GenLayerCave extends GenLayer
public GenLayerCave(DimensionalTerrainProvider iris, RNG rng)
{
//@builder
//@NoArgsConstructor
super(iris, rng);
gg = new FastNoiseDouble(324895 * rng.nextParallelRNG(49678).imax());
//@done

View File

@ -106,7 +106,7 @@ public class NMSCreator141
}
DimensionManager actualDimension = DimensionManager.a((int) creator.environment().getId());
DimensionManager internalDimension = DimensionManager.register((String) name.toLowerCase(Locale.ENGLISH), (DimensionManager) new DimensionManager(dimension, actualDimension.getSuffix(), actualDimension.folder, (w, manager) -> (WorldProvider) manager.providerFactory.apply(w, manager), actualDimension.hasSkyLight(), actualDimension));
//@builder
//@NoArgsConstructor
WorldServer internal = new WorldServer(
(MinecraftServer)console,
console.executorService,

View File

@ -106,7 +106,7 @@ public class NMSCreator151
}
DimensionManager actualDimension = DimensionManager.a((int) creator.environment().getId());
DimensionManager internalDimension = DimensionManager.register((String) name.toLowerCase(Locale.ENGLISH), (DimensionManager) new DimensionManager(dimension, actualDimension.getSuffix(), actualDimension.folder, (w, manager) -> (WorldProvider) manager.providerFactory.apply(w, manager), actualDimension.hasSkyLight(), actualDimension.getGenLayerZoomer(), actualDimension));
//@builder
//@NoArgsConstructor
WorldServer internal = new WorldServer(
(MinecraftServer)console,
console.executorService,

View File

@ -165,7 +165,7 @@ public class NMSCreator161
ResourceKey typeKey = (ResourceKey) console.f.a().c(dimensionmanager).orElseThrow(() -> new IllegalStateException("Unregistered dimension type: " + (Object) dimensionmanager));
ResourceKey worldKey = ResourceKey.a((ResourceKey) IRegistry.ae, (MinecraftKey) new MinecraftKey(name.toLowerCase(Locale.ENGLISH)));
//@builder
//@NoArgsConstructor
WorldServer internal = new WorldServer(
(MinecraftServer)console,
console.executorService,

View File

@ -160,7 +160,7 @@ public class NMSCreator162
}
final ResourceKey<net.minecraft.server.v1_16_R2.World> worldKey = (ResourceKey<net.minecraft.server.v1_16_R2.World>) ResourceKey.a(IRegistry.L, new MinecraftKey(name.toLowerCase(Locale.ENGLISH)));
//@builder
//@NoArgsConstructor
final WorldServer internal = new WorldServer((MinecraftServer) console,
console.executorService, worldSession,
(IWorldDataServer) worlddata,

View File

@ -163,7 +163,7 @@ public class PostMasterPatcher extends IrisPostBlockFilter
// Slab
if(gen.getDimension().isPostProcessingSlabs())
{
//@builder
//@NoArgsConstructor
if((ha == h + 1 && isSolidNonSlab(x + 1, ha, z, currentPostX, currentPostZ, currentData))
|| (hb == h + 1 && isSolidNonSlab(x, hb, z + 1, currentPostX, currentPostZ, currentData))
|| (hc == h + 1 && isSolidNonSlab(x - 1, hc, z, currentPostX, currentPostZ, currentData))
@ -323,7 +323,7 @@ public class PostMasterPatcher extends IrisPostBlockFilter
if(gen.getDimension().isPostProcessingSlabs())
{
//@builder
//@NoArgsConstructor
if((fa == f + 1 && isSolidNonSlab(x + 1, fa, z, currentPostX, currentPostZ, currentData))
|| (fb == f + 1 && isSolidNonSlab(x, fb, z + 1, currentPostX, currentPostZ, currentData))
|| (fc == f + 1 && isSolidNonSlab(x - 1, fc, z, currentPostX, currentPostZ, currentData))
@ -358,7 +358,7 @@ public class PostMasterPatcher extends IrisPostBlockFilter
}
}
//@builder
//@NoArgsConstructor
if((ca == c - 1 && isSolidNonSlab(x + 1, ca, z, currentPostX, currentPostZ, currentData))
|| (cb == c - 1 && isSolidNonSlab(x, cb, z + 1, currentPostX, currentPostZ, currentData))
|| (cc == c - 1 && isSolidNonSlab(x - 1, cc, z, currentPostX, currentPostZ, currentData))

View File

@ -37,14 +37,8 @@ public class TerrainTarget
public static TerrainTarget from(World world)
{
//@builder
return new TerrainTargetBuilder()
.environment(world.getEnvironment())
.seed(world.getSeed())
.folder(world.getWorldFolder())
.name(world.getName())
.realWorld(world)
.build();
// @NoArgsConstructor
return new TerrainTargetBuilder().environment(world.getEnvironment()).seed(world.getSeed()).folder(world.getWorldFolder()).name(world.getName()).realWorld(world).build();
//@done
}

View File

@ -39,7 +39,7 @@ public class IrisBoardManager implements BoardProvider, Listener
public IrisBoardManager()
{
Iris.instance.registerListener(this);
//@builder
//@NoArgsConstructor
manager = new BoardManager(Iris.instance, BoardSettings.builder()
.boardProvider(this)
.scoreDirection(ScoreDirection.DOWN)

View File

@ -52,6 +52,7 @@ import com.volmit.iris.object.IrisStructureTile;
import com.volmit.iris.object.NoiseStyle;
import com.volmit.iris.object.StructureTileCondition;
import com.volmit.iris.util.ArrayType;
import com.volmit.iris.util.B;
import com.volmit.iris.util.C;
import com.volmit.iris.util.ChronoLatch;
import com.volmit.iris.util.DependsOn;
@ -71,6 +72,7 @@ import com.volmit.iris.util.MinNumber;
import com.volmit.iris.util.MortarSender;
import com.volmit.iris.util.O;
import com.volmit.iris.util.RegistryListBiome;
import com.volmit.iris.util.RegistryListBlockType;
import com.volmit.iris.util.RegistryListDimension;
import com.volmit.iris.util.RegistryListEntity;
import com.volmit.iris.util.RegistryListFont;
@ -372,7 +374,7 @@ public class ProjectManager
}
});
//@builder
//@NoArgsConstructor
World world = NMSCreator.createWorld(new WorldCreator(wfp)
.seed(1337)
.generator(gen)
@ -1124,6 +1126,11 @@ public class ProjectManager
prop.put("enum", new JSONArray(getBiomeList(dat)));
}
if(k.isAnnotationPresent(RegistryListBlockType.class))
{
prop.put("enum", new JSONArray(getBlockTypeList(dat)));
}
if(k.isAnnotationPresent(RegistryListEntity.class))
{
prop.put("enum", new JSONArray(getEntityList(dat)));
@ -1290,6 +1297,26 @@ public class ProjectManager
continue;
}
if(k.isAnnotationPresent(RegistryListBlockType.class))
{
String name = "enblk" + t.type().getSimpleName().toLowerCase();
if(!def.containsKey(name))
{
JSONObject deff = new JSONObject();
deff.put("type", tx);
deff.put("enum", new JSONArray(getBlockTypeList(dat)));
def.put(name, deff);
}
JSONObject items = new JSONObject();
items.put("$ref", "#/definitions/" + name);
prop.put("items", items);
prop.put("description", tp + "\n\n" + k.getAnnotation(Desc.class).value());
prop.put("type", tp);
properties.put(k.getName(), prop);
continue;
}
if(k.isAnnotationPresent(RegistryListEntity.class))
{
String name = "enent" + t.type().getSimpleName().toLowerCase();
@ -1627,6 +1654,11 @@ public class ProjectManager
return data.getBiomeLoader().getPossibleKeys();
}
private String[] getBlockTypeList(IrisDataManager data)
{
return B.getBlockTypes();
}
private String[] getEntityList(IrisDataManager data)
{
return data.getEntityLoader().getPossibleKeys();

View File

@ -71,7 +71,7 @@ public class CNG
public static CNG signature(RNG rng, NoiseType t)
{
// @builder
// @NoArgsConstructor
return new CNG(rng.nextParallelRNG(17), t, 1D, 1)
.fractureWith(
new CNG(rng.nextParallelRNG(18), 1, 1).scale(0.9)
@ -84,7 +84,7 @@ public class CNG
public static CNG signatureThick(RNG rng, NoiseType t)
{
// @builder
// @NoArgsConstructor
return new CNG(rng.nextParallelRNG(133), t, 1D, 1)
.fractureWith(
new CNG(rng.nextParallelRNG(18), 1, 1).scale(0.5)
@ -97,7 +97,7 @@ public class CNG
public static CNG signatureHalf(RNG rng, NoiseType t)
{
// @builder
// @NoArgsConstructor
return new CNG(rng.nextParallelRNG(127), t, 1D, 1)
.fractureWith(
new CNG(rng.nextParallelRNG(18), 1, 1).scale(0.9)

View File

@ -14,57 +14,52 @@ import com.volmit.iris.util.RNG;
import com.volmit.iris.util.Required;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
@Accessors(chain = true)
@AllArgsConstructor
@Builder
@NoArgsConstructor
@Desc("Represents an attribute modifier for an item or an entity. This allows you to create modifications to basic game attributes such as MAX_HEALTH or ARMOR_VALUE.")
@Data
public class IrisAttributeModifier
{
@Required
@Builder.Default
@DontObfuscate
@Desc("The Attribute type. This type is pulled from the game attributes. Zombie & Horse attributes will not work on non-zombie/horse entities.\nUsing an attribute on an item will have affects when held, or worn. There is no way to specify further granularity as the game picks this depending on the item type.")
private Attribute attribute = null;
@MinNumber(2)
@Required
@Builder.Default
@DontObfuscate
@Desc("The Attribute Name is used internally only for the game. This value should be unique to all other attributes applied to this item/entity. It is not shown in game.")
private String name = "";
@DontObfuscate
@Builder.Default
@Desc("The application operation (add number is default). Add Number adds to the default value. \nAdd scalar_1 will multiply by 1 for example if the health is 20 and you multiply_scalar_1 by 0.5, the health will result in 30, not 10. Use negative values to achieve that.")
private Operation operation = Operation.ADD_NUMBER;
@DontObfuscate
@Builder.Default
@Desc("Minimum amount for this modifier. Iris randomly chooses an amount, this is the minimum it can choose randomly for this attribute.")
private double minAmount = 1;
@Builder.Default
@DontObfuscate
@Desc("Maximum amount for this modifier Iris randomly chooses an amount, this is the maximum it can choose randomly for this attribute.")
private double maxAmount = 1;
@MinNumber(0)
@MaxNumber(1)
@Builder.Default
@DontObfuscate
@Desc("The chance that this attribute is applied (0 to 1). If the chance is 0.5 (50%), then Iris will only apply this attribute 50% of the time.")
private double chance = 1;
public IrisAttributeModifier()
{
}
public void apply(RNG rng, ItemMeta meta)
{
if(rng.nextDouble() < getChance())

View File

@ -9,19 +9,19 @@ import com.volmit.iris.util.MinNumber;
import com.volmit.iris.util.Required;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
@Accessors(chain = true)
@AllArgsConstructor
@Builder
@NoArgsConstructor
@Desc("Represents a rotation axis with intervals and maxes. The x and z axis values are defaulted to disabled. The Y axis defaults to on, rotating by 90 degree increments.")
@Data
public class IrisAxisRotationClamp
{
@DontObfuscate
@Builder.Default
@Desc("Should this axis be rotated at all?")
private boolean enabled = false;
@ -29,7 +29,7 @@ public class IrisAxisRotationClamp
@DependsOn({"max"})
@MinNumber(-360)
@MaxNumber(360)
@Builder.Default
@DontObfuscate
@Desc("The minimum angle (from) or set this and max to zero for any angle degrees. Set both to the same non-zero value to force it to that angle only")
private double min = 0;
@ -38,7 +38,7 @@ public class IrisAxisRotationClamp
@DependsOn({"min"})
@MinNumber(-360)
@MaxNumber(360)
@Builder.Default
@DontObfuscate
@Desc("The maximum angle (to) or set this and min to zero for any angle degrees. Set both to the same non-zero value to force it to that angle only")
private double max = 0;
@ -48,15 +48,10 @@ public class IrisAxisRotationClamp
@MinNumber(0)
@MaxNumber(360)
@DontObfuscate
@Builder.Default
@Desc("Iris spins the axis but not freely. For example an interval of 90 would mean 4 possible angles (right angles) degrees. \nSetting this to 0 means totally free rotation.\n\nNote that a lot of structures can have issues with non 90 degree intervals because the minecraft block resolution is so low.")
private double interval = 0;
public IrisAxisRotationClamp()
{
}
public boolean isUnlimited()
{
return min == max && min == 0;

View File

@ -23,13 +23,13 @@ import com.volmit.iris.util.RegistryListBiome;
import com.volmit.iris.util.Required;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
@Accessors(chain = true)
@Builder
@NoArgsConstructor
@AllArgsConstructor
@DontObfuscate
@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.")
@ -39,174 +39,174 @@ public class IrisBiome extends IrisRegistrant implements IRare
{
@MinNumber(2)
@Required
@Builder.Default
@DontObfuscate
@Desc("This is the human readable name for this biome. This can and should be different than the file name. This is not used for loading biomes in other objects.")
private String name = "A Biome";
@DontObfuscate
@Builder.Default
@Desc("Place text on terrain. Iris will render text into block schematics and randomly place them in this biome.")
@ArrayType(min = 1, type = IrisTextPlacement.class)
private KList<IrisTextPlacement> text = new KList<>();
@DontObfuscate
@Builder.Default
@Desc("The type of fluid if this biome is underwater. To 'defer' this value to whatever the parent dimension fluid type is, use an emtpy string.")
private String fluidType = "";
@DontObfuscate
@Builder.Default
@Desc("Entity spawns to override or add to this biome. Anytime an entity spawns, it has a chance to be replaced as one of these overrides.")
@ArrayType(min = 1, type = IrisEntitySpawnOverride.class)
private KList<IrisEntitySpawnOverride> entitySpawnOverrides = new KList<>();
@DontObfuscate
@Builder.Default
@Desc("Entity spawns during generation")
@ArrayType(min = 1, type = IrisEntityInitialSpawn.class)
private KList<IrisEntityInitialSpawn> entityInitialSpawns = new KList<>();
@ArrayType(min = 1, type = IrisEffect.class)
@DontObfuscate
@Builder.Default
@Desc("Effects are ambient effects such as potion effects, random sounds, or even particles around each player. All of these effects are played via packets so two players won't see/hear each others effects.\nDue to performance reasons, effects will play arround the player even if where the effect was played is no longer in the biome the player is in.")
private KList<IrisEffect> effects = new KList<>();
@DontObfuscate
@Builder.Default
@DependsOn({"biomeStyle", "biomeZoom", "biomeScatter"})
@Desc("This changes the dispersion of the biome colors if multiple derivatives are chosen.")
private IrisGeneratorStyle biomeStyle = NoiseStyle.SIMPLEX.style();
@ArrayType(min = 1, type = IrisBlockDrops.class)
@DontObfuscate
@Builder.Default
@Desc("Define custom block drops for this biome")
private KList<IrisBlockDrops> blockDrops = new KList<>();
@DontObfuscate
@Builder.Default
@Desc("Reference loot tables in this area")
private IrisLootReference loot = new IrisLootReference();
@MinNumber(0.0001)
@DontObfuscate
@Builder.Default
@DependsOn({"biomeStyle", "biomeZoom", "biomeScatter"})
@Desc("This zooms in the biome colors if multiple derivatives are chosen")
private double biomeZoom = 1;
@DontObfuscate
@Builder.Default
@Desc("Layers no longer descend from the surface block, they descend from the max possible height the biome can produce (constant) creating mesa like layers.")
private boolean lockLayers = false;
@Builder.Default
@DontObfuscate
@Desc("The max layers to iterate below the surface for locked layer biomes (mesa).")
private int lockLayersMax = 7;
@MinNumber(1)
@Builder.Default
@MaxNumber(512)
@DontObfuscate
@Desc("The rarity of this biome (integer)")
private int rarity = 1;
@DontObfuscate
@Builder.Default
@Desc("A debug color for visualizing this biome with a color. I.e. #F13AF5")
private String debugColor = "";
@Required
@DontObfuscate
@Builder.Default
@Desc("The raw derivative of this biome. This is required or the terrain will not properly generate. Use any vanilla biome type. Look in examples/biome-list.txt")
private Biome derivative = Biome.THE_VOID;
@ArrayType(min = 1, type = Biome.class)
@DontObfuscate
@Builder.Default
@Desc("You can instead specify multiple biome derivatives to randomly scatter colors in this biome")
private KList<Biome> biomeScatter = new KList<>();
@ArrayType(min = 1, type = Biome.class)
@DontObfuscate
@Builder.Default
@Desc("Since 1.13 supports 3D biomes, you can add different derivative colors for anything above the terrain. (Think swampy tree leaves with a desert looking grass surface)")
private KList<Biome> biomeSkyScatter = new KList<>();
@DontObfuscate
@Builder.Default
@DependsOn({"children"})
@Desc("If this biome has children biomes, and the gen layer chooses one of this biomes children, how much smaller will it be (inside of this biome). Higher values means a smaller biome relative to this biome's size. Set higher than 1.0 and below 3.0 for best results.")
private double childShrinkFactor = 1.5;
@DontObfuscate
@Builder.Default
@DependsOn({"children"})
@Desc("If this biome has children biomes, and the gen layer chooses one of this biomes children, How will it be shaped?")
private IrisGeneratorStyle childStyle = NoiseStyle.CELLULAR_IRIS_DOUBLE.style();
@RegistryListBiome
@Builder.Default
@ArrayType(min = 1, type = String.class)
@DontObfuscate
@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<>();
@Builder.Default
@DontObfuscate
@Desc("The default slab if iris decides to place a slab in this biome. Default is no slab.")
private IrisBiomePaletteLayer slab = new IrisBiomePaletteLayer().zero();
@DontObfuscate
@Builder.Default
@Desc("The default wall if iris decides to place a wall higher than 2 blocks (steep hills or possibly cliffs)")
private IrisBiomePaletteLayer wall = new IrisBiomePaletteLayer().zero();
@Required
@ArrayType(min = 1, type = IrisBiomePaletteLayer.class)
@DontObfuscate
@Builder.Default
@Desc("This defines the layers of materials in this biome. Each layer has a palette and min/max height and some other properties. Usually a grassy/sandy layer then a dirt layer then a stone layer. Iris will fill in the remaining blocks below your layers with stone.")
private KList<IrisBiomePaletteLayer> layers = new KList<IrisBiomePaletteLayer>().qadd(new IrisBiomePaletteLayer());
@ArrayType(min = 1, type = IrisBiomePaletteLayer.class)
@DontObfuscate
@Builder.Default
@Desc("This defines the layers of materials in this biome. Each layer has a palette and min/max height and some other properties. Usually a grassy/sandy layer then a dirt layer then a stone layer. Iris will fill in the remaining blocks below your layers with stone.")
private KList<IrisBiomePaletteLayer> seaLayers = new KList<IrisBiomePaletteLayer>();
@ArrayType(min = 1, type = IrisBiomeDecorator.class)
@DontObfuscate
@Builder.Default
@Desc("Decorators are used for things like tall grass, bisected flowers, and even kelp or cactus (random heights)")
private KList<IrisBiomeDecorator> decorators = new KList<IrisBiomeDecorator>();
@ArrayType(min = 1, type = IrisObjectPlacement.class)
@DontObfuscate
@Builder.Default
@Desc("Objects define what schematics (iob files) iris will place in this biome")
private KList<IrisObjectPlacement> objects = new KList<IrisObjectPlacement>();
@Required
@ArrayType(min = 1, type = IrisBiomeGeneratorLink.class)
@DontObfuscate
@Builder.Default
@Desc("Generators for this biome. Multiple generators with different interpolation sizes will mix with other biomes how you would expect. This defines your biome height relative to the fluid height. Use negative for oceans.")
private KList<IrisBiomeGeneratorLink> generators = new KList<IrisBiomeGeneratorLink>().qadd(new IrisBiomeGeneratorLink());
@ArrayType(min = 1, type = IrisStructurePlacement.class)
@DontObfuscate
@Builder.Default
@Desc("A list of structure tilesets")
private KList<IrisStructurePlacement> structures = new KList<>();
@ArrayType(min = 1, type = IrisDepositGenerator.class)
@DontObfuscate
@Builder.Default
@Desc("Define biome deposit generators that add onto the existing regional and global deposit generators")
private KList<IrisDepositGenerator> deposits = new KList<>();
@ -220,11 +220,6 @@ public class IrisBiome extends IrisRegistrant implements IRare
private final transient AtomicCache<KList<CNG>> layerHeightGenerators = new AtomicCache<>();
private final transient AtomicCache<KList<CNG>> layerSeaHeightGenerators = new AtomicCache<>();
public IrisBiome()
{
}
public Color getCachedColor()
{
return cacheColor.aquire(() ->

View File

@ -17,42 +17,42 @@ import com.volmit.iris.util.RNG;
import com.volmit.iris.util.Required;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
@Accessors(chain = true)
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Desc("A biome decorator is used for placing flowers, grass, cacti and so on")
@Data
public class IrisBiomeDecorator
{
@DontObfuscate
@Builder.Default
@Desc("The varience dispersion is used when multiple blocks are put in the palette. Scatter scrambles them, Wispy shows streak-looking varience")
private IrisGeneratorStyle variance = NoiseStyle.STATIC.style();
@DontObfuscate
@Builder.Default
@Desc("Dispersion is used to pick places to spawn. Scatter randomly places them (vanilla) or Wispy for a streak like patch system.")
private IrisGeneratorStyle style = NoiseStyle.STATIC.style();
@DependsOn({"stackMin", "stackMax"})
@DontObfuscate
@Builder.Default
@Desc("If this decorator has a height more than 1 this changes how it picks the height between your maxes. Scatter = random, Wispy = wavy heights")
private IrisGeneratorStyle heightVariance = NoiseStyle.STATIC.style();
@DontObfuscate
@Builder.Default
@Desc("Tells iris where this decoration is a part of. I.e. SHORE_LINE or SEA_SURFACE")
private DecorationPart partOf = DecorationPart.NONE;
@DependsOn({"stackMin", "stackMax"})
@MinNumber(1)
@MaxNumber(256)
@Builder.Default
@DontObfuscate
@Desc("The minimum repeat stack height (setting to 3 would stack 3 of <block> on top of each other")
private int stackMin = 1;
@ -60,27 +60,27 @@ public class IrisBiomeDecorator
@DependsOn({"stackMin", "stackMax"})
@MinNumber(1)
@MaxNumber(256)
@Builder.Default
@DontObfuscate
@Desc("The maximum repeat stack height")
private int stackMax = 1;
@MinNumber(0.0001)
@Builder.Default
@DontObfuscate
@Desc("The zoom is for zooming in or out wispy dispersions. Makes patches bigger the higher this zoom value is")
private double zoom = 1;
@MinNumber(0.0001)
@DontObfuscate
@Builder.Default
@Desc("The zoom is for zooming in or out variance. Makes patches have more or less of one type.")
private double varianceZoom = 1;
@DependsOn({"stackMin", "stackMax"})
@MinNumber(0.0001)
@DontObfuscate
@Builder.Default
@Desc("The vertical zoom is for wispy stack heights. Zooming this in makes stack heights more slowly change over a distance")
private double verticalZoom = 1;
@ -88,14 +88,14 @@ public class IrisBiomeDecorator
@MinNumber(0)
@MaxNumber(1)
@DontObfuscate
@Builder.Default
@Desc("The chance for this decorator to decorate at a given X,Y coordinate. This is hit 256 times per chunk (per surface block)")
private double chance = 0.1;
@Required
@ArrayType(min = 1, type = String.class)
@DontObfuscate
@Builder.Default
@Desc("The palette of blocks to pick from when this decorator needs to place.")
private KList<String> palette = new KList<String>().qadd("GRASS");
@ -104,11 +104,6 @@ public class IrisBiomeDecorator
private final transient AtomicCache<CNG> heightGenerator = new AtomicCache<>();
private final transient AtomicCache<KList<BlockData>> blockData = new AtomicCache<>();
public IrisBiomeDecorator()
{
}
public int getHeight(RNG rng, double x, double z)
{
if(stackMin == stackMax)

View File

@ -13,24 +13,23 @@ import com.volmit.iris.util.RegistryListGenerator;
import com.volmit.iris.util.Required;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
@Accessors(chain = true)
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Desc("This represents a link to a generator for a biome")
@Data
public class IrisBiomeGeneratorLink
{
@Builder.Default
@RegistryListGenerator
@DontObfuscate
@Desc("The generator id")
private String generator = "default";
@Builder.Default
@DependsOn({"min", "max"})
@Required
@MinNumber(-256)
@ -39,7 +38,6 @@ public class IrisBiomeGeneratorLink
@Desc("The min block value (value + fluidHeight)")
private int min = 0;
@Builder.Default
@DependsOn({"min", "max"})
@Required
@MinNumber(-256)
@ -50,11 +48,6 @@ public class IrisBiomeGeneratorLink
private final transient AtomicCache<IrisGenerator> gen = new AtomicCache<>();
public IrisBiomeGeneratorLink()
{
}
public IrisGenerator getCachedGenerator(ContextualTerrainProvider g)
{
return gen.aquire(() ->

View File

@ -14,18 +14,18 @@ import com.volmit.iris.util.RegistryListObject;
import com.volmit.iris.util.Required;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
@Accessors(chain = true)
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Desc("A biome mutation if a condition is met")
@Data
public class IrisBiomeMutation
{
@Builder.Default
@RegistryListBiome
@Required
@ArrayType(min = 1, type = String.class)
@ -33,7 +33,6 @@ public class IrisBiomeMutation
@Desc("One of The following biomes or regions must show up")
private KList<String> sideA = new KList<>();
@Builder.Default
@RegistryListBiome
@Required
@ArrayType(min = 1, type = String.class)
@ -41,7 +40,6 @@ public class IrisBiomeMutation
@Desc("One of The following biomes or regions must show up")
private KList<String> sideB = new KList<>();
@Builder.Default
@Required
@MinNumber(1)
@MaxNumber(1024)
@ -49,7 +47,6 @@ public class IrisBiomeMutation
@Desc("The scan radius for placing this mutator")
private int radius = 16;
@Builder.Default
@Required
@MinNumber(1)
@MaxNumber(32)
@ -57,7 +54,6 @@ public class IrisBiomeMutation
@Desc("How many tries per chunk to check for this mutation")
private int checks = 2;
@Builder.Default
@RegistryListObject
@ArrayType(min = 1, type = IrisObjectPlacement.class)
@DontObfuscate

View File

@ -16,23 +16,22 @@ import com.volmit.iris.util.RNG;
import com.volmit.iris.util.Required;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
@Accessors(chain = true)
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Desc("A layer of surface / subsurface material in biomes")
@Data
public class IrisBiomePaletteLayer
{
@Builder.Default
@DontObfuscate
@Desc("The style of noise")
private IrisGeneratorStyle style = NoiseStyle.STATIC.style();
@Builder.Default
@DependsOn({"minHeight", "maxHeight"})
@MinNumber(0)
@MaxNumber(256)
@ -40,7 +39,6 @@ public class IrisBiomePaletteLayer
@Desc("The min thickness of this layer")
private int minHeight = 1;
@Builder.Default
@DependsOn({"minHeight", "maxHeight"})
@MinNumber(1)
@MaxNumber(256)
@ -48,13 +46,11 @@ public class IrisBiomePaletteLayer
@Desc("The max thickness of this layer")
private int maxHeight = 1;
@Builder.Default
@MinNumber(0.0001)
@DontObfuscate
@Desc("The terrain zoom mostly for zooming in on a wispy palette")
private double zoom = 5;
@Builder.Default
@Required
@ArrayType(min = 1, type = String.class)
@DontObfuscate
@ -65,15 +61,6 @@ public class IrisBiomePaletteLayer
private final transient AtomicCache<CNG> layerGenerator = new AtomicCache<>();
private final transient AtomicCache<CNG> heightGenerator = new AtomicCache<>();
public IrisBiomePaletteLayer()
{
}
{
}
public CNG getHeightGenerator(RNG rng)
{
return heightGenerator.aquire(() -> CNG.signature(rng.nextParallelRNG(minHeight * maxHeight + getBlockData().size())));

View File

@ -0,0 +1,75 @@
package com.volmit.iris.object;
import org.bukkit.block.data.BlockData;
import com.volmit.iris.gen.atomics.AtomicCache;
import com.volmit.iris.util.B;
import com.volmit.iris.util.Desc;
import com.volmit.iris.util.DontObfuscate;
import com.volmit.iris.util.KList;
import com.volmit.iris.util.KMap;
import com.volmit.iris.util.RegistryListBlockType;
import com.volmit.iris.util.Required;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
@Accessors(chain = true)
@NoArgsConstructor
@AllArgsConstructor
@Desc("Represents Block Data")
@Data
public class IrisBlockData
{
@RegistryListBlockType
@Required
@DontObfuscate
@Desc("The cave zoom. Higher values makes caves spread out further and branch less often, but are thicker.")
private String block = "air";
@DontObfuscate
@Desc("The resource key. Typically Minecraft")
private String key = "minecraft";
@DontObfuscate
@Desc("Optional properties for this block data such as 'waterlogged': true")
private KMap<String, Object> data = new KMap<>();
private final transient AtomicCache<BlockData> blockdata = new AtomicCache<>();
private final transient AtomicCache<String> realProperties = new AtomicCache<>();
public String computeProperties()
{
if(getData().isEmpty())
{
return "";
}
KList<String> r = new KList<>();
for(String i : getData().keySet())
{
r.add(i + "=" + getData().get(i));
}
return "[" + r.toString(",") + "]";
}
public BlockData getBlockData()
{
return blockdata.aquire(() ->
{
BlockData b = B.get(getKey() + ":" + getBlock() + computeProperties());
if(b != null)
{
return b;
}
return B.get("AIR");
});
}
}

View File

@ -5,7 +5,6 @@ import org.bukkit.inventory.ItemStack;
import com.volmit.iris.gen.atomics.AtomicCache;
import com.volmit.iris.util.ArrayType;
import com.volmit.iris.util.B;
import com.volmit.iris.util.Desc;
import com.volmit.iris.util.DontObfuscate;
import com.volmit.iris.util.KList;
@ -13,60 +12,51 @@ import com.volmit.iris.util.RNG;
import com.volmit.iris.util.Required;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
@Accessors(chain = true)
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Desc("Represents a block drop list")
@Data
public class IrisBlockDrops
{
@Builder.Default
@Required
@ArrayType(min = 1, type = String.class)
@Desc("The blocks that drop loot")
private KList<String> blocks = new KList<String>();
@Builder.Default
@Required
@ArrayType(min = 1, type = IrisBlockData.class)
@Desc("The blocks that drop loot")
private KList<IrisBlockData> blocks = new KList<IrisBlockData>();
@DontObfuscate
@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;
@Builder.Default
@DontObfuscate
@Desc("Add in specific items to drop")
@ArrayType(min = 1, type = IrisLoot.class)
private KList<IrisLoot> drops = new KList<>();
@Builder.Default
@DontObfuscate
@Desc("If this is in a biome, setting skipParents to true will ignore the drops in the region and dimension for this block type. The default (false) will allow all three nodes to fire and add to a list of drops.")
private boolean skipParents = false;
@Builder.Default
@DontObfuscate
@Desc("Removes the default vanilla block drops and only drops the given items & any parent loot tables specified for this block type.")
private boolean replaceVanillaDrops = false;
private final transient AtomicCache<KList<BlockData>> data = new AtomicCache<>();
public IrisBlockDrops()
{
}
public boolean shouldDropFor(BlockData data)
{
KList<BlockData> list = this.data.aquire(() ->
{
KList<BlockData> b = new KList<>();
for(String i : getBlocks())
for(IrisBlockData i : getBlocks())
{
BlockData dd = B.get(i);
BlockData dd = i.getBlockData();
if(dd != null)
{

View File

@ -12,38 +12,35 @@ import com.volmit.iris.util.RNG;
import com.volmit.iris.util.Required;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
@Accessors(chain = true)
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Desc("Translate objects")
@Data
public class IrisCarveLayer
{
@Builder.Default
@Required
@DontObfuscate
@Desc("The 4d slope this carve layer follows")
private IrisGeneratorStyle style = new IrisGeneratorStyle();
@Builder.Default
@MaxNumber(512)
@MinNumber(-128)
@DontObfuscate
@Desc("The max height")
private int maxHeight = 220;
@Builder.Default
@MaxNumber(512)
@MinNumber(-128)
@DontObfuscate
@Desc("The min height")
private int minHeight = 147;
@Builder.Default
@MaxNumber(1)
@MinNumber(0)
@DontObfuscate
@ -52,11 +49,6 @@ public class IrisCarveLayer
private final transient AtomicCache<CNG> cng = new AtomicCache<>();
public IrisCarveLayer()
{
}
public boolean isCarved(RNG rng, double x, double y, double z)
{
if(y > getMaxHeight() || y < getMinHeight())

View File

@ -11,18 +11,18 @@ import com.volmit.iris.util.MinNumber;
import com.volmit.iris.util.Required;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
@Accessors(chain = true)
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Desc("Translate objects")
@Data
public class IrisCaveFluid
{
@Builder.Default
@Required
@MaxNumber(255)
@MinNumber(0)
@ -30,12 +30,10 @@ public class IrisCaveFluid
@Desc("The cave zoom. Higher values makes caves spread out further and branch less often, but are thicker.")
private int fluidHeight = 35;
@Builder.Default
@DontObfuscate
@Desc("Insead of fluidHeight & below being fluid, turning inverse height on will simply spawn fluid in this cave layer from min(max_height, cave_height) to the fluid height. Basically, fluid will spawn above the fluidHeight value instead of below the fluidHeight.")
private boolean inverseHeight = false;
@Builder.Default
@Required
@DontObfuscate
@Desc("The fluid type that should spawn here")
@ -43,11 +41,6 @@ public class IrisCaveFluid
private final transient AtomicCache<BlockData> fluidData = new AtomicCache<>();
public IrisCaveFluid()
{
}
public boolean hasFluid()
{
return !B.isAir(getFluid());

View File

@ -6,53 +6,44 @@ import com.volmit.iris.util.MinNumber;
import com.volmit.iris.util.Required;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
@Accessors(chain = true)
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Desc("Translate objects")
@Data
public class IrisCaveLayer
{
@Builder.Default
@Required
@DontObfuscate
@Desc("The vertical slope this cave layer follows")
private IrisShapedGeneratorStyle verticalSlope = new IrisShapedGeneratorStyle();
@Builder.Default
@Required
@DontObfuscate
@Desc("The horizontal slope this cave layer follows")
private IrisShapedGeneratorStyle horizontalSlope = new IrisShapedGeneratorStyle();
@Builder.Default
@DontObfuscate
@Desc("If defined, a cave fluid will fill this cave below (or above) the specified fluidHeight in this object.")
private IrisCaveFluid fluid = new IrisCaveFluid();
@Builder.Default
@MinNumber(0.001)
@DontObfuscate
@Desc("The cave zoom. Higher values makes caves spread out further and branch less often, but are thicker.")
private double caveZoom = 1D;
@Builder.Default
@MinNumber(0.001)
@DontObfuscate
@Desc("The cave thickness.")
private double caveThickness = 1D;
@Builder.Default
@DontObfuscate
@Desc("If set to true, this cave layer can break the surface")
private boolean canBreakSurface = false;
public IrisCaveLayer()
{
}
}

View File

@ -10,30 +10,28 @@ import com.volmit.iris.util.DontObfuscate;
import com.volmit.iris.util.Required;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
@Accessors(chain = true)
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Desc("Find and replace object materials for compatability")
@Data
public class IrisCompatabilityFilter
{
@Builder.Default
@Required
@DontObfuscate
@Desc("When iris sees this block, and it's not reconized")
private String when = "";
@Builder.Default
@Required
@DontObfuscate
@Desc("Replace it with this block. Dont worry if this block is also not reconized, iris repeat this compat check.")
private String supplement = "";
@Builder.Default
@DontObfuscate
@Desc("If exact is true, it compares block data for example minecraft:some_log[axis=x]")
private boolean exact = false;
@ -46,10 +44,6 @@ public class IrisCompatabilityFilter
this(when, supplement, false);
}
public IrisCompatabilityFilter()
{
}
public BlockData getFind()
{

View File

@ -17,18 +17,18 @@ import com.volmit.iris.util.RNG;
import com.volmit.iris.util.Required;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
@Accessors(chain = true)
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Desc("Creates ore & other block deposits underground")
@Data
public class IrisDepositGenerator
{
@Builder.Default
@Required
@MinNumber(0)
@MaxNumber(256)
@ -36,7 +36,6 @@ public class IrisDepositGenerator
@Desc("The minimum height this deposit can generate at")
private int minHeight = 7;
@Builder.Default
@Required
@MinNumber(0)
@MaxNumber(256)
@ -44,7 +43,6 @@ public class IrisDepositGenerator
@Desc("The maximum height this deposit can generate at")
private int maxHeight = 55;
@Builder.Default
@Required
@MinNumber(1)
@MaxNumber(32)
@ -52,7 +50,6 @@ public class IrisDepositGenerator
@Desc("The minimum amount of deposit blocks per clump")
private int minSize = 3;
@Builder.Default
@Required
@MinNumber(1)
@MaxNumber(32)
@ -60,7 +57,6 @@ public class IrisDepositGenerator
@Desc("The maximum amount of deposit blocks per clump")
private int maxSize = 5;
@Builder.Default
@Required
@MinNumber(1)
@MaxNumber(128)
@ -68,7 +64,6 @@ public class IrisDepositGenerator
@Desc("The maximum amount of clumps per chunk")
private int maxPerChunk = 3;
@Builder.Default
@Required
@MinNumber(0)
@MaxNumber(128)
@ -76,14 +71,12 @@ public class IrisDepositGenerator
@Desc("The minimum amount of clumps per chunk")
private int minPerChunk = 1;
@Builder.Default
@Required
@ArrayType(min = 1, type = String.class)
@DontObfuscate
@Desc("The palette of blocks to be used in this deposit generator")
private KList<String> palette = new KList<String>();
@Builder.Default
@MinNumber(1)
@MaxNumber(64)
@DontObfuscate
@ -93,11 +86,6 @@ public class IrisDepositGenerator
private final transient AtomicCache<KList<IrisObject>> objects = new AtomicCache<>();
private final transient AtomicCache<KList<BlockData>> blockData = new AtomicCache<>();
public IrisDepositGenerator()
{
}
public IrisObject getClump(RNG rng)
{
KList<IrisObject> objects = this.objects.aquire(() ->

View File

@ -29,15 +29,14 @@ import com.volmit.iris.util.RegistryListRegion;
import com.volmit.iris.util.Required;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
@Accessors(chain = true)
@Builder
@AllArgsConstructor
@NoArgsConstructor
@Desc("Represents a dimension")
@Data
@EqualsAndHashCode(callSuper = false)
@ -46,180 +45,147 @@ public class IrisDimension extends IrisRegistrant
public static final BlockData STONE = Material.STONE.createBlockData();
public static final BlockData WATER = Material.WATER.createBlockData();
@Builder.Default
@MinNumber(2)
@Required
@DontObfuscate
@Desc("The human readable name of this dimension")
private String name = "A Dimension";
@Builder.Default
@DontObfuscate
@Desc("Place text on terrain")
@ArrayType(min = 1, type = IrisTextPlacement.class)
private KList<IrisTextPlacement> text = new KList<>();
@Builder.Default
@DontObfuscate
@Desc("Entity spawns to override or add to this dimension")
@ArrayType(min = 1, type = IrisEntitySpawnOverride.class)
private KList<IrisEntitySpawnOverride> entitySpawnOverrides = new KList<>();
@Builder.Default
@DontObfuscate
@Desc("Entity spawns during generation")
@ArrayType(min = 1, type = IrisEntityInitialSpawn.class)
private KList<IrisEntityInitialSpawn> entityInitialSpawns = new KList<>();
@Builder.Default
@DontObfuscate
@Desc("Reference loot tables in this area")
private IrisLootReference loot = new IrisLootReference();
@Builder.Default
@DontObfuscate
@MinNumber(0)
@Desc("Try to fill a container with loot up to this many times to avoid too many empty chests.")
private int lootTries = 5;
@Builder.Default
@Required
@MinNumber(0)
@DontObfuscate
@Desc("The version of this dimension. Changing this will stop users from accidentally upgrading (and breaking their worlds).")
private int version = 1;
@Builder.Default
@ArrayType(min = 1, type = IrisBlockDrops.class)
@DontObfuscate
@Desc("Define custom block drops for this dimension")
private KList<IrisBlockDrops> blockDrops = new KList<>();
@Builder.Default
@MinNumber(0)
@MaxNumber(1)
@DontObfuscate
@Desc("The land chance. Up to 1.0 for total land or 0.0 for total sea")
private double landChance = 0.625;
@Builder.Default
@DontObfuscate
@Desc("The placement style of regions")
private IrisGeneratorStyle regionStyle = NoiseStyle.CELLULAR_IRIS_DOUBLE.style();
@Builder.Default
@DontObfuscate
@Desc("The placement style of land/sea")
private IrisGeneratorStyle continentalStyle = NoiseStyle.CELLULAR_IRIS_DOUBLE.style();
@Builder.Default
@DontObfuscate
@Desc("The placement style of biomes")
private IrisGeneratorStyle landBiomeStyle = NoiseStyle.CELLULAR_IRIS_DOUBLE.style();
@Builder.Default
@DontObfuscate
@Desc("The placement style of biomes")
private IrisGeneratorStyle shoreBiomeStyle = NoiseStyle.CELLULAR_IRIS_DOUBLE.style();
@Builder.Default
@DontObfuscate
@Desc("The placement style of biomes")
private IrisGeneratorStyle seaBiomeStyle = NoiseStyle.CELLULAR_IRIS_DOUBLE.style();
@Builder.Default
@DontObfuscate
@Desc("The placement style of biomes")
private IrisGeneratorStyle caveBiomeStyle = NoiseStyle.CELLULAR_IRIS_DOUBLE.style();
@Builder.Default
@DontObfuscate
@Desc("The placement style of biomes")
private IrisGeneratorStyle riverBiomeStyle = NoiseStyle.CELLULAR_IRIS_DOUBLE.style();
@Builder.Default
@DontObfuscate
@Desc("The placement style of biomes")
private IrisGeneratorStyle lakeBiomeStyle = NoiseStyle.CELLULAR_IRIS_DOUBLE.style();
@Builder.Default
@DontObfuscate
@Desc("The placement style of biomes")
private IrisGeneratorStyle islandBiomeStyle = NoiseStyle.CELLULAR_IRIS_DOUBLE.style();
@Builder.Default
@DontObfuscate
@Desc("The placement style of biomes")
private IrisGeneratorStyle islandBiomeChanceStyle = NoiseStyle.CELLULAR_HEIGHT_IRIS_DOUBLE.style();
@Builder.Default
@DontObfuscate
@Desc("The placement style of biomes")
private IrisGeneratorStyle skylandBiomeStyle = NoiseStyle.CELLULAR_IRIS_DOUBLE.style();
@Builder.Default
@DontObfuscate
@Desc("Generate caves or not.")
private boolean caves = true;
@Builder.Default
@DontObfuscate
@Desc("Instead of filling objects with air, fills them with cobweb so you can see them")
private boolean debugSmartBore = false;
@Builder.Default
@DontObfuscate
@Desc("Carve terrain or not")
private boolean carving = true;
@Builder.Default
@DontObfuscate
@Desc("Generate vanilla caves")
private boolean vanillaCaves = false;
@Builder.Default
@DontObfuscate
@Desc("Generate vanilla structures")
private boolean vanillaStructures = false;
@Builder.Default
@DontObfuscate
@Desc("Generate decorations or not")
private boolean decorate = true;
@Builder.Default
@DontObfuscate
@Desc("Use post processing or not")
private boolean postProcessing = true;
@Builder.Default
@DontObfuscate
@Desc("Add slabs in post processing")
private boolean postProcessingSlabs = true;
@Builder.Default
@DontObfuscate
@Desc("Add painted walls in post processing")
private boolean postProcessingWalls = true;
@Builder.Default
@DontObfuscate
@Desc("Use post processing for caves or not")
private boolean postProcessCaves = true;
@Builder.Default
@ArrayType(min = 1, type = IrisCompatabilityFilter.class)
@DontObfuscate
@Desc("Compatability filters")
private KList<IrisCompatabilityFilter> compatability = getDefaultCompatability();
@Builder.Default
@Required
@DontObfuscate
@Desc("The world environment")
private Environment environment = Environment.NORMAL;
@Builder.Default
@RegistryListRegion
@Required
@ArrayType(min = 1, type = String.class)
@ -227,7 +193,6 @@ public class IrisDimension extends IrisRegistrant
@Desc("Define all of the regions to include in this dimension. Dimensions -> Regions -> Biomes -> Objects etc")
private KList<String> regions = new KList<>();
@Builder.Default
@Required
@MinNumber(0)
@MaxNumber(255)
@ -235,139 +200,117 @@ public class IrisDimension extends IrisRegistrant
@Desc("The fluid height for this dimension")
private int fluidHeight = 63;
@Builder.Default
@RegistryListBiome
@DontObfuscate
@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 = "";
@Builder.Default
@MinNumber(0.0001)
@MaxNumber(512)
@DontObfuscate
@Desc("Zoom in or out the biome size. Higher = bigger biomes")
private double biomeZoom = 5D;
@Builder.Default
@MinNumber(0.0001)
@MaxNumber(512)
@DontObfuscate
@Desc("Zoom in or out the terrain. This stretches the terrain. Due to performance improvements, Higher than 2.0 may cause weird rounding artifacts. Lower = more terrain changes per block. Its a true zoom-out.")
private double terrainZoom = 2D;
@Builder.Default
@MinNumber(0)
@MaxNumber(360)
@DontObfuscate
@Desc("You can rotate the input coordinates by an angle. This can make terrain appear more natural (less sharp corners and lines). This literally rotates the entire dimension by an angle. Hint: Try 12 degrees or something not on a 90 or 45 degree angle.")
private double dimensionAngleDeg = 0;
@Builder.Default
@MinNumber(0)
@MaxNumber(8192)
@DontObfuscate
@Desc("Coordinate fracturing applies noise to the input coordinates. This creates the 'iris swirls' and wavy features. The distance pushes these waves further into places they shouldnt be. This is a block value multiplier.")
private double coordFractureDistance = 20;
@Builder.Default
@MinNumber(0.0001)
@MaxNumber(512)
@DontObfuscate
@Desc("Coordinate fracturing zoom. Higher = less frequent warping, Lower = more frequent and rapid warping / swirls.")
private double coordFractureZoom = 8;
@Builder.Default
@MinNumber(0.0001)
@MaxNumber(512)
@DontObfuscate
@Desc("This zooms in the land space")
private double landZoom = 1;
@Builder.Default
@MinNumber(0.0001)
@MaxNumber(512)
@DontObfuscate
@Desc("This zooms oceanic biomes")
private double seaZoom = 1;
@Builder.Default
@MinNumber(0.0001)
@MaxNumber(512)
@DontObfuscate
@Desc("Zoom in continents")
private double continentZoom = 1;
@Builder.Default
@MinNumber(0.0001)
@MaxNumber(512)
@DontObfuscate
@Desc("Change the size of regions")
private double regionZoom = 1;
@Builder.Default
@DontObfuscate
@Desc("Disable this to stop placing schematics in biomes")
private boolean placeObjects = true;
@Builder.Default
@DontObfuscate
@Desc("Prevent Leaf decay as if placed in creative mode")
private boolean preventLeafDecay = false;
@Builder.Default
@ArrayType(min = 1, type = IrisDepositGenerator.class)
@DontObfuscate
@Desc("Define global deposit generators")
private KList<IrisDepositGenerator> deposits = new KList<>();
@Builder.Default
@ArrayType(min = 1, type = IrisShapedGeneratorStyle.class)
@DontObfuscate
@Desc("Overlay additional noise on top of the interoplated terrain.")
private KList<IrisShapedGeneratorStyle> overlayNoise = new KList<>();
@Builder.Default
@DontObfuscate
@Desc("The noise style for rock types")
private IrisGeneratorStyle rockStyle = NoiseStyle.STATIC.style();
@Builder.Default
@ArrayType(min = 1, type = IrisCaveLayer.class)
@DontObfuscate
@Desc("Define cave layers")
private KList<IrisCaveLayer> caveLayers = new KList<>();
@Builder.Default
@ArrayType(min = 1, type = IrisCarveLayer.class)
@DontObfuscate
@Desc("Define carve layers")
private KList<IrisCarveLayer> carveLayers = new KList<>();
@Builder.Default
@DontObfuscate
@Desc("The noise style for fluid types")
private IrisGeneratorStyle fluidStyle = NoiseStyle.STATIC.style();
@Builder.Default
@MinNumber(0.0001)
@MaxNumber(512)
@DontObfuscate
@Desc("The rock zoom mostly for zooming in on a wispy palette")
private double rockZoom = 5;
@Builder.Default
@ArrayType(min = 1, type = String.class)
@DontObfuscate
@Desc("The palette of blocks for 'stone'")
private KList<String> rockPalette = new KList<String>().qadd("STONE");
@Builder.Default
@ArrayType(min = 1, type = String.class)
@DontObfuscate
@Desc("The palette of blocks for 'water'")
private KList<String> fluidPalette = new KList<String>().qadd("WATER");
@Builder.Default
@ArrayType(min = 1, type = IrisBiomeMutation.class)
@DontObfuscate
@Desc("Define biome mutations for this dimension")
@ -384,11 +327,6 @@ public class IrisDimension extends IrisRegistrant
private final transient AtomicCache<Double> cosr = new AtomicCache<>();
private final transient AtomicCache<Double> rad = new AtomicCache<>();
public IrisDimension()
{
}
public static KList<IrisCompatabilityFilter> getDefaultCompatability()
{
KList<IrisCompatabilityFilter> filters = new KList<>();

View File

@ -20,29 +20,26 @@ import com.volmit.iris.util.RNG;
import com.volmit.iris.util.Required;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
@Accessors(chain = true)
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Desc("An iris effect")
@Data
public class IrisEffect
{
@Builder.Default
@DontObfuscate
@Desc("The potion effect to apply in this area")
private String potionEffect = "";
@Builder.Default
@DontObfuscate
@Desc("The particle effect to apply in the area")
private Particle particleEffect = null;
@Builder.Default
@DependsOn({"particleEffect"})
@MinNumber(-32)
@MaxNumber(32)
@ -50,7 +47,6 @@ public class IrisEffect
@Desc("Randomly offset from the surface to this surface+value")
private int particleOffset = 0;
@Builder.Default
@DependsOn({"particleEffect"})
@MinNumber(-8)
@MaxNumber(8)
@ -58,7 +54,6 @@ public class IrisEffect
@Desc("The alt x, usually represents motion if the particle count is zero. Otherwise an offset.")
private double particleAltX = 0;
@Builder.Default
@DependsOn({"particleEffect"})
@MinNumber(-8)
@MaxNumber(8)
@ -66,7 +61,6 @@ public class IrisEffect
@Desc("The alt y, usually represents motion if the particle count is zero. Otherwise an offset.")
private double particleAltY = 0;
@Builder.Default
@DependsOn({"particleEffect"})
@MinNumber(-8)
@MaxNumber(8)
@ -74,30 +68,25 @@ public class IrisEffect
@Desc("The alt z, usually represents motion if the particle count is zero. Otherwise an offset.")
private double particleAltZ = 0;
@Builder.Default
@DependsOn({"particleEffect"})
@DontObfuscate
@Desc("Randomize the altX by -altX to altX")
private boolean randomAltX = true;
@Builder.Default
@DependsOn({"particleEffect"})
@DontObfuscate
@Desc("Randomize the altY by -altY to altY")
private boolean randomAltY = false;
@Builder.Default
@DependsOn({"particleEffect"})
@DontObfuscate
@Desc("Randomize the altZ by -altZ to altZ")
private boolean randomAltZ = true;
@Builder.Default
@DontObfuscate
@Desc("The sound to play")
private Sound sound = null;
@Builder.Default
@DependsOn({"sound"})
@MinNumber(0)
@MaxNumber(512)
@ -105,7 +94,6 @@ public class IrisEffect
@Desc("The max distance from the player the sound will play")
private int soundDistance = 12;
@Builder.Default
@DependsOn({"sound", "maxPitch"})
@MinNumber(0.01)
@MaxNumber(1.99)
@ -113,7 +101,6 @@ public class IrisEffect
@Desc("The minimum sound pitch")
private double minPitch = 0.5D;
@Builder.Default
@DependsOn({"sound", "minVolume"})
@MinNumber(0.01)
@MaxNumber(1.99)
@ -121,7 +108,6 @@ public class IrisEffect
@Desc("The max sound pitch")
private double maxPitch = 1.5D;
@Builder.Default
@DependsOn({"sound"})
@MinNumber(0.001)
@MaxNumber(512)
@ -129,7 +115,6 @@ public class IrisEffect
@Desc("The sound volume.")
private double volume = 1.5D;
@Builder.Default
@DependsOn({"particleEffect"})
@MinNumber(0)
@MaxNumber(512)
@ -137,7 +122,6 @@ public class IrisEffect
@Desc("The particle count. Try setting to zero for using the alt xyz to a motion value instead of an offset")
private int particleCount = 0;
@Builder.Default
@DependsOn({"particleEffect"})
@MinNumber(0)
@MaxNumber(64)
@ -145,7 +129,6 @@ public class IrisEffect
@Desc("How far away from the player particles can play")
private int particleDistance = 20;
@Builder.Default
@DependsOn({"particleEffect"})
@MinNumber(0)
@MaxNumber(128)
@ -153,13 +136,11 @@ public class IrisEffect
@Desc("How wide the particles can play (player's view left and right) RADIUS")
private int particleDistanceWidth = 24;
@Builder.Default
@DependsOn({"particleEffect"})
@DontObfuscate
@Desc("An extra value for some particles... Which bukkit doesn't even document.")
private double extra = 0;
@Builder.Default
@DependsOn({"potionEffect"})
@MinNumber(-1)
@MaxNumber(1024)
@ -167,28 +148,24 @@ public class IrisEffect
@Desc("The Potion Strength or -1 to disable")
private int potionStrength = -1;
@Builder.Default
@DependsOn({"potionEffect", "potionTicksMin"})
@MinNumber(1)
@DontObfuscate
@Desc("The max time the potion will last for")
private int potionTicksMax = 155;
@Builder.Default
@DependsOn({"potionEffect", "potionTicksMax"})
@MinNumber(1)
@DontObfuscate
@Desc("The min time the potion will last for")
private int potionTicksMin = 75;
@Builder.Default
@Required
@MinNumber(0)
@DontObfuscate
@Desc("The effect interval in milliseconds")
private int interval = 150;
@Builder.Default
@DependsOn({"particleEffect"})
@MinNumber(0)
@MaxNumber(16)
@ -196,7 +173,6 @@ public class IrisEffect
@Desc("The effect distance start away")
private int particleAway = 5;
@Builder.Default
@Required
@MinNumber(1)
@DontObfuscate
@ -206,10 +182,6 @@ public class IrisEffect
private final transient AtomicCache<PotionEffectType> pt = new AtomicCache<>();
private final transient AtomicCache<ChronoLatch> latch = new AtomicCache<>();
public IrisEffect()
{
}
public boolean canTick()
{

View File

@ -13,48 +13,39 @@ import com.volmit.iris.util.RNG;
import com.volmit.iris.util.Required;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
@Accessors(chain = true)
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Desc("Represents an enchantment & level")
@Data
public class IrisEnchantment
{
@Builder.Default
@Required
@DontObfuscate
@Desc("The enchantment")
private String enchantment = "";
@Builder.Default
@MinNumber(1)
@DontObfuscate
@Desc("Minimum amount of this loot")
private int minLevel = 1;
@Builder.Default
@MinNumber(1)
@DontObfuscate
@Desc("Maximum amount of this loot")
private int maxLevel = 1;
@Builder.Default
@MinNumber(0)
@MaxNumber(1)
@DontObfuscate
@Desc("The chance that this enchantment is applied (0 to 1)")
private double chance = 1;
public IrisEnchantment()
{
}
public void apply(RNG rng, ItemMeta meta)
{
try

View File

@ -27,14 +27,13 @@ import com.volmit.iris.util.RNG;
import com.volmit.iris.util.Required;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
@Accessors(chain = true)
@Builder
@NoArgsConstructor
@AllArgsConstructor
@DontObfuscate
@Desc("Represents an iris entity.")
@ -42,119 +41,94 @@ import lombok.experimental.Accessors;
@EqualsAndHashCode(callSuper = false)
public class IrisEntity extends IrisRegistrant
{
@Builder.Default
@Required
@DontObfuscate
@Desc("The type of entity to spawn")
private EntityType type = EntityType.PIG;
@Builder.Default
@DontObfuscate
@Desc("The custom name of this entity")
private String customName = "";
@Builder.Default
@DontObfuscate
@Desc("Should the name on this entity be visible even if you arent looking at it.")
private boolean customNameVisible = false;
@Builder.Default
@DontObfuscate
@Desc("If this entity type is a mob, should it be aware of it's surroundings & interact with the world.")
private boolean aware = true;
@Builder.Default
@DontObfuscate
@Desc("If this entity type is a creature, should it have ai goals.")
private boolean ai = true;
@Builder.Default
@DontObfuscate
@Desc("Should this entity be glowing")
private boolean glowing = false;
@Builder.Default
@DontObfuscate
@Desc("Should gravity apply to this entity")
private boolean gravity = true;
@Builder.Default
@DontObfuscate
@Desc("When an entity is invulnerable it can only be damaged by players increative mode.")
private boolean invulnerable = false;
@Builder.Default
@DontObfuscate
@Desc("When an entity is silent it will not produce any sound.")
private boolean silent = false;
@Builder.Default
@DontObfuscate
@Desc("Should this entity be allowed to pickup items")
private boolean pickupItems = false;
@Builder.Default
@DontObfuscate
@Desc("Should this entity be removed when far away")
private boolean removable = true;
@Builder.Default
@DontObfuscate
@Desc("Entity helmet equipment")
private IrisLoot helmet = null;
@Builder.Default
@DontObfuscate
@Desc("Entity chestplate equipment")
private IrisLoot chestplate = null;
@Builder.Default
@DontObfuscate
@Desc("Entity boots equipment")
private IrisLoot boots = null;
@Builder.Default
@DontObfuscate
@Desc("Entity leggings equipment")
private IrisLoot leggings = null;
@Builder.Default
@DontObfuscate
@Desc("Entity main hand equipment")
private IrisLoot mainHand = null;
@Builder.Default
@DontObfuscate
@Desc("Entity off hand equipment")
private IrisLoot offHand = null;
@Builder.Default
@DontObfuscate
@Desc("Make other entities ride this entity")
@ArrayType(min = 1, type = IrisEntity.class)
private KList<IrisEntity> passengers = new KList<>();
@Builder.Default
@DontObfuscate
@Desc("Attribute modifiers for this entity")
@ArrayType(min = 1, type = IrisAttributeModifier.class)
private KList<IrisAttributeModifier> attributes = new KList<>();
@Builder.Default
@DontObfuscate
@Desc("Loot tables for drops")
private IrisLootReference loot = new IrisLootReference();
@Builder.Default
@DontObfuscate
@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 IrisEntity leashHolder = null;
public IrisEntity()
{
}
public Entity spawn(ParallaxTerrainProvider gen, Location at)
{
return spawn(gen, at, new RNG(at.hashCode()));

View File

@ -14,38 +14,34 @@ import com.volmit.iris.util.RegistryListEntity;
import com.volmit.iris.util.Required;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
@Accessors(chain = true)
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Desc("Represents an entity spawn during initial chunk generation")
@Data
public class IrisEntityInitialSpawn
{
@Builder.Default
@RegistryListEntity
@Required
@DontObfuscate
@Desc("The entity")
private String entity = "";
@Builder.Default
@MinNumber(1)
@DontObfuscate
@Desc("The 1 in RARITY chance for this entity to spawn")
private int rarity = 1;
@Builder.Default
@MinNumber(1)
@DontObfuscate
@Desc("The minumum of this entity to spawn")
private int minSpawns = 1;
@Builder.Default
@MinNumber(1)
@DontObfuscate
@Desc("The max of this entity to spawn")
@ -54,11 +50,6 @@ public class IrisEntityInitialSpawn
private final transient AtomicCache<RNG> rng = new AtomicCache<>();
private final transient AtomicCache<IrisEntity> ent = new AtomicCache<>();
public IrisEntityInitialSpawn()
{
}
public void spawn(ParallaxTerrainProvider gen, Chunk c, RNG rng)
{
int spawns = rng.i(1, rarity) == 1 ? rng.i(minSpawns, maxSpawns) : 0;

View File

@ -15,37 +15,36 @@ import com.volmit.iris.util.RegistryListEntity;
import com.volmit.iris.util.Required;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
@Accessors(chain = true)
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Desc("Represents an entity spawn")
@Data
public class IrisEntitySpawnOverride
{
@Builder.Default
@RegistryListEntity
@Required
@DontObfuscate
@Desc("The entity")
private String entity = "";
@Builder.Default
@Required
@DontObfuscate
@Desc("If the following entity type spawns, spawn this entity. Set to unknown for any entity spawn")
private EntityType trigger = EntityType.UNKNOWN;
@Builder.Default
@DontObfuscate
@Desc("If the source is triggered, cancel spawning the original entity instead of ADDING a new entity.")
private boolean cancelSourceSpawn = false;
@Builder.Default
@MinNumber(1)
@DontObfuscate
@Desc("The 1 in RARITY chance for this entity to spawn")
@ -54,10 +53,6 @@ public class IrisEntitySpawnOverride
private final transient AtomicCache<RNG> rng = new AtomicCache<>();
private final transient AtomicCache<IrisEntity> ent = new AtomicCache<>();
public IrisEntitySpawnOverride()
{
}
public Entity on(IrisTerrainProvider g, Location at, EntityType t, EntitySpawnEvent ee)
{

View File

@ -17,110 +17,91 @@ import com.volmit.iris.util.RNG;
import com.volmit.iris.util.Required;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
@Accessors(chain = true)
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Desc("Represents a composite generator of noise gens")
@Data
@EqualsAndHashCode(callSuper = false)
public class IrisGenerator extends IrisRegistrant
{
@Builder.Default
@MinNumber(0.001)
@DontObfuscate
@Desc("The zoom or frequency.")
private double zoom = 1;
@Builder.Default
@MinNumber(0)
@DontObfuscate
@Desc("The opacity, essentially a multiplier on the output.")
private double opacity = 1;
@Builder.Default
@MinNumber(0.001)
@DontObfuscate
@Desc("The size of the cell fractures")
private double cellFractureZoom = 1D;
@Builder.Default
@MinNumber(0)
@DontObfuscate
@Desc("Cell Fracture Coordinate Shuffling")
private double cellFractureShuffle = 12D;
@Builder.Default
@DontObfuscate
@Desc("The height of fracture cells. Set to 0 to disable")
private double cellFractureHeight = 0D;
@Builder.Default
@MinNumber(0)
@MaxNumber(1)
@DontObfuscate
@Desc("How big are the cells (X,Z) relative to the veins that touch them. Between 0 and 1. 0.1 means thick veins, small cells.")
private double cellPercentSize = 0.75D;
@Builder.Default
@DontObfuscate
@Desc("The offset to shift this noise x")
private double offsetX = 0;
@Builder.Default
@DontObfuscate
@Desc("The offset to shift this noise z")
private double offsetZ = 0;
@Builder.Default
@Required
@DontObfuscate
@Desc("The seed for this generator")
private long seed = 1;
@Builder.Default
@Required
@DontObfuscate
@Desc("The interpolator to use when smoothing this generator into other regions & generators")
private IrisInterpolator interpolator = new IrisInterpolator();
@Builder.Default
@MinNumber(0)
@MaxNumber(8192)
@DontObfuscate
@Desc("Cliff Height Max. Disable with 0 for min and max")
private double cliffHeightMax = 0;
@Builder.Default
@MinNumber(0)
@MaxNumber(8192)
@DontObfuscate
@Desc("Cliff Height Min. Disable with 0 for min and max")
private double cliffHeightMin = 0;
@Builder.Default
@ArrayType(min = 1, type = IrisNoiseGenerator.class)
@DontObfuscate
@Desc("The list of noise gens this gen contains.")
private KList<IrisNoiseGenerator> composite = new KList<IrisNoiseGenerator>();
@Builder.Default
@DontObfuscate
@Desc("The noise gen for cliff height.")
private IrisNoiseGenerator cliffHeightGenerator = new IrisNoiseGenerator();
private final transient AtomicCache<CellGenerator> cellGen = new AtomicCache<>();
public IrisGenerator()
{
}
public double getMax()
{
return opacity;

View File

@ -10,42 +10,37 @@ import com.volmit.iris.util.RNG;
import com.volmit.iris.util.Required;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
@Accessors(chain = true)
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Desc("A gen style")
@Data
public class IrisGeneratorStyle
{
@Builder.Default
@Required
@DontObfuscate
@Desc("The chance is 1 in CHANCE per interval")
private NoiseStyle style = NoiseStyle.IRIS;
@Builder.Default
@DontObfuscate
@MinNumber(0.00001)
@Desc("The zoom of this style")
private double zoom = 1;
@Builder.Default
@DontObfuscate
@MinNumber(0.00001)
@Desc("The Output multiplier. Only used if parent is fracture.")
private double multiplier = 1;
@Builder.Default
@DontObfuscate
@Desc("Apply a generator to the coordinate field fed into this parent generator. I.e. Distort your generator with another generator.")
private IrisGeneratorStyle fracture = null;
@Builder.Default
@DontObfuscate
@MinNumber(0.01562)
@MaxNumber(64)
@ -54,11 +49,6 @@ public class IrisGeneratorStyle
private final transient AtomicCache<CNG> cng = new AtomicCache<CNG>();
public IrisGeneratorStyle()
{
}
public IrisGeneratorStyle(NoiseStyle s)
{
this.style = s;
@ -69,7 +59,7 @@ public class IrisGeneratorStyle
this.zoom = z;
return this;
}
public CNG create(RNG rng)
{
return cng.aquire(() ->

View File

@ -9,25 +9,23 @@ import com.volmit.iris.util.NoiseProvider;
import com.volmit.iris.util.Required;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
@Accessors(chain = true)
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Desc("Configures rotation for iris")
@Data
public class IrisInterpolator
{
@Builder.Default
@Required
@DontObfuscate
@Desc("The interpolation method when two biomes use different heights but this same generator")
private InterpolationMethod function = InterpolationMethod.BICUBIC;
@Builder.Default
@Required
@MinNumber(1)
@MaxNumber(8192)
@ -35,11 +33,6 @@ public class IrisInterpolator
@Desc("The range checked horizontally. Smaller ranges yeild more detail but are not as smooth.")
private double horizontalScale = 3;
public IrisInterpolator()
{
}
public double interpolate(double x, double z, NoiseProvider provider)
{
return interpolate((int) Math.round(x), (int) Math.round(z), provider);

View File

@ -27,118 +27,97 @@ import com.volmit.iris.util.RNG;
import com.volmit.iris.util.Required;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
@Accessors(chain = true)
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Desc("Represents a loot entry")
@Data
public class IrisLoot
{
@Builder.Default
@DontObfuscate
@Desc("The target inventory slot types to fill this loot with")
private InventorySlotType slotTypes = InventorySlotType.STORAGE;
@Builder.Default
@MinNumber(1)
@DontObfuscate
@Desc("The sub rarity of this loot. Calculated after this loot table has been picked.")
private int rarity = 1;
@Builder.Default
@MinNumber(1)
@DontObfuscate
@Desc("Minimum amount of this loot")
private int minAmount = 1;
@Builder.Default
@MinNumber(1)
@DontObfuscate
@Desc("Maximum amount of this loot")
private int maxAmount = 1;
@Builder.Default
@MinNumber(1)
@DontObfuscate
@Desc("The display name of this item")
private String displayName = null;
@Builder.Default
@MinNumber(0)
@MaxNumber(1)
@DontObfuscate
@Desc("Minimum durability percent")
private double minDurability = 0;
@Builder.Default
@MinNumber(0)
@MaxNumber(1)
@DontObfuscate
@Desc("Maximum durability percent")
private double maxDurability = 1;
@Builder.Default
@DontObfuscate
@Desc("Define a custom model identifier 1.14+ only")
private Integer customModel = null;
@Builder.Default
@DontObfuscate
@Desc("Set this to true to prevent it from being broken")
private boolean unbreakable = false;
@Builder.Default
@ArrayType(min = 1, type = ItemFlag.class)
@DontObfuscate
@Desc("The item flags to add")
private KList<ItemFlag> itemFlags = new KList<>();
@Builder.Default
@DontObfuscate
@Desc("Apply enchantments to this item")
@ArrayType(min = 1, type = IrisEnchantment.class)
private KList<IrisEnchantment> enchantments = new KList<>();
@Builder.Default
@DontObfuscate
@Desc("Apply attribute modifiers to this item")
@ArrayType(min = 1, type = IrisAttributeModifier.class)
private KList<IrisAttributeModifier> attributes = new KList<>();
@Builder.Default
@ArrayType(min = 1, type = String.class)
@DontObfuscate
@Desc("Add lore to this item")
private KList<String> lore = new KList<>();
@Builder.Default
@Required
@DontObfuscate
@Desc("This is the item or block type. Does not accept minecraft:*. Only materials such as DIAMOND_SWORD or DIRT.")
private String type = "";
@Builder.Default
@DontObfuscate
@Desc("The dye color")
private DyeColor dyeColor = null;
@Builder.Default
@DontObfuscate
@Desc("The leather armor color")
private String leatherColor = null;
private final transient AtomicCache<CNG> chance = new AtomicCache<>();
public IrisLoot()
{
}
public Material getType()
{
return B.getMaterial(type);

View File

@ -10,31 +10,28 @@ import com.volmit.iris.util.MinNumber;
import com.volmit.iris.util.RegistryListLoot;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
@Accessors(chain = true)
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Desc("Represents a loot entry")
@Data
public class IrisLootReference
{
@Builder.Default
@DontObfuscate
@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 LootMode mode = LootMode.ADD;
@Builder.Default
@DontObfuscate
@RegistryListLoot
@ArrayType(min = 1, type = String.class)
@Desc("Add loot table registries here")
private KList<String> tables = new KList<>();
@Builder.Default
@MinNumber(0)
@DontObfuscate
@Desc("Increase the chance of loot in this area")
@ -42,11 +39,6 @@ public class IrisLootReference
private final transient AtomicCache<KList<IrisLootTable>> tt = new AtomicCache<>();
public IrisLootReference()
{
}
public KList<IrisLootTable> getLootTables(DimensionalTerrainProvider g)
{
return tt.aquire(() ->

View File

@ -11,14 +11,13 @@ import com.volmit.iris.util.RNG;
import com.volmit.iris.util.Required;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
@Accessors(chain = true)
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Desc("Represents a loot table. Biomes, Regions & Objects can add or replace the virtual table with these loot tables")
@Data
@ -26,35 +25,27 @@ import lombok.experimental.Accessors;
public class IrisLootTable extends IrisRegistrant
{
@Required
@Builder.Default
@Desc("The name of this loot table")
@DontObfuscate
@MinNumber(2)
private String name = "";
@Builder.Default
@MinNumber(1)
@DontObfuscate
@Desc("The rarity as in 1 in X chance")
private int rarity = 1;
@Builder.Default
@MinNumber(1)
@DontObfuscate
@Desc("The maximum amount of loot that can be picked in this table at a time.")
private int maxPicked = 3;
@Builder.Default
@DontObfuscate
@Desc("The loot in this table")
@ArrayType(min = 1, type = IrisLoot.class)
private KList<IrisLoot> loot = new KList<>();
public IrisLootTable()
{
}
public KList<ItemStack> getLoot(boolean debug, RNG rng, InventorySlotType slot, int x, int y, int z, int gg, int ffs)
{
KList<ItemStack> lootf = new KList<>();

View File

@ -14,30 +14,27 @@ import com.volmit.iris.util.RNG;
import com.volmit.iris.util.Required;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
@Accessors(chain = true)
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Desc("A palette of materials")
@Data
public class IrisMaterialPalette
{
@Builder.Default
@DontObfuscate
@Desc("The style of noise")
private IrisGeneratorStyle style = NoiseStyle.STATIC.style();
@Builder.Default
@MinNumber(0.0001)
@DontObfuscate
@Desc("The terrain zoom mostly for zooming in on a wispy palette")
private double zoom = 5;
@Builder.Default
@Required
@ArrayType(min = 1, type = String.class)
@DontObfuscate
@ -48,11 +45,6 @@ public class IrisMaterialPalette
private final transient AtomicCache<CNG> layerGenerator = new AtomicCache<>();
private final transient AtomicCache<CNG> heightGenerator = new AtomicCache<>();
public IrisMaterialPalette()
{
}
public BlockData get(RNG rng, double x, double y, double z)
{
if(getBlockData().isEmpty())

View File

@ -12,94 +12,79 @@ import com.volmit.iris.util.RNG;
import com.volmit.iris.util.Required;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
@Accessors(chain = true)
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Desc("A noise generator")
@Data
public class IrisNoiseGenerator
{
@Builder.Default
@MinNumber(0.0001)
@DontObfuscate
@Desc("The coordinate input zoom")
private double zoom = 1;
@Builder.Default
@DontObfuscate
@Desc("Reverse the output. So that noise = -noise + opacity")
private boolean negative = false;
@Builder.Default
@MinNumber(0)
@DontObfuscate
@Desc("The output multiplier")
private double opacity = 1;
@Builder.Default
@DontObfuscate
@Desc("Coordinate offset x")
private double offsetX = 0;
@Builder.Default
@DontObfuscate
@Desc("Height output offset y")
private double offsetY = 0;
@Builder.Default
@DontObfuscate
@Desc("Coordinate offset z")
private double offsetZ = 0;
@Builder.Default
@Required
@DontObfuscate
@Desc("The seed")
private long seed = 0;
@Builder.Default
@DontObfuscate
@Desc("Apply a parametric curve on the output")
private boolean parametric = false;
@Builder.Default
@DontObfuscate
@Desc("Apply a bezier curve on the output")
private boolean bezier = false;
@Builder.Default
@DontObfuscate
@Desc("Apply a sin-center curve on the output (0, and 1 = 0 and 0.5 = 1.0 using a sinoid shape.)")
private boolean sinCentered = false;
@Builder.Default
@DontObfuscate
@Desc("The exponent noise^EXPONENT")
private double exponent = 1;
@Builder.Default
@DontObfuscate
@Desc("Enable / disable. Outputs offsetY if disabled")
private boolean enabled = true;
@Builder.Default
@Required
@DontObfuscate
@Desc("The Noise Style")
private IrisGeneratorStyle style = NoiseStyle.IRIS.style();
@Builder.Default
@MinNumber(1)
@DontObfuscate
@Desc("Multiple octaves for multple generators of changing zooms added together")
private int octaves = 1;
@Builder.Default
@ArrayType(min = 1, type = IrisNoiseGenerator.class)
@DontObfuscate
@Desc("Apply a child noise generator to fracture the input coordinates of this generator")
@ -107,11 +92,6 @@ public class IrisNoiseGenerator
private final transient AtomicCache<CNG> generator = new AtomicCache<>();
public IrisNoiseGenerator()
{
}
public IrisNoiseGenerator(boolean enabled)
{
this();

View File

@ -6,37 +6,30 @@ import com.volmit.iris.util.MaxNumber;
import com.volmit.iris.util.MinNumber;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
@Accessors(chain = true)
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Desc("Translate objects")
@Data
public class IrisObjectLimit
{
@Builder.Default
@MinNumber(0)
@MaxNumber(255)
@DontObfuscate
@Desc("The minimum height for placement (bottom of object)")
private int minimumHeight = 0;
@Builder.Default
@MinNumber(0)
@MaxNumber(255)
@DontObfuscate
@Desc("The maximum height for placement (top of object)")
private int maximumHeight = 255;
public IrisObjectLimit()
{
}
public boolean canPlace(int h, int l)
{
if(h > maximumHeight || l < minimumHeight)

View File

@ -15,19 +15,18 @@ import com.volmit.iris.util.RegistryListObject;
import com.volmit.iris.util.Required;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
@Accessors(chain = true)
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Desc("Represents an iris object placer. It places objects.")
@Data
public class IrisObjectPlacement
{
@Builder.Default
@RegistryListObject
@Required
@ArrayType(min = 1, type = String.class)
@ -35,45 +34,37 @@ public class IrisObjectPlacement
@Desc("List of objects to place")
private KList<String> place = new KList<>();
@Builder.Default
@DontObfuscate
@Desc("If the place mode is set to CENTER_HEIGHT_RIGID and you have an X/Z translation, Turning on translate center will also translate the center height check.")
private boolean translateCenter = false;
@Builder.Default
@DontObfuscate
@Desc("The placement mode")
private ObjectPlaceMode mode = ObjectPlaceMode.CENTER_HEIGHT;
@Builder.Default
@ArrayType(min = 1, type = IrisObjectReplace.class)
@DontObfuscate
@Desc("Find and replace blocks")
private KList<IrisObjectReplace> edit = new KList<>();
@Builder.Default
@DontObfuscate
@Desc("Translate this object's placement")
private IrisObjectTranslate translate = new IrisObjectTranslate();
@Builder.Default
@DontObfuscate
@Desc("Rotate this objects placement")
private IrisObjectRotation rotation = new IrisObjectRotation();
@Builder.Default
@DontObfuscate
@Desc("Limit the max height or min height of placement.")
private IrisObjectLimit clamp = new IrisObjectLimit();
@Builder.Default
@MinNumber(0)
@MaxNumber(1)
@DontObfuscate
@Desc("The maximum layer level of a snow filter overtop of this placement. Set to 0 to disable. Max of 1.")
private double snow = 0;
@Builder.Default
@Required
@MinNumber(0)
@MaxNumber(1)
@ -81,80 +72,63 @@ public class IrisObjectPlacement
@Desc("The chance for this to place in a chunk. If you need multiple per chunk, set this to 1 and use density.")
private double chance = 1;
@Builder.Default
@MinNumber(1)
@DontObfuscate
@Desc("If the chance check passes, place this many in a single chunk")
private int density = 1;
@Builder.Default
@MaxNumber(64)
@MinNumber(0)
@DontObfuscate
@Desc("If the place mode is set to stilt, you can over-stilt it even further into the ground. Especially useful when using fast stilt due to inaccuracies.")
private int overStilt = 0;
@Builder.Default
@MaxNumber(64)
@MinNumber(0)
@DontObfuscate
@Desc("When boar is enabled, expand max-y of the cuboid it removes")
private int boarExtendMaxY = 0;
@Builder.Default
@MaxNumber(64)
@MinNumber(0)
@DontObfuscate
@Desc("When boar is enabled, lower min-y of the cuboid it removes")
private int boarExtendMinY = 0;
@Builder.Default
@DontObfuscate
@Desc("If set to true, objects will place on the terrain height, ignoring the water surface.")
private boolean underwater = false;
@Builder.Default
@DontObfuscate
@Desc("If set to true, Iris will try to fill the insides of 'rooms' and 'pockets' where air should fit based off of raytrace checks. This prevents a village house placing in an area where a tree already exists, and instead replaces the parts of the tree where the interior of the structure is. \n\nThis operation does not affect warmed-up generation speed however it does slow down loading objects.")
private boolean smartBore = false;
@Builder.Default
@DontObfuscate
@Desc("If set to true, Blocks placed underwater that could be waterlogged are waterlogged.")
private boolean waterloggable = true;
@Builder.Default
@DontObfuscate
@Desc("If set to true, objects will place on the fluid height level Such as boats.")
private boolean onwater = false;
@Builder.Default
@DontObfuscate
@Desc("If set to true, this object will only place parts of itself where blocks already exist. Warning: Melding is very performance intensive!")
private boolean meld = false;
@Builder.Default
@DontObfuscate
@Desc("If set to true, this object will place from the ground up instead of height checks when not y locked to the surface. This is not compatable with X and Z axis rotations (it may look off)")
private boolean bottom = false;
@Builder.Default
@DontObfuscate
@Desc("If set to true, air will be placed before the schematic places.")
private boolean bore = false;
@Builder.Default
@DontObfuscate
@Desc("Use a generator to warp the field of coordinates. Using simplex for example would make a square placement warp like a flag")
private IrisGeneratorStyle warp = new IrisGeneratorStyle(NoiseStyle.FLAT);
private final transient AtomicCache<CNG> surfaceWarp = new AtomicCache<>();
public IrisObjectPlacement()
{
}
public CNG getSurfaceWarp(RNG rng)
{
return surfaceWarp.aquire(() ->

View File

@ -13,33 +13,32 @@ import com.volmit.iris.util.RNG;
import com.volmit.iris.util.Required;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
@Accessors(chain = true)
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Desc("Find and replace object materials")
@Data
public class IrisObjectReplace
{
@Builder.Default
@ArrayType(min = 1, type = String.class)
@Required
@Desc("Find this block")
@DontObfuscate
private KList<String> find = new KList<>();
@Builder.Default
@ArrayType(min = 1, type = String.class)
@Required
@Desc("Replace it with this block")
@DontObfuscate
private KList<String> replace = new KList<>();
@Builder.Default
@Desc("Exactly match the block data or not")
@DontObfuscate
private boolean exact = false;
@ -48,11 +47,6 @@ public class IrisObjectReplace
private final transient AtomicCache<KList<BlockData>> findData = new AtomicCache<>();
private final transient AtomicCache<KList<BlockData>> replaceData = new AtomicCache<>();
public IrisObjectReplace()
{
}
public KList<BlockData> getFind()
{
return findData.aquire(() -> B.getBlockData(find));

View File

@ -14,43 +14,34 @@ import com.volmit.iris.util.DontObfuscate;
import com.volmit.iris.util.KList;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
@Accessors(chain = true)
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Desc("Configures rotation for iris")
@Data
public class IrisObjectRotation
{
@Builder.Default
@DontObfuscate
@Desc("If this rotator is enabled or not")
private boolean enabled = true;
@Builder.Default
@DontObfuscate
@Desc("The x axis rotation")
private IrisAxisRotationClamp xAxis = new IrisAxisRotationClamp();
@Builder.Default
@DontObfuscate
@Desc("The y axis rotation")
private IrisAxisRotationClamp yAxis = new IrisAxisRotationClamp(true, 0, 0, 90);
@Builder.Default
@DontObfuscate
@Desc("The z axis rotation")
private IrisAxisRotationClamp zAxis = new IrisAxisRotationClamp();
public IrisObjectRotation()
{
}
public double getYRotation(int spin)
{
return getRotation(spin, yAxis);

View File

@ -9,26 +9,24 @@ import com.volmit.iris.util.MinNumber;
import com.volmit.iris.util.Required;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
@Accessors(chain = true)
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Desc("Translate objects")
@Data
public class IrisObjectTranslate
{
@Builder.Default
@MinNumber(-128)
@MaxNumber(128)
@DontObfuscate
@Desc("The x shift in blocks")
private int x = 0;
@Builder.Default
@Required
@MinNumber(-256)
@MaxNumber(256)
@ -36,27 +34,18 @@ public class IrisObjectTranslate
@Desc("The x shift in blocks")
private int y = 0;
@Builder.Default
@MinNumber(-128)
@MaxNumber(128)
@DontObfuscate
@Desc("Adds an additional amount of height randomly (translateY + rand(0 - yRandom))")
private int yRandom = 0;
@Builder.Default
@MinNumber(-128)
@MaxNumber(128)
@DontObfuscate
@Desc("The x shift in blocks")
private int z = 0;
public IrisObjectTranslate()
{
x = 0;
y = 0;
z = 0;
}
public boolean canTranslate()
{
return x != 0 || y != 0 || z != 0;

View File

@ -13,26 +13,24 @@ import com.volmit.iris.util.MinNumber;
import com.volmit.iris.util.Required;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
@Accessors(chain = true)
@Builder
@NoArgsConstructor
@AllArgsConstructor
@DontObfuscate
@Desc("An iris potion effect")
@Data
public class IrisPotionEffect
{
@Builder.Default
@Required
@DontObfuscate
@Desc("The potion effect to apply in this area")
private String potionEffect = "";
@Builder.Default
@Required
@MinNumber(-1)
@MaxNumber(1024)
@ -40,30 +38,22 @@ public class IrisPotionEffect
@Desc("The Potion Strength or -1 to disable")
private int strength = -1;
@Builder.Default
@Required
@MinNumber(1)
@DontObfuscate
@Desc("The time the potion will last for")
private int ticks = 200;
@Builder.Default
@DontObfuscate
@Desc("Is the effect ambient")
private boolean ambient = false;
@Builder.Default
@DontObfuscate
@Desc("Is the effect showing particles")
private boolean particles = true;
private final transient AtomicCache<PotionEffectType> pt = new AtomicCache<>();
public IrisPotionEffect()
{
}
public PotionEffectType getRealType()
{
return pt.aquire(() ->

View File

@ -7,14 +7,13 @@ import com.volmit.iris.util.RegistryListObject;
import com.volmit.iris.util.Required;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
@Accessors(chain = true)
@Builder
@NoArgsConstructor
@AllArgsConstructor
@DontObfuscate
@Desc("Represents a structure tile")
@ -22,22 +21,16 @@ import lombok.experimental.Accessors;
@EqualsAndHashCode(callSuper = false)
public class IrisRareObject
{
@Builder.Default
@Required
@MinNumber(1)
@Desc("The rarity is 1 in X")
@DontObfuscate
private int rarity = 1;
@Builder.Default
@RegistryListObject
@Required
@Desc("The object to place if rarity check passed")
@DontObfuscate
private String object = "";
public IrisRareObject()
{
}
}

View File

@ -6,61 +6,49 @@ import com.volmit.iris.util.MinNumber;
import com.volmit.iris.util.Required;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
@Accessors(chain = true)
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Desc("Represents a carving that slices through the surface")
@Data
public class IrisRavineLayer
{
@Builder.Default
@Required
@DontObfuscate
@Desc("The vertical slope this cave layer follows typically you would set both the min and max values to negative values so the ravine is always under the surface.")
private IrisShapedGeneratorStyle verticalSlope = IrisShapedGeneratorStyle.builder().generator(new IrisGeneratorStyle(NoiseStyle.IRIS_THICK)).min(-19).max(-11).build();
private IrisShapedGeneratorStyle verticalSlope = new IrisShapedGeneratorStyle(new IrisGeneratorStyle(NoiseStyle.IRIS_THICK), -19, -11);
@Builder.Default
@Required
@DontObfuscate
@Desc("The horizontal slope this cave layer follows. This affects if the ravine is straight or curves or even whirls around")
private IrisShapedGeneratorStyle horizontalSlope = IrisShapedGeneratorStyle.builder().generator(new IrisGeneratorStyle(NoiseStyle.IRIS)).min(-30).max(30).build();
private IrisShapedGeneratorStyle horizontalSlope = new IrisShapedGeneratorStyle(new IrisGeneratorStyle(NoiseStyle.IRIS), -30, 30);
@Builder.Default
@DontObfuscate
@Desc("If defined, a cave fluid will fill this cave below (or above) the specified fluidHeight in this object.")
private IrisCaveFluid fluid = new IrisCaveFluid();
@Builder.Default
@MinNumber(0.001)
@DontObfuscate
@Desc("The cave zoom. Higher values makes caves spread out further and branch less often, but are thicker.")
private double caveZoom = 1D;
@Builder.Default
@MinNumber(0.001)
@DontObfuscate
@Desc("The ravine thickness.")
private double ravineThickness = 1D;
@Builder.Default
@MinNumber(1)
@DontObfuscate
@Desc("The ravine rarity as 1 in rarity chance.")
private int rarity = 12;
@Builder.Default
@MinNumber(0.001)
@DontObfuscate
@Desc("The ravine rarity zoom is how large of a check area at a time iris will do. For example, with higher zooms ravines will have the same effective rarity, but when you actually find a ravine, it will be near a whole patch of ravines. Setting a lower zoom such as 0.25 will make the check density higher resulting in a more uniform distribution of ravines. A zoom that is too small may also reduce the ravine sizes.")
private double rarityZoom = 1;
public IrisRavineLayer()
{
}
}

View File

@ -18,150 +18,128 @@ import com.volmit.iris.util.RegistryListBiome;
import com.volmit.iris.util.Required;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
@Accessors(chain = true)
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Desc("Represents an iris region")
@Data
@EqualsAndHashCode(callSuper = false)
public class IrisRegion extends IrisRegistrant implements IRare
{
@Builder.Default
@MinNumber(2)
@Required
@DontObfuscate
@Desc("The name of the region")
private String name = "A Region";
@Builder.Default
@ArrayType(min = 1, type = IrisEffect.class)
@DontObfuscate
@Desc("Effects are ambient effects such as potion effects, random sounds, or even particles around each player. All of these effects are played via packets so two players won't see/hear each others effects.\nDue to performance reasons, effects will play arround the player even if where the effect was played is no longer in the biome the player is in.")
private KList<IrisEffect> effects = new KList<>();
@Builder.Default
@DontObfuscate
@Desc("Entity spawns to override or add to this region")
@ArrayType(min = 1, type = IrisEntitySpawnOverride.class)
private KList<IrisEntitySpawnOverride> entitySpawnOverrides = new KList<>();
@Builder.Default
@DontObfuscate
@Desc("Entity spawns during generation")
@ArrayType(min = 1, type = IrisEntityInitialSpawn.class)
private KList<IrisEntityInitialSpawn> entityInitialSpawns = new KList<>();
@Builder.Default
@MinNumber(1)
@MaxNumber(256)
@DontObfuscate
@Desc("The rarity of the region")
private int rarity = 1;
@Builder.Default
@DontObfuscate
@Desc("Place text on terrain")
@ArrayType(min = 1, type = IrisTextPlacement.class)
private KList<IrisTextPlacement> text = new KList<>();
@Builder.Default
@ArrayType(min = 1, type = IrisBlockDrops.class)
@DontObfuscate
@Desc("Define custom block drops for this region")
private KList<IrisBlockDrops> blockDrops = new KList<>();
@Builder.Default
@MinNumber(0.0001)
@MaxNumber(1)
@DontObfuscate
@Desc("The shore ration (How much percent of land should be a shore)")
private double shoreRatio = 0.13;
@Builder.Default
@ArrayType(min = 1, type = IrisObjectPlacement.class)
@DontObfuscate
@Desc("Objects define what schematics (iob files) iris will place in this region")
private KList<IrisObjectPlacement> objects = new KList<IrisObjectPlacement>();
@Builder.Default
@MinNumber(0)
@DontObfuscate
@Desc("The min shore height")
private double shoreHeightMin = 1.2;
@Builder.Default
@DontObfuscate
@Desc("Reference loot tables in this area")
private IrisLootReference loot = new IrisLootReference();
@Builder.Default
@MinNumber(0)
@DontObfuscate
@Desc("The the max shore height")
private double shoreHeightMax = 3.2;
@Builder.Default
@MinNumber(0.0001)
@DontObfuscate
@Desc("The varience of the shore height")
private double shoreHeightZoom = 3.14;
@Builder.Default
@MinNumber(0.0001)
@DontObfuscate
@Desc("How large land biomes are in this region")
private double landBiomeZoom = 1;
@Builder.Default
@MinNumber(0.0001)
@DontObfuscate
@Desc("How large shore biomes are in this region")
private double shoreBiomeZoom = 1;
@Builder.Default
@MinNumber(0.0001)
@DontObfuscate
@Desc("How large lake biomes are in this region")
private double lakeBiomeZoom = 1;
@Builder.Default
@MinNumber(0.0001)
@DontObfuscate
@Desc("How large river biomes are in this region")
private double riverBiomeZoom = 1;
@Builder.Default
@MinNumber(0.0001)
@DontObfuscate
@Desc("How large sea biomes are in this region")
private double seaBiomeZoom = 1;
@Builder.Default
@MinNumber(0.0001)
@DontObfuscate
@Desc("How large cave biomes are in this region")
private double caveBiomeZoom = 1;
@Builder.Default
@MinNumber(0.0001)
@MaxNumber(1)
@DontObfuscate
@Desc("The biome implosion ratio, how much to implode biomes into children (chance)")
private double biomeImplosionRatio = 0.4;
@Builder.Default
@ArrayType(min = 1, type = IrisStructurePlacement.class)
@DontObfuscate
@Desc("A list of structure tilesets")
private KList<IrisStructurePlacement> structures = new KList<>();
@Builder.Default
@RegistryListBiome
@Required
@ArrayType(min = 1, type = String.class)
@ -169,7 +147,6 @@ public class IrisRegion extends IrisRegistrant implements IRare
@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<>();
@Builder.Default
@RegistryListBiome
@Required
@ArrayType(min = 1, type = String.class)
@ -177,7 +154,6 @@ public class IrisRegion extends IrisRegistrant implements IRare
@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<>();
@Builder.Default
@RegistryListBiome
@Required
@ArrayType(min = 1, type = String.class)
@ -185,82 +161,68 @@ public class IrisRegion extends IrisRegistrant implements IRare
@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<>();
@Builder.Default
@RegistryListBiome
@ArrayType(min = 1, type = String.class)
@DontObfuscate
@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<>();
@Builder.Default
@RegistryListBiome
@ArrayType(min = 1, type = String.class)
@DontObfuscate
@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<>();
@Builder.Default
@RegistryListBiome
@ArrayType(min = 1, type = String.class)
@DontObfuscate
@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<>();
@Builder.Default
@ArrayType(min = 1, type = IrisRegionRidge.class)
@DontObfuscate
@Desc("Ridge biomes create a vein-like network like rivers through this region")
private KList<IrisRegionRidge> ridgeBiomes = new KList<>();
@Builder.Default
@ArrayType(min = 1, type = IrisRegionSpot.class)
@DontObfuscate
@Desc("Spot biomes splotch themselves across this region like lakes")
private KList<IrisRegionSpot> spotBiomes = new KList<>();
@Builder.Default
@ArrayType(min = 1, type = IrisDepositGenerator.class)
@Desc("Define regional deposit generators that add onto the global deposit generators")
private KList<IrisDepositGenerator> deposits = new KList<>();
@Builder.Default
@DontObfuscate
@Desc("The style of rivers")
private IrisGeneratorStyle riverStyle = NoiseStyle.VASCULAR_THIN.style().zoomed(7.77);
@Builder.Default
@DontObfuscate
@Desc("The style of lakes")
private IrisGeneratorStyle lakeStyle = NoiseStyle.CELLULAR_IRIS_THICK.style();
@Builder.Default
@DontObfuscate
@Desc("The style of river chances")
private IrisGeneratorStyle riverChanceStyle = NoiseStyle.SIMPLEX.style().zoomed(4);
@Builder.Default
@DontObfuscate
@Desc("Generate lakes in this region")
private boolean lakes = true;
@Builder.Default
@DontObfuscate
@Desc("Generate rivers in this region")
private boolean rivers = true;
@Builder.Default
@MinNumber(1)
@DontObfuscate
@Desc("Generate lakes in this region")
private int lakeRarity = 22;
@Builder.Default
@MinNumber(1)
@DontObfuscate
@Desc("Generate rivers in this region")
private int riverRarity = 3;
@Builder.Default
@MinNumber(0)
@MaxNumber(1)
@DontObfuscate
@ -280,11 +242,6 @@ public class IrisRegion extends IrisRegistrant implements IRare
private final transient AtomicCache<CNG> riverGen = new AtomicCache<>();
private final transient AtomicCache<CNG> riverChanceGen = new AtomicCache<>();
public IrisRegion()
{
}
public boolean isRiver(RNG rng, double x, double z)
{
if(!isRivers())

View File

@ -11,42 +11,41 @@ import com.volmit.iris.util.RegistryListBiome;
import com.volmit.iris.util.Required;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
@Accessors(chain = true)
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Desc("A ridge config")
@Data
public class IrisRegionRidge
{
@Builder.Default
@RegistryListBiome
@Required
@DontObfuscate
@Desc("The biome name")
private String biome = "";
@Builder.Default
@Required
@DontObfuscate
@Desc("The type this biome should override (land sea or shore)")
private InferredType type = InferredType.LAND;
@Builder.Default
@DontObfuscate
@Desc("What type this spot is (i.e. target SEA but as LAND) like an island. Default matches the target type")
private InferredType as = InferredType.DEFER;
@Builder.Default
@DontObfuscate
@Desc("Use the distance from cell value to add or remove noise value. (Forces depth or height)")
private double noiseMultiplier = 0;
@Builder.Default
@Required
@MinNumber(0)
@MaxNumber(1)
@ -54,36 +53,36 @@ public class IrisRegionRidge
@Desc("The chance this biome will be placed in a given spot")
private double chance = 0.75;
@Builder.Default
@MinNumber(0)
@DontObfuscate
@Desc("The scale of the biome ridge. Higher values = wider veins & bigger connected cells")
private double scale = 5;
@Builder.Default
@DontObfuscate
@Desc("The chance scale (cell chances)")
private double chanceScale = 4;
@Builder.Default
@MinNumber(0)
@DontObfuscate
@Desc("The shuffle, how 'natural' this looks. Compared to pure polygons")
private double shuffle = 16;
@Builder.Default
@MinNumber(0)
@DontObfuscate
@Desc("The chance shuffle (polygon cell chances)")
private double chanceShuffle = 128;
@Builder.Default
@MinNumber(0)
@DontObfuscate
@Desc("The thickness of the vein")
private double thickness = 0.125;
@Builder.Default
@DontObfuscate
@Desc("If the noise multiplier is below zero, what should the air be filled with?")
private IrisBiomePaletteLayer air = new IrisBiomePaletteLayer().zero();
@ -91,10 +90,6 @@ public class IrisRegionRidge
private final transient AtomicCache<CellGenerator> spot = new AtomicCache<>();
private final transient AtomicCache<CellGenerator> ridge = new AtomicCache<>();
public IrisRegionRidge()
{
}
public CellGenerator getSpotGenerator(RNG rng)
{

View File

@ -10,72 +10,59 @@ import com.volmit.iris.util.RegistryListBiome;
import com.volmit.iris.util.Required;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
@Accessors(chain = true)
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Desc("A spot config")
@Data
public class IrisRegionSpot
{
@Builder.Default
@RegistryListBiome
@Required
@DontObfuscate
@Desc("The biome to be placed")
private String biome = "";
@Builder.Default
@Required
@DontObfuscate
@Desc("Where this spot overrides. Land sea or shore")
private InferredType type = InferredType.LAND;
@Builder.Default
@DontObfuscate
@Desc("What type this spot is (i.e. target SEA but as LAND) like an island. Default matches the target type")
private InferredType as = InferredType.DEFER;
@Builder.Default
@DontObfuscate
@Desc("Use the distance from cell value to add or remove noise value. (Forces depth or height)")
private double noiseMultiplier = 0;
@Builder.Default
@MinNumber(0)
@DontObfuscate
@Desc("The scale of splotches")
private double scale = 1;
@Builder.Default
@Required
@MinNumber(1)
@DontObfuscate
@Desc("Rarity is how often this splotch appears. higher = less often")
private double rarity = 1;
@Builder.Default
@MinNumber(0)
@DontObfuscate
@Desc("The shuffle or how natural the splotch looks like (anti-polygon)")
private double shuffle = 128;
@Builder.Default
@DontObfuscate
@Desc("If the noise multiplier is below zero, what should the air be filled with?")
private IrisBiomePaletteLayer air = new IrisBiomePaletteLayer().zero();
private final transient AtomicCache<CellGenerator> spot = new AtomicCache<>();
public IrisRegionSpot()
{
}
public CellGenerator getSpotGenerator(RNG rng)
{
return spot.aquire(() ->

View File

@ -8,13 +8,12 @@ import com.volmit.iris.util.RNG;
import com.volmit.iris.util.Required;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
@Accessors(chain = true)
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Desc("This represents a generator with a min and max height")
@Data
@ -23,13 +22,13 @@ public class IrisShapedGeneratorStyle
@Required
@DontObfuscate
@Desc("The generator id")
@Builder.Default
private IrisGeneratorStyle generator = new IrisGeneratorStyle(NoiseStyle.IRIS);
@Required
@MinNumber(-256)
@MaxNumber(256)
@Builder.Default
@DontObfuscate
@Desc("The min block value")
private int min = 0;
@ -37,7 +36,7 @@ public class IrisShapedGeneratorStyle
@Required
@MinNumber(-256)
@MaxNumber(256)
@Builder.Default
@DontObfuscate
@Desc("The max block value")
private int max = 0;
@ -58,9 +57,4 @@ public class IrisShapedGeneratorStyle
{
this.generator = new IrisGeneratorStyle(style);
}
public IrisShapedGeneratorStyle()
{
}
}

View File

@ -13,14 +13,13 @@ import com.volmit.iris.util.RNG;
import com.volmit.iris.util.Required;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
@Accessors(chain = true)
@Builder
@NoArgsConstructor
@AllArgsConstructor
@DontObfuscate
@Desc("Represents a structure in iris.")
@ -28,46 +27,39 @@ import lombok.experimental.Accessors;
@EqualsAndHashCode(callSuper = false)
public class IrisStructure extends IrisRegistrant
{
@Builder.Default
@MinNumber(2)
@Required
@DontObfuscate
@Desc("This is the human readable name for this structure. Such as Red Dungeon or Tropical Village.")
private String name = "A Structure Type";
@Builder.Default
@DontObfuscate
@Desc("Entity spawns to override or add to this structure")
@ArrayType(min = 1, type = IrisEntitySpawnOverride.class)
private KList<IrisEntitySpawnOverride> entitySpawnOverrides = new KList<>();
@Builder.Default
@DontObfuscate
@Desc("Entity spawns during generation")
@ArrayType(min = 1, type = IrisEntityInitialSpawn.class)
private KList<IrisEntityInitialSpawn> entityInitialSpawns = new KList<>();
@Builder.Default
@DontObfuscate
@Desc("Wall style noise")
private IrisGeneratorStyle wallStyle = NoiseStyle.STATIC.style();
@Builder.Default
@Desc("Setting underwater to true will waterlog blocks")
@DontObfuscate
private boolean underwater = false;
@Builder.Default
@Desc("The max & min height any part of this structure can place at")
@DontObfuscate
private IrisObjectLimit clamp = new IrisObjectLimit();
@Builder.Default
@Desc("Setting bore to true will dig out blocks before placing tiles")
@DontObfuscate
private boolean bore = false;
@Builder.Default
@Required
@MinNumber(3)
@MaxNumber(64)
@ -75,12 +67,10 @@ public class IrisStructure extends IrisRegistrant
@Desc("This is the x and z size of each grid cell")
private int gridSize = 11;
@Builder.Default
@DontObfuscate
@Desc("Reference loot tables in this area")
private IrisLootReference loot = new IrisLootReference();
@Builder.Default
@Required
@MinNumber(1)
@MaxNumber(255)
@ -88,14 +78,12 @@ public class IrisStructure extends IrisRegistrant
@Desc("This is the y size of each grid cell")
private int gridHeight = 5;
@Builder.Default
@MinNumber(1)
@MaxNumber(82)
@DontObfuscate
@Desc("This is the maximum layers iris will generate for (height cells)")
private int maxLayers = 1;
@Builder.Default
@Required
@MinNumber(0)
@MaxNumber(1)
@ -103,12 +91,10 @@ public class IrisStructure extends IrisRegistrant
@Desc("This is the wall chance. Higher values makes more rooms and less open halls")
private double wallChance = 0.25;
@Builder.Default
@DontObfuscate
@Desc("Edges of tiles replace each other instead of having their own.")
private boolean mergeEdges = false;
@Builder.Default
@Required
@ArrayType(min = 1, type = IrisStructureTile.class)
@DontObfuscate
@ -207,9 +193,4 @@ public class IrisStructure extends IrisRegistrant
return wallStyle.create(rngx).scale(0.8);
});
}
public IrisStructure()
{
}
}

View File

@ -16,54 +16,48 @@ import com.volmit.iris.util.RegistryListStructure;
import com.volmit.iris.util.Required;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
@Accessors(chain = true)
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Desc("Represents a structure placement")
@Data
public class IrisStructurePlacement
{
@Builder.Default
@RegistryListStructure
@Required
@DontObfuscate
@Desc("The structure tileset to use")
private String tileset = "";
@Builder.Default
@Required
@MinNumber(0.0001)
@DontObfuscate
@Desc("The structure chance zoom. Higher = bigger cells, further away")
private double zoom = 1D;
@Builder.Default
@MinNumber(-1)
@MaxNumber(1)
@DontObfuscate
@Desc("The ratio. Lower values means cells can get closer to other cells. Negative values means make veins of structures")
private double ratio = 0.25D;
@Builder.Default
@Required
@MinNumber(1)
@DontObfuscate
@Desc("The rarity for this structure")
private int rarity = 4;
@Builder.Default
@MinNumber(-1)
@MaxNumber(255)
@DontObfuscate
@Desc("The height or -1 for surface")
private int height = -1;
@Builder.Default
@MinNumber(0)
@DontObfuscate
@Desc("The chance cell shuffle (rougher edges)")
@ -73,11 +67,6 @@ public class IrisStructurePlacement
private final transient AtomicCache<IrisStructure> structure = new AtomicCache<>();
private final transient AtomicCache<IrisObjectPlacement> config = new AtomicCache<>();
public IrisStructurePlacement()
{
}
public void place(ParallaxTerrainProvider g, RNG rngno, int cx, int cz)
{
try

View File

@ -12,14 +12,13 @@ import com.volmit.iris.util.RegistryListObject;
import com.volmit.iris.util.Required;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
@Accessors(chain = true)
@Builder
@NoArgsConstructor
@AllArgsConstructor
@DontObfuscate
@Desc("Represents a structure tile")
@ -27,65 +26,55 @@ import lombok.experimental.Accessors;
@EqualsAndHashCode(callSuper = false)
public class IrisStructureTile
{
@Builder.Default
@DontObfuscate
@Desc("Reference loot tables in this area")
private IrisLootReference loot = new IrisLootReference();
@Builder.Default
@DontObfuscate
@Desc("Entity spawns to override or add to this structure tile")
@ArrayType(min = 1, type = IrisEntitySpawnOverride.class)
private KList<IrisEntitySpawnOverride> entitySpawnOverrides = new KList<>();
@Builder.Default
@DontObfuscate
@Desc("Entity spawns during generation")
@ArrayType(min = 1, type = IrisEntityInitialSpawn.class)
private KList<IrisEntityInitialSpawn> entityInitialSpawns = new KList<>();
@Builder.Default
@DontObfuscate
@Desc("The place mode for this tile")
private ObjectPlaceMode placeMode = ObjectPlaceMode.CENTER_HEIGHT;
@Builder.Default
@Required
@DontObfuscate
@Desc("Is this structure allowed to place if there is supposed to be a ceiling?")
private StructureTileCondition ceiling = StructureTileCondition.AGNOSTIC;
@Builder.Default
@Required
@DontObfuscate
@Desc("Is this structure allowed to place if there is supposed to be a floor?")
private StructureTileCondition floor = StructureTileCondition.REQUIRED;
@Builder.Default
@Required
@DontObfuscate
@Desc("Is this structure allowed to place if there is supposed to be a north wall?")
private StructureTileCondition north = StructureTileCondition.AGNOSTIC;
@Builder.Default
@Required
@DontObfuscate
@Desc("Is this structure allowed to place if there is supposed to be a south wall?")
private StructureTileCondition south = StructureTileCondition.AGNOSTIC;
@Builder.Default
@Required
@DontObfuscate
@Desc("Is this structure allowed to place if there is supposed to be a east wall?")
private StructureTileCondition east = StructureTileCondition.AGNOSTIC;
@Builder.Default
@Required
@DontObfuscate
@Desc("Is this structure allowed to place if there is supposed to be a west wall?")
private StructureTileCondition west = StructureTileCondition.AGNOSTIC;
@Builder.Default
@RegistryListObject
@Required
@ArrayType(min = 1, type = String.class)
@ -93,12 +82,10 @@ public class IrisStructureTile
@Desc("List of objects to place centered in this tile")
private KList<String> objects = new KList<>();
@Builder.Default
@DontObfuscate
@Desc("If set to true, Iris will try to fill the insides of 'rooms' and 'pockets' where air should fit based off of raytrace checks. This prevents a village house placing in an area where a tree already exists, and instead replaces the parts of the tree where the interior of the structure is. \n\nThis operation does not affect warmed-up generation speed however it does slow down loading objects.")
private boolean smartBore = false;
@Builder.Default
@RegistryListObject
@ArrayType(min = 1, type = IrisRareObject.class)
@DontObfuscate
@ -109,11 +96,6 @@ public class IrisStructureTile
private final transient AtomicCache<Integer> minFaces = new AtomicCache<>();
private final transient AtomicCache<Integer> maxFaces = new AtomicCache<>();
public IrisStructureTile()
{
}
public int hashFace()
{
return Objects.hash(ceiling, floor, south, north, east, west);
@ -126,23 +108,23 @@ public class IrisStructureTile
public boolean likeAGlove(boolean floor, boolean ceiling, KList<StructureTileFace> walls, int faces, int openings)
{
//@builder
// @NoArgsConstructor
if((getFloor().required() && !floor) || (getCeiling().required() && !ceiling))
{
return false;
}
if((!getFloor().supported() && floor) || (!getCeiling().supported() && ceiling))
{
return false;
}
if(!fitsWalls(walls, faces, openings))
{
return false;
}
//@done
return faces >= minFaces.aquire(() ->
@ -170,19 +152,13 @@ public class IrisStructureTile
private boolean fitsWalls(KList<StructureTileFace> walls, int faces, int openings)
{
//@builder
if((getNorth().required() && !walls.contains(StructureTileFace.NORTH))
|| (getSouth().required() && !walls.contains(StructureTileFace.SOUTH))
|| (getEast().required() && !walls.contains(StructureTileFace.EAST))
|| (getWest().required() && !walls.contains(StructureTileFace.WEST)))
// @NoArgsConstructor
if((getNorth().required() && !walls.contains(StructureTileFace.NORTH)) || (getSouth().required() && !walls.contains(StructureTileFace.SOUTH)) || (getEast().required() && !walls.contains(StructureTileFace.EAST)) || (getWest().required() && !walls.contains(StructureTileFace.WEST)))
{
return false;
}
if((!getNorth().supported() && walls.contains(StructureTileFace.NORTH))
|| (!getSouth().supported() && walls.contains(StructureTileFace.SOUTH))
|| (!getEast().supported() && walls.contains(StructureTileFace.EAST))
|| (!getWest().supported() && walls.contains(StructureTileFace.WEST)))
if((!getNorth().supported() && walls.contains(StructureTileFace.NORTH)) || (!getSouth().supported() && walls.contains(StructureTileFace.SOUTH)) || (!getEast().supported() && walls.contains(StructureTileFace.EAST)) || (!getWest().supported() && walls.contains(StructureTileFace.WEST)))
{
return false;
}

View File

@ -12,69 +12,59 @@ import com.volmit.iris.util.RNG;
import com.volmit.iris.util.Required;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
@Accessors(chain = true)
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Desc("A text renderer to place text on terrain")
@Data
public class IrisTextPlacement
{
@Builder.Default
@MinNumber(0)
@MaxNumber(1)
@DontObfuscate
@Desc("The chance to place this font per chunk")
private double chance = 0.1;
@Builder.Default
@MinNumber(0)
@DontObfuscate
@Desc("The amount of times to place randomly in a chunk if the chance passes")
private int density = 1;
@Builder.Default
@DontObfuscate
@Desc("The rotation for this text placement")
private IrisObjectRotation rotation = new IrisObjectRotation();
@Builder.Default
@DontObfuscate
@Desc("The mode to place this text")
private ObjectPlaceMode mode = ObjectPlaceMode.PAINT;
@Builder.Default
@DontObfuscate
@Desc("The translation for this text placement")
private IrisObjectTranslate translate = new IrisObjectTranslate();
@Builder.Default
@DontObfuscate
@Desc("The clamp for this text placement")
private IrisObjectLimit clamp = new IrisObjectLimit();
@Builder.Default
@Required
@DontObfuscate
@Desc("The text renderers to pick from")
@ArrayType(min = 1, type = IrisTextRenderer.class)
private KList<IrisTextRenderer> render = new KList<>();
@Builder.Default
@DontObfuscate
@Desc("If set to true, objects will place on the terrain height, ignoring the water surface.")
private boolean underwater = false;
@Builder.Default
@DontObfuscate
@Desc("If set to true, Blocks placed underwater that could be waterlogged are waterlogged.")
private boolean waterloggable = true;
@Builder.Default
@DontObfuscate
@Desc("If set to true, objects will place on the fluid height level Such as boats.")
private boolean onwater = false;
@ -102,11 +92,6 @@ public class IrisTextPlacement
});
}
public IrisTextPlacement()
{
}
public int maxDimension()
{
int m = 0;

View File

@ -17,45 +17,40 @@ import com.volmit.iris.util.RegistryListFont;
import com.volmit.iris.util.Required;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
@Accessors(chain = true)
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Desc("A text renderer to place text on terrain")
@Data
public class IrisTextRenderer
{
@Builder.Default
@RegistryListFont
@Required
@DontObfuscate
@Desc("The font to use for this renderer")
private String font = "default";
@Builder.Default
@MinNumber(4)
@MaxNumber(48)
@DontObfuscate
@Desc("The font scale 1 = 1pt = ~1-2 blocks high per character")
private int size = 18;
@Builder.Default
@DontObfuscate
@Desc("The font style to use while rendering text")
private FontStyle fontStyle = FontStyle.PLAIN;
@Builder.Default
@Required
@DontObfuscate
@Desc("The lines of text to randomly pick from")
@ArrayType(min = 1, type = String.class)
private KList<String> text = new KList<>();
@Builder.Default
@Required
@DontObfuscate
@Desc("The palette of blocks to use when drawing text")
@ -67,11 +62,6 @@ public class IrisTextRenderer
private final transient AtomicCache<Double> maxLength = new AtomicCache<>();
private final transient AtomicCache<Integer> fontStyleData = new AtomicCache<>();
public IrisTextRenderer()
{
}
public KList<IrisObject> getObjects(ParallaxTerrainProvider g, RNG rng)
{
return objects.aquire(() ->

View File

@ -1,11 +1,11 @@
package com.volmit.iris.object;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class TileResult
{

View File

@ -609,7 +609,7 @@ public class StructureTemplate implements Listener, IObjectPlacer
public Cuboid getBounds(Location center)
{
//@builder
//@NoArgsConstructor
return new Cuboid(
getTileBounds(center.clone().add(
((size / 2) * w) + 1,
@ -626,7 +626,7 @@ public class StructureTemplate implements Listener, IObjectPlacer
public Cuboid getTileBounds(Location l)
{
//@builder
//@NoArgsConstructor
return new Cuboid(
new Location(l.getWorld(),
Math.floorDiv(l.getBlockX(), w) * w,
@ -851,7 +851,7 @@ public class StructureTemplate implements Listener, IObjectPlacer
{
if(use3d)
{
//@builder
//@NoArgsConstructor
structure.getTiles().add(tileFor("Cross Floor",
StructureTileCondition.REQUIRED,
StructureTileCondition.NEVER,
@ -1052,7 +1052,7 @@ public class StructureTemplate implements Listener, IObjectPlacer
else
{
//@builder
//@NoArgsConstructor
structure.getTiles().add(tileFor("Cross",
StructureTileCondition.REQUIRED,
StructureTileCondition.AGNOSTIC,

View File

@ -77,6 +77,33 @@ public class B
return getBlockData(bd, defaultCompat);
}
public static String[] getBlockTypes()
{
KList<String> bt = new KList<String>();
for(Material i : Material.values())
{
if(i.isBlock())
{
String v = i.createBlockData().getAsString(true);
if(v.contains("["))
{
v = v.split("\\Q[\\E")[0];
}
if(v.contains(":"))
{
v = v.split("\\Q:\\E")[1];
}
bt.add(v);
}
}
return bt.toArray(new String[bt.size()]);
}
public static BlockData getBlockData(String bdxf, IrisDimension resolver)
{
try
@ -163,7 +190,7 @@ public class B
return true;
}
//@builder
//@NoArgsConstructor
boolean str = mat.equals(B.mat("CHEST"))
|| mat.equals(B.mat("TRAPPED_CHEST"))
|| mat.equals(B.mat("SHULKER_BOX"))
@ -210,7 +237,7 @@ public class B
return true;
}
//@builder
//@NoArgsConstructor
boolean str = mat.equals(B.mat("CHEST"))
|| mat.equals(B.mat("TRAPPED_CHEST"))
|| mat.equals(B.mat("SHULKER_BOX"))
@ -254,7 +281,7 @@ public class B
return true;
}
//@builder
//@NoArgsConstructor
boolean str = mat.equals(B.mat("GLOWSTONE"))
|| mat.equals(B.mat("END_ROD"))
|| mat.equals(B.mat("SOUL_SAND"))
@ -324,7 +351,7 @@ public class B
}
Material mat = d.getMaterial();
//@builder
//@NoArgsConstructor
return mat.equals(Material.POPPY)
|| mat.equals(Material.DANDELION)
|| mat.equals(B.mat("CORNFLOWER"))
@ -425,7 +452,7 @@ public class B
return true;
}
//@builder
//@NoArgsConstructor
boolean str = m.equals(Material.GRASS)
|| m.equals(Material.TALL_GRASS)
|| m.equals(B.mat("CORNFLOWER"))

View File

@ -10,7 +10,7 @@ public class BoardSettings
{
@DontObfuscate
private BoardProvider boardProvider;
@DontObfuscate
private ScoreDirection scoreDirection;
}

View File

@ -128,7 +128,7 @@ public class IrisInterpolation
public static double bihermite(double p00, double p01, double p02, double p03, double p10, double p11, double p12, double p13, double p20, double p21, double p22, double p23, double p30, double p31, double p32, double p33, double mux, double muy, double tension, double bias)
{
//@builder
//@NoArgsConstructor
return hermite(
hermite(p00, p01, p02, p03, muy, tension, bias),
hermite(p10, p11, p12, p13, muy, tension, bias),
@ -140,7 +140,7 @@ public class IrisInterpolation
public static double bihermiteBezier(double p00, double p01, double p02, double p03, double p10, double p11, double p12, double p13, double p20, double p21, double p22, double p23, double p30, double p31, double p32, double p33, double mux, double muy, double tension, double bias)
{
//@builder
//@NoArgsConstructor
return hermiteBezier(
hermiteBezier(p00, p01, p02, p03, muy, tension, bias),
hermiteBezier(p10, p11, p12, p13, muy, tension, bias),
@ -152,7 +152,7 @@ public class IrisInterpolation
public static double bihermiteParametric(double p00, double p01, double p02, double p03, double p10, double p11, double p12, double p13, double p20, double p21, double p22, double p23, double p30, double p31, double p32, double p33, double mux, double muy, double tension, double bias, double a)
{
//@builder
//@NoArgsConstructor
return hermiteParametric(
hermiteParametric(p00, p01, p02, p03, muy, tension, bias, a),
hermiteParametric(p10, p11, p12, p13, muy, tension, bias, a),
@ -187,7 +187,7 @@ public class IrisInterpolation
public static double bicubic(double p00, double p01, double p02, double p03, double p10, double p11, double p12, double p13, double p20, double p21, double p22, double p23, double p30, double p31, double p32, double p33, double mux, double muy)
{
//@builder
//@NoArgsConstructor
return cubic(
cubic(p00, p01, p02, p03, muy),
cubic(p10, p11, p12, p13, muy),
@ -199,7 +199,7 @@ public class IrisInterpolation
public static double bicubicBezier(double p00, double p01, double p02, double p03, double p10, double p11, double p12, double p13, double p20, double p21, double p22, double p23, double p30, double p31, double p32, double p33, double mux, double muy)
{
//@builder
//@NoArgsConstructor
return cubicBezier(
cubicBezier(p00, p01, p02, p03, muy),
cubicBezier(p10, p11, p12, p13, muy),
@ -211,7 +211,7 @@ public class IrisInterpolation
public static double bicubicParametric(double p00, double p01, double p02, double p03, double p10, double p11, double p12, double p13, double p20, double p21, double p22, double p23, double p30, double p31, double p32, double p33, double mux, double muy, double a)
{
//@builder
//@NoArgsConstructor
return cubicParametric(
cubicParametric(p00, p01, p02, p03, muy,a),
cubicParametric(p10, p11, p12, p13, muy,a),
@ -239,7 +239,7 @@ public class IrisInterpolation
double px = rangeScale(0, 1, x1, x2, x);
double pz = rangeScale(0, 1, z1, z2, z);
//@builder
//@NoArgsConstructor
return blerp(
n.noise(x1, z1),
n.noise(x2, z1),
@ -276,7 +276,7 @@ public class IrisInterpolation
int z2 = (int) Math.round((fz + 1) * rad);
double px = rangeScale(0, 1, x1, x2, x);
double pz = rangeScale(0, 1, z1, z2, z);
//@builder
//@NoArgsConstructor
return blerpBezier(
n.noise(x1, z1),
n.noise(x2, z1),
@ -296,7 +296,7 @@ public class IrisInterpolation
int z2 = (int) Math.round((fz + 1) * rad);
double px = rangeScale(0, 1, x1, x2, x);
double pz = rangeScale(0, 1, z1, z2, z);
//@builder
//@NoArgsConstructor
return blerpParametric(
n.noise(x1, z1),
n.noise(x2, z1),
@ -316,7 +316,7 @@ public class IrisInterpolation
int z2 = (int) Math.round((fz + 1) * rad);
double px = rangeScale(0, 1, x1, x2, x);
double pz = rangeScale(0, 1, z1, z2, z);
//@builder
//@NoArgsConstructor
return blerpSinCenter(
n.noise(x1, z1),
n.noise(x2, z1),
@ -340,7 +340,7 @@ public class IrisInterpolation
int z3 = (int) Math.round((fz + 2) * rad);
double px = rangeScale(0, 1, x1, x2, x);
double pz = rangeScale(0, 1, z1, z2, z);
//@builder
//@NoArgsConstructor
return bicubic(
n.noise(x0, z0),
n.noise(x0, z1),
@ -376,7 +376,7 @@ public class IrisInterpolation
int z3 = (int) Math.round((fz + 2) * rad);
double px = rangeScale(0, 1, x1, x2, x);
double pz = rangeScale(0, 1, z1, z2, z);
//@builder
//@NoArgsConstructor
return bicubicBezier(
n.noise(x0, z0),
n.noise(x0, z1),
@ -412,7 +412,7 @@ public class IrisInterpolation
int z3 = (int) Math.round((fz + 2) * rad);
double px = rangeScale(0, 1, x1, x2, x);
double pz = rangeScale(0, 1, z1, z2, z);
//@builder
//@NoArgsConstructor
return bicubicParametric(
n.noise(x0, z0),
n.noise(x0, z1),
@ -463,7 +463,7 @@ public class IrisInterpolation
int z3 = (int) Math.round((fz + 2) * rad);
double px = rangeScale(0, 1, x1, x2, x);
double pz = rangeScale(0, 1, z1, z2, z);
//@builder
//@NoArgsConstructor
return bihermite(
n.noise(x0, z0),
n.noise(x0, z1),
@ -499,7 +499,7 @@ public class IrisInterpolation
int z3 = (int) Math.round((fz + 2) * rad);
double px = rangeScale(0, 1, x1, x2, x);
double pz = rangeScale(0, 1, z1, z2, z);
//@builder
//@NoArgsConstructor
return bihermiteBezier(
n.noise(x0, z0),
n.noise(x0, z1),
@ -535,7 +535,7 @@ public class IrisInterpolation
int z3 = (int) Math.round((fz + 2) * rad);
double px = rangeScale(0, 1, x1, x2, x);
double pz = rangeScale(0, 1, z1, z2, z);
//@builder
//@NoArgsConstructor
return bihermiteParametric(
n.noise(x0, z0),
n.noise(x0, z1),

View File

@ -0,0 +1,14 @@
package com.volmit.iris.util;
import static java.lang.annotation.ElementType.*;
import static java.lang.annotation.RetentionPolicy.*;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;
@Retention(RUNTIME)
@Target({PARAMETER, TYPE, FIELD})
public @interface RegistryListBlockType
{
}