mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2026-04-07 08:16:31 +00:00
Objectify objects
This commit is contained in:
@@ -1,24 +0,0 @@
|
||||
/*
|
||||
* Iris is a World Generator for Minecraft Bukkit Servers
|
||||
* Copyright (c) 2021 Arcane Arts (Volmit Software)
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.volmit.iris.engine.object;
|
||||
|
||||
// Because Red Matter is too weak
|
||||
public class IrisMatter {
|
||||
|
||||
}
|
||||
@@ -1,49 +0,0 @@
|
||||
/*
|
||||
* Iris is a World Generator for Minecraft Bukkit Servers
|
||||
* Copyright (c) 2021 Arcane Arts (Volmit Software)
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.volmit.iris.engine.object;
|
||||
|
||||
import com.volmit.iris.Iris;
|
||||
import com.volmit.iris.core.project.loader.IrisData;
|
||||
import lombok.Data;
|
||||
|
||||
import java.awt.*;
|
||||
import java.io.File;
|
||||
|
||||
@Data
|
||||
public abstract class IrisRegistrant {
|
||||
private transient IrisData loader;
|
||||
|
||||
private transient String loadKey;
|
||||
|
||||
private transient File loadFile;
|
||||
|
||||
public abstract String getFolderName();
|
||||
|
||||
public abstract String getTypeName();
|
||||
|
||||
public File openInVSCode() {
|
||||
try {
|
||||
Desktop.getDesktop().open(getLoadFile());
|
||||
} catch (Throwable e) {
|
||||
Iris.reportError(e);
|
||||
}
|
||||
|
||||
return getLoadFile();
|
||||
}
|
||||
}
|
||||
@@ -18,7 +18,7 @@
|
||||
|
||||
package com.volmit.iris.engine.object.annotations;
|
||||
|
||||
import com.volmit.iris.engine.object.IrisRegistrant;
|
||||
import com.volmit.iris.core.project.loader.LoaderRegistrant;
|
||||
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.Target;
|
||||
@@ -29,5 +29,5 @@ import static java.lang.annotation.RetentionPolicy.RUNTIME;
|
||||
@Retention(RUNTIME)
|
||||
@Target({PARAMETER, TYPE, FIELD})
|
||||
public @interface RegistryListResource {
|
||||
Class<? extends IrisRegistrant> value();
|
||||
Class<? extends LoaderRegistrant> value();
|
||||
}
|
||||
|
||||
@@ -16,10 +16,10 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.volmit.iris.engine.object;
|
||||
package com.volmit.iris.engine.object.basic;
|
||||
|
||||
import com.volmit.iris.Iris;
|
||||
import com.volmit.iris.engine.cache.AtomicCache;
|
||||
import com.volmit.iris.engine.data.cache.AtomicCache;
|
||||
import com.volmit.iris.engine.object.annotations.Desc;
|
||||
import com.volmit.iris.engine.object.annotations.MaxNumber;
|
||||
import com.volmit.iris.engine.object.annotations.MinNumber;
|
||||
@@ -16,7 +16,7 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.volmit.iris.engine.object;
|
||||
package com.volmit.iris.engine.object.basic;
|
||||
|
||||
import com.volmit.iris.engine.object.annotations.Desc;
|
||||
import com.volmit.iris.util.format.Form;
|
||||
@@ -16,7 +16,7 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.volmit.iris.engine.object;
|
||||
package com.volmit.iris.engine.object.basic;
|
||||
|
||||
import com.volmit.iris.engine.object.annotations.Desc;
|
||||
import lombok.AllArgsConstructor;
|
||||
@@ -16,7 +16,7 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.volmit.iris.engine.object;
|
||||
package com.volmit.iris.engine.object.basic;
|
||||
|
||||
import com.volmit.iris.engine.object.annotations.Desc;
|
||||
import lombok.AllArgsConstructor;
|
||||
@@ -16,7 +16,7 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.volmit.iris.engine.object;
|
||||
package com.volmit.iris.engine.object.basic;
|
||||
|
||||
import com.volmit.iris.engine.object.annotations.Desc;
|
||||
import com.volmit.iris.util.math.RNG;
|
||||
@@ -16,7 +16,7 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.volmit.iris.engine.object;
|
||||
package com.volmit.iris.engine.object.basic;
|
||||
|
||||
import com.volmit.iris.engine.object.annotations.Desc;
|
||||
import com.volmit.iris.util.format.Form;
|
||||
@@ -16,7 +16,7 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.volmit.iris.engine.object;
|
||||
package com.volmit.iris.engine.object.basic;
|
||||
|
||||
import com.volmit.iris.engine.object.annotations.Desc;
|
||||
import lombok.Data;
|
||||
@@ -16,7 +16,7 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.volmit.iris.engine.object;
|
||||
package com.volmit.iris.engine.object.basic;
|
||||
|
||||
import com.volmit.iris.engine.object.annotations.Desc;
|
||||
import org.bukkit.World;
|
||||
@@ -16,7 +16,7 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.volmit.iris.engine.object;
|
||||
package com.volmit.iris.engine.object.biome;
|
||||
|
||||
import com.volmit.iris.engine.object.annotations.Desc;
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.volmit.iris.engine.object;
|
||||
package com.volmit.iris.engine.object.biome;
|
||||
|
||||
import com.volmit.iris.Iris;
|
||||
import com.volmit.iris.engine.object.annotations.*;
|
||||
@@ -16,7 +16,7 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.volmit.iris.engine.object;
|
||||
package com.volmit.iris.engine.object.biome;
|
||||
|
||||
import com.volmit.iris.engine.object.annotations.Desc;
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.volmit.iris.engine.object;
|
||||
package com.volmit.iris.engine.object.biome;
|
||||
|
||||
import com.volmit.iris.engine.object.annotations.Desc;
|
||||
import com.volmit.iris.engine.object.annotations.MaxNumber;
|
||||
@@ -16,7 +16,7 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.volmit.iris.engine.object;
|
||||
package com.volmit.iris.engine.object.biome;
|
||||
|
||||
import com.volmit.iris.engine.object.annotations.Desc;
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.volmit.iris.engine.object;
|
||||
package com.volmit.iris.engine.object.biome;
|
||||
|
||||
import com.volmit.iris.engine.object.annotations.Desc;
|
||||
import com.volmit.iris.engine.object.annotations.MaxNumber;
|
||||
@@ -16,7 +16,7 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.volmit.iris.engine.object;
|
||||
package com.volmit.iris.engine.object.biome;
|
||||
|
||||
import com.volmit.iris.engine.object.annotations.Desc;
|
||||
|
||||
@@ -16,12 +16,13 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.volmit.iris.engine.object;
|
||||
package com.volmit.iris.engine.object.biome;
|
||||
|
||||
import com.volmit.iris.engine.cache.AtomicCache;
|
||||
import com.volmit.iris.engine.data.cache.AtomicCache;
|
||||
import com.volmit.iris.engine.data.DataProvider;
|
||||
import com.volmit.iris.engine.interpolation.IrisInterpolation;
|
||||
import com.volmit.iris.util.interpolation.IrisInterpolation;
|
||||
import com.volmit.iris.engine.object.annotations.*;
|
||||
import com.volmit.iris.engine.object.noise.LoaderGenerator;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
@@ -34,7 +35,7 @@ import lombok.experimental.Accessors;
|
||||
@Data
|
||||
public class IrisBiomeGeneratorLink {
|
||||
|
||||
@RegistryListResource(IrisGenerator.class)
|
||||
@RegistryListResource(LoaderGenerator.class)
|
||||
@Desc("The generator id")
|
||||
private String generator = "default";
|
||||
|
||||
@@ -52,15 +53,15 @@ public class IrisBiomeGeneratorLink {
|
||||
@Desc("The max block value (value + fluidHeight)")
|
||||
private int max = 0;
|
||||
|
||||
private final transient AtomicCache<IrisGenerator> gen = new AtomicCache<>();
|
||||
private final transient AtomicCache<LoaderGenerator> gen = new AtomicCache<>();
|
||||
|
||||
public IrisGenerator getCachedGenerator(DataProvider g) {
|
||||
public LoaderGenerator getCachedGenerator(DataProvider g) {
|
||||
return gen.aquire(() ->
|
||||
{
|
||||
IrisGenerator gen = g.getData().getGeneratorLoader().load(getGenerator());
|
||||
LoaderGenerator gen = g.getData().getGeneratorLoader().load(getGenerator());
|
||||
|
||||
if (gen == null) {
|
||||
gen = new IrisGenerator();
|
||||
gen = new LoaderGenerator();
|
||||
}
|
||||
|
||||
return gen;
|
||||
@@ -16,11 +16,13 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.volmit.iris.engine.object;
|
||||
package com.volmit.iris.engine.object.biome;
|
||||
|
||||
import com.volmit.iris.engine.cache.AtomicCache;
|
||||
import com.volmit.iris.engine.data.cache.AtomicCache;
|
||||
import com.volmit.iris.engine.data.DataProvider;
|
||||
import com.volmit.iris.engine.object.annotations.*;
|
||||
import com.volmit.iris.engine.object.objects.LoaderObject;
|
||||
import com.volmit.iris.engine.object.objects.IrisObjectPlacement;
|
||||
import com.volmit.iris.util.collection.KList;
|
||||
import com.volmit.iris.util.collection.KSet;
|
||||
import lombok.AllArgsConstructor;
|
||||
@@ -34,13 +36,13 @@ import lombok.experimental.Accessors;
|
||||
@Desc("A biome mutation if a condition is met")
|
||||
@Data
|
||||
public class IrisBiomeMutation {
|
||||
@RegistryListResource(IrisBiome.class)
|
||||
@RegistryListResource(LoaderBiome.class)
|
||||
@Required
|
||||
@ArrayType(min = 1, type = String.class)
|
||||
@Desc("One of The following biomes or regions must show up")
|
||||
private KList<String> sideA = new KList<>();
|
||||
|
||||
@RegistryListResource(IrisBiome.class)
|
||||
@RegistryListResource(LoaderBiome.class)
|
||||
@Required
|
||||
@ArrayType(min = 1, type = String.class)
|
||||
@Desc("One of The following biomes or regions must show up")
|
||||
@@ -58,7 +60,7 @@ public class IrisBiomeMutation {
|
||||
@Desc("How many tries per chunk to check for this mutation")
|
||||
private int checks = 2;
|
||||
|
||||
@RegistryListResource(IrisObject.class)
|
||||
@RegistryListResource(LoaderObject.class)
|
||||
@ArrayType(min = 1, type = IrisObjectPlacement.class)
|
||||
@Desc("Objects define what schematics (iob files) iris will place in this biome mutation")
|
||||
private KList<IrisObjectPlacement> objects = new KList<>();
|
||||
@@ -16,10 +16,14 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.volmit.iris.engine.object;
|
||||
package com.volmit.iris.engine.object.biome;
|
||||
|
||||
import com.volmit.iris.core.project.loader.IrisData;
|
||||
import com.volmit.iris.engine.cache.AtomicCache;
|
||||
import com.volmit.iris.engine.data.cache.AtomicCache;
|
||||
import com.volmit.iris.engine.object.block.LoaderBlockData;
|
||||
import com.volmit.iris.engine.object.noise.IrisGeneratorStyle;
|
||||
import com.volmit.iris.engine.object.noise.IrisSlopeClip;
|
||||
import com.volmit.iris.engine.object.noise.NoiseStyle;
|
||||
import com.volmit.iris.util.noise.CNG;
|
||||
import com.volmit.iris.engine.object.annotations.*;
|
||||
import com.volmit.iris.util.collection.KList;
|
||||
@@ -62,9 +66,9 @@ public class IrisBiomePaletteLayer {
|
||||
private double zoom = 5;
|
||||
|
||||
@Required
|
||||
@ArrayType(min = 1, type = IrisBlockData.class)
|
||||
@ArrayType(min = 1, type = LoaderBlockData.class)
|
||||
@Desc("The palette of blocks to be used in this layer")
|
||||
private KList<IrisBlockData> palette = new KList<IrisBlockData>().qadd(new IrisBlockData("GRASS_BLOCK"));
|
||||
private KList<LoaderBlockData> palette = new KList<LoaderBlockData>().qadd(new LoaderBlockData("GRASS_BLOCK"));
|
||||
|
||||
private final transient AtomicCache<KList<BlockData>> blockData = new AtomicCache<>();
|
||||
private final transient AtomicCache<CNG> layerGenerator = new AtomicCache<>();
|
||||
@@ -94,8 +98,8 @@ public class IrisBiomePaletteLayer {
|
||||
});
|
||||
}
|
||||
|
||||
public KList<IrisBlockData> add(String b) {
|
||||
palette.add(new IrisBlockData(b));
|
||||
public KList<LoaderBlockData> add(String b) {
|
||||
palette.add(new LoaderBlockData(b));
|
||||
|
||||
return palette;
|
||||
}
|
||||
@@ -104,7 +108,7 @@ public class IrisBiomePaletteLayer {
|
||||
return blockData.aquire(() ->
|
||||
{
|
||||
KList<BlockData> blockData = new KList<>();
|
||||
for (IrisBlockData ix : palette) {
|
||||
for (LoaderBlockData ix : palette) {
|
||||
BlockData bx = ix.getBlockData(data);
|
||||
if (bx != null) {
|
||||
for (int i = 0; i < ix.getWeight(); i++) {
|
||||
@@ -16,17 +16,31 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.volmit.iris.engine.object;
|
||||
package com.volmit.iris.engine.object.biome;
|
||||
|
||||
import com.volmit.iris.Iris;
|
||||
import com.volmit.iris.core.gui.components.RenderType;
|
||||
import com.volmit.iris.core.project.loader.IrisData;
|
||||
import com.volmit.iris.core.project.loader.LoaderRegistrant;
|
||||
import com.volmit.iris.engine.IrisComplex;
|
||||
import com.volmit.iris.engine.cache.AtomicCache;
|
||||
import com.volmit.iris.engine.data.cache.AtomicCache;
|
||||
import com.volmit.iris.engine.data.B;
|
||||
import com.volmit.iris.engine.data.DataProvider;
|
||||
import com.volmit.iris.engine.framework.Engine;
|
||||
import com.volmit.iris.engine.framework.IrisAccess;
|
||||
import com.volmit.iris.engine.object.block.IrisBlockDrops;
|
||||
import com.volmit.iris.engine.object.decoration.IrisDecorator;
|
||||
import com.volmit.iris.engine.object.deposits.IrisDepositGenerator;
|
||||
import com.volmit.iris.engine.object.feature.IrisFeaturePotential;
|
||||
import com.volmit.iris.engine.object.jigsaw.IrisJigsawStructurePlacement;
|
||||
import com.volmit.iris.engine.object.loot.IrisLootReference;
|
||||
import com.volmit.iris.engine.object.meta.IrisEffect;
|
||||
import com.volmit.iris.engine.object.noise.IrisGeneratorStyle;
|
||||
import com.volmit.iris.engine.object.noise.IrisSlopeClip;
|
||||
import com.volmit.iris.engine.object.noise.NoiseStyle;
|
||||
import com.volmit.iris.engine.object.objects.LoaderObject;
|
||||
import com.volmit.iris.engine.object.objects.IrisObjectPlacement;
|
||||
import com.volmit.iris.engine.object.spawners.LoaderSpawner;
|
||||
import com.volmit.iris.util.noise.CNG;
|
||||
import com.volmit.iris.engine.object.annotations.*;
|
||||
import com.volmit.iris.engine.object.common.IRare;
|
||||
@@ -54,7 +68,7 @@ import java.awt.*;
|
||||
@Desc("Represents a biome in iris. Biomes are placed inside of regions and hold objects.\nA biome consists of layers (block palletes), decorations, objects & generators.")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
public class IrisBiome extends IrisRegistrant implements IRare {
|
||||
public class LoaderBiome extends LoaderRegistrant implements IRare {
|
||||
@MinNumber(2)
|
||||
@Required
|
||||
@Desc("This is the human readable name for this biome. This can and should be different than the file name. This is not used for loading biomes in other objects.")
|
||||
@@ -66,7 +80,7 @@ public class IrisBiome extends IrisRegistrant implements IRare {
|
||||
|
||||
@Desc("Spawn Entities in this area over time. Iris will continually replenish these mobs just like vanilla does.")
|
||||
@ArrayType(min = 1, type = String.class)
|
||||
@RegistryListResource(IrisSpawner.class)
|
||||
@RegistryListResource(LoaderSpawner.class)
|
||||
private KList<String> entitySpawners = new KList<>();
|
||||
|
||||
@Desc("Add random chances for terrain features")
|
||||
@@ -132,7 +146,7 @@ public class IrisBiome extends IrisRegistrant implements IRare {
|
||||
@Desc("If this biome has children biomes, and the gen layer chooses one of this biomes children, How will it be shaped?")
|
||||
private IrisGeneratorStyle childStyle = NoiseStyle.CELLULAR_IRIS_DOUBLE.style();
|
||||
|
||||
@RegistryListResource(IrisBiome.class)
|
||||
@RegistryListResource(LoaderBiome.class)
|
||||
@ArrayType(min = 1, type = String.class)
|
||||
@Desc("List any biome names (file names without.json) here as children. Portions of this biome can sometimes morph into their children. Iris supports cyclic relationships such as A > B > A > B. Iris will stop checking 9 biomes down the tree.")
|
||||
private KList<String> children = new KList<>();
|
||||
@@ -141,7 +155,7 @@ public class IrisBiome extends IrisRegistrant implements IRare {
|
||||
@Desc("Jigsaw structures")
|
||||
private KList<IrisJigsawStructurePlacement> jigsawStructures = new KList<>();
|
||||
|
||||
@RegistryListResource(IrisBiome.class)
|
||||
@RegistryListResource(LoaderBiome.class)
|
||||
@Desc("The carving biome. If specified the biome will be used when under a carving instead of this current biome.")
|
||||
private String carvingBiome = "";
|
||||
|
||||
@@ -193,8 +207,8 @@ public class IrisBiome extends IrisRegistrant implements IRare {
|
||||
private final transient AtomicCache<CNG> biomeGenerator = new AtomicCache<>();
|
||||
private final transient AtomicCache<Integer> maxHeight = new AtomicCache<>();
|
||||
private final transient AtomicCache<Integer> maxWithObjectHeight = new AtomicCache<>();
|
||||
private final transient AtomicCache<IrisBiome> realCarveBiome = new AtomicCache<>();
|
||||
private final transient AtomicCache<KList<IrisBiome>> realChildren = new AtomicCache<>();
|
||||
private final transient AtomicCache<LoaderBiome> realCarveBiome = new AtomicCache<>();
|
||||
private final transient AtomicCache<KList<LoaderBiome>> realChildren = new AtomicCache<>();
|
||||
private final transient AtomicCache<KList<CNG>> layerHeightGenerators = new AtomicCache<>();
|
||||
private final transient AtomicCache<KList<CNG>> layerSeaHeightGenerators = new AtomicCache<>();
|
||||
|
||||
@@ -249,10 +263,10 @@ public class IrisBiome extends IrisRegistrant implements IRare {
|
||||
}).get(loadKey);
|
||||
}
|
||||
|
||||
public IrisBiome getRealCarvingBiome(IrisData data) {
|
||||
public LoaderBiome getRealCarvingBiome(IrisData data) {
|
||||
return realCarveBiome.aquire(() ->
|
||||
{
|
||||
IrisBiome biome = data.getBiomeLoader().load(getCarvingBiome());
|
||||
LoaderBiome biome = data.getBiomeLoader().load(getCarvingBiome());
|
||||
|
||||
if (biome == null) {
|
||||
biome = this;
|
||||
@@ -431,7 +445,7 @@ public class IrisBiome extends IrisRegistrant implements IRare {
|
||||
int gg = 0;
|
||||
|
||||
for (IrisObjectPlacement i : getObjects()) {
|
||||
for (IrisObject j : data.getObjectLoader().loadAll(i.getPlace())) {
|
||||
for (LoaderObject j : data.getObjectLoader().loadAll(i.getPlace())) {
|
||||
gg = Math.max(gg, j.getH());
|
||||
}
|
||||
}
|
||||
@@ -440,7 +454,7 @@ public class IrisBiome extends IrisRegistrant implements IRare {
|
||||
});
|
||||
}
|
||||
|
||||
public IrisBiome infer(InferredType t, InferredType type) {
|
||||
public LoaderBiome infer(InferredType t, InferredType type) {
|
||||
setInferredType(t.equals(InferredType.DEFER) ? type : t);
|
||||
return this;
|
||||
}
|
||||
@@ -568,10 +582,10 @@ public class IrisBiome extends IrisRegistrant implements IRare {
|
||||
return customDerivitives.get(getBiomeGenerator(rng).fit(0, customDerivitives.size() - 1, x, y, z));
|
||||
}
|
||||
|
||||
public KList<IrisBiome> getRealChildren(DataProvider g) {
|
||||
public KList<LoaderBiome> getRealChildren(DataProvider g) {
|
||||
return realChildren.aquire(() ->
|
||||
{
|
||||
KList<IrisBiome> realChildren = new KList<>();
|
||||
KList<LoaderBiome> realChildren = new KList<>();
|
||||
|
||||
for (String i : getChildren()) {
|
||||
realChildren.add(g.getData().getBiomeLoader().load(i));
|
||||
@@ -588,7 +602,7 @@ public class IrisBiome extends IrisRegistrant implements IRare {
|
||||
|
||||
if (limit > 0) {
|
||||
for (String i : getChildren()) {
|
||||
IrisBiome b = g.getData().getBiomeLoader().load(i);
|
||||
LoaderBiome b = g.getData().getBiomeLoader().load(i);
|
||||
m.addAll(b.getAllChildren(g, limit));
|
||||
}
|
||||
}
|
||||
@@ -16,13 +16,14 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.volmit.iris.engine.object;
|
||||
package com.volmit.iris.engine.object.block;
|
||||
|
||||
import com.volmit.iris.core.project.loader.IrisData;
|
||||
import com.volmit.iris.engine.cache.AtomicCache;
|
||||
import com.volmit.iris.engine.data.cache.AtomicCache;
|
||||
import com.volmit.iris.engine.object.annotations.ArrayType;
|
||||
import com.volmit.iris.engine.object.annotations.Desc;
|
||||
import com.volmit.iris.engine.object.annotations.Required;
|
||||
import com.volmit.iris.engine.object.loot.IrisLoot;
|
||||
import com.volmit.iris.util.collection.KList;
|
||||
import com.volmit.iris.util.math.RNG;
|
||||
import lombok.AllArgsConstructor;
|
||||
@@ -39,9 +40,9 @@ import org.bukkit.inventory.ItemStack;
|
||||
@Data
|
||||
public class IrisBlockDrops {
|
||||
@Required
|
||||
@ArrayType(min = 1, type = IrisBlockData.class)
|
||||
@ArrayType(min = 1, type = LoaderBlockData.class)
|
||||
@Desc("The blocks that drop loot")
|
||||
private KList<IrisBlockData> blocks = new KList<>();
|
||||
private KList<LoaderBlockData> blocks = new KList<>();
|
||||
|
||||
@Desc("If exact blocks is set to true, minecraft:barrel[axis=x] will only drop for that axis. When exact is false (default) any barrel will drop the defined drops.")
|
||||
private boolean exactBlocks = false;
|
||||
@@ -63,7 +64,7 @@ public class IrisBlockDrops {
|
||||
{
|
||||
KList<BlockData> b = new KList<>();
|
||||
|
||||
for (IrisBlockData i : getBlocks()) {
|
||||
for (LoaderBlockData i : getBlocks()) {
|
||||
BlockData dd = i.getBlockData(rdata);
|
||||
|
||||
if (dd != null) {
|
||||
@@ -16,10 +16,12 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.volmit.iris.engine.object;
|
||||
package com.volmit.iris.engine.object.block;
|
||||
|
||||
import com.volmit.iris.core.project.loader.IrisData;
|
||||
import com.volmit.iris.engine.cache.AtomicCache;
|
||||
import com.volmit.iris.engine.data.cache.AtomicCache;
|
||||
import com.volmit.iris.engine.object.noise.IrisGeneratorStyle;
|
||||
import com.volmit.iris.engine.object.noise.NoiseStyle;
|
||||
import com.volmit.iris.util.noise.CNG;
|
||||
import com.volmit.iris.engine.object.annotations.ArrayType;
|
||||
import com.volmit.iris.engine.object.annotations.Desc;
|
||||
@@ -47,9 +49,9 @@ public class IrisMaterialPalette {
|
||||
private double zoom = 5;
|
||||
|
||||
@Required
|
||||
@ArrayType(min = 1, type = IrisBlockData.class)
|
||||
@ArrayType(min = 1, type = LoaderBlockData.class)
|
||||
@Desc("The palette of blocks to be used in this layer")
|
||||
private KList<IrisBlockData> palette = new KList<IrisBlockData>().qadd(new IrisBlockData("STONE"));
|
||||
private KList<LoaderBlockData> palette = new KList<LoaderBlockData>().qadd(new LoaderBlockData("STONE"));
|
||||
|
||||
private final transient AtomicCache<KList<BlockData>> blockData = new AtomicCache<>();
|
||||
private final transient AtomicCache<CNG> layerGenerator = new AtomicCache<>();
|
||||
@@ -80,14 +82,14 @@ public class IrisMaterialPalette {
|
||||
return this;
|
||||
}
|
||||
|
||||
public KList<IrisBlockData> add(String b) {
|
||||
palette.add(new IrisBlockData(b));
|
||||
public KList<LoaderBlockData> add(String b) {
|
||||
palette.add(new LoaderBlockData(b));
|
||||
|
||||
return palette;
|
||||
}
|
||||
|
||||
public IrisMaterialPalette qadd(String b) {
|
||||
palette.add(new IrisBlockData(b));
|
||||
palette.add(new LoaderBlockData(b));
|
||||
|
||||
return this;
|
||||
}
|
||||
@@ -96,7 +98,7 @@ public class IrisMaterialPalette {
|
||||
return blockData.aquire(() ->
|
||||
{
|
||||
KList<BlockData> blockData = new KList<>();
|
||||
for (IrisBlockData ix : palette) {
|
||||
for (LoaderBlockData ix : palette) {
|
||||
BlockData bx = ix.getBlockData(rdata);
|
||||
if (bx != null) {
|
||||
for (int i = 0; i < ix.getWeight(); i++) {
|
||||
@@ -16,12 +16,13 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.volmit.iris.engine.object;
|
||||
package com.volmit.iris.engine.object.block;
|
||||
|
||||
import com.volmit.iris.Iris;
|
||||
import com.volmit.iris.core.project.loader.IrisData;
|
||||
import com.volmit.iris.engine.cache.AtomicCache;
|
||||
import com.volmit.iris.engine.data.cache.AtomicCache;
|
||||
import com.volmit.iris.engine.data.B;
|
||||
import com.volmit.iris.core.project.loader.LoaderRegistrant;
|
||||
import com.volmit.iris.engine.object.annotations.*;
|
||||
import com.volmit.iris.util.collection.KList;
|
||||
import com.volmit.iris.util.collection.KMap;
|
||||
@@ -41,7 +42,7 @@ import java.util.Map;
|
||||
@Desc("Represents Block Data")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
public class IrisBlockData extends IrisRegistrant {
|
||||
public class LoaderBlockData extends LoaderRegistrant {
|
||||
@RegistryListBlockType
|
||||
@Required
|
||||
@Desc("The block to use")
|
||||
@@ -59,7 +60,7 @@ public class IrisBlockData extends IrisRegistrant {
|
||||
private int weight = 1;
|
||||
|
||||
@Desc("If the block cannot be created on this version, Iris will attempt to use this backup block data instead.")
|
||||
private IrisBlockData backup = null;
|
||||
private LoaderBlockData backup = null;
|
||||
|
||||
@Desc("Optional properties for this block data such as 'waterlogged': true")
|
||||
private KMap<String, Object> data = new KMap<>();
|
||||
@@ -67,7 +68,7 @@ public class IrisBlockData extends IrisRegistrant {
|
||||
private final transient AtomicCache<BlockData> blockdata = new AtomicCache<>();
|
||||
private final transient AtomicCache<String> realProperties = new AtomicCache<>();
|
||||
|
||||
public IrisBlockData(String b) {
|
||||
public LoaderBlockData(String b) {
|
||||
this.block = b;
|
||||
}
|
||||
|
||||
@@ -94,7 +95,7 @@ public class IrisBlockData extends IrisRegistrant {
|
||||
{
|
||||
BlockData b = null;
|
||||
|
||||
IrisBlockData customData = data.getBlockLoader().load(getBlock(), false);
|
||||
LoaderBlockData customData = data.getBlockLoader().load(getBlock(), false);
|
||||
|
||||
if (customData != null) {
|
||||
b = customData.getBlockData(data);
|
||||
@@ -151,8 +152,8 @@ public class IrisBlockData extends IrisRegistrant {
|
||||
});
|
||||
}
|
||||
|
||||
public static IrisBlockData from(String j) {
|
||||
IrisBlockData b = new IrisBlockData();
|
||||
public static LoaderBlockData from(String j) {
|
||||
LoaderBlockData b = new LoaderBlockData();
|
||||
String m = j.toLowerCase().trim();
|
||||
|
||||
if (m.contains(":")) {
|
||||
@@ -16,11 +16,12 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.volmit.iris.engine.object;
|
||||
package com.volmit.iris.engine.object.carve;
|
||||
|
||||
import com.volmit.iris.core.project.loader.IrisData;
|
||||
import com.volmit.iris.engine.cache.AtomicCache;
|
||||
import com.volmit.iris.engine.interpolation.IrisInterpolation;
|
||||
import com.volmit.iris.engine.data.cache.AtomicCache;
|
||||
import com.volmit.iris.util.interpolation.IrisInterpolation;
|
||||
import com.volmit.iris.engine.object.noise.IrisGeneratorStyle;
|
||||
import com.volmit.iris.util.noise.CNG;
|
||||
import com.volmit.iris.engine.object.annotations.Desc;
|
||||
import com.volmit.iris.engine.object.annotations.MaxNumber;
|
||||
@@ -16,11 +16,12 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.volmit.iris.engine.object;
|
||||
package com.volmit.iris.engine.object.carve;
|
||||
|
||||
import com.volmit.iris.core.project.loader.IrisData;
|
||||
import com.volmit.iris.engine.cache.AtomicCache;
|
||||
import com.volmit.iris.engine.data.cache.AtomicCache;
|
||||
import com.volmit.iris.engine.data.B;
|
||||
import com.volmit.iris.engine.object.block.LoaderBlockData;
|
||||
import com.volmit.iris.engine.object.annotations.Desc;
|
||||
import com.volmit.iris.engine.object.annotations.MaxNumber;
|
||||
import com.volmit.iris.engine.object.annotations.MinNumber;
|
||||
@@ -48,7 +49,7 @@ public class IrisCaveFluid {
|
||||
|
||||
@Required
|
||||
@Desc("The fluid type that should spawn here")
|
||||
private IrisBlockData fluidType = new IrisBlockData("CAVE_AIR");
|
||||
private LoaderBlockData fluidType = new LoaderBlockData("CAVE_AIR");
|
||||
|
||||
private final transient AtomicCache<BlockData> fluidData = new AtomicCache<>();
|
||||
|
||||
@@ -16,11 +16,12 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.volmit.iris.engine.object;
|
||||
package com.volmit.iris.engine.object.carve;
|
||||
|
||||
import com.volmit.iris.engine.object.annotations.Desc;
|
||||
import com.volmit.iris.engine.object.annotations.MinNumber;
|
||||
import com.volmit.iris.engine.object.annotations.Required;
|
||||
import com.volmit.iris.engine.object.noise.IrisShapedGeneratorStyle;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
@@ -16,14 +16,15 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.volmit.iris.engine.object;
|
||||
package com.volmit.iris.engine.object.carve;
|
||||
|
||||
import com.volmit.iris.core.project.loader.IrisData;
|
||||
import com.volmit.iris.engine.cache.AtomicCache;
|
||||
import com.volmit.iris.engine.data.cache.AtomicCache;
|
||||
import com.volmit.iris.engine.object.annotations.Desc;
|
||||
import com.volmit.iris.engine.object.annotations.MaxNumber;
|
||||
import com.volmit.iris.engine.object.annotations.MinNumber;
|
||||
import com.volmit.iris.engine.object.common.IRare;
|
||||
import com.volmit.iris.engine.object.noise.IrisGeneratorStyle;
|
||||
import com.volmit.iris.util.stream.ProceduralStream;
|
||||
import com.volmit.iris.util.math.RNG;
|
||||
import lombok.AllArgsConstructor;
|
||||
@@ -16,12 +16,15 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.volmit.iris.engine.object;
|
||||
package com.volmit.iris.engine.object.carve;
|
||||
|
||||
import com.volmit.iris.core.project.loader.IrisData;
|
||||
import com.volmit.iris.engine.cache.AtomicCache;
|
||||
import com.volmit.iris.engine.data.cache.AtomicCache;
|
||||
import com.volmit.iris.engine.object.annotations.ArrayType;
|
||||
import com.volmit.iris.engine.object.annotations.Desc;
|
||||
import com.volmit.iris.engine.object.noise.IrisGeneratorStyle;
|
||||
import com.volmit.iris.engine.object.noise.IrisInterpolator3D;
|
||||
import com.volmit.iris.engine.object.noise.NoiseStyle;
|
||||
import com.volmit.iris.util.stream.ProceduralStream;
|
||||
import com.volmit.iris.util.stream.interpolation.Interpolated;
|
||||
import com.volmit.iris.util.collection.KList;
|
||||
@@ -16,7 +16,7 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.volmit.iris.engine.object;
|
||||
package com.volmit.iris.engine.object.compat;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.volmit.iris.Iris;
|
||||
@@ -16,10 +16,10 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.volmit.iris.engine.object;
|
||||
package com.volmit.iris.engine.object.compat;
|
||||
|
||||
import com.volmit.iris.Iris;
|
||||
import com.volmit.iris.engine.cache.AtomicCache;
|
||||
import com.volmit.iris.engine.data.cache.AtomicCache;
|
||||
import com.volmit.iris.engine.data.B;
|
||||
import com.volmit.iris.engine.object.annotations.Desc;
|
||||
import com.volmit.iris.engine.object.annotations.Required;
|
||||
@@ -16,10 +16,10 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.volmit.iris.engine.object;
|
||||
package com.volmit.iris.engine.object.compat;
|
||||
|
||||
import com.volmit.iris.Iris;
|
||||
import com.volmit.iris.engine.cache.AtomicCache;
|
||||
import com.volmit.iris.engine.data.cache.AtomicCache;
|
||||
import com.volmit.iris.engine.data.B;
|
||||
import com.volmit.iris.engine.object.annotations.Desc;
|
||||
import com.volmit.iris.engine.object.annotations.Required;
|
||||
@@ -16,12 +16,12 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.volmit.iris.engine.object;
|
||||
package com.volmit.iris.engine.object.decoration;
|
||||
|
||||
import com.volmit.iris.engine.object.annotations.Desc;
|
||||
|
||||
@Desc("Represents a location where decorations should go")
|
||||
public enum DecorationPart {
|
||||
public enum IrisDecorationPart {
|
||||
@Desc("The default, decorate anywhere")
|
||||
NONE,
|
||||
|
||||
@@ -16,11 +16,15 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.volmit.iris.engine.object;
|
||||
package com.volmit.iris.engine.object.decoration;
|
||||
|
||||
import com.volmit.iris.Iris;
|
||||
import com.volmit.iris.core.project.loader.IrisData;
|
||||
import com.volmit.iris.engine.cache.AtomicCache;
|
||||
import com.volmit.iris.engine.data.cache.AtomicCache;
|
||||
import com.volmit.iris.engine.object.biome.LoaderBiome;
|
||||
import com.volmit.iris.engine.object.block.LoaderBlockData;
|
||||
import com.volmit.iris.engine.object.noise.IrisGeneratorStyle;
|
||||
import com.volmit.iris.engine.object.noise.NoiseStyle;
|
||||
import com.volmit.iris.util.noise.CNG;
|
||||
import com.volmit.iris.engine.object.annotations.*;
|
||||
import com.volmit.iris.util.collection.KList;
|
||||
@@ -51,7 +55,7 @@ public class IrisDecorator {
|
||||
private IrisGeneratorStyle heightVariance = NoiseStyle.STATIC.style();
|
||||
|
||||
@Desc("Tells iris where this decoration is a part of. I.e. SHORE_LINE or SEA_SURFACE")
|
||||
private DecorationPart partOf = DecorationPart.NONE;
|
||||
private IrisDecorationPart partOf = IrisDecorationPart.NONE;
|
||||
|
||||
@DependsOn({"stackMin", "stackMax"})
|
||||
@MinNumber(1)
|
||||
@@ -78,13 +82,13 @@ public class IrisDecorator {
|
||||
private double chance = 0.1;
|
||||
|
||||
@Required
|
||||
@ArrayType(min = 1, type = IrisBlockData.class)
|
||||
@ArrayType(min = 1, type = LoaderBlockData.class)
|
||||
@Desc("The palette of blocks to pick from when this decorator needs to place.")
|
||||
private KList<IrisBlockData> palette = new KList<IrisBlockData>().qadd(new IrisBlockData("grass"));
|
||||
private KList<LoaderBlockData> palette = new KList<LoaderBlockData>().qadd(new LoaderBlockData("grass"));
|
||||
|
||||
@ArrayType(min = 1, type = IrisBlockData.class)
|
||||
@ArrayType(min = 1, type = LoaderBlockData.class)
|
||||
@Desc("The palette of blocks used at the very top of a 'stackMax' of higher than 1. For example, bamboo tops.")
|
||||
private KList<IrisBlockData> topPalette = new KList<>();
|
||||
private KList<LoaderBlockData> topPalette = new KList<>();
|
||||
|
||||
@DependsOn("topPalette")
|
||||
@MinNumber(0.01)
|
||||
@@ -122,12 +126,12 @@ public class IrisDecorator {
|
||||
.scale(1D / variance.getZoom()));
|
||||
}
|
||||
|
||||
public KList<IrisBlockData> add(String b) {
|
||||
palette.add(new IrisBlockData(b));
|
||||
public KList<LoaderBlockData> add(String b) {
|
||||
palette.add(new LoaderBlockData(b));
|
||||
return palette;
|
||||
}
|
||||
|
||||
public BlockData getBlockData(IrisBiome b, RNG rng, double x, double z, IrisData data) {
|
||||
public BlockData getBlockData(LoaderBiome b, RNG rng, double x, double z, IrisData data) {
|
||||
if (getBlockData(data).isEmpty()) {
|
||||
Iris.warn("Empty Block Data for " + b.getName());
|
||||
return null;
|
||||
@@ -147,7 +151,7 @@ public class IrisDecorator {
|
||||
return null;
|
||||
}
|
||||
|
||||
public BlockData getBlockData100(IrisBiome b, RNG rng, double x, double y, double z, IrisData data) {
|
||||
public BlockData getBlockData100(LoaderBiome b, RNG rng, double x, double y, double z, IrisData data) {
|
||||
if (getBlockData(data).isEmpty()) {
|
||||
Iris.warn("Empty Block Data for " + b.getName());
|
||||
return null;
|
||||
@@ -170,7 +174,7 @@ public class IrisDecorator {
|
||||
return getVarianceGenerator(rng, data).fit(getBlockData(data), z, y, x).clone(); //X and Z must be switched
|
||||
}
|
||||
|
||||
public BlockData getBlockDataForTop(IrisBiome b, RNG rng, double x, double y, double z, IrisData data) {
|
||||
public BlockData getBlockDataForTop(LoaderBiome b, RNG rng, double x, double y, double z, IrisData data) {
|
||||
if (getBlockDataTops(data).isEmpty()) {
|
||||
return getBlockData100(b, rng, x, y, z, data);
|
||||
}
|
||||
@@ -193,7 +197,7 @@ public class IrisDecorator {
|
||||
return blockData.aquire(() ->
|
||||
{
|
||||
KList<BlockData> blockData = new KList<>();
|
||||
for (IrisBlockData i : palette) {
|
||||
for (LoaderBlockData i : palette) {
|
||||
BlockData bx = i.getBlockData(data);
|
||||
if (bx != null) {
|
||||
for (int n = 0; n < i.getWeight(); n++) {
|
||||
@@ -210,7 +214,7 @@ public class IrisDecorator {
|
||||
return blockDataTops.aquire(() ->
|
||||
{
|
||||
KList<BlockData> blockDataTops = new KList<>();
|
||||
for (IrisBlockData i : topPalette) {
|
||||
for (LoaderBlockData i : topPalette) {
|
||||
BlockData bx = i.getBlockData(data);
|
||||
if (bx != null) {
|
||||
for (int n = 0; n < i.getWeight(); n++) {
|
||||
@@ -16,11 +16,13 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.volmit.iris.engine.object;
|
||||
package com.volmit.iris.engine.object.deposits;
|
||||
|
||||
import com.volmit.iris.core.project.loader.IrisData;
|
||||
import com.volmit.iris.engine.cache.AtomicCache;
|
||||
import com.volmit.iris.engine.data.cache.AtomicCache;
|
||||
import com.volmit.iris.engine.object.annotations.*;
|
||||
import com.volmit.iris.engine.object.block.LoaderBlockData;
|
||||
import com.volmit.iris.engine.object.objects.LoaderObject;
|
||||
import com.volmit.iris.util.collection.KList;
|
||||
import com.volmit.iris.util.math.RNG;
|
||||
import lombok.AllArgsConstructor;
|
||||
@@ -73,23 +75,23 @@ public class IrisDepositGenerator {
|
||||
private int minPerChunk = 1;
|
||||
|
||||
@Required
|
||||
@ArrayType(min = 1, type = IrisBlockData.class)
|
||||
@ArrayType(min = 1, type = LoaderBlockData.class)
|
||||
@Desc("The palette of blocks to be used in this deposit generator")
|
||||
private KList<IrisBlockData> palette = new KList<>();
|
||||
private KList<LoaderBlockData> palette = new KList<>();
|
||||
|
||||
@MinNumber(1)
|
||||
@MaxNumber(64)
|
||||
@Desc("Ore varience is how many different objects clumps iris will create")
|
||||
private int varience = 3;
|
||||
|
||||
private final transient AtomicCache<KList<IrisObject>> objects = new AtomicCache<>();
|
||||
private final transient AtomicCache<KList<LoaderObject>> objects = new AtomicCache<>();
|
||||
private final transient AtomicCache<KList<BlockData>> blockData = new AtomicCache<>();
|
||||
|
||||
public IrisObject getClump(RNG rng, IrisData rdata) {
|
||||
KList<IrisObject> objects = this.objects.aquire(() ->
|
||||
public LoaderObject getClump(RNG rng, IrisData rdata) {
|
||||
KList<LoaderObject> objects = this.objects.aquire(() ->
|
||||
{
|
||||
RNG rngv = rng.nextParallelRNG(3957778);
|
||||
KList<IrisObject> objectsf = new KList<>();
|
||||
KList<LoaderObject> objectsf = new KList<>();
|
||||
|
||||
for (int i = 0; i < varience; i++) {
|
||||
objectsf.add(generateClumpObject(rngv.nextParallelRNG(2349 * i + 3598), rdata));
|
||||
@@ -104,11 +106,11 @@ public class IrisDepositGenerator {
|
||||
return Math.min(11, (int) Math.round(Math.pow(maxSize, 1D / 3D)));
|
||||
}
|
||||
|
||||
private IrisObject generateClumpObject(RNG rngv, IrisData rdata) {
|
||||
private LoaderObject generateClumpObject(RNG rngv, IrisData rdata) {
|
||||
int s = rngv.i(minSize, maxSize);
|
||||
int dim = Math.min(11, (int) Math.round(Math.pow(maxSize, 1D / 3D)));
|
||||
int w = dim / 2;
|
||||
IrisObject o = new IrisObject(dim, dim, dim);
|
||||
LoaderObject o = new LoaderObject(dim, dim, dim);
|
||||
|
||||
if (s == 1) {
|
||||
o.getBlocks().put(o.getCenter(), nextBlock(rngv, rdata));
|
||||
@@ -133,7 +135,7 @@ public class IrisDepositGenerator {
|
||||
{
|
||||
KList<BlockData> blockData = new KList<>();
|
||||
|
||||
for (IrisBlockData ix : palette) {
|
||||
for (LoaderBlockData ix : palette) {
|
||||
BlockData bx = ix.getBlockData(rdata);
|
||||
|
||||
if (bx != null) {
|
||||
@@ -16,7 +16,7 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.volmit.iris.engine.object;
|
||||
package com.volmit.iris.engine.object.dimensional;
|
||||
|
||||
import com.volmit.iris.engine.object.annotations.Desc;
|
||||
import com.volmit.iris.engine.object.annotations.MinNumber;
|
||||
@@ -47,7 +47,7 @@ public class IrisDimensionIndex {
|
||||
private boolean primary = false;
|
||||
|
||||
@Required
|
||||
@RegistryListResource(IrisDimension.class)
|
||||
@RegistryListResource(LoaderDimension.class)
|
||||
@MinNumber(1)
|
||||
@Desc("Name of dimension")
|
||||
private String dimension = "";
|
||||
@@ -16,11 +16,13 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.volmit.iris.engine.object;
|
||||
package com.volmit.iris.engine.object.dimensional;
|
||||
|
||||
import com.volmit.iris.engine.object.annotations.Desc;
|
||||
import com.volmit.iris.engine.object.annotations.MaxNumber;
|
||||
import com.volmit.iris.engine.object.annotations.MinNumber;
|
||||
import com.volmit.iris.engine.object.noise.IrisInterpolator;
|
||||
import com.volmit.iris.engine.object.noise.IrisStyledRange;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
@@ -16,7 +16,7 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.volmit.iris.engine.object;
|
||||
package com.volmit.iris.engine.object.dimensional;
|
||||
|
||||
import com.volmit.iris.engine.object.annotations.Desc;
|
||||
|
||||
@@ -16,12 +16,36 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.volmit.iris.engine.object;
|
||||
package com.volmit.iris.engine.object.dimensional;
|
||||
|
||||
import com.volmit.iris.Iris;
|
||||
import com.volmit.iris.core.project.loader.IrisData;
|
||||
import com.volmit.iris.engine.cache.AtomicCache;
|
||||
import com.volmit.iris.core.project.loader.LoaderRegistrant;
|
||||
import com.volmit.iris.engine.data.cache.AtomicCache;
|
||||
import com.volmit.iris.engine.data.DataProvider;
|
||||
import com.volmit.iris.engine.object.biome.InferredType;
|
||||
import com.volmit.iris.engine.object.biome.LoaderBiome;
|
||||
import com.volmit.iris.engine.object.biome.IrisBiomeCustom;
|
||||
import com.volmit.iris.engine.object.biome.IrisBiomeMutation;
|
||||
import com.volmit.iris.engine.object.block.IrisBlockDrops;
|
||||
import com.volmit.iris.engine.object.block.IrisMaterialPalette;
|
||||
import com.volmit.iris.engine.object.carve.IrisCarveLayer;
|
||||
import com.volmit.iris.engine.object.carve.IrisCaveFluid;
|
||||
import com.volmit.iris.engine.object.carve.IrisCaveLayer;
|
||||
import com.volmit.iris.engine.object.carve.IrisCaverns;
|
||||
import com.volmit.iris.engine.object.deposits.IrisDepositGenerator;
|
||||
import com.volmit.iris.engine.object.feature.IrisFeaturePositional;
|
||||
import com.volmit.iris.engine.object.feature.IrisFeaturePotential;
|
||||
import com.volmit.iris.engine.object.jigsaw.LoaderJigsawStructure;
|
||||
import com.volmit.iris.engine.object.jigsaw.IrisJigsawStructurePlacement;
|
||||
import com.volmit.iris.engine.object.loot.IrisLootReference;
|
||||
import com.volmit.iris.engine.object.noise.IrisGeneratorStyle;
|
||||
import com.volmit.iris.engine.object.noise.IrisShapedGeneratorStyle;
|
||||
import com.volmit.iris.engine.object.noise.NoiseStyle;
|
||||
import com.volmit.iris.engine.object.objects.IrisObjectPlacement;
|
||||
import com.volmit.iris.engine.object.regional.LoaderRegion;
|
||||
import com.volmit.iris.engine.object.spawners.LoaderSpawner;
|
||||
import com.volmit.iris.engine.object.trees.IrisTreeSettings;
|
||||
import com.volmit.iris.util.noise.CNG;
|
||||
import com.volmit.iris.engine.object.annotations.*;
|
||||
import com.volmit.iris.util.collection.KList;
|
||||
@@ -47,7 +71,7 @@ import java.io.IOException;
|
||||
@Desc("Represents a dimension")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
public class IrisDimension extends IrisRegistrant {
|
||||
public class LoaderDimension extends LoaderRegistrant {
|
||||
public static final BlockData STONE = Material.STONE.createBlockData();
|
||||
public static final BlockData WATER = Material.WATER.createBlockData();
|
||||
|
||||
@@ -61,9 +85,9 @@ public class IrisDimension extends IrisRegistrant {
|
||||
private KList<IrisDimensionIndex> dimensionalComposite = new KList<>();
|
||||
|
||||
@Desc("Create an inverted dimension in the sky (like the nether)")
|
||||
private IrisDimension sky = null;
|
||||
private LoaderDimension sky = null;
|
||||
|
||||
@RegistryListResource(IrisJigsawStructure.class)
|
||||
@RegistryListResource(LoaderJigsawStructure.class)
|
||||
@Desc("If defined, Iris will place the given jigsaw structure where minecraft should place the overworld stronghold.")
|
||||
private String stronghold;
|
||||
|
||||
@@ -90,7 +114,7 @@ public class IrisDimension extends IrisRegistrant {
|
||||
|
||||
@Desc("Spawn Entities in this dimension over time. Iris will continually replenish these mobs just like vanilla does.")
|
||||
@ArrayType(min = 1, type = String.class)
|
||||
@RegistryListResource(IrisSpawner.class)
|
||||
@RegistryListResource(LoaderSpawner.class)
|
||||
private KList<String> entitySpawners = new KList<>();
|
||||
|
||||
@Desc("Add specific features in exact positions")
|
||||
@@ -194,7 +218,7 @@ public class IrisDimension extends IrisRegistrant {
|
||||
@Desc("The world environment")
|
||||
private Environment environment = Environment.NORMAL;
|
||||
|
||||
@RegistryListResource(IrisRegion.class)
|
||||
@RegistryListResource(LoaderRegion.class)
|
||||
@Required
|
||||
@ArrayType(min = 1, type = String.class)
|
||||
@Desc("Define all of the regions to include in this dimension. Dimensions -> Regions -> Biomes -> Objects etc")
|
||||
@@ -210,11 +234,11 @@ public class IrisDimension extends IrisRegistrant {
|
||||
@Desc("The fluid height for this dimension")
|
||||
private int fluidHeight = 63;
|
||||
|
||||
@RegistryListResource(IrisBiome.class)
|
||||
@RegistryListResource(LoaderBiome.class)
|
||||
@Desc("Keep this either undefined or empty. Setting any biome name into this will force iris to only generate the specified biome. Great for testing.")
|
||||
private String focus = "";
|
||||
|
||||
@RegistryListResource(IrisBiome.class)
|
||||
@RegistryListResource(LoaderBiome.class)
|
||||
@Desc("Keep this either undefined or empty. Setting any region name into this will force iris to only generate the specified region. Great for testing.")
|
||||
private String focusRegion = "";
|
||||
|
||||
@@ -385,8 +409,8 @@ public class IrisDimension extends IrisRegistrant {
|
||||
return cosr.aquire(() -> Math.cos(getDimensionAngle()));
|
||||
}
|
||||
|
||||
public KList<IrisRegion> getAllRegions(DataProvider g) {
|
||||
KList<IrisRegion> r = new KList<>();
|
||||
public KList<LoaderRegion> getAllRegions(DataProvider g) {
|
||||
KList<LoaderRegion> r = new KList<>();
|
||||
|
||||
for (String i : getRegions()) {
|
||||
r.add(g.getData().getRegionLoader().load(i));
|
||||
@@ -395,8 +419,8 @@ public class IrisDimension extends IrisRegistrant {
|
||||
return r;
|
||||
}
|
||||
|
||||
public KList<IrisRegion> getAllAnyRegions() {
|
||||
KList<IrisRegion> r = new KList<>();
|
||||
public KList<LoaderRegion> getAllAnyRegions() {
|
||||
KList<LoaderRegion> r = new KList<>();
|
||||
|
||||
for (String i : getRegions()) {
|
||||
r.add(IrisData.loadAnyRegion(i));
|
||||
@@ -405,14 +429,14 @@ public class IrisDimension extends IrisRegistrant {
|
||||
return r;
|
||||
}
|
||||
|
||||
public KList<IrisBiome> getAllBiomes(DataProvider g) {
|
||||
public KList<LoaderBiome> getAllBiomes(DataProvider g) {
|
||||
return g.getData().getBiomeLoader().loadAll(g.getData().getBiomeLoader().getPossibleKeys());
|
||||
}
|
||||
|
||||
public KList<IrisBiome> getAllAnyBiomes() {
|
||||
KList<IrisBiome> r = new KList<>();
|
||||
public KList<LoaderBiome> getAllAnyBiomes() {
|
||||
KList<LoaderBiome> r = new KList<>();
|
||||
|
||||
for (IrisRegion i : getAllAnyRegions()) {
|
||||
for (LoaderRegion i : getAllAnyRegions()) {
|
||||
if (i == null) {
|
||||
continue;
|
||||
}
|
||||
@@ -450,7 +474,7 @@ public class IrisDimension extends IrisRegistrant {
|
||||
|
||||
IO.delete(new File(datapacks, "iris/data/" + getLoadKey()));
|
||||
|
||||
for (IrisBiome i : getAllBiomes(data)) {
|
||||
for (LoaderBiome i : getAllBiomes(data)) {
|
||||
if (i.isCustom()) {
|
||||
write = true;
|
||||
|
||||
@@ -500,7 +524,7 @@ public class IrisDimension extends IrisRegistrant {
|
||||
return true;
|
||||
}
|
||||
|
||||
for (IrisRegion i : getAllRegions(data)) {
|
||||
for (LoaderRegion i : getAllRegions(data)) {
|
||||
if (i.getFeatures().isNotEmpty()) {
|
||||
return true;
|
||||
}
|
||||
@@ -511,7 +535,7 @@ public class IrisDimension extends IrisRegistrant {
|
||||
}
|
||||
}
|
||||
|
||||
for (IrisBiome j : i.getAllBiomes(data)) {
|
||||
for (LoaderBiome j : i.getAllBiomes(data)) {
|
||||
if (j.getFeatures().isNotEmpty()) {
|
||||
return true;
|
||||
}
|
||||
@@ -19,7 +19,7 @@
|
||||
package com.volmit.iris.engine.object.engine;
|
||||
|
||||
import com.volmit.iris.engine.framework.Engine;
|
||||
import com.volmit.iris.engine.object.IrisRate;
|
||||
import com.volmit.iris.engine.object.basic.IrisRate;
|
||||
import com.volmit.iris.util.math.M;
|
||||
import lombok.Data;
|
||||
|
||||
|
||||
@@ -16,14 +16,16 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.volmit.iris.engine.object;
|
||||
package com.volmit.iris.engine.object.entity;
|
||||
|
||||
import com.volmit.iris.Iris;
|
||||
import com.volmit.iris.engine.IrisComplex;
|
||||
import com.volmit.iris.engine.cache.AtomicCache;
|
||||
import com.volmit.iris.engine.data.cache.AtomicCache;
|
||||
import com.volmit.iris.engine.framework.Engine;
|
||||
import com.volmit.iris.engine.framework.EngineFramework;
|
||||
import com.volmit.iris.engine.modifier.IrisCaveModifier;
|
||||
import com.volmit.iris.engine.object.biome.LoaderBiome;
|
||||
import com.volmit.iris.engine.object.spawners.LoaderSpawner;
|
||||
import com.volmit.iris.engine.object.annotations.Desc;
|
||||
import com.volmit.iris.engine.object.annotations.MinNumber;
|
||||
import com.volmit.iris.engine.object.annotations.RegistryListResource;
|
||||
@@ -38,9 +40,7 @@ import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.bukkit.Chunk;
|
||||
import org.bukkit.HeightMap;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.entity.Entity;
|
||||
|
||||
@Accessors(chain = true)
|
||||
@@ -49,7 +49,7 @@ import org.bukkit.entity.Entity;
|
||||
@Desc("Represents an entity spawn during initial chunk generation")
|
||||
@Data
|
||||
public class IrisEntitySpawn implements IRare {
|
||||
@RegistryListResource(IrisEntity.class)
|
||||
@RegistryListResource(LoaderEntity.class)
|
||||
@Required
|
||||
@Desc("The entity")
|
||||
private String entity = "";
|
||||
@@ -69,9 +69,9 @@ public class IrisEntitySpawn implements IRare {
|
||||
@Desc("The max of this entity to spawn")
|
||||
private int maxSpawns = 1;
|
||||
|
||||
private transient IrisSpawner referenceSpawner;
|
||||
private transient LoaderSpawner referenceSpawner;
|
||||
private final transient AtomicCache<RNG> rng = new AtomicCache<>();
|
||||
private final transient AtomicCache<IrisEntity> ent = new AtomicCache<>();
|
||||
private final transient AtomicCache<LoaderEntity> ent = new AtomicCache<>();
|
||||
|
||||
public int spawn(Engine gen, Chunk c, RNG rng) {
|
||||
int spawns = minSpawns == maxSpawns ? minSpawns : rng.i(Math.min(minSpawns, maxSpawns), Math.max(minSpawns, maxSpawns));
|
||||
@@ -88,7 +88,7 @@ public class IrisEntitySpawn implements IRare {
|
||||
case CAVE -> {
|
||||
IrisComplex comp = gen.getFramework().getComplex();
|
||||
EngineFramework frame = gen.getFramework();
|
||||
IrisBiome cave = comp.getCaveBiomeStream().get(x, z);
|
||||
LoaderBiome cave = comp.getCaveBiomeStream().get(x, z);
|
||||
KList<Location> r = new KList<>();
|
||||
if (cave != null) {
|
||||
for (CaveResult i : ((IrisCaveModifier) frame.getCaveModifier()).genCaves(x, z)) {
|
||||
@@ -116,7 +116,7 @@ public class IrisEntitySpawn implements IRare {
|
||||
return s;
|
||||
}
|
||||
|
||||
public IrisEntity getRealEntity(Engine g) {
|
||||
public LoaderEntity getRealEntity(Engine g) {
|
||||
return ent.aquire(() -> g.getData().getEntityLoader().load(getEntity()));
|
||||
}
|
||||
|
||||
@@ -134,7 +134,7 @@ public class IrisEntitySpawn implements IRare {
|
||||
|
||||
private Entity spawn100(Engine g, Location at) {
|
||||
try {
|
||||
IrisEntity irisEntity = getRealEntity(g);
|
||||
LoaderEntity irisEntity = getRealEntity(g);
|
||||
|
||||
if (!irisEntity.getSurface().matches(at.clone().subtract(0, 1, 0).getBlock().getState())) return null; //Make sure it can spawn on the block
|
||||
|
||||
@@ -16,9 +16,9 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.volmit.iris.engine.object;
|
||||
package com.volmit.iris.engine.object.entity;
|
||||
|
||||
import com.volmit.iris.engine.cache.AtomicCache;
|
||||
import com.volmit.iris.engine.data.cache.AtomicCache;
|
||||
import com.volmit.iris.engine.framework.Engine;
|
||||
import com.volmit.iris.engine.object.annotations.Desc;
|
||||
import com.volmit.iris.engine.object.annotations.MinNumber;
|
||||
@@ -40,7 +40,7 @@ import org.bukkit.event.entity.EntitySpawnEvent;
|
||||
@Desc("Represents an entity spawn")
|
||||
@Data
|
||||
public class IrisEntitySpawnOverride {
|
||||
@RegistryListResource(IrisEntity.class)
|
||||
@RegistryListResource(LoaderEntity.class)
|
||||
@Required
|
||||
@Desc("The entity")
|
||||
private String entity = "";
|
||||
@@ -57,7 +57,7 @@ public class IrisEntitySpawnOverride {
|
||||
private int rarity = 1;
|
||||
|
||||
private final transient AtomicCache<RNG> rng = new AtomicCache<>();
|
||||
private final transient AtomicCache<IrisEntity> ent = new AtomicCache<>();
|
||||
private final transient AtomicCache<LoaderEntity> ent = new AtomicCache<>();
|
||||
|
||||
|
||||
public Entity on(Engine g, Location at, EntityType t, EntitySpawnEvent ee) {
|
||||
@@ -89,7 +89,7 @@ public class IrisEntitySpawnOverride {
|
||||
return null;
|
||||
}
|
||||
|
||||
public IrisEntity getRealEntity(Engine g) {
|
||||
public LoaderEntity getRealEntity(Engine g) {
|
||||
return ent.aquire(() -> g.getData().getEntityLoader().load(getEntity()));
|
||||
}
|
||||
}
|
||||
@@ -16,13 +16,21 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.volmit.iris.engine.object;
|
||||
package com.volmit.iris.engine.object.entity;
|
||||
|
||||
import com.volmit.iris.Iris;
|
||||
import com.volmit.iris.core.project.loader.LoaderRegistrant;
|
||||
import com.volmit.iris.engine.framework.Engine;
|
||||
import com.volmit.iris.engine.object.annotations.ArrayType;
|
||||
import com.volmit.iris.engine.object.annotations.Desc;
|
||||
import com.volmit.iris.engine.object.annotations.Required;
|
||||
import com.volmit.iris.engine.object.loot.IrisLoot;
|
||||
import com.volmit.iris.engine.object.loot.IrisLootReference;
|
||||
import com.volmit.iris.engine.object.loot.LoaderLootTable;
|
||||
import com.volmit.iris.engine.object.meta.InventorySlotType;
|
||||
import com.volmit.iris.engine.object.meta.IrisAttributeModifier;
|
||||
import com.volmit.iris.engine.object.meta.IrisEffect;
|
||||
import com.volmit.iris.engine.object.spawners.IrisSurface;
|
||||
import com.volmit.iris.util.collection.KList;
|
||||
import com.volmit.iris.util.format.C;
|
||||
import com.volmit.iris.util.math.RNG;
|
||||
@@ -57,7 +65,7 @@ import java.util.concurrent.atomic.AtomicReference;
|
||||
@Desc("Represents an iris entity.")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
public class IrisEntity extends IrisRegistrant {
|
||||
public class LoaderEntity extends LoaderRegistrant {
|
||||
@Required
|
||||
@Desc("The type of entity to spawn. To spawn a mythic mob, set this type to unknown and define mythic type.")
|
||||
private EntityType type = EntityType.UNKNOWN;
|
||||
@@ -111,8 +119,8 @@ public class IrisEntity extends IrisRegistrant {
|
||||
private IrisLoot offHand = null;
|
||||
|
||||
@Desc("Make other entities ride this entity")
|
||||
@ArrayType(min = 1, type = IrisEntity.class)
|
||||
private KList<IrisEntity> passengers = new KList<>();
|
||||
@ArrayType(min = 1, type = LoaderEntity.class)
|
||||
private KList<LoaderEntity> passengers = new KList<>();
|
||||
|
||||
@Desc("Attribute modifiers for this entity")
|
||||
@ArrayType(min = 1, type = IrisAttributeModifier.class)
|
||||
@@ -122,7 +130,7 @@ public class IrisEntity extends IrisRegistrant {
|
||||
private IrisLootReference loot = new IrisLootReference();
|
||||
|
||||
@Desc("If specified, this entity will be leashed by this entity. I.e. THIS ENTITY Leashed by SPECIFIED. This has no effect on EnderDragons, Withers, Players, or Bats.Non-living entities excluding leashes will not persist as leashholders.")
|
||||
private IrisEntity leashHolder = null;
|
||||
private LoaderEntity leashHolder = null;
|
||||
|
||||
@Desc("If specified, this entity will spawn with an effect")
|
||||
private IrisEffect spawnEffect = null;
|
||||
@@ -163,7 +171,7 @@ public class IrisEntity extends IrisRegistrant {
|
||||
e.setPersistent(isKeepEntity());
|
||||
|
||||
int gg = 0;
|
||||
for (IrisEntity i : passengers) {
|
||||
for (LoaderEntity i : passengers) {
|
||||
Entity passenger = i.spawn(gen, at, rng.nextParallelRNG(234858 + gg++));
|
||||
if (!Bukkit.isPrimaryThread()) {
|
||||
J.s(() -> e.addPassenger(passenger));
|
||||
@@ -185,7 +193,7 @@ public class IrisEntity extends IrisRegistrant {
|
||||
l.setLootTable(new LootTable() {
|
||||
@Override
|
||||
public NamespacedKey getKey() {
|
||||
return new NamespacedKey(Iris.instance, "loot-" + IrisEntity.this.hashCode());
|
||||
return new NamespacedKey(Iris.instance, "loot-" + LoaderEntity.this.hashCode());
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -193,7 +201,7 @@ public class IrisEntity extends IrisRegistrant {
|
||||
KList<ItemStack> items = new KList<>();
|
||||
|
||||
for (String fi : getLoot().getTables()) {
|
||||
IrisLootTable i = gen.getData().getLootLoader().load(fi);
|
||||
LoaderLootTable i = gen.getData().getLootLoader().load(fi);
|
||||
items.addAll(i.getLoot(gen.isStudio(), false, rng.nextParallelRNG(345911), InventorySlotType.STORAGE, at.getBlockX(), at.getBlockY(), at.getBlockZ(), 8, 4));
|
||||
}
|
||||
|
||||
@@ -16,13 +16,16 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.volmit.iris.engine.object;
|
||||
package com.volmit.iris.engine.object.feature;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.volmit.iris.engine.cache.AtomicCache;
|
||||
import com.volmit.iris.engine.interpolation.InterpolationMethod;
|
||||
import com.volmit.iris.engine.interpolation.IrisInterpolation;
|
||||
import com.volmit.iris.engine.data.cache.AtomicCache;
|
||||
import com.volmit.iris.util.interpolation.InterpolationMethod;
|
||||
import com.volmit.iris.util.interpolation.IrisInterpolation;
|
||||
import com.volmit.iris.engine.object.biome.LoaderBiome;
|
||||
import com.volmit.iris.engine.object.spawners.LoaderSpawner;
|
||||
import com.volmit.iris.engine.object.annotations.*;
|
||||
import com.volmit.iris.engine.object.noise.IrisGeneratorStyle;
|
||||
import com.volmit.iris.util.collection.KList;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
@@ -47,7 +50,7 @@ public class IrisFeature {
|
||||
@Desc("The chance an object that should be place actually will place. Set to below 1 to affect objects in this zone")
|
||||
private double objectChance = 1;
|
||||
|
||||
@RegistryListResource(IrisBiome.class)
|
||||
@RegistryListResource(LoaderBiome.class)
|
||||
@Desc("Apply a custom biome here")
|
||||
private String customBiome = null;
|
||||
|
||||
@@ -82,7 +85,7 @@ public class IrisFeature {
|
||||
@Desc("Fracture the radius ring with additional noise")
|
||||
private IrisGeneratorStyle fractureRadius = null;
|
||||
|
||||
@RegistryListResource(IrisSpawner.class)
|
||||
@RegistryListResource(LoaderSpawner.class)
|
||||
@ArrayType(min = 1, type = String.class)
|
||||
@Desc("Within this noise feature, use the following spawners")
|
||||
private KList<String> entitySpawners = new KList<>();
|
||||
@@ -16,12 +16,13 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.volmit.iris.engine.object;
|
||||
package com.volmit.iris.engine.object.feature;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.volmit.iris.core.project.loader.IrisData;
|
||||
import com.volmit.iris.engine.cache.AtomicCache;
|
||||
import com.volmit.iris.engine.interpolation.IrisInterpolation;
|
||||
import com.volmit.iris.engine.data.cache.AtomicCache;
|
||||
import com.volmit.iris.util.interpolation.IrisInterpolation;
|
||||
import com.volmit.iris.engine.object.biome.LoaderBiome;
|
||||
import com.volmit.iris.engine.object.annotations.Desc;
|
||||
import com.volmit.iris.engine.object.annotations.Required;
|
||||
import com.volmit.iris.util.documentation.BlockCoordinates;
|
||||
@@ -124,10 +125,10 @@ public class IrisFeaturePositional {
|
||||
return M.lerp(1, getFeature().getObjectChance(), getStrength(x, z, rng, data));
|
||||
}
|
||||
|
||||
public IrisBiome filter(double x, double z, IrisBiome biome, RNG rng) {
|
||||
public LoaderBiome filter(double x, double z, LoaderBiome biome, RNG rng) {
|
||||
if (getFeature().getCustomBiome() != null) {
|
||||
if (getStrength(x, z, rng, biome.getLoader()) >= getFeature().getBiomeStrengthThreshold()) {
|
||||
IrisBiome b = biome.getLoader().getBiomeLoader().load(getFeature().getCustomBiome());
|
||||
LoaderBiome b = biome.getLoader().getBiomeLoader().load(getFeature().getCustomBiome());
|
||||
b.setInferredType(biome.getInferredType());
|
||||
return b;
|
||||
}
|
||||
@@ -16,7 +16,7 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.volmit.iris.engine.object;
|
||||
package com.volmit.iris.engine.object.feature;
|
||||
|
||||
import com.volmit.iris.engine.object.annotations.Desc;
|
||||
import com.volmit.iris.engine.object.annotations.MinNumber;
|
||||
@@ -16,8 +16,11 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.volmit.iris.engine.object;
|
||||
package com.volmit.iris.engine.object.jigsaw;
|
||||
|
||||
import com.volmit.iris.engine.object.objects.IrisDirection;
|
||||
import com.volmit.iris.engine.object.entity.LoaderEntity;
|
||||
import com.volmit.iris.engine.object.basic.IrisPosition;
|
||||
import com.volmit.iris.engine.object.annotations.*;
|
||||
import com.volmit.iris.util.collection.KList;
|
||||
import lombok.AllArgsConstructor;
|
||||
@@ -49,13 +52,13 @@ public class IrisJigsawPieceConnector {
|
||||
@Desc("If set to true, this connector is allowed to place pieces inside of it's own piece. For example if you are adding a light post, or house on top of a path piece, you would set this to true to allow the piece to collide with the path bounding box.")
|
||||
private boolean innerConnector = false;
|
||||
|
||||
@RegistryListResource(IrisJigsawPool.class)
|
||||
@RegistryListResource(LoaderJigsawPool.class)
|
||||
@Desc("Pick piece pools to place onto this connector")
|
||||
@ArrayType(type = String.class, min = 1)
|
||||
@Required
|
||||
private KList<String> pools = new KList<>();
|
||||
|
||||
@RegistryListResource(IrisEntity.class)
|
||||
@RegistryListResource(LoaderEntity.class)
|
||||
@Desc("Pick an entity to spawn on this connector")
|
||||
private String spawnEntity;
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.volmit.iris.engine.object;
|
||||
package com.volmit.iris.engine.object.jigsaw;
|
||||
|
||||
import com.volmit.iris.engine.object.annotations.Desc;
|
||||
import com.volmit.iris.engine.object.annotations.MinNumber;
|
||||
@@ -33,7 +33,7 @@ import lombok.experimental.Accessors;
|
||||
@Desc("Represents a jigsaw placement")
|
||||
@Data
|
||||
public class IrisJigsawPlacement {
|
||||
@RegistryListResource(IrisJigsawStructure.class)
|
||||
@RegistryListResource(LoaderJigsawStructure.class)
|
||||
@Required
|
||||
@Desc("The jigsaw structure to use")
|
||||
private String structure = "";
|
||||
@@ -16,7 +16,7 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.volmit.iris.engine.object;
|
||||
package com.volmit.iris.engine.object.jigsaw;
|
||||
|
||||
import com.volmit.iris.engine.object.annotations.Desc;
|
||||
import com.volmit.iris.engine.object.annotations.RegistryListResource;
|
||||
@@ -36,7 +36,7 @@ import lombok.experimental.Accessors;
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
public class IrisJigsawStructurePlacement {
|
||||
@RegistryListResource(IrisJigsawStructure.class)
|
||||
@RegistryListResource(LoaderJigsawStructure.class)
|
||||
@Required
|
||||
@Desc("The structure to place")
|
||||
private String structure;
|
||||
@@ -16,14 +16,19 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.volmit.iris.engine.object;
|
||||
package com.volmit.iris.engine.object.jigsaw;
|
||||
|
||||
import com.volmit.iris.Iris;
|
||||
import com.volmit.iris.engine.cache.AtomicCache;
|
||||
import com.volmit.iris.engine.data.cache.AtomicCache;
|
||||
import com.volmit.iris.engine.object.basic.IrisPosition;
|
||||
import com.volmit.iris.core.project.loader.LoaderRegistrant;
|
||||
import com.volmit.iris.engine.object.objects.ObjectPlaceMode;
|
||||
import com.volmit.iris.engine.object.annotations.ArrayType;
|
||||
import com.volmit.iris.engine.object.annotations.Desc;
|
||||
import com.volmit.iris.engine.object.annotations.RegistryListResource;
|
||||
import com.volmit.iris.engine.object.annotations.Required;
|
||||
import com.volmit.iris.engine.object.objects.LoaderObject;
|
||||
import com.volmit.iris.engine.object.objects.IrisObjectPlacement;
|
||||
import com.volmit.iris.util.collection.KList;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
@@ -42,8 +47,8 @@ import java.io.IOException;
|
||||
@Desc("Represents a structure tile")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
public class IrisJigsawPiece extends IrisRegistrant {
|
||||
@RegistryListResource(IrisObject.class)
|
||||
public class LoaderJigsawPiece extends LoaderRegistrant {
|
||||
@RegistryListResource(LoaderObject.class)
|
||||
@Required
|
||||
@Desc("The object this piece represents")
|
||||
private String object = "";
|
||||
@@ -62,7 +67,7 @@ public class IrisJigsawPiece extends IrisRegistrant {
|
||||
public int getMax2dDimension() {
|
||||
return max2dDim.aquire(() -> {
|
||||
try {
|
||||
BlockVector v = IrisObject.sampleSize(getLoader().getObjectLoader().findFile(getObject()));
|
||||
BlockVector v = LoaderObject.sampleSize(getLoader().getObjectLoader().findFile(getObject()));
|
||||
return Math.max(v.getBlockX(), v.getBlockZ());
|
||||
} catch (IOException e) {
|
||||
Iris.reportError(e);
|
||||
@@ -76,7 +81,7 @@ public class IrisJigsawPiece extends IrisRegistrant {
|
||||
public int getMax3dDimension() {
|
||||
return max3dDim.aquire(() -> {
|
||||
try {
|
||||
BlockVector v = IrisObject.sampleSize(getLoader().getObjectLoader().findFile(getObject()));
|
||||
BlockVector v = LoaderObject.sampleSize(getLoader().getObjectLoader().findFile(getObject()));
|
||||
return Math.max(Math.max(v.getBlockX(), v.getBlockZ()), v.getBlockY());
|
||||
} catch (IOException e) {
|
||||
Iris.reportError(e);
|
||||
@@ -98,8 +103,8 @@ public class IrisJigsawPiece extends IrisRegistrant {
|
||||
return null;
|
||||
}
|
||||
|
||||
public IrisJigsawPiece copy() {
|
||||
IrisJigsawPiece p = new IrisJigsawPiece();
|
||||
public LoaderJigsawPiece copy() {
|
||||
LoaderJigsawPiece p = new LoaderJigsawPiece();
|
||||
p.setObject(getObject());
|
||||
p.setLoader(getLoader());
|
||||
p.setLoadKey(getLoadKey());
|
||||
@@ -16,8 +16,9 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.volmit.iris.engine.object;
|
||||
package com.volmit.iris.engine.object.jigsaw;
|
||||
|
||||
import com.volmit.iris.core.project.loader.LoaderRegistrant;
|
||||
import com.volmit.iris.engine.object.annotations.ArrayType;
|
||||
import com.volmit.iris.engine.object.annotations.Desc;
|
||||
import com.volmit.iris.engine.object.annotations.RegistryListResource;
|
||||
@@ -37,8 +38,8 @@ import lombok.experimental.Accessors;
|
||||
@Desc("Represents a structure piece pool")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
public class IrisJigsawPool extends IrisRegistrant {
|
||||
@RegistryListResource(IrisJigsawPiece.class)
|
||||
public class LoaderJigsawPool extends LoaderRegistrant {
|
||||
@RegistryListResource(LoaderJigsawPiece.class)
|
||||
@Required
|
||||
@ArrayType(min = 1, type = String.class)
|
||||
@Desc("A list of structure piece pools")
|
||||
@@ -16,10 +16,12 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.volmit.iris.engine.object;
|
||||
package com.volmit.iris.engine.object.jigsaw;
|
||||
|
||||
import com.volmit.iris.Iris;
|
||||
import com.volmit.iris.engine.cache.AtomicCache;
|
||||
import com.volmit.iris.engine.data.cache.AtomicCache;
|
||||
import com.volmit.iris.engine.object.feature.IrisFeature;
|
||||
import com.volmit.iris.core.project.loader.LoaderRegistrant;
|
||||
import com.volmit.iris.engine.object.annotations.*;
|
||||
import com.volmit.iris.util.collection.KList;
|
||||
import lombok.AllArgsConstructor;
|
||||
@@ -36,8 +38,8 @@ import lombok.experimental.Accessors;
|
||||
@Desc("Represents a jigsaw structure")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
public class IrisJigsawStructure extends IrisRegistrant {
|
||||
@RegistryListResource(IrisJigsawPiece.class)
|
||||
public class LoaderJigsawStructure extends LoaderRegistrant {
|
||||
@RegistryListResource(LoaderJigsawPiece.class)
|
||||
@Required
|
||||
@ArrayType(min = 1, type = String.class)
|
||||
@Desc("The starting pieces. Randomly chooses a starting piece, then connects pieces using the pools define in the starting piece.")
|
||||
@@ -64,7 +66,7 @@ public class IrisJigsawStructure extends IrisRegistrant {
|
||||
return;
|
||||
}
|
||||
|
||||
IrisJigsawPool pool = getLoader().getJigsawPoolLoader().load(p);
|
||||
LoaderJigsawPool pool = getLoader().getJigsawPoolLoader().load(p);
|
||||
|
||||
if (pool == null) {
|
||||
Iris.warn("Can't find jigsaw pool: " + p);
|
||||
@@ -79,7 +81,7 @@ public class IrisJigsawStructure extends IrisRegistrant {
|
||||
}
|
||||
|
||||
private void loadPiece(String p, KList<String> pools, KList<String> pieces) {
|
||||
IrisJigsawPiece piece = getLoader().getJigsawPieceLoader().load(p);
|
||||
LoaderJigsawPiece piece = getLoader().getJigsawPieceLoader().load(p);
|
||||
|
||||
if (piece == null) {
|
||||
Iris.warn("Can't find jigsaw piece: " + p);
|
||||
@@ -16,11 +16,15 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.volmit.iris.engine.object;
|
||||
package com.volmit.iris.engine.object.loot;
|
||||
|
||||
import com.volmit.iris.Iris;
|
||||
import com.volmit.iris.engine.cache.AtomicCache;
|
||||
import com.volmit.iris.engine.data.cache.AtomicCache;
|
||||
import com.volmit.iris.engine.data.B;
|
||||
import com.volmit.iris.engine.object.meta.InventorySlotType;
|
||||
import com.volmit.iris.engine.object.meta.IrisAttributeModifier;
|
||||
import com.volmit.iris.engine.object.meta.IrisEnchantment;
|
||||
import com.volmit.iris.engine.object.noise.NoiseStyle;
|
||||
import com.volmit.iris.util.noise.CNG;
|
||||
import com.volmit.iris.engine.object.annotations.*;
|
||||
import com.volmit.iris.util.collection.KList;
|
||||
@@ -191,7 +195,7 @@ public class IrisLoot {
|
||||
return new ItemStack(Material.AIR);
|
||||
}
|
||||
|
||||
public ItemStack get(boolean debug, boolean giveSomething, IrisLootTable table, RNG rng, int x, int y, int z) {
|
||||
public ItemStack get(boolean debug, boolean giveSomething, LoaderLootTable table, RNG rng, int x, int y, int z) {
|
||||
if (debug) {
|
||||
chance.reset();
|
||||
}
|
||||
@@ -16,9 +16,9 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.volmit.iris.engine.object;
|
||||
package com.volmit.iris.engine.object.loot;
|
||||
|
||||
import com.volmit.iris.engine.cache.AtomicCache;
|
||||
import com.volmit.iris.engine.data.cache.AtomicCache;
|
||||
import com.volmit.iris.engine.data.DataProvider;
|
||||
import com.volmit.iris.engine.object.annotations.ArrayType;
|
||||
import com.volmit.iris.engine.object.annotations.Desc;
|
||||
@@ -39,7 +39,7 @@ public class IrisLootReference {
|
||||
@Desc("Add = add on top of parent tables, Replace = clear first then add these. Clear = Remove all and dont add loot from this or parent.")
|
||||
private LootMode mode = LootMode.ADD;
|
||||
|
||||
@RegistryListResource(IrisLootTable.class)
|
||||
@RegistryListResource(LoaderLootTable.class)
|
||||
@ArrayType(min = 1, type = String.class)
|
||||
@Desc("Add loot table registries here")
|
||||
private KList<String> tables = new KList<>();
|
||||
@@ -48,12 +48,12 @@ public class IrisLootReference {
|
||||
@Desc("Increase the chance of loot in this area")
|
||||
private double multiplier = 1D;
|
||||
|
||||
private final transient AtomicCache<KList<IrisLootTable>> tt = new AtomicCache<>();
|
||||
private final transient AtomicCache<KList<LoaderLootTable>> tt = new AtomicCache<>();
|
||||
|
||||
public KList<IrisLootTable> getLootTables(DataProvider g) {
|
||||
public KList<LoaderLootTable> getLootTables(DataProvider g) {
|
||||
return tt.aquire(() ->
|
||||
{
|
||||
KList<IrisLootTable> t = new KList<>();
|
||||
KList<LoaderLootTable> t = new KList<>();
|
||||
|
||||
for (String i : tables) {
|
||||
t.add(g.getData().getLootLoader().load(i));
|
||||
@@ -16,8 +16,10 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.volmit.iris.engine.object;
|
||||
package com.volmit.iris.engine.object.loot;
|
||||
|
||||
import com.volmit.iris.engine.object.meta.InventorySlotType;
|
||||
import com.volmit.iris.core.project.loader.LoaderRegistrant;
|
||||
import com.volmit.iris.engine.object.annotations.ArrayType;
|
||||
import com.volmit.iris.engine.object.annotations.Desc;
|
||||
import com.volmit.iris.engine.object.annotations.MinNumber;
|
||||
@@ -39,7 +41,7 @@ import org.bukkit.inventory.ItemStack;
|
||||
@Desc("Represents a loot table. Biomes, Regions & Objects can add or replace the virtual table with these loot tables")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
public class IrisLootTable extends IrisRegistrant {
|
||||
public class LoaderLootTable extends LoaderRegistrant {
|
||||
@Required
|
||||
@Desc("The name of this loot table")
|
||||
@MinNumber(2)
|
||||
@@ -16,7 +16,7 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.volmit.iris.engine.object;
|
||||
package com.volmit.iris.engine.object.loot;
|
||||
|
||||
import com.volmit.iris.engine.object.annotations.Desc;
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
|
||||
package com.volmit.iris.engine.object.matter;
|
||||
|
||||
import com.volmit.iris.engine.cache.Cache;
|
||||
import com.volmit.iris.engine.data.cache.Cache;
|
||||
import com.volmit.iris.util.hunk.Hunk;
|
||||
import com.volmit.iris.util.data.Varint;
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.volmit.iris.engine.object;
|
||||
package com.volmit.iris.engine.object.meta;
|
||||
|
||||
import com.volmit.iris.engine.object.annotations.Desc;
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.volmit.iris.engine.object;
|
||||
package com.volmit.iris.engine.object.meta;
|
||||
|
||||
import com.volmit.iris.engine.object.annotations.Desc;
|
||||
import com.volmit.iris.engine.object.annotations.MaxNumber;
|
||||
@@ -16,10 +16,10 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.volmit.iris.engine.object;
|
||||
package com.volmit.iris.engine.object.meta;
|
||||
|
||||
import com.volmit.iris.Iris;
|
||||
import com.volmit.iris.engine.cache.AtomicCache;
|
||||
import com.volmit.iris.engine.data.cache.AtomicCache;
|
||||
import com.volmit.iris.engine.framework.GeneratorAccess;
|
||||
import com.volmit.iris.engine.object.annotations.*;
|
||||
import com.volmit.iris.util.math.RNG;
|
||||
@@ -16,7 +16,7 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.volmit.iris.engine.object;
|
||||
package com.volmit.iris.engine.object.meta;
|
||||
|
||||
import com.volmit.iris.Iris;
|
||||
import com.volmit.iris.engine.object.annotations.Desc;
|
||||
@@ -16,10 +16,10 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.volmit.iris.engine.object;
|
||||
package com.volmit.iris.engine.object.meta;
|
||||
|
||||
import com.volmit.iris.Iris;
|
||||
import com.volmit.iris.engine.cache.AtomicCache;
|
||||
import com.volmit.iris.engine.data.cache.AtomicCache;
|
||||
import com.volmit.iris.engine.object.annotations.Desc;
|
||||
import com.volmit.iris.engine.object.annotations.MaxNumber;
|
||||
import com.volmit.iris.engine.object.annotations.MinNumber;
|
||||
@@ -16,8 +16,10 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.volmit.iris.engine.object;
|
||||
package com.volmit.iris.engine.object.mods;
|
||||
|
||||
import com.volmit.iris.engine.object.biome.LoaderBiome;
|
||||
import com.volmit.iris.engine.object.regional.LoaderRegion;
|
||||
import com.volmit.iris.engine.object.annotations.ArrayType;
|
||||
import com.volmit.iris.engine.object.annotations.Desc;
|
||||
import com.volmit.iris.engine.object.annotations.RegistryListResource;
|
||||
@@ -36,12 +38,12 @@ import lombok.experimental.Accessors;
|
||||
public class IrisModBiomeInjector {
|
||||
@Required
|
||||
@Desc("The region to find")
|
||||
@RegistryListResource(IrisRegion.class)
|
||||
@RegistryListResource(LoaderRegion.class)
|
||||
private String region = "";
|
||||
|
||||
@Required
|
||||
@Desc("A biome to inject into the region")
|
||||
@RegistryListResource(IrisBiome.class)
|
||||
@RegistryListResource(LoaderBiome.class)
|
||||
@ArrayType(type = String.class, min = 1)
|
||||
private KList<String> inject = new KList<>();
|
||||
}
|
||||
@@ -16,8 +16,9 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.volmit.iris.engine.object;
|
||||
package com.volmit.iris.engine.object.mods;
|
||||
|
||||
import com.volmit.iris.engine.object.biome.LoaderBiome;
|
||||
import com.volmit.iris.engine.object.annotations.ArrayType;
|
||||
import com.volmit.iris.engine.object.annotations.Desc;
|
||||
import com.volmit.iris.engine.object.annotations.RegistryListResource;
|
||||
@@ -36,12 +37,12 @@ import lombok.experimental.Accessors;
|
||||
public class IrisModBiomeReplacer {
|
||||
@Required
|
||||
@Desc("A list of biomes to find")
|
||||
@RegistryListResource(IrisBiome.class)
|
||||
@RegistryListResource(LoaderBiome.class)
|
||||
@ArrayType(type = String.class, min = 1)
|
||||
private KList<String> find = new KList<>();
|
||||
|
||||
@Required
|
||||
@Desc("A biome to replace it with")
|
||||
@RegistryListResource(IrisBiome.class)
|
||||
@RegistryListResource(LoaderBiome.class)
|
||||
private String replace = "";
|
||||
}
|
||||
@@ -16,8 +16,11 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.volmit.iris.engine.object;
|
||||
package com.volmit.iris.engine.object.mods;
|
||||
|
||||
import com.volmit.iris.engine.object.biome.LoaderBiome;
|
||||
import com.volmit.iris.engine.object.noise.IrisGeneratorStyle;
|
||||
import com.volmit.iris.engine.object.noise.NoiseStyle;
|
||||
import com.volmit.iris.engine.object.annotations.ArrayType;
|
||||
import com.volmit.iris.engine.object.annotations.Desc;
|
||||
import com.volmit.iris.engine.object.annotations.RegistryListResource;
|
||||
@@ -44,6 +47,6 @@ public class IrisModNoiseStyleReplacer {
|
||||
|
||||
@Required
|
||||
@Desc("A noise style to replace it with")
|
||||
@RegistryListResource(IrisBiome.class)
|
||||
@RegistryListResource(LoaderBiome.class)
|
||||
private IrisGeneratorStyle replace = new IrisGeneratorStyle();
|
||||
}
|
||||
@@ -16,12 +16,14 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.volmit.iris.engine.object;
|
||||
package com.volmit.iris.engine.object.mods;
|
||||
|
||||
import com.volmit.iris.engine.object.biome.LoaderBiome;
|
||||
import com.volmit.iris.engine.object.annotations.ArrayType;
|
||||
import com.volmit.iris.engine.object.annotations.Desc;
|
||||
import com.volmit.iris.engine.object.annotations.RegistryListResource;
|
||||
import com.volmit.iris.engine.object.annotations.Required;
|
||||
import com.volmit.iris.engine.object.objects.IrisObjectPlacement;
|
||||
import com.volmit.iris.util.collection.KList;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
@@ -36,7 +38,7 @@ import lombok.experimental.Accessors;
|
||||
public class IrisModObjectPlacementBiomeInjector {
|
||||
@Required
|
||||
@Desc("The biome to find")
|
||||
@RegistryListResource(IrisBiome.class)
|
||||
@RegistryListResource(LoaderBiome.class)
|
||||
private String biome = "";
|
||||
|
||||
@Required
|
||||
@@ -16,12 +16,14 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.volmit.iris.engine.object;
|
||||
package com.volmit.iris.engine.object.mods;
|
||||
|
||||
import com.volmit.iris.engine.object.regional.LoaderRegion;
|
||||
import com.volmit.iris.engine.object.annotations.ArrayType;
|
||||
import com.volmit.iris.engine.object.annotations.Desc;
|
||||
import com.volmit.iris.engine.object.annotations.RegistryListResource;
|
||||
import com.volmit.iris.engine.object.annotations.Required;
|
||||
import com.volmit.iris.engine.object.objects.IrisObjectPlacement;
|
||||
import com.volmit.iris.util.collection.KList;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
@@ -36,7 +38,7 @@ import lombok.experimental.Accessors;
|
||||
public class IrisModObjectPlacementRegionInjector {
|
||||
@Required
|
||||
@Desc("The biome to find")
|
||||
@RegistryListResource(IrisRegion.class)
|
||||
@RegistryListResource(LoaderRegion.class)
|
||||
private String biome = "";
|
||||
|
||||
@Required
|
||||
@@ -16,12 +16,14 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.volmit.iris.engine.object;
|
||||
package com.volmit.iris.engine.object.mods;
|
||||
|
||||
import com.volmit.iris.engine.object.biome.LoaderBiome;
|
||||
import com.volmit.iris.engine.object.annotations.ArrayType;
|
||||
import com.volmit.iris.engine.object.annotations.Desc;
|
||||
import com.volmit.iris.engine.object.annotations.RegistryListResource;
|
||||
import com.volmit.iris.engine.object.annotations.Required;
|
||||
import com.volmit.iris.engine.object.objects.LoaderObject;
|
||||
import com.volmit.iris.util.collection.KList;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
@@ -36,12 +38,12 @@ import lombok.experimental.Accessors;
|
||||
public class IrisModObjectReplacer {
|
||||
@Required
|
||||
@Desc("A list of objects to find")
|
||||
@RegistryListResource(IrisObject.class)
|
||||
@RegistryListResource(LoaderObject.class)
|
||||
@ArrayType(type = String.class, min = 1)
|
||||
private KList<String> find = new KList<>();
|
||||
|
||||
@Required
|
||||
@Desc("An object to replace it with")
|
||||
@RegistryListResource(IrisBiome.class)
|
||||
@RegistryListResource(LoaderBiome.class)
|
||||
private String replace = "";
|
||||
}
|
||||
@@ -16,8 +16,9 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.volmit.iris.engine.object;
|
||||
package com.volmit.iris.engine.object.mods;
|
||||
|
||||
import com.volmit.iris.engine.object.regional.LoaderRegion;
|
||||
import com.volmit.iris.engine.object.annotations.ArrayType;
|
||||
import com.volmit.iris.engine.object.annotations.Desc;
|
||||
import com.volmit.iris.engine.object.annotations.RegistryListResource;
|
||||
@@ -36,12 +37,12 @@ import lombok.experimental.Accessors;
|
||||
public class IrisModRegionReplacer {
|
||||
@Required
|
||||
@Desc("A list of regions to find")
|
||||
@RegistryListResource(IrisRegion.class)
|
||||
@RegistryListResource(LoaderRegion.class)
|
||||
@ArrayType(type = String.class, min = 1)
|
||||
private KList<String> find = new KList<>();
|
||||
|
||||
@Required
|
||||
@Desc("A region to replace it with")
|
||||
@RegistryListResource(IrisRegion.class)
|
||||
@RegistryListResource(LoaderRegion.class)
|
||||
private String replace = "";
|
||||
}
|
||||
@@ -16,9 +16,14 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.volmit.iris.engine.object;
|
||||
package com.volmit.iris.engine.object.mods;
|
||||
|
||||
import com.volmit.iris.engine.object.biome.LoaderBiome;
|
||||
import com.volmit.iris.engine.object.regional.LoaderRegion;
|
||||
import com.volmit.iris.core.project.loader.LoaderRegistrant;
|
||||
import com.volmit.iris.engine.object.annotations.*;
|
||||
import com.volmit.iris.engine.object.objects.LoaderObject;
|
||||
import com.volmit.iris.engine.object.objects.IrisObjectReplace;
|
||||
import com.volmit.iris.util.collection.KList;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
@@ -33,7 +38,7 @@ import lombok.experimental.Accessors;
|
||||
@Desc("Represents a dimension")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
public class IrisMod extends IrisRegistrant {
|
||||
public class LoaderMod extends LoaderRegistrant {
|
||||
@MinNumber(2)
|
||||
@Required
|
||||
@Desc("The human readable name of this dimension")
|
||||
@@ -48,22 +53,22 @@ public class IrisMod extends IrisRegistrant {
|
||||
private int overrideFluidHeight = -1;
|
||||
|
||||
@Desc("A list of biomes to remove")
|
||||
@RegistryListResource(IrisBiome.class)
|
||||
@RegistryListResource(LoaderBiome.class)
|
||||
@ArrayType(type = String.class, min = 1)
|
||||
private KList<String> removeBiomes = new KList<>();
|
||||
|
||||
@Desc("A list of objects to remove")
|
||||
@RegistryListResource(IrisObject.class)
|
||||
@RegistryListResource(LoaderObject.class)
|
||||
@ArrayType(type = String.class, min = 1)
|
||||
private KList<String> removeObjects = new KList<>();
|
||||
|
||||
@Desc("A list of regions to remove")
|
||||
@RegistryListResource(IrisRegion.class)
|
||||
@RegistryListResource(LoaderRegion.class)
|
||||
@ArrayType(type = String.class, min = 1)
|
||||
private KList<String> removeRegions = new KList<>();
|
||||
|
||||
@Desc("A list of regions to inject")
|
||||
@RegistryListResource(IrisRegion.class)
|
||||
@RegistryListResource(LoaderRegion.class)
|
||||
@ArrayType(type = String.class, min = 1)
|
||||
private KList<String> injectRegions = new KList<>();
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.volmit.iris.engine.object;
|
||||
package com.volmit.iris.engine.object.noise;
|
||||
|
||||
import com.volmit.iris.engine.object.annotations.Desc;
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.volmit.iris.engine.object;
|
||||
package com.volmit.iris.engine.object.noise;
|
||||
|
||||
import com.volmit.iris.engine.framework.EngineFramework;
|
||||
import com.volmit.iris.engine.object.annotations.Desc;
|
||||
@@ -16,7 +16,7 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.volmit.iris.engine.object;
|
||||
package com.volmit.iris.engine.object.noise;
|
||||
|
||||
import com.volmit.iris.engine.framework.EngineFramework;
|
||||
import com.volmit.iris.engine.object.annotations.Desc;
|
||||
@@ -16,10 +16,10 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.volmit.iris.engine.object;
|
||||
package com.volmit.iris.engine.object.noise;
|
||||
|
||||
import com.volmit.iris.core.project.loader.IrisData;
|
||||
import com.volmit.iris.engine.cache.AtomicCache;
|
||||
import com.volmit.iris.engine.data.cache.AtomicCache;
|
||||
import com.volmit.iris.engine.object.annotations.Desc;
|
||||
import com.volmit.iris.engine.object.annotations.Required;
|
||||
import com.volmit.iris.util.stream.ProceduralStream;
|
||||
@@ -16,10 +16,10 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.volmit.iris.engine.object;
|
||||
package com.volmit.iris.engine.object.noise;
|
||||
|
||||
import com.volmit.iris.core.project.loader.IrisData;
|
||||
import com.volmit.iris.engine.cache.AtomicCache;
|
||||
import com.volmit.iris.engine.data.cache.AtomicCache;
|
||||
import com.volmit.iris.util.noise.CNG;
|
||||
import com.volmit.iris.util.noise.ExpressionNoise;
|
||||
import com.volmit.iris.engine.object.annotations.Desc;
|
||||
@@ -46,7 +46,7 @@ public class IrisGeneratorStyle {
|
||||
private double zoom = 1;
|
||||
|
||||
@Desc("Instead of using the style property, use a custom expression to represent this style.")
|
||||
@RegistryListResource(IrisExpression.class)
|
||||
@RegistryListResource(LoaderExpression.class)
|
||||
private String expression = null;
|
||||
|
||||
@MinNumber(0.00001)
|
||||
@@ -79,7 +79,7 @@ public class IrisGeneratorStyle {
|
||||
return cng.aquire(() ->
|
||||
{
|
||||
if (getExpression() != null) {
|
||||
IrisExpression e = data.getExpressionLoader().load(getExpression());
|
||||
LoaderExpression e = data.getExpressionLoader().load(getExpression());
|
||||
|
||||
if (e != null) {
|
||||
CNG cng = new CNG(rng, new ExpressionNoise(rng, e), 1D, 1)
|
||||
@@ -16,10 +16,10 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.volmit.iris.engine.object;
|
||||
package com.volmit.iris.engine.object.noise;
|
||||
|
||||
import com.volmit.iris.engine.interpolation.InterpolationMethod;
|
||||
import com.volmit.iris.engine.interpolation.IrisInterpolation;
|
||||
import com.volmit.iris.util.interpolation.InterpolationMethod;
|
||||
import com.volmit.iris.util.interpolation.IrisInterpolation;
|
||||
import com.volmit.iris.engine.object.annotations.Desc;
|
||||
import com.volmit.iris.engine.object.annotations.MaxNumber;
|
||||
import com.volmit.iris.engine.object.annotations.MinNumber;
|
||||
@@ -16,10 +16,10 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.volmit.iris.engine.object;
|
||||
package com.volmit.iris.engine.object.noise;
|
||||
|
||||
import com.volmit.iris.engine.interpolation.InterpolationMethod3D;
|
||||
import com.volmit.iris.engine.interpolation.IrisInterpolation;
|
||||
import com.volmit.iris.util.interpolation.InterpolationMethod3D;
|
||||
import com.volmit.iris.util.interpolation.IrisInterpolation;
|
||||
import com.volmit.iris.engine.object.annotations.Desc;
|
||||
import com.volmit.iris.engine.object.annotations.MaxNumber;
|
||||
import com.volmit.iris.engine.object.annotations.MinNumber;
|
||||
@@ -16,11 +16,11 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.volmit.iris.engine.object;
|
||||
package com.volmit.iris.engine.object.noise;
|
||||
|
||||
import com.volmit.iris.core.project.loader.IrisData;
|
||||
import com.volmit.iris.engine.cache.AtomicCache;
|
||||
import com.volmit.iris.engine.interpolation.IrisInterpolation;
|
||||
import com.volmit.iris.engine.data.cache.AtomicCache;
|
||||
import com.volmit.iris.util.interpolation.IrisInterpolation;
|
||||
import com.volmit.iris.util.noise.CNG;
|
||||
import com.volmit.iris.engine.object.annotations.*;
|
||||
import com.volmit.iris.util.collection.KList;
|
||||
@@ -16,7 +16,7 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.volmit.iris.engine.object;
|
||||
package com.volmit.iris.engine.object.noise;
|
||||
|
||||
import com.volmit.iris.core.project.loader.IrisData;
|
||||
import com.volmit.iris.engine.object.annotations.Desc;
|
||||
@@ -16,7 +16,7 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.volmit.iris.engine.object;
|
||||
package com.volmit.iris.engine.object.noise;
|
||||
|
||||
import com.volmit.iris.engine.object.annotations.Desc;
|
||||
import com.volmit.iris.engine.object.annotations.MaxNumber;
|
||||
@@ -16,7 +16,7 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.volmit.iris.engine.object;
|
||||
package com.volmit.iris.engine.object.noise;
|
||||
|
||||
import com.volmit.iris.core.project.loader.IrisData;
|
||||
import com.volmit.iris.engine.object.annotations.Desc;
|
||||
@@ -16,13 +16,14 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.volmit.iris.engine.object;
|
||||
package com.volmit.iris.engine.object.noise;
|
||||
|
||||
import com.dfsek.paralithic.Expression;
|
||||
import com.dfsek.paralithic.eval.parser.Parser;
|
||||
import com.dfsek.paralithic.eval.parser.Scope;
|
||||
import com.volmit.iris.Iris;
|
||||
import com.volmit.iris.engine.cache.AtomicCache;
|
||||
import com.volmit.iris.engine.data.cache.AtomicCache;
|
||||
import com.volmit.iris.core.project.loader.LoaderRegistrant;
|
||||
import com.volmit.iris.engine.object.annotations.ArrayType;
|
||||
import com.volmit.iris.engine.object.annotations.Desc;
|
||||
import com.volmit.iris.engine.object.annotations.Required;
|
||||
@@ -43,7 +44,7 @@ import lombok.experimental.Accessors;
|
||||
@Desc("Represents an Iris Expression")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
public class IrisExpression extends IrisRegistrant {
|
||||
public class LoaderExpression extends LoaderRegistrant {
|
||||
private static final Parser parser = new Parser();
|
||||
|
||||
@ArrayType(type = IrisExpressionLoad.class, min = 1)
|
||||
@@ -16,11 +16,12 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.volmit.iris.engine.object;
|
||||
package com.volmit.iris.engine.object.noise;
|
||||
|
||||
import com.volmit.iris.Iris;
|
||||
import com.volmit.iris.engine.cache.AtomicCache;
|
||||
import com.volmit.iris.engine.interpolation.IrisInterpolation;
|
||||
import com.volmit.iris.engine.data.cache.AtomicCache;
|
||||
import com.volmit.iris.util.interpolation.IrisInterpolation;
|
||||
import com.volmit.iris.core.project.loader.LoaderRegistrant;
|
||||
import com.volmit.iris.util.noise.CellGenerator;
|
||||
import com.volmit.iris.engine.object.annotations.*;
|
||||
import com.volmit.iris.engine.object.common.IRare;
|
||||
@@ -41,7 +42,7 @@ import java.util.List;
|
||||
@Desc("Represents a composite generator of noise gens")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
public class IrisGenerator extends IrisRegistrant {
|
||||
public class LoaderGenerator extends LoaderRegistrant {
|
||||
@MinNumber(0.001)
|
||||
@Desc("The zoom or frequency.")
|
||||
private double zoom = 1;
|
||||
@@ -269,7 +270,7 @@ public class IrisGenerator extends IrisRegistrant {
|
||||
return (Math.round((v * 255D) / cliffHeight) * cliffHeight) / 255D;
|
||||
}
|
||||
|
||||
public IrisGenerator rescale(double scale) {
|
||||
public LoaderGenerator rescale(double scale) {
|
||||
zoom /= scale;
|
||||
return this;
|
||||
}
|
||||
@@ -16,7 +16,7 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.volmit.iris.engine.object;
|
||||
package com.volmit.iris.engine.object.noise;
|
||||
|
||||
import com.volmit.iris.util.noise.CNG;
|
||||
import com.volmit.iris.util.noise.CNGFactory;
|
||||
@@ -16,7 +16,7 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.volmit.iris.engine.object;
|
||||
package com.volmit.iris.engine.object.objects;
|
||||
|
||||
import com.volmit.iris.engine.object.annotations.*;
|
||||
import com.volmit.iris.util.math.M;
|
||||
@@ -16,7 +16,7 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.volmit.iris.engine.object;
|
||||
package com.volmit.iris.engine.object.objects;
|
||||
|
||||
import com.volmit.iris.engine.object.annotations.Desc;
|
||||
import com.volmit.iris.util.collection.GBiset;
|
||||
@@ -16,12 +16,12 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.volmit.iris.engine.object;
|
||||
package com.volmit.iris.engine.object.objects;
|
||||
|
||||
import com.volmit.iris.engine.object.annotations.Desc;
|
||||
|
||||
@Desc("Represents a basic font style to apply to a font family")
|
||||
public enum FontStyle {
|
||||
public enum IrisFontStyle {
|
||||
@Desc("Plain old text")
|
||||
PLAIN,
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.volmit.iris.engine.object;
|
||||
package com.volmit.iris.engine.object.objects;
|
||||
|
||||
import com.volmit.iris.engine.object.annotations.Desc;
|
||||
import com.volmit.iris.engine.object.annotations.MaxNumber;
|
||||
@@ -16,10 +16,12 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.volmit.iris.engine.object;
|
||||
package com.volmit.iris.engine.object.objects;
|
||||
|
||||
import com.volmit.iris.core.project.loader.IrisData;
|
||||
import com.volmit.iris.engine.cache.AtomicCache;
|
||||
import com.volmit.iris.engine.data.cache.AtomicCache;
|
||||
import com.volmit.iris.engine.object.block.LoaderBlockData;
|
||||
import com.volmit.iris.engine.object.loot.LoaderLootTable;
|
||||
import com.volmit.iris.engine.object.annotations.ArrayType;
|
||||
import com.volmit.iris.engine.object.annotations.Desc;
|
||||
import com.volmit.iris.engine.object.annotations.RegistryListResource;
|
||||
@@ -37,16 +39,16 @@ import org.bukkit.block.data.BlockData;
|
||||
@Desc("Represents loot within this object or jigsaw piece")
|
||||
@Data
|
||||
public class IrisObjectLoot {
|
||||
@ArrayType(min = 1, type = IrisBlockData.class)
|
||||
@ArrayType(min = 1, type = LoaderBlockData.class)
|
||||
@Desc("The list of blocks this loot table should apply to")
|
||||
private KList<IrisBlockData> filter = new KList<>();
|
||||
private KList<LoaderBlockData> filter = new KList<>();
|
||||
|
||||
@Desc("Exactly match the block data or not")
|
||||
private boolean exact = false;
|
||||
|
||||
@Desc("The loot table name")
|
||||
@Required
|
||||
@RegistryListResource(IrisLootTable.class)
|
||||
@RegistryListResource(LoaderLootTable.class)
|
||||
private String name;
|
||||
|
||||
@Desc("The weight of this loot table being chosen")
|
||||
@@ -59,7 +61,7 @@ public class IrisObjectLoot {
|
||||
{
|
||||
KList<BlockData> b = new KList<>();
|
||||
|
||||
for (IrisBlockData i : filter) {
|
||||
for (LoaderBlockData i : filter) {
|
||||
BlockData bx = i.getBlockData(rdata);
|
||||
|
||||
if (bx != null) {
|
||||
@@ -16,14 +16,22 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.volmit.iris.engine.object;
|
||||
package com.volmit.iris.engine.object.objects;
|
||||
|
||||
import com.volmit.iris.Iris;
|
||||
import com.volmit.iris.core.project.loader.IrisData;
|
||||
import com.volmit.iris.engine.cache.AtomicCache;
|
||||
import com.volmit.iris.engine.data.cache.AtomicCache;
|
||||
import com.volmit.iris.engine.data.B;
|
||||
import com.volmit.iris.engine.data.DataProvider;
|
||||
import com.volmit.iris.engine.interpolation.InterpolationMethod;
|
||||
import com.volmit.iris.util.interpolation.InterpolationMethod;
|
||||
import com.volmit.iris.engine.object.feature.IrisFeaturePotential;
|
||||
import com.volmit.iris.engine.object.loot.LoaderLootTable;
|
||||
import com.volmit.iris.engine.object.noise.CarvingMode;
|
||||
import com.volmit.iris.engine.object.noise.IrisGeneratorStyle;
|
||||
import com.volmit.iris.engine.object.noise.IrisNoiseGenerator;
|
||||
import com.volmit.iris.engine.object.noise.NoiseStyle;
|
||||
import com.volmit.iris.engine.object.trees.IrisTree;
|
||||
import com.volmit.iris.engine.object.trees.IrisTreeSize;
|
||||
import com.volmit.iris.util.noise.CNG;
|
||||
import com.volmit.iris.engine.object.annotations.*;
|
||||
import com.volmit.iris.util.collection.KList;
|
||||
@@ -46,7 +54,7 @@ import org.bukkit.block.data.BlockData;
|
||||
@Desc("Represents an iris object placer. It places objects.")
|
||||
@Data
|
||||
public class IrisObjectPlacement {
|
||||
@RegistryListResource(IrisObject.class)
|
||||
@RegistryListResource(LoaderObject.class)
|
||||
@Required
|
||||
@ArrayType(min = 1, type = String.class)
|
||||
@Desc("List of objects to place")
|
||||
@@ -206,7 +214,7 @@ public class IrisObjectPlacement {
|
||||
return 0;
|
||||
}
|
||||
|
||||
public IrisObject getObject(DataProvider g, RNG random) {
|
||||
public LoaderObject getObject(DataProvider g, RNG random) {
|
||||
if (place.isEmpty()) {
|
||||
return null;
|
||||
}
|
||||
@@ -235,9 +243,9 @@ public class IrisObjectPlacement {
|
||||
}
|
||||
|
||||
private static class TableCache {
|
||||
final transient WeightedRandom<IrisLootTable> global = new WeightedRandom<>();
|
||||
final transient KMap<Material, WeightedRandom<IrisLootTable>> basic = new KMap<>();
|
||||
final transient KMap<Material, KMap<BlockData, WeightedRandom<IrisLootTable>>> exact = new KMap<>();
|
||||
final transient WeightedRandom<LoaderLootTable> global = new WeightedRandom<>();
|
||||
final transient KMap<Material, WeightedRandom<LoaderLootTable>> basic = new KMap<>();
|
||||
final transient KMap<Material, KMap<BlockData, WeightedRandom<LoaderLootTable>>> exact = new KMap<>();
|
||||
}
|
||||
|
||||
private TableCache getCache(IrisData manager) {
|
||||
@@ -245,7 +253,7 @@ public class IrisObjectPlacement {
|
||||
TableCache tc = new TableCache();
|
||||
|
||||
for (IrisObjectLoot loot : getLoot()) {
|
||||
IrisLootTable table = manager.getLootLoader().load(loot.getName());
|
||||
LoaderLootTable table = manager.getLootLoader().load(loot.getName());
|
||||
if (table == null) {
|
||||
Iris.warn("Couldn't find loot table " + loot.getName());
|
||||
continue;
|
||||
@@ -289,11 +297,11 @@ public class IrisObjectPlacement {
|
||||
* @param dataManager Iris Data Manager
|
||||
* @return The loot table it should use.
|
||||
*/
|
||||
public IrisLootTable getTable(BlockData data, IrisData dataManager) {
|
||||
public LoaderLootTable getTable(BlockData data, IrisData dataManager) {
|
||||
TableCache cache = getCache(dataManager);
|
||||
|
||||
if (B.isStorageChest(data)) {
|
||||
IrisLootTable picked = null;
|
||||
LoaderLootTable picked = null;
|
||||
if (cache.exact.containsKey(data.getMaterial()) && cache.exact.containsKey(data)) {
|
||||
picked = cache.exact.get(data.getMaterial()).get(data).pullRandom();
|
||||
} else if (cache.basic.containsKey(data.getMaterial())) {
|
||||
@@ -16,7 +16,7 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.volmit.iris.engine.object;
|
||||
package com.volmit.iris.engine.object.objects;
|
||||
|
||||
import com.volmit.iris.engine.object.annotations.Desc;
|
||||
|
||||
@@ -16,10 +16,12 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.volmit.iris.engine.object;
|
||||
package com.volmit.iris.engine.object.objects;
|
||||
|
||||
import com.volmit.iris.core.project.loader.IrisData;
|
||||
import com.volmit.iris.engine.cache.AtomicCache;
|
||||
import com.volmit.iris.engine.data.cache.AtomicCache;
|
||||
import com.volmit.iris.engine.object.block.LoaderBlockData;
|
||||
import com.volmit.iris.engine.object.block.IrisMaterialPalette;
|
||||
import com.volmit.iris.util.noise.CNG;
|
||||
import com.volmit.iris.engine.object.annotations.*;
|
||||
import com.volmit.iris.util.collection.KList;
|
||||
@@ -36,10 +38,10 @@ import org.bukkit.block.data.BlockData;
|
||||
@Desc("Find and replace object materials")
|
||||
@Data
|
||||
public class IrisObjectReplace {
|
||||
@ArrayType(min = 1, type = IrisBlockData.class)
|
||||
@ArrayType(min = 1, type = LoaderBlockData.class)
|
||||
@Required
|
||||
@Desc("Find this block")
|
||||
private KList<IrisBlockData> find = new KList<>();
|
||||
private KList<LoaderBlockData> find = new KList<>();
|
||||
|
||||
@Required
|
||||
@Desc("Replace it with this block palette")
|
||||
@@ -62,7 +64,7 @@ public class IrisObjectReplace {
|
||||
{
|
||||
KList<BlockData> b = new KList<>();
|
||||
|
||||
for (IrisBlockData i : find) {
|
||||
for (LoaderBlockData i : find) {
|
||||
BlockData bx = i.getBlockData(rdata);
|
||||
|
||||
if (bx != null) {
|
||||
@@ -16,10 +16,13 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.volmit.iris.engine.object;
|
||||
package com.volmit.iris.engine.object.objects;
|
||||
|
||||
import com.volmit.iris.Iris;
|
||||
import com.volmit.iris.engine.object.annotations.Desc;
|
||||
import com.volmit.iris.engine.object.basic.IrisPosition;
|
||||
import com.volmit.iris.engine.object.jigsaw.LoaderJigsawPiece;
|
||||
import com.volmit.iris.engine.object.jigsaw.IrisJigsawPieceConnector;
|
||||
import com.volmit.iris.util.collection.KList;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
@@ -30,7 +33,6 @@ import org.bukkit.Material;
|
||||
import org.bukkit.block.BlockFace;
|
||||
import org.bukkit.block.data.*;
|
||||
import org.bukkit.util.BlockVector;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -64,7 +66,7 @@ public class IrisObjectRotation {
|
||||
return getRotation(spin, zAxis);
|
||||
}
|
||||
|
||||
public IrisObject rotateCopy(IrisObject e) {
|
||||
public LoaderObject rotateCopy(LoaderObject e) {
|
||||
if (e == null) {
|
||||
return null;
|
||||
}
|
||||
@@ -72,8 +74,8 @@ public class IrisObjectRotation {
|
||||
return e.rotateCopy(this);
|
||||
}
|
||||
|
||||
public IrisJigsawPiece rotateCopy(IrisJigsawPiece v) {
|
||||
IrisJigsawPiece piece = v.copy();
|
||||
public LoaderJigsawPiece rotateCopy(LoaderJigsawPiece v) {
|
||||
LoaderJigsawPiece piece = v.copy();
|
||||
for (IrisJigsawPieceConnector i : piece.getConnectors()) {
|
||||
i.setPosition(rotate(i.getPosition()));
|
||||
i.setDirection(rotate(i.getDirection()));
|
||||
@@ -16,7 +16,7 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.volmit.iris.engine.object;
|
||||
package com.volmit.iris.engine.object.objects;
|
||||
|
||||
import com.googlecode.concurrentlinkedhashmap.ConcurrentLinkedHashMap;
|
||||
import com.volmit.iris.engine.object.annotations.Desc;
|
||||
@@ -53,8 +53,8 @@ public class IrisObjectScale {
|
||||
@Desc("If this object is scaled up beyond its origin size, specify a 3D interpolator")
|
||||
private IrisObjectPlacementScaleInterpolator interpolation = IrisObjectPlacementScaleInterpolator.NONE;
|
||||
|
||||
private static transient ConcurrentLinkedHashMap<IrisObject, KList<IrisObject>> cache
|
||||
= new ConcurrentLinkedHashMap.Builder<IrisObject, KList<IrisObject>>()
|
||||
private static transient ConcurrentLinkedHashMap<LoaderObject, KList<LoaderObject>> cache
|
||||
= new ConcurrentLinkedHashMap.Builder<LoaderObject, KList<LoaderObject>>()
|
||||
.initialCapacity(64)
|
||||
.maximumWeightedCapacity(1024)
|
||||
.concurrencyLevel(32)
|
||||
@@ -78,7 +78,7 @@ public class IrisObjectScale {
|
||||
return mx;
|
||||
}
|
||||
|
||||
public IrisObject get(RNG rng, IrisObject origin) {
|
||||
public LoaderObject get(RNG rng, LoaderObject origin) {
|
||||
if (shouldScale()) {
|
||||
return origin;
|
||||
}
|
||||
@@ -88,7 +88,7 @@ public class IrisObjectScale {
|
||||
return v;
|
||||
}
|
||||
|
||||
KList<IrisObject> c = new KList<>();
|
||||
KList<LoaderObject> c = new KList<>();
|
||||
for (double i = minimumScale; i < maximumScale; i += (maximumScale - minimumScale) / (double) (Math.min(variations, 32))) {
|
||||
c.add(origin.scaled(i, getInterpolation()));
|
||||
}
|
||||
@@ -16,7 +16,7 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.volmit.iris.engine.object;
|
||||
package com.volmit.iris.engine.object.objects;
|
||||
|
||||
import com.volmit.iris.engine.object.annotations.Desc;
|
||||
import com.volmit.iris.engine.object.annotations.MaxNumber;
|
||||
@@ -16,7 +16,7 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.volmit.iris.engine.object;
|
||||
package com.volmit.iris.engine.object.objects;
|
||||
|
||||
import com.volmit.iris.engine.object.annotations.Desc;
|
||||
import com.volmit.iris.engine.object.annotations.MinNumber;
|
||||
@@ -42,7 +42,7 @@ public class IrisRareObject {
|
||||
@Desc("The rarity is 1 in X")
|
||||
private int rarity = 1;
|
||||
|
||||
@RegistryListResource(IrisObject.class)
|
||||
@RegistryListResource(LoaderObject.class)
|
||||
@Required
|
||||
@Desc("The object to place if rarity check passed")
|
||||
private String object = "";
|
||||
@@ -16,14 +16,16 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.volmit.iris.engine.object;
|
||||
package com.volmit.iris.engine.object.objects;
|
||||
|
||||
import com.volmit.iris.Iris;
|
||||
import com.volmit.iris.core.project.loader.IrisData;
|
||||
import com.volmit.iris.engine.cache.AtomicCache;
|
||||
import com.volmit.iris.engine.data.cache.AtomicCache;
|
||||
import com.volmit.iris.engine.data.B;
|
||||
import com.volmit.iris.engine.framework.placer.HeightmapObjectPlacer;
|
||||
import com.volmit.iris.engine.interpolation.IrisInterpolation;
|
||||
import com.volmit.iris.util.interpolation.IrisInterpolation;
|
||||
import com.volmit.iris.engine.object.basic.IrisPosition;
|
||||
import com.volmit.iris.core.project.loader.LoaderRegistrant;
|
||||
import com.volmit.iris.engine.object.common.CarveResult;
|
||||
import com.volmit.iris.engine.object.common.IObjectPlacer;
|
||||
import com.volmit.iris.engine.object.tile.TileData;
|
||||
@@ -56,7 +58,7 @@ import java.util.function.Consumer;
|
||||
@Accessors(chain = true)
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
public class IrisObject extends IrisRegistrant {
|
||||
public class LoaderObject extends LoaderRegistrant {
|
||||
private static final Vector HALF = new Vector(0.5, 0.5, 0.5);
|
||||
private static final BlockData AIR = B.get("CAVE_AIR");
|
||||
private static final BlockData VAIR = B.get("VOID_AIR");
|
||||
@@ -75,7 +77,7 @@ public class IrisObject extends IrisRegistrant {
|
||||
private transient AtomicCache<AxisAlignedBB> aabb = new AtomicCache<>();
|
||||
|
||||
|
||||
public IrisObject(int w, int h, int d) {
|
||||
public LoaderObject(int w, int h, int d) {
|
||||
blocks = new KMap<>();
|
||||
states = new KMap<>();
|
||||
this.w = w;
|
||||
@@ -84,7 +86,7 @@ public class IrisObject extends IrisRegistrant {
|
||||
center = new BlockVector(w / 2, h / 2, d / 2);
|
||||
}
|
||||
|
||||
public IrisObject() {
|
||||
public LoaderObject() {
|
||||
this(0, 0, 0);
|
||||
}
|
||||
|
||||
@@ -212,8 +214,8 @@ public class IrisObject extends IrisRegistrant {
|
||||
lock.unlock();
|
||||
}
|
||||
|
||||
public synchronized IrisObject copy() {
|
||||
IrisObject o = new IrisObject(w, h, d);
|
||||
public synchronized LoaderObject copy() {
|
||||
LoaderObject o = new LoaderObject(w, h, d);
|
||||
o.setLoadKey(o.getLoadKey());
|
||||
o.setCenter(getCenter().clone());
|
||||
|
||||
@@ -715,8 +717,8 @@ public class IrisObject extends IrisRegistrant {
|
||||
return y;
|
||||
}
|
||||
|
||||
public IrisObject rotateCopy(IrisObjectRotation rt) {
|
||||
IrisObject copy = copy();
|
||||
public LoaderObject rotateCopy(IrisObjectRotation rt) {
|
||||
LoaderObject copy = copy();
|
||||
copy.rotate(rt, 0, 0, 0);
|
||||
return copy;
|
||||
}
|
||||
@@ -778,7 +780,7 @@ public class IrisObject extends IrisRegistrant {
|
||||
}
|
||||
}
|
||||
|
||||
public IrisObject scaled(double scale, IrisObjectPlacementScaleInterpolator interpolation) {
|
||||
public LoaderObject scaled(double scale, IrisObjectPlacementScaleInterpolator interpolation) {
|
||||
Vector sm1 = new Vector(scale - 1, scale - 1, scale - 1);
|
||||
scale = Math.max(0.001, Math.min(50, scale));
|
||||
if (scale < 1) {
|
||||
@@ -800,7 +802,7 @@ public class IrisObject extends IrisRegistrant {
|
||||
center = center.setZ(center.getBlockZ() + 0.5);
|
||||
}
|
||||
|
||||
IrisObject oo = new IrisObject((int) Math.ceil((w * scale) + (scale * 2)), (int) Math.ceil((h * scale) + (scale * 2)), (int) Math.ceil((d * scale) + (scale * 2)));
|
||||
LoaderObject oo = new LoaderObject((int) Math.ceil((w * scale) + (scale * 2)), (int) Math.ceil((h * scale) + (scale * 2)), (int) Math.ceil((d * scale) + (scale * 2)));
|
||||
|
||||
for (Map.Entry<BlockVector, BlockData> entry : blocks.entrySet()) {
|
||||
BlockData bd = entry.getValue();
|
||||
@@ -16,7 +16,7 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.volmit.iris.engine.object;
|
||||
package com.volmit.iris.engine.object.objects;
|
||||
|
||||
import com.volmit.iris.engine.object.annotations.Desc;
|
||||
|
||||
@@ -16,9 +16,12 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.volmit.iris.engine.object;
|
||||
package com.volmit.iris.engine.object.regional;
|
||||
|
||||
import com.volmit.iris.engine.cache.AtomicCache;
|
||||
import com.volmit.iris.engine.data.cache.AtomicCache;
|
||||
import com.volmit.iris.engine.object.biome.InferredType;
|
||||
import com.volmit.iris.engine.object.biome.LoaderBiome;
|
||||
import com.volmit.iris.engine.object.biome.IrisBiomePaletteLayer;
|
||||
import com.volmit.iris.util.noise.CellGenerator;
|
||||
import com.volmit.iris.engine.object.annotations.*;
|
||||
import com.volmit.iris.util.math.RNG;
|
||||
@@ -33,7 +36,7 @@ import lombok.experimental.Accessors;
|
||||
@Desc("A ridge config")
|
||||
@Data
|
||||
public class IrisRegionRidge {
|
||||
@RegistryListResource(IrisBiome.class)
|
||||
@RegistryListResource(LoaderBiome.class)
|
||||
@Required
|
||||
@Desc("The biome name")
|
||||
private String biome = "";
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user