mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2025-07-18 18:23:06 +00:00
Registry list abstraction
This commit is contained in:
parent
0a6e24104e
commit
488c609109
@ -27,6 +27,7 @@ import com.volmit.iris.core.link.MultiverseCoreLink;
|
||||
import com.volmit.iris.core.link.MythicMobsLink;
|
||||
import com.volmit.iris.core.link.OraxenLink;
|
||||
import com.volmit.iris.core.nms.INMS;
|
||||
import com.volmit.iris.core.project.loader.IrisData;
|
||||
import com.volmit.iris.core.tools.IrisWorlds;
|
||||
import com.volmit.iris.engine.framework.EngineCompositeGenerator;
|
||||
import com.volmit.iris.engine.object.IrisBiome;
|
||||
@ -178,7 +179,7 @@ public class Iris extends VolmitPlugin implements Listener {
|
||||
for (File i : packs.listFiles()) {
|
||||
if (i.isDirectory()) {
|
||||
Iris.verbose("Checking Pack: " + i.getPath());
|
||||
IrisDataManager data = new IrisDataManager(i);
|
||||
IrisData data = new IrisData(i);
|
||||
File dims = new File(i, "dimensions");
|
||||
|
||||
if (dims.exists()) {
|
||||
@ -301,7 +302,7 @@ public class Iris extends VolmitPlugin implements Listener {
|
||||
for (File i : packs.listFiles()) {
|
||||
if (i.isDirectory()) {
|
||||
Iris.verbose("Checking Pack: " + i.getPath());
|
||||
IrisDataManager data = new IrisDataManager(i);
|
||||
IrisData data = new IrisData(i);
|
||||
File dims = new File(i, "dimensions");
|
||||
|
||||
if (dims.exists()) {
|
||||
@ -338,7 +339,7 @@ public class Iris extends VolmitPlugin implements Listener {
|
||||
}
|
||||
|
||||
public boolean verifyDataPackInstalled(IrisDimension dimension) {
|
||||
IrisDataManager idm = new IrisDataManager(getDataFolder("packs", dimension.getLoadKey()));
|
||||
IrisData idm = new IrisData(getDataFolder("packs", dimension.getLoadKey()));
|
||||
KSet<String> keys = new KSet<>();
|
||||
boolean warn = false;
|
||||
|
||||
|
@ -22,6 +22,7 @@ import com.google.gson.Gson;
|
||||
import com.google.gson.JsonSyntaxException;
|
||||
import com.volmit.iris.Iris;
|
||||
import com.volmit.iris.core.project.IrisProject;
|
||||
import com.volmit.iris.core.project.loader.IrisData;
|
||||
import com.volmit.iris.engine.cache.AtomicCache;
|
||||
import com.volmit.iris.engine.object.IrisDimension;
|
||||
import com.volmit.iris.util.collection.KMap;
|
||||
@ -95,7 +96,7 @@ public class ProjectManager {
|
||||
sender.sendMessage("Looking for Package: " + type);
|
||||
File iris = new File(folder, "iris");
|
||||
File irispack = new File(folder, "iris/pack");
|
||||
IrisDimension dim = IrisDataManager.loadAnyDimension(type);
|
||||
IrisDimension dim = IrisData.loadAnyDimension(type);
|
||||
|
||||
if (dim == null) {
|
||||
for (File i : Iris.proj.getWorkspaceFolder().listFiles()) {
|
||||
@ -148,7 +149,7 @@ public class ProjectManager {
|
||||
return null;
|
||||
}
|
||||
|
||||
IrisDataManager dm = new IrisDataManager(irispack);
|
||||
IrisData dm = new IrisData(irispack);
|
||||
dim = dm.getDimensionLoader().load(type);
|
||||
|
||||
if (dim == null) {
|
||||
@ -269,7 +270,7 @@ public class ProjectManager {
|
||||
IO.delete(packEntry);
|
||||
}
|
||||
|
||||
if (IrisDataManager.loadAnyDimension(key) != null) {
|
||||
if (IrisData.loadAnyDimension(key) != null) {
|
||||
sender.sendMessage("Another dimension in the packs folder is already using the key " + key + " IMPORT FAILED!");
|
||||
return;
|
||||
}
|
||||
|
@ -19,9 +19,9 @@
|
||||
package com.volmit.iris.core.command.jigsaw;
|
||||
|
||||
import com.volmit.iris.Iris;
|
||||
import com.volmit.iris.core.IrisDataManager;
|
||||
import com.volmit.iris.core.IrisSettings;
|
||||
import com.volmit.iris.core.edit.JigsawEditor;
|
||||
import com.volmit.iris.core.project.loader.IrisData;
|
||||
import com.volmit.iris.engine.object.IrisJigsawPiece;
|
||||
import com.volmit.iris.util.collection.KList;
|
||||
import com.volmit.iris.util.plugin.MortarCommand;
|
||||
@ -59,11 +59,11 @@ public class CommandIrisJigsawEdit extends MortarCommand {
|
||||
return true;
|
||||
}
|
||||
|
||||
IrisJigsawPiece piece = IrisDataManager.loadAnyJigsawPiece(args[0]);
|
||||
IrisJigsawPiece piece = IrisData.loadAnyJigsawPiece(args[0]);
|
||||
|
||||
if (piece != null) {
|
||||
File dest = piece.getLoadFile();
|
||||
new JigsawEditor(sender.player(), piece, IrisDataManager.loadAnyObject(piece.getObject()), dest);
|
||||
new JigsawEditor(sender.player(), piece, IrisData.loadAnyObject(piece.getObject()), dest);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -19,9 +19,9 @@
|
||||
package com.volmit.iris.core.command.jigsaw;
|
||||
|
||||
import com.volmit.iris.Iris;
|
||||
import com.volmit.iris.core.IrisDataManager;
|
||||
import com.volmit.iris.core.IrisSettings;
|
||||
import com.volmit.iris.core.edit.JigsawEditor;
|
||||
import com.volmit.iris.core.project.loader.IrisData;
|
||||
import com.volmit.iris.engine.object.IrisObject;
|
||||
import com.volmit.iris.util.collection.KList;
|
||||
import com.volmit.iris.util.plugin.MortarCommand;
|
||||
@ -59,7 +59,7 @@ public class CommandIrisJigsawNew extends MortarCommand {
|
||||
return true;
|
||||
}
|
||||
|
||||
IrisObject object = IrisDataManager.loadAnyObject(args[2]);
|
||||
IrisObject object = IrisData.loadAnyObject(args[2]);
|
||||
|
||||
if (object == null) {
|
||||
sender.sendMessage("Failed to find existing object: " + args[2]);
|
||||
|
@ -19,8 +19,8 @@
|
||||
package com.volmit.iris.core.command.jigsaw;
|
||||
|
||||
import com.volmit.iris.Iris;
|
||||
import com.volmit.iris.core.IrisDataManager;
|
||||
import com.volmit.iris.core.IrisSettings;
|
||||
import com.volmit.iris.core.project.loader.IrisData;
|
||||
import com.volmit.iris.core.tools.IrisWorlds;
|
||||
import com.volmit.iris.engine.jigsaw.PlannedStructure;
|
||||
import com.volmit.iris.engine.object.IrisJigsawStructure;
|
||||
@ -43,7 +43,7 @@ public class CommandIrisJigsawPlace extends MortarCommand {
|
||||
@Override
|
||||
public void addTabOptions(VolmitSender sender, String[] args, KList<String> list) {
|
||||
if ((args.length == 0 || args.length == 1) && sender.isPlayer() && IrisWorlds.isIrisWorld(sender.player().getWorld())) {
|
||||
IrisDataManager data = IrisWorlds.access(sender.player().getWorld()).getData();
|
||||
IrisData data = IrisWorlds.access(sender.player().getWorld()).getData();
|
||||
if (data == null) {
|
||||
sender.sendMessage("Tab complete options only work for jigsaw structures while in an Iris world.");
|
||||
} else if (args.length == 0) {
|
||||
@ -71,7 +71,7 @@ public class CommandIrisJigsawPlace extends MortarCommand {
|
||||
return true;
|
||||
}
|
||||
|
||||
IrisJigsawStructure str = IrisDataManager.loadAnyJigsawStructure(args[0]);
|
||||
IrisJigsawStructure str = IrisData.loadAnyJigsawStructure(args[0]);
|
||||
|
||||
if (str != null) {
|
||||
PrecisionStopwatch p = PrecisionStopwatch.start();
|
||||
|
@ -19,10 +19,10 @@
|
||||
package com.volmit.iris.core.command.object;
|
||||
|
||||
import com.volmit.iris.Iris;
|
||||
import com.volmit.iris.core.IrisDataManager;
|
||||
import com.volmit.iris.core.IrisSettings;
|
||||
import com.volmit.iris.core.ProjectManager;
|
||||
import com.volmit.iris.core.WandManager;
|
||||
import com.volmit.iris.core.project.loader.IrisData;
|
||||
import com.volmit.iris.core.tools.IrisWorlds;
|
||||
import com.volmit.iris.engine.object.IrisObject;
|
||||
import com.volmit.iris.util.collection.KList;
|
||||
@ -44,7 +44,7 @@ public class CommandIrisObjectPaste extends MortarCommand {
|
||||
@Override
|
||||
public void addTabOptions(VolmitSender sender, String[] args, KList<String> list) {
|
||||
if ((args.length == 0 || args.length == 1) && sender.isPlayer() && IrisWorlds.isIrisWorld(sender.player().getWorld())) {
|
||||
IrisDataManager data = IrisWorlds.access(sender.player().getWorld()).getData();
|
||||
IrisData data = IrisWorlds.access(sender.player().getWorld()).getData();
|
||||
if (data == null) {
|
||||
sender.sendMessage("Tab complete options only work for objects while in an Iris world.");
|
||||
} else if (args.length == 0) {
|
||||
@ -73,7 +73,7 @@ public class CommandIrisObjectPaste extends MortarCommand {
|
||||
}
|
||||
|
||||
Player p = sender.player();
|
||||
IrisObject obj = IrisDataManager.loadAnyObject(args[0]);
|
||||
IrisObject obj = IrisData.loadAnyObject(args[0]);
|
||||
|
||||
if (obj == null || obj.getLoadFile() == null) {
|
||||
|
||||
|
@ -19,9 +19,9 @@
|
||||
package com.volmit.iris.core.command.studio;
|
||||
|
||||
import com.volmit.iris.Iris;
|
||||
import com.volmit.iris.core.IrisDataManager;
|
||||
import com.volmit.iris.core.IrisSettings;
|
||||
import com.volmit.iris.core.gui.NoiseExplorerGUI;
|
||||
import com.volmit.iris.core.project.loader.IrisData;
|
||||
import com.volmit.iris.core.tools.IrisWorlds;
|
||||
import com.volmit.iris.engine.object.IrisGenerator;
|
||||
import com.volmit.iris.util.collection.KList;
|
||||
@ -40,7 +40,7 @@ public class CommandIrisStudioExplorerGenerator extends MortarCommand {
|
||||
@Override
|
||||
public void addTabOptions(VolmitSender sender, String[] args, KList<String> list) {
|
||||
if ((args.length == 0 || args.length == 1) && sender.isPlayer() && IrisWorlds.isIrisWorld(sender.player().getWorld())) {
|
||||
IrisDataManager data = IrisWorlds.access(sender.player().getWorld()).getData();
|
||||
IrisData data = IrisWorlds.access(sender.player().getWorld()).getData();
|
||||
if (data == null) {
|
||||
sender.sendMessage("Issue when loading tab completions. No data found (?)");
|
||||
} else if (args.length == 0) {
|
||||
@ -75,7 +75,7 @@ public class CommandIrisStudioExplorerGenerator extends MortarCommand {
|
||||
generator = Iris.proj.getActiveProject().getActiveProvider().getData().getGeneratorLoader().load(args[0]);
|
||||
seed = Iris.proj.getActiveProject().getActiveProvider().getTarget().getWorld().seed();
|
||||
} else {
|
||||
generator = IrisDataManager.loadAnyGenerator(args[0]);
|
||||
generator = IrisData.loadAnyGenerator(args[0]);
|
||||
}
|
||||
|
||||
if (generator != null) {
|
||||
|
@ -19,7 +19,7 @@
|
||||
package com.volmit.iris.core.command.studio;
|
||||
|
||||
import com.volmit.iris.Iris;
|
||||
import com.volmit.iris.core.IrisDataManager;
|
||||
import com.volmit.iris.core.project.loader.IrisData;
|
||||
import com.volmit.iris.core.tools.IrisWorlds;
|
||||
import com.volmit.iris.engine.framework.IrisAccess;
|
||||
import com.volmit.iris.engine.object.IrisBiome;
|
||||
@ -49,7 +49,7 @@ public class CommandIrisStudioGoto extends MortarCommand {
|
||||
@Override
|
||||
public void addTabOptions(VolmitSender sender, String[] args, KList<String> list) {
|
||||
if ((args.length == 0 || args.length == 1) && sender.isPlayer() && IrisWorlds.isIrisWorld(sender.player().getWorld())) {
|
||||
IrisDataManager data = IrisWorlds.access(sender.player().getWorld()).getData();
|
||||
IrisData data = IrisWorlds.access(sender.player().getWorld()).getData();
|
||||
if (data == null) {
|
||||
sender.sendMessage("Issue when loading tab completions. No data found (?)");
|
||||
} else if (args.length == 0) {
|
||||
@ -80,8 +80,8 @@ public class CommandIrisStudioGoto extends MortarCommand {
|
||||
}
|
||||
|
||||
IrisAccess g = IrisWorlds.access(world);
|
||||
IrisBiome b = IrisDataManager.loadAnyBiome(args[0]);
|
||||
IrisRegion r = IrisDataManager.loadAnyRegion(args[0]);
|
||||
IrisBiome b = IrisData.loadAnyBiome(args[0]);
|
||||
IrisRegion r = IrisData.loadAnyRegion(args[0]);
|
||||
|
||||
if (b != null) {
|
||||
J.a(() -> {
|
||||
|
@ -19,9 +19,9 @@
|
||||
package com.volmit.iris.core.command.studio;
|
||||
|
||||
import com.volmit.iris.Iris;
|
||||
import com.volmit.iris.core.IrisDataManager;
|
||||
import com.volmit.iris.core.IrisSettings;
|
||||
import com.volmit.iris.core.project.IrisProject;
|
||||
import com.volmit.iris.core.project.loader.IrisData;
|
||||
import com.volmit.iris.engine.interpolation.InterpolationMethod;
|
||||
import com.volmit.iris.engine.noise.CNG;
|
||||
import com.volmit.iris.engine.object.*;
|
||||
@ -80,7 +80,7 @@ public class CommandIrisStudioProfile extends MortarCommand {
|
||||
}
|
||||
|
||||
IrisProject p = new IrisProject(f);
|
||||
IrisDataManager data = new IrisDataManager(f);
|
||||
IrisData data = new IrisData(f);
|
||||
KMap<NoiseStyle, Double> styleTimings = new KMap<>();
|
||||
KMap<InterpolationMethod, Double> interpolatorTimings = new KMap<>();
|
||||
KMap<String, Double> generatorTimings = new KMap<>();
|
||||
|
@ -19,10 +19,10 @@
|
||||
package com.volmit.iris.core.command.world;
|
||||
|
||||
import com.volmit.iris.Iris;
|
||||
import com.volmit.iris.core.IrisDataManager;
|
||||
import com.volmit.iris.core.IrisSettings;
|
||||
import com.volmit.iris.core.link.MultiverseCoreLink;
|
||||
import com.volmit.iris.core.nms.INMS;
|
||||
import com.volmit.iris.core.project.loader.IrisData;
|
||||
import com.volmit.iris.core.tools.IrisWorldCreator;
|
||||
import com.volmit.iris.engine.framework.IrisAccess;
|
||||
import com.volmit.iris.engine.object.IrisDimension;
|
||||
@ -184,7 +184,7 @@ public class CommandIrisCreate extends MortarCommand {
|
||||
};
|
||||
|
||||
if (multiverse) {
|
||||
dim = IrisDataManager.loadAnyDimension(type);
|
||||
dim = IrisData.loadAnyDimension(type);
|
||||
|
||||
if (dim == null) {
|
||||
sender.sendMessage("Cant find dimension type: " + type + ". Did you forget to /ir download " + type + "?");
|
||||
|
@ -20,13 +20,13 @@ package com.volmit.iris.core.project;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.volmit.iris.Iris;
|
||||
import com.volmit.iris.core.IrisDataManager;
|
||||
import com.volmit.iris.core.IrisSettings;
|
||||
import com.volmit.iris.core.nms.INMS;
|
||||
import com.volmit.iris.core.project.loader.IrisData;
|
||||
import com.volmit.iris.core.project.loader.ResourceLoader;
|
||||
import com.volmit.iris.core.report.Report;
|
||||
import com.volmit.iris.core.report.ReportType;
|
||||
import com.volmit.iris.core.tools.IrisWorldCreator;
|
||||
import com.volmit.iris.engine.data.loader.ResourceLoader;
|
||||
import com.volmit.iris.engine.framework.Engine;
|
||||
import com.volmit.iris.engine.framework.IrisAccess;
|
||||
import com.volmit.iris.engine.object.*;
|
||||
@ -72,7 +72,7 @@ public class IrisProject {
|
||||
|
||||
public KList<Report> scanForErrors() {
|
||||
KList<Report> reports = new KList<>();
|
||||
IrisDataManager data = new IrisDataManager(path);
|
||||
IrisData data = new IrisData(path);
|
||||
Gson g = new Gson();
|
||||
MultiBurst.burst.burst(collectFiles("json").convert((i) -> () -> {
|
||||
try {
|
||||
@ -245,7 +245,7 @@ public class IrisProject {
|
||||
return;
|
||||
}
|
||||
|
||||
IrisDimension d = IrisDataManager.loadAnyDimension(getName());
|
||||
IrisDimension d = IrisData.loadAnyDimension(getName());
|
||||
if (d == null) {
|
||||
sender.sendMessage("Can't find dimension: " + getName());
|
||||
return;
|
||||
@ -440,7 +440,7 @@ public class IrisProject {
|
||||
settings.put("[json]", jc);
|
||||
settings.put("json.maxItemsComputed", 30000);
|
||||
JSONArray schemas = new JSONArray();
|
||||
IrisDataManager dm = new IrisDataManager(getPath());
|
||||
IrisData dm = new IrisData(getPath());
|
||||
|
||||
for(ResourceLoader<?> r : dm.getLoaders().v())
|
||||
{
|
||||
@ -458,7 +458,7 @@ public class IrisProject {
|
||||
|
||||
public File compilePackage(VolmitSender sender, boolean obfuscate, boolean minify) {
|
||||
String dimm = getName();
|
||||
IrisDataManager dm = new IrisDataManager(path);
|
||||
IrisData dm = new IrisData(path);
|
||||
IrisDimension dimension = dm.getDimensionLoader().load(dimm);
|
||||
File folder = new File(Iris.instance.getDataFolder(), "exports/" + dimension.getLoadKey());
|
||||
folder.mkdirs();
|
||||
|
@ -19,12 +19,12 @@
|
||||
package com.volmit.iris.core.project;
|
||||
|
||||
import com.volmit.iris.Iris;
|
||||
import com.volmit.iris.core.IrisDataManager;
|
||||
import com.volmit.iris.core.project.loader.IrisData;
|
||||
import com.volmit.iris.core.project.loader.ResourceLoader;
|
||||
import com.volmit.iris.engine.data.B;
|
||||
import com.volmit.iris.engine.object.annotations.*;
|
||||
import com.volmit.iris.util.collection.KList;
|
||||
import com.volmit.iris.util.collection.KMap;
|
||||
import com.volmit.iris.util.format.Form;
|
||||
import com.volmit.iris.util.json.JSONArray;
|
||||
import com.volmit.iris.util.json.JSONObject;
|
||||
import org.bukkit.enchantments.Enchantment;
|
||||
@ -46,9 +46,9 @@ public class SchemaBuilder {
|
||||
private final KMap<String, JSONObject> definitions;
|
||||
private final Class<?> root;
|
||||
private final KList<String> warnings;
|
||||
private final IrisDataManager data;
|
||||
private final IrisData data;
|
||||
|
||||
public SchemaBuilder(Class<?> root, IrisDataManager data) {
|
||||
public SchemaBuilder(Class<?> root, IrisData data) {
|
||||
this.data = data;
|
||||
warnings = new KList<>();
|
||||
this.definitions = new KMap<>();
|
||||
@ -164,21 +164,35 @@ public class SchemaBuilder {
|
||||
prop.put("maxLength", max);
|
||||
description.add(SYMBOL_LIMIT__N + " Maximum Length allowed is " + max);
|
||||
}
|
||||
// TODO Automate registry lists
|
||||
if (k.isAnnotationPresent(RegistryListBiome.class)) {
|
||||
String key = "enum-reg-biome";
|
||||
|
||||
if (!definitions.containsKey(key)) {
|
||||
JSONObject j = new JSONObject();
|
||||
j.put("enum", new JSONArray(data.getBiomeLoader().getPossibleKeys()));
|
||||
definitions.put(key, j);
|
||||
|
||||
if(k.isAnnotationPresent(RegistryListResource.class))
|
||||
{
|
||||
RegistryListResource rr = k.getDeclaredAnnotation(RegistryListResource.class);
|
||||
ResourceLoader<?> loader = data.getLoaders().get(rr.value());
|
||||
|
||||
if(loader != null)
|
||||
{
|
||||
String key = "erz" + loader.getFolderName();
|
||||
|
||||
if (!definitions.containsKey(key)) {
|
||||
JSONObject j = new JSONObject();
|
||||
j.put("enum", new JSONArray(loader.getPossibleKeys()));
|
||||
definitions.put(key, j);
|
||||
}
|
||||
|
||||
fancyType = "Iris " + loader.getResourceTypeName();
|
||||
prop.put("$ref", "#/definitions/" + key);
|
||||
description.add(SYMBOL_TYPE__N + " Must be a valid " + loader.getFolderName() + " (use ctrl+space for auto complete!)");
|
||||
}
|
||||
|
||||
fancyType = "Iris Biome";
|
||||
prop.put("$ref", "#/definitions/" + key);
|
||||
description.add(SYMBOL_TYPE__N + " Must be a valid Biome (use ctrl+space for auto complete!)");
|
||||
else
|
||||
{
|
||||
Iris.error("Cannot find Registry Loader for type " + rr.value() + " used in " + k.getDeclaringClass().getCanonicalName() + " in field " + k.getName());
|
||||
}
|
||||
}
|
||||
|
||||
} else if (k.isAnnotationPresent(RegistryListMythical.class)) {
|
||||
else if (k.isAnnotationPresent(RegistryListMythical.class)) {
|
||||
String key = "enum-reg-mythical";
|
||||
|
||||
if (!definitions.containsKey(key)) {
|
||||
@ -190,18 +204,6 @@ public class SchemaBuilder {
|
||||
fancyType = "Mythic Mob Type";
|
||||
prop.put("$ref", "#/definitions/" + key);
|
||||
description.add(SYMBOL_TYPE__N + " Must be a valid Mythic Mob Type (use ctrl+space for auto complete!) Define mythic mobs with the mythic mobs plugin configuration files.");
|
||||
} else if (k.isAnnotationPresent(RegistryListSpawner.class)) {
|
||||
String key = "enum-reg-spawner";
|
||||
|
||||
if (!definitions.containsKey(key)) {
|
||||
JSONObject j = new JSONObject();
|
||||
j.put("enum", new JSONArray(data.getSpawnerLoader().getPossibleKeys()));
|
||||
definitions.put(key, j);
|
||||
}
|
||||
|
||||
fancyType = "Iris Spawner";
|
||||
prop.put("$ref", "#/definitions/" + key);
|
||||
description.add(SYMBOL_TYPE__N + " Must be a valid Spawner (use ctrl+space for auto complete!)");
|
||||
} else if (k.isAnnotationPresent(RegistryListBlockType.class)) {
|
||||
String key = "enum-block-type";
|
||||
|
||||
@ -238,19 +240,6 @@ public class SchemaBuilder {
|
||||
prop.put("$ref", "#/definitions/" + key);
|
||||
description.add(SYMBOL_TYPE__N + " Must be a valid Item Type (use ctrl+space for auto complete!)");
|
||||
|
||||
} else if (k.isAnnotationPresent(RegistryListEntity.class)) {
|
||||
String key = "enum-reg-entity";
|
||||
|
||||
if (!definitions.containsKey(key)) {
|
||||
JSONObject j = new JSONObject();
|
||||
j.put("enum", new JSONArray(data.getEntityLoader().getPossibleKeys()));
|
||||
definitions.put(key, j);
|
||||
}
|
||||
|
||||
fancyType = "Iris Entity";
|
||||
prop.put("$ref", "#/definitions/" + key);
|
||||
description.add(SYMBOL_TYPE__N + " Must be a valid Iris Entity (use ctrl+space for auto complete!)");
|
||||
|
||||
} else if (k.isAnnotationPresent(RegistryListFont.class)) {
|
||||
String key = "enum-font";
|
||||
|
||||
@ -264,106 +253,6 @@ public class SchemaBuilder {
|
||||
prop.put("$ref", "#/definitions/" + key);
|
||||
description.add(SYMBOL_TYPE__N + " Must be a valid Font Family (use ctrl+space for auto complete!)");
|
||||
|
||||
} else if (k.isAnnotationPresent(RegistryListLoot.class)) {
|
||||
String key = "enum-reg-loot-table";
|
||||
|
||||
if (!definitions.containsKey(key)) {
|
||||
JSONObject j = new JSONObject();
|
||||
j.put("enum", new JSONArray(data.getLootLoader().getPossibleKeys()));
|
||||
definitions.put(key, j);
|
||||
}
|
||||
|
||||
fancyType = "Iris Loot Table";
|
||||
prop.put("$ref", "#/definitions/" + key);
|
||||
description.add(SYMBOL_TYPE__N + " Must be a valid Loot Table (use ctrl+space for auto complete!)");
|
||||
} else if (k.isAnnotationPresent(RegistryListDimension.class)) {
|
||||
String key = "enum-reg-dimension";
|
||||
|
||||
if (!definitions.containsKey(key)) {
|
||||
JSONObject j = new JSONObject();
|
||||
j.put("enum", new JSONArray(data.getDimensionLoader().getPossibleKeys()));
|
||||
definitions.put(key, j);
|
||||
}
|
||||
|
||||
fancyType = "Iris Dimension";
|
||||
prop.put("$ref", "#/definitions/" + key);
|
||||
description.add(SYMBOL_TYPE__N + " Must be a valid Dimension (use ctrl+space for auto complete!)");
|
||||
|
||||
} else if (k.isAnnotationPresent(RegistryListGenerator.class)) {
|
||||
String key = "enum-reg-generator";
|
||||
|
||||
if (!definitions.containsKey(key)) {
|
||||
JSONObject j = new JSONObject();
|
||||
j.put("enum", new JSONArray(data.getGeneratorLoader().getPossibleKeys()));
|
||||
definitions.put(key, j);
|
||||
}
|
||||
|
||||
fancyType = "Iris Generator";
|
||||
prop.put("$ref", "#/definitions/" + key);
|
||||
description.add(SYMBOL_TYPE__N + " Must be a valid Generator (use ctrl+space for auto complete!)");
|
||||
|
||||
} else if (k.isAnnotationPresent(RegistryListObject.class)) {
|
||||
String key = "enum-reg-object";
|
||||
|
||||
if (!definitions.containsKey(key)) {
|
||||
JSONObject j = new JSONObject();
|
||||
j.put("enum", new JSONArray(data.getObjectLoader().getPossibleKeys()));
|
||||
definitions.put(key, j);
|
||||
}
|
||||
|
||||
fancyType = "Iris Object";
|
||||
prop.put("$ref", "#/definitions/" + key);
|
||||
description.add(SYMBOL_TYPE__N + " Must be a valid Object (use ctrl+space for auto complete!)");
|
||||
|
||||
} else if (k.isAnnotationPresent(RegistryListRegion.class)) {
|
||||
String key = "enum-reg-region";
|
||||
|
||||
if (!definitions.containsKey(key)) {
|
||||
JSONObject j = new JSONObject();
|
||||
j.put("enum", new JSONArray(data.getRegionLoader().getPossibleKeys()));
|
||||
definitions.put(key, j);
|
||||
}
|
||||
|
||||
fancyType = "Iris Region";
|
||||
prop.put("$ref", "#/definitions/" + key);
|
||||
description.add(SYMBOL_TYPE__N + " Must be a valid Region (use ctrl+space for auto complete!)");
|
||||
|
||||
} else if (k.isAnnotationPresent(RegistryListJigsawPiece.class)) {
|
||||
String key = "enum-reg-structure-piece";
|
||||
|
||||
if (!definitions.containsKey(key)) {
|
||||
JSONObject j = new JSONObject();
|
||||
j.put("enum", new JSONArray(data.getJigsawPieceLoader().getPossibleKeys()));
|
||||
definitions.put(key, j);
|
||||
}
|
||||
|
||||
fancyType = "Iris Jigsaw Piece";
|
||||
prop.put("$ref", "#/definitions/" + key);
|
||||
description.add(SYMBOL_TYPE__N + " Must be a valid Jigsaw Piece (use ctrl+space for auto complete!)");
|
||||
} else if (k.isAnnotationPresent(RegistryListJigsaw.class)) {
|
||||
String key = "enum-reg-jigsaw";
|
||||
|
||||
if (!definitions.containsKey(key)) {
|
||||
JSONObject j = new JSONObject();
|
||||
j.put("enum", new JSONArray(data.getJigsawStructureLoader().getPossibleKeys()));
|
||||
definitions.put(key, j);
|
||||
}
|
||||
|
||||
fancyType = "Iris Jigsaw";
|
||||
prop.put("$ref", "#/definitions/" + key);
|
||||
description.add(SYMBOL_TYPE__N + " Must be a valid Jigsaw (use ctrl+space for auto complete!)");
|
||||
} else if (k.isAnnotationPresent(RegistryListJigsawPool.class)) {
|
||||
String key = "enum-reg-structure-pool";
|
||||
|
||||
if (!definitions.containsKey(key)) {
|
||||
JSONObject j = new JSONObject();
|
||||
j.put("enum", new JSONArray(data.getJigsawPoolLoader().getPossibleKeys()));
|
||||
definitions.put(key, j);
|
||||
}
|
||||
|
||||
fancyType = "Iris Jigsaw Pool";
|
||||
prop.put("$ref", "#/definitions/" + key);
|
||||
description.add(SYMBOL_TYPE__N + " Must be a valid Jigsaw Piece (use ctrl+space for auto complete!)");
|
||||
} else if (k.getType().equals(Enchantment.class)) {
|
||||
String key = "enum-enchantment";
|
||||
|
||||
@ -464,35 +353,35 @@ public class SchemaBuilder {
|
||||
}
|
||||
case "string" -> {
|
||||
fancyType = "List of Text";
|
||||
if (k.isAnnotationPresent(RegistryListBiome.class)) {
|
||||
fancyType = "List of Iris Biomes";
|
||||
String key = "enum-reg-biome";
|
||||
|
||||
if (!definitions.containsKey(key)) {
|
||||
JSONObject j = new JSONObject();
|
||||
j.put("enum", new JSONArray(data.getBiomeLoader().getPossibleKeys()));
|
||||
definitions.put(key, j);
|
||||
if(k.isAnnotationPresent(RegistryListResource.class))
|
||||
{
|
||||
RegistryListResource rr = k.getDeclaredAnnotation(RegistryListResource.class);
|
||||
ResourceLoader<?> loader = data.getLoaders().get(rr.value());
|
||||
|
||||
if(loader != null)
|
||||
{
|
||||
fancyType = "List<" + loader.getResourceTypeName() + ">";
|
||||
String key = "erz" + loader.getFolderName();
|
||||
|
||||
if (!definitions.containsKey(key)) {
|
||||
JSONObject j = new JSONObject();
|
||||
j.put("enum", new JSONArray(loader.getPossibleKeys()));
|
||||
definitions.put(key, j);
|
||||
}
|
||||
|
||||
JSONObject items = new JSONObject();
|
||||
items.put("$ref", "#/definitions/" + key);
|
||||
prop.put("items", items);
|
||||
description.add(SYMBOL_TYPE__N + " Must be a valid " + loader.getResourceTypeName() + " (use ctrl+space for auto complete!)");
|
||||
}
|
||||
|
||||
JSONObject items = new JSONObject();
|
||||
items.put("$ref", "#/definitions/" + key);
|
||||
prop.put("items", items);
|
||||
description.add(SYMBOL_TYPE__N + " Must be a valid Biome (use ctrl+space for auto complete!)");
|
||||
} else if (k.isAnnotationPresent(RegistryListSpawner.class)) {
|
||||
fancyType = "List of Iris Spawners";
|
||||
String key = "enum-reg-spawner";
|
||||
|
||||
if (!definitions.containsKey(key)) {
|
||||
JSONObject j = new JSONObject();
|
||||
j.put("enum", new JSONArray(data.getSpawnerLoader().getPossibleKeys()));
|
||||
definitions.put(key, j);
|
||||
else
|
||||
{
|
||||
Iris.error("Cannot find Registry Loader for type (list schema) " + rr.value() + " used in " + k.getDeclaringClass().getCanonicalName() + " in field " + k.getName());
|
||||
}
|
||||
|
||||
JSONObject items = new JSONObject();
|
||||
items.put("$ref", "#/definitions/" + key);
|
||||
prop.put("items", items);
|
||||
description.add(SYMBOL_TYPE__N + " Must be a valid Spawner (use ctrl+space for auto complete!)");
|
||||
} else if (k.isAnnotationPresent(RegistryListMythical.class)) {
|
||||
}
|
||||
else if (k.isAnnotationPresent(RegistryListMythical.class)) {
|
||||
fancyType = "List of Mythic Mob Types";
|
||||
String key = "enum-reg-mythical";
|
||||
|
||||
@ -550,20 +439,6 @@ public class SchemaBuilder {
|
||||
items.put("$ref", "#/definitions/" + key);
|
||||
prop.put("items", items);
|
||||
description.add(SYMBOL_TYPE__N + " Must be a valid Item Type (use ctrl+space for auto complete!)");
|
||||
} else if (k.isAnnotationPresent(RegistryListEntity.class)) {
|
||||
fancyType = "List of Iris Entities";
|
||||
String key = "enum-reg-entity";
|
||||
|
||||
if (!definitions.containsKey(key)) {
|
||||
JSONObject j = new JSONObject();
|
||||
j.put("enum", new JSONArray(data.getEntityLoader().getPossibleKeys()));
|
||||
definitions.put(key, j);
|
||||
}
|
||||
|
||||
JSONObject items = new JSONObject();
|
||||
items.put("$ref", "#/definitions/" + key);
|
||||
prop.put("items", items);
|
||||
description.add(SYMBOL_TYPE__N + " Must be a valid Iris Entity (use ctrl+space for auto complete!)");
|
||||
} else if (k.isAnnotationPresent(RegistryListFont.class)) {
|
||||
String key = "enum-font";
|
||||
fancyType = "List of Font Families";
|
||||
@ -578,118 +453,6 @@ public class SchemaBuilder {
|
||||
items.put("$ref", "#/definitions/" + key);
|
||||
prop.put("items", items);
|
||||
description.add(SYMBOL_TYPE__N + " Must be a valid Font Family (use ctrl+space for auto complete!)");
|
||||
} else if (k.isAnnotationPresent(RegistryListLoot.class)) {
|
||||
fancyType = "List of Iris Loot Tables";
|
||||
String key = "enum-reg-loot-table";
|
||||
|
||||
if (!definitions.containsKey(key)) {
|
||||
JSONObject j = new JSONObject();
|
||||
j.put("enum", new JSONArray(data.getLootLoader().getPossibleKeys()));
|
||||
definitions.put(key, j);
|
||||
}
|
||||
|
||||
JSONObject items = new JSONObject();
|
||||
items.put("$ref", "#/definitions/" + key);
|
||||
prop.put("items", items);
|
||||
description.add(SYMBOL_TYPE__N + " Must be a valid Loot Table (use ctrl+space for auto complete!)");
|
||||
} else if (k.isAnnotationPresent(RegistryListDimension.class)) {
|
||||
fancyType = "List of Iris Dimensions";
|
||||
String key = "enum-reg-dimension";
|
||||
|
||||
if (!definitions.containsKey(key)) {
|
||||
JSONObject j = new JSONObject();
|
||||
j.put("enum", new JSONArray(data.getDimensionLoader().getPossibleKeys()));
|
||||
definitions.put(key, j);
|
||||
}
|
||||
|
||||
JSONObject items = new JSONObject();
|
||||
items.put("$ref", "#/definitions/" + key);
|
||||
prop.put("items", items);
|
||||
description.add(SYMBOL_TYPE__N + " Must be a valid Dimension (use ctrl+space for auto complete!)");
|
||||
} else if (k.isAnnotationPresent(RegistryListGenerator.class)) {
|
||||
fancyType = "List of Iris Generators";
|
||||
String key = "enum-reg-generator";
|
||||
|
||||
if (!definitions.containsKey(key)) {
|
||||
JSONObject j = new JSONObject();
|
||||
j.put("enum", new JSONArray(data.getGeneratorLoader().getPossibleKeys()));
|
||||
definitions.put(key, j);
|
||||
}
|
||||
|
||||
JSONObject items = new JSONObject();
|
||||
items.put("$ref", "#/definitions/" + key);
|
||||
prop.put("items", items);
|
||||
description.add(SYMBOL_TYPE__N + " Must be a valid Generator (use ctrl+space for auto complete!)");
|
||||
} else if (k.isAnnotationPresent(RegistryListObject.class)) {
|
||||
fancyType = "List of Iris Objects";
|
||||
String key = "enum-reg-object";
|
||||
|
||||
if (!definitions.containsKey(key)) {
|
||||
JSONObject j = new JSONObject();
|
||||
j.put("enum", new JSONArray(data.getObjectLoader().getPossibleKeys()));
|
||||
definitions.put(key, j);
|
||||
}
|
||||
|
||||
JSONObject items = new JSONObject();
|
||||
items.put("$ref", "#/definitions/" + key);
|
||||
prop.put("items", items);
|
||||
description.add(SYMBOL_TYPE__N + " Must be a valid Object (use ctrl+space for auto complete!)");
|
||||
} else if (k.isAnnotationPresent(RegistryListRegion.class)) {
|
||||
fancyType = "List of Iris Regions";
|
||||
String key = "enum-reg-region";
|
||||
|
||||
if (!definitions.containsKey(key)) {
|
||||
JSONObject j = new JSONObject();
|
||||
j.put("enum", new JSONArray(data.getRegionLoader().getPossibleKeys()));
|
||||
definitions.put(key, j);
|
||||
}
|
||||
|
||||
JSONObject items = new JSONObject();
|
||||
items.put("$ref", "#/definitions/" + key);
|
||||
prop.put("items", items);
|
||||
description.add(SYMBOL_TYPE__N + " Must be a valid Region (use ctrl+space for auto complete!)");
|
||||
} else if (k.isAnnotationPresent(RegistryListJigsawPiece.class)) {
|
||||
fancyType = "List of Iris Jigsaw Pieces";
|
||||
String key = "enum-reg-structure-piece";
|
||||
|
||||
if (!definitions.containsKey(key)) {
|
||||
JSONObject j = new JSONObject();
|
||||
j.put("enum", new JSONArray(data.getJigsawPieceLoader().getPossibleKeys()));
|
||||
definitions.put(key, j);
|
||||
}
|
||||
|
||||
JSONObject items = new JSONObject();
|
||||
items.put("$ref", "#/definitions/" + key);
|
||||
prop.put("items", items);
|
||||
description.add(SYMBOL_TYPE__N + " Must be a valid Jigsaw Piece (use ctrl+space for auto complete!)");
|
||||
} else if (k.isAnnotationPresent(RegistryListJigsawPool.class)) {
|
||||
fancyType = "List of Iris Jigsaw Pools";
|
||||
String key = "enum-reg-structure-pool";
|
||||
|
||||
if (!definitions.containsKey(key)) {
|
||||
JSONObject j = new JSONObject();
|
||||
j.put("enum", new JSONArray(data.getJigsawPoolLoader().getPossibleKeys()));
|
||||
definitions.put(key, j);
|
||||
}
|
||||
|
||||
JSONObject items = new JSONObject();
|
||||
items.put("$ref", "#/definitions/" + key);
|
||||
prop.put("items", items);
|
||||
description.add(SYMBOL_TYPE__N + " Must be a valid Jigsaw Pool (use ctrl+space for auto complete!)");
|
||||
} else if (k.isAnnotationPresent(RegistryListJigsaw.class)) {
|
||||
fancyType = "List of Iris Jigsaw Structures";
|
||||
String key = "enum-reg-jigsaw";
|
||||
|
||||
if (!definitions.containsKey(key)) {
|
||||
JSONObject j = new JSONObject();
|
||||
j.put("enum", new JSONArray(data.getJigsawStructureLoader().getPossibleKeys()));
|
||||
definitions.put(key, j);
|
||||
}
|
||||
|
||||
JSONObject items = new JSONObject();
|
||||
items.put("$ref", "#/definitions/" + key);
|
||||
prop.put("items", items);
|
||||
description.add(SYMBOL_TYPE__N + " Must be a valid Jigsaw (use ctrl+space for auto complete!)");
|
||||
} else if (t.type().equals(Enchantment.class)) {
|
||||
fancyType = "List of Enchantment Types";
|
||||
String key = "enum-enchantment";
|
||||
|
@ -16,11 +16,9 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.volmit.iris.core;
|
||||
package com.volmit.iris.core.project.loader;
|
||||
|
||||
import com.volmit.iris.Iris;
|
||||
import com.volmit.iris.engine.data.loader.ObjectResourceLoader;
|
||||
import com.volmit.iris.engine.data.loader.ResourceLoader;
|
||||
import com.volmit.iris.engine.object.*;
|
||||
import com.volmit.iris.util.collection.KMap;
|
||||
import com.volmit.iris.util.math.RNG;
|
||||
@ -31,7 +29,7 @@ import java.util.Objects;
|
||||
import java.util.function.Function;
|
||||
|
||||
@Data
|
||||
public class IrisDataManager {
|
||||
public class IrisData {
|
||||
private ResourceLoader<IrisBiome> biomeLoader;
|
||||
private ResourceLoader<IrisLootTable> lootLoader;
|
||||
private ResourceLoader<IrisRegion> regionLoader;
|
||||
@ -51,11 +49,11 @@ public class IrisDataManager {
|
||||
private final File dataFolder;
|
||||
private final int id;
|
||||
|
||||
public IrisDataManager(File dataFolder) {
|
||||
public IrisData(File dataFolder) {
|
||||
this(dataFolder, false);
|
||||
}
|
||||
|
||||
public IrisDataManager(File dataFolder, boolean oneshot) {
|
||||
public IrisData(File dataFolder, boolean oneshot) {
|
||||
this.dataFolder = dataFolder;
|
||||
this.id = RNG.r.imax();
|
||||
closed = false;
|
||||
@ -72,8 +70,8 @@ public class IrisDataManager {
|
||||
Iris.warn(" " + rl.getResourceTypeName() + " @ /" + rl.getFolderName() + ": Cache=" + rl.getLoadCache().size() + " Folders=" + rl.getFolders().size());
|
||||
}
|
||||
|
||||
public IrisDataManager copy() {
|
||||
return new IrisDataManager(dataFolder);
|
||||
public IrisData copy() {
|
||||
return new IrisData(dataFolder);
|
||||
}
|
||||
|
||||
private <T extends IrisRegistrant> ResourceLoader<T> registerLoader(Class<T> registrant)
|
||||
@ -207,11 +205,11 @@ public class IrisDataManager {
|
||||
return loadAny(key, (dm) -> dm.getGeneratorLoader().load(key, false));
|
||||
}
|
||||
|
||||
public static <T extends IrisRegistrant> T loadAny(String key, Function<IrisDataManager, T> v) {
|
||||
public static <T extends IrisRegistrant> T loadAny(String key, Function<IrisData, T> v) {
|
||||
try {
|
||||
for (File i : Objects.requireNonNull(Iris.instance.getDataFolder("packs").listFiles())) {
|
||||
if (i.isDirectory()) {
|
||||
IrisDataManager dm = new IrisDataManager(i, true);
|
||||
IrisData dm = new IrisData(i, true);
|
||||
T t = v.apply(dm);
|
||||
|
||||
if (t != null) {
|
@ -16,10 +16,9 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.volmit.iris.engine.data.loader;
|
||||
package com.volmit.iris.core.project.loader;
|
||||
|
||||
import com.volmit.iris.Iris;
|
||||
import com.volmit.iris.core.IrisDataManager;
|
||||
import com.volmit.iris.engine.object.IrisObject;
|
||||
import com.volmit.iris.util.collection.KList;
|
||||
import com.volmit.iris.util.collection.KMap;
|
||||
@ -40,7 +39,7 @@ public class ObjectResourceLoader extends ResourceLoader<IrisObject> {
|
||||
private final ChronoLatch cl;
|
||||
private final AtomicInteger unload;
|
||||
|
||||
public ObjectResourceLoader(File root, IrisDataManager idm, String folderName, String resourceTypeName) {
|
||||
public ObjectResourceLoader(File root, IrisData idm, String folderName, String resourceTypeName) {
|
||||
super(root, idm, folderName, resourceTypeName, IrisObject.class);
|
||||
cl = new ChronoLatch(30000);
|
||||
unload = new AtomicInteger(0);
|
@ -16,12 +16,11 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.volmit.iris.engine.data.loader;
|
||||
package com.volmit.iris.core.project.loader;
|
||||
|
||||
import com.google.common.util.concurrent.AtomicDouble;
|
||||
import com.google.gson.Gson;
|
||||
import com.volmit.iris.Iris;
|
||||
import com.volmit.iris.core.IrisDataManager;
|
||||
import com.volmit.iris.core.project.SchemaBuilder;
|
||||
import com.volmit.iris.engine.object.IrisRegistrant;
|
||||
import com.volmit.iris.util.collection.KList;
|
||||
@ -56,11 +55,11 @@ public class ResourceLoader<T extends IrisRegistrant> {
|
||||
protected String cname;
|
||||
protected IrisLock lock;
|
||||
protected String[] possibleKeys = null;
|
||||
protected IrisDataManager manager;
|
||||
protected IrisData manager;
|
||||
protected AtomicInteger loads;
|
||||
protected ChronoLatch sec;
|
||||
|
||||
public ResourceLoader(File root, IrisDataManager manager, String folderName, String resourceTypeName, Class<? extends T> objectClass) {
|
||||
public ResourceLoader(File root, IrisData manager, String folderName, String resourceTypeName, Class<? extends T> objectClass) {
|
||||
lock = new IrisLock("Res");
|
||||
this.manager = manager;
|
||||
sec = new ChronoLatch(5000);
|
@ -19,13 +19,13 @@
|
||||
package com.volmit.iris.core.tools;
|
||||
|
||||
import com.volmit.iris.Iris;
|
||||
import com.volmit.iris.core.IrisDataManager;
|
||||
import com.volmit.iris.core.IrisSettings;
|
||||
import com.volmit.iris.core.gui.PregeneratorJob;
|
||||
import com.volmit.iris.core.pregenerator.PregenTask;
|
||||
import com.volmit.iris.core.pregenerator.PregeneratorMethod;
|
||||
import com.volmit.iris.core.pregenerator.methods.HeadlessPregenMethod;
|
||||
import com.volmit.iris.core.pregenerator.methods.HybridPregenMethod;
|
||||
import com.volmit.iris.core.project.loader.IrisData;
|
||||
import com.volmit.iris.engine.framework.IrisAccess;
|
||||
import com.volmit.iris.engine.object.IrisDimension;
|
||||
import com.volmit.iris.util.plugin.VolmitSender;
|
||||
@ -61,7 +61,7 @@ public class IrisToolbelt {
|
||||
return null;
|
||||
}
|
||||
|
||||
return new IrisDataManager(pack).getDimensionLoader().load(dimension);
|
||||
return new IrisData(pack).getDimensionLoader().load(dimension);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -18,7 +18,7 @@
|
||||
|
||||
package com.volmit.iris.core.tools;
|
||||
|
||||
import com.volmit.iris.core.IrisDataManager;
|
||||
import com.volmit.iris.core.project.loader.IrisData;
|
||||
import com.volmit.iris.engine.framework.EngineCompositeGenerator;
|
||||
import com.volmit.iris.engine.object.IrisDimension;
|
||||
import com.volmit.iris.engine.object.common.IrisWorld;
|
||||
@ -93,7 +93,7 @@ public class IrisWorldCreator {
|
||||
}
|
||||
|
||||
private World.Environment findEnvironment() {
|
||||
IrisDimension dim = IrisDataManager.loadAnyDimension(dimensionName);
|
||||
IrisDimension dim = IrisData.loadAnyDimension(dimensionName);
|
||||
if (dim == null || dim.getEnvironment() == null) {
|
||||
return World.Environment.NORMAL;
|
||||
} else {
|
||||
|
@ -20,7 +20,7 @@ package com.volmit.iris.engine;
|
||||
|
||||
import com.google.common.util.concurrent.AtomicDouble;
|
||||
import com.volmit.iris.Iris;
|
||||
import com.volmit.iris.core.IrisDataManager;
|
||||
import com.volmit.iris.core.project.loader.IrisData;
|
||||
import com.volmit.iris.engine.actuator.IrisTerrainNormalActuator;
|
||||
import com.volmit.iris.engine.data.DataProvider;
|
||||
import com.volmit.iris.engine.framework.Engine;
|
||||
@ -48,7 +48,7 @@ public class IrisComplex implements DataProvider {
|
||||
public static AtomicBoolean cacheLock = new AtomicBoolean(false);
|
||||
private RNG rng;
|
||||
private double fluidHeight;
|
||||
private IrisDataManager data;
|
||||
private IrisData data;
|
||||
private KList<IrisGenerator> generators;
|
||||
private static final BlockData AIR = Material.AIR.createBlockData();
|
||||
private ProceduralStream<IrisRegion> regionStream;
|
||||
|
@ -19,8 +19,8 @@
|
||||
package com.volmit.iris.engine;
|
||||
|
||||
import com.volmit.iris.Iris;
|
||||
import com.volmit.iris.core.IrisDataManager;
|
||||
import com.volmit.iris.core.IrisSettings;
|
||||
import com.volmit.iris.core.project.loader.IrisData;
|
||||
import com.volmit.iris.engine.framework.Engine;
|
||||
import com.volmit.iris.engine.framework.EngineCompound;
|
||||
import com.volmit.iris.engine.framework.EngineData;
|
||||
@ -80,7 +80,7 @@ public class IrisEngineCompound implements EngineCompound {
|
||||
@Setter
|
||||
private boolean studio;
|
||||
|
||||
public IrisEngineCompound(IrisWorld world, IrisDimension rootDimension, IrisDataManager data, int maximumThreads) {
|
||||
public IrisEngineCompound(IrisWorld world, IrisDimension rootDimension, IrisData data, int maximumThreads) {
|
||||
wallClock = new AtomicRollingSequence(32);
|
||||
this.rootDimension = rootDimension;
|
||||
Iris.info("Initializing Engine Composite for " + world.name());
|
||||
@ -264,7 +264,7 @@ public class IrisEngineCompound implements EngineCompound {
|
||||
|
||||
@BlockCoordinates
|
||||
@Override
|
||||
public IrisDataManager getData(int height) {
|
||||
public IrisData getData(int height) {
|
||||
return getEngineForHeight(height).getData();
|
||||
}
|
||||
|
||||
|
@ -18,8 +18,8 @@
|
||||
|
||||
package com.volmit.iris.engine.data;
|
||||
|
||||
import com.volmit.iris.core.IrisDataManager;
|
||||
import com.volmit.iris.core.project.loader.IrisData;
|
||||
|
||||
public interface DataProvider {
|
||||
IrisDataManager getData();
|
||||
IrisData getData();
|
||||
}
|
||||
|
@ -19,9 +19,9 @@
|
||||
package com.volmit.iris.engine.framework;
|
||||
|
||||
import com.volmit.iris.Iris;
|
||||
import com.volmit.iris.core.IrisDataManager;
|
||||
import com.volmit.iris.core.gui.components.RenderType;
|
||||
import com.volmit.iris.core.gui.components.Renderer;
|
||||
import com.volmit.iris.core.project.loader.IrisData;
|
||||
import com.volmit.iris.engine.cache.Cache;
|
||||
import com.volmit.iris.engine.data.B;
|
||||
import com.volmit.iris.engine.data.DataProvider;
|
||||
@ -117,7 +117,7 @@ public interface Engine extends DataProvider, Fallible, GeneratorAccess, LootPro
|
||||
return getTarget().getHeight();
|
||||
}
|
||||
|
||||
default IrisDataManager getData() {
|
||||
default IrisData getData() {
|
||||
return getTarget().getData();
|
||||
}
|
||||
|
||||
|
@ -19,7 +19,7 @@
|
||||
package com.volmit.iris.engine.framework;
|
||||
|
||||
import com.volmit.iris.Iris;
|
||||
import com.volmit.iris.core.IrisDataManager;
|
||||
import com.volmit.iris.core.project.loader.IrisData;
|
||||
import com.volmit.iris.engine.IrisComplex;
|
||||
import com.volmit.iris.engine.object.IrisDimension;
|
||||
import com.volmit.iris.engine.parallax.ParallaxAccess;
|
||||
@ -52,7 +52,7 @@ public interface EngineComponent {
|
||||
return getEngine().modifyZ(z);
|
||||
}
|
||||
|
||||
default IrisDataManager getData() {
|
||||
default IrisData getData() {
|
||||
return getEngine().getData();
|
||||
}
|
||||
|
||||
|
@ -19,11 +19,11 @@
|
||||
package com.volmit.iris.engine.framework;
|
||||
|
||||
import com.volmit.iris.Iris;
|
||||
import com.volmit.iris.core.IrisDataManager;
|
||||
import com.volmit.iris.core.IrisSettings;
|
||||
import com.volmit.iris.core.nms.INMS;
|
||||
import com.volmit.iris.core.pregenerator.PregenListener;
|
||||
import com.volmit.iris.core.pregenerator.PregenTask;
|
||||
import com.volmit.iris.core.project.loader.IrisData;
|
||||
import com.volmit.iris.engine.IrisEngineCompound;
|
||||
import com.volmit.iris.engine.data.B;
|
||||
import com.volmit.iris.engine.data.chunk.MCATerrainChunk;
|
||||
@ -207,11 +207,11 @@ public class EngineCompositeGenerator extends ChunkGenerator implements IrisAcce
|
||||
query = IrisSettings.get().getGenerator().getDefaultWorldType();
|
||||
}
|
||||
|
||||
dim = IrisDataManager.loadAnyDimension(query);
|
||||
dim = IrisData.loadAnyDimension(query);
|
||||
|
||||
if (dim == null) {
|
||||
Iris.proj.downloadSearch(new VolmitSender(Bukkit.getConsoleSender(), Iris.instance.getTag()), query, false);
|
||||
dim = IrisDataManager.loadAnyDimension(query);
|
||||
dim = IrisData.loadAnyDimension(query);
|
||||
|
||||
if (dim == null) {
|
||||
throw new RuntimeException("Cannot find dimension: " + query);
|
||||
@ -222,12 +222,12 @@ public class EngineCompositeGenerator extends ChunkGenerator implements IrisAcce
|
||||
|
||||
if (production) {
|
||||
IrisDimension od = dim;
|
||||
dim = new IrisDataManager(getDataFolder(world)).getDimensionLoader().load(od.getLoadKey());
|
||||
dim = new IrisData(getDataFolder(world)).getDimensionLoader().load(od.getLoadKey());
|
||||
|
||||
if (dim == null) {
|
||||
Iris.info("Installing Iris pack " + od.getName() + " into world " + world.name() + "...");
|
||||
Iris.proj.installIntoWorld(new VolmitSender(Bukkit.getConsoleSender(), Iris.instance.getTag()), od.getLoadKey(), world.worldFolder());
|
||||
dim = new IrisDataManager(getDataFolder(world)).getDimensionLoader().load(od.getLoadKey());
|
||||
dim = new IrisData(getDataFolder(world)).getDimensionLoader().load(od.getLoadKey());
|
||||
|
||||
if (dim == null) {
|
||||
throw new RuntimeException("Cannot find dimension: " + query);
|
||||
@ -273,11 +273,11 @@ public class EngineCompositeGenerator extends ChunkGenerator implements IrisAcce
|
||||
query = IrisSettings.get().getGenerator().getDefaultWorldType();
|
||||
}
|
||||
|
||||
dim = IrisDataManager.loadAnyDimension(query);
|
||||
dim = IrisData.loadAnyDimension(query);
|
||||
|
||||
if (dim == null) {
|
||||
Iris.proj.downloadSearch(new VolmitSender(Bukkit.getConsoleSender(), Iris.instance.getTag()), query, false);
|
||||
dim = IrisDataManager.loadAnyDimension(query);
|
||||
dim = IrisData.loadAnyDimension(query);
|
||||
|
||||
if (dim == null) {
|
||||
throw new RuntimeException("Cannot find dimension: " + query);
|
||||
@ -288,12 +288,12 @@ public class EngineCompositeGenerator extends ChunkGenerator implements IrisAcce
|
||||
|
||||
if (production) {
|
||||
IrisDimension od = dim;
|
||||
dim = new IrisDataManager(getDataFolder(world)).getDimensionLoader().load(od.getLoadKey());
|
||||
dim = new IrisData(getDataFolder(world)).getDimensionLoader().load(od.getLoadKey());
|
||||
|
||||
if (dim == null) {
|
||||
Iris.info("Installing Iris pack " + od.getName() + " into world " + world + "...");
|
||||
Iris.proj.installIntoWorld(new VolmitSender(Bukkit.getConsoleSender(), Iris.instance.getTag()), od.getLoadKey(), new File(world));
|
||||
dim = new IrisDataManager(getDataFolder(world)).getDimensionLoader().load(od.getLoadKey());
|
||||
dim = new IrisData(getDataFolder(world)).getDimensionLoader().load(od.getLoadKey());
|
||||
|
||||
if (dim == null) {
|
||||
throw new RuntimeException("Cannot find dimension: " + query);
|
||||
@ -314,7 +314,7 @@ public class EngineCompositeGenerator extends ChunkGenerator implements IrisAcce
|
||||
try {
|
||||
initialized.set(true);
|
||||
IrisDimension dim = getDimension(world);
|
||||
IrisDataManager data = production ? new IrisDataManager(getDataFolder(world)) : dim.getLoader().copy();
|
||||
IrisData data = production ? new IrisData(getDataFolder(world)) : dim.getLoader().copy();
|
||||
compound.set(new IrisEngineCompound(world, dim, data, IrisSettings.getThreadCount(IrisSettings.get().getConcurrency().getEngineThreadCount())));
|
||||
compound.get().setStudio(!production);
|
||||
populators.clear();
|
||||
@ -667,7 +667,7 @@ public class EngineCompositeGenerator extends ChunkGenerator implements IrisAcce
|
||||
}
|
||||
|
||||
@Override
|
||||
public IrisDataManager getData() {
|
||||
public IrisData getData() {
|
||||
if (getCompound() == null) {
|
||||
return null;
|
||||
}
|
||||
@ -755,7 +755,7 @@ public class EngineCompositeGenerator extends ChunkGenerator implements IrisAcce
|
||||
dim.getAllAnyBiomes().forEach((i) -> v.put(i.getLoadKey(), i));
|
||||
|
||||
try {
|
||||
dim.getDimensionalComposite().forEach((m) -> IrisDataManager.loadAnyDimension(m.getDimension()).getAllAnyBiomes().forEach((i) -> v.put(i.getLoadKey(), i)));
|
||||
dim.getDimensionalComposite().forEach((m) -> IrisData.loadAnyDimension(m.getDimension()).getAllAnyBiomes().forEach((i) -> v.put(i.getLoadKey(), i)));
|
||||
} catch (Throwable ignored) {
|
||||
Iris.reportError(ignored);
|
||||
|
||||
|
@ -19,7 +19,7 @@
|
||||
package com.volmit.iris.engine.framework;
|
||||
|
||||
import com.volmit.iris.Iris;
|
||||
import com.volmit.iris.core.IrisDataManager;
|
||||
import com.volmit.iris.core.project.loader.IrisData;
|
||||
import com.volmit.iris.engine.actuator.IrisTerrainNormalActuator;
|
||||
import com.volmit.iris.engine.data.DataProvider;
|
||||
import com.volmit.iris.engine.hunk.Hunk;
|
||||
@ -105,9 +105,9 @@ public interface EngineCompound extends Listener, Hotloadable, DataProvider {
|
||||
}
|
||||
}
|
||||
|
||||
IrisDataManager getData(int height);
|
||||
IrisData getData(int height);
|
||||
|
||||
default IrisDataManager getData() {
|
||||
default IrisData getData() {
|
||||
return getData(0);
|
||||
}
|
||||
|
||||
|
@ -18,7 +18,7 @@
|
||||
|
||||
package com.volmit.iris.engine.framework;
|
||||
|
||||
import com.volmit.iris.core.IrisDataManager;
|
||||
import com.volmit.iris.core.project.loader.IrisData;
|
||||
import com.volmit.iris.engine.IrisComplex;
|
||||
import com.volmit.iris.engine.data.DataProvider;
|
||||
import org.bukkit.block.Biome;
|
||||
@ -31,7 +31,7 @@ public interface EngineFramework extends DataProvider {
|
||||
|
||||
EngineParallaxManager getEngineParallax();
|
||||
|
||||
default IrisDataManager getData() {
|
||||
default IrisData getData() {
|
||||
return getComplex().getData();
|
||||
}
|
||||
|
||||
|
@ -19,7 +19,7 @@
|
||||
package com.volmit.iris.engine.framework;
|
||||
|
||||
import com.volmit.iris.Iris;
|
||||
import com.volmit.iris.core.IrisDataManager;
|
||||
import com.volmit.iris.core.project.loader.IrisData;
|
||||
import com.volmit.iris.engine.IrisComplex;
|
||||
import com.volmit.iris.engine.cache.Cache;
|
||||
import com.volmit.iris.engine.data.B;
|
||||
@ -70,7 +70,7 @@ public interface EngineParallaxManager extends DataProvider, IObjectPlacer {
|
||||
return getEngine().getParallax();
|
||||
}
|
||||
|
||||
default IrisDataManager getData() {
|
||||
default IrisData getData() {
|
||||
return getEngine().getData();
|
||||
}
|
||||
|
||||
|
@ -18,8 +18,8 @@
|
||||
|
||||
package com.volmit.iris.engine.framework;
|
||||
|
||||
import com.volmit.iris.core.IrisDataManager;
|
||||
import com.volmit.iris.core.IrisSettings;
|
||||
import com.volmit.iris.core.project.loader.IrisData;
|
||||
import com.volmit.iris.engine.object.IrisDimension;
|
||||
import com.volmit.iris.engine.object.common.IrisWorld;
|
||||
import com.volmit.iris.engine.parallax.ParallaxWorld;
|
||||
@ -35,11 +35,11 @@ public class EngineTarget {
|
||||
private final IrisDimension dimension;
|
||||
private IrisWorld world;
|
||||
private final int height;
|
||||
private final IrisDataManager data;
|
||||
private final IrisData data;
|
||||
private final ParallaxWorld parallaxWorld;
|
||||
private final boolean inverted;
|
||||
|
||||
public EngineTarget(IrisWorld world, IrisDimension dimension, IrisDataManager data, int height, boolean inverted, int threads) {
|
||||
public EngineTarget(IrisWorld world, IrisDimension dimension, IrisData data, int height, boolean inverted, int threads) {
|
||||
this.world = world;
|
||||
this.height = height;
|
||||
this.dimension = dimension;
|
||||
@ -50,7 +50,7 @@ public class EngineTarget {
|
||||
this.parallaxWorld = new ParallaxWorld(parallaxBurster, 256, new File(world.worldFolder(), "iris/" + dimension.getLoadKey() + "/parallax"));
|
||||
}
|
||||
|
||||
public EngineTarget(IrisWorld world, IrisDimension dimension, IrisDataManager data, int height, int threads) {
|
||||
public EngineTarget(IrisWorld world, IrisDimension dimension, IrisData data, int height, int threads) {
|
||||
this(world, dimension, data, height, false, threads);
|
||||
}
|
||||
|
||||
|
@ -18,8 +18,8 @@
|
||||
|
||||
package com.volmit.iris.engine.framework;
|
||||
|
||||
import com.volmit.iris.core.IrisDataManager;
|
||||
import com.volmit.iris.core.gui.components.Renderer;
|
||||
import com.volmit.iris.core.project.loader.IrisData;
|
||||
import com.volmit.iris.engine.data.DataProvider;
|
||||
import com.volmit.iris.engine.object.IrisBiome;
|
||||
import com.volmit.iris.engine.object.IrisObjectPlacement;
|
||||
@ -31,7 +31,7 @@ public interface GeneratorAccess extends DataProvider, Renderer {
|
||||
|
||||
ParallaxAccess getParallaxAccess();
|
||||
|
||||
IrisDataManager getData();
|
||||
IrisData getData();
|
||||
|
||||
IrisBiome getCaveBiome(int x, int z);
|
||||
|
||||
|
@ -19,8 +19,8 @@
|
||||
package com.volmit.iris.engine.framework;
|
||||
|
||||
import com.volmit.iris.Iris;
|
||||
import com.volmit.iris.core.IrisDataManager;
|
||||
import com.volmit.iris.core.pregenerator.PregenListener;
|
||||
import com.volmit.iris.core.project.loader.IrisData;
|
||||
import com.volmit.iris.engine.IrisComplex;
|
||||
import com.volmit.iris.engine.data.DataProvider;
|
||||
import com.volmit.iris.engine.data.mca.NBTWorld;
|
||||
@ -98,7 +98,7 @@ public interface IrisAccess extends Hotloadable, DataProvider {
|
||||
|
||||
GeneratorAccess getEngineAccess(int y);
|
||||
|
||||
IrisDataManager getData();
|
||||
IrisData getData();
|
||||
|
||||
int getHeight(int x, int y, int z);
|
||||
|
||||
|
@ -19,7 +19,7 @@
|
||||
package com.volmit.iris.engine.headless;
|
||||
|
||||
import com.volmit.iris.Iris;
|
||||
import com.volmit.iris.core.IrisDataManager;
|
||||
import com.volmit.iris.core.project.loader.IrisData;
|
||||
import com.volmit.iris.core.tools.IrisWorlds;
|
||||
import com.volmit.iris.engine.framework.EngineCompositeGenerator;
|
||||
import com.volmit.iris.engine.object.IrisDimension;
|
||||
@ -83,6 +83,6 @@ public class HeadlessWorld {
|
||||
}
|
||||
|
||||
public static HeadlessWorld from(String name, String dimension, long seed) {
|
||||
return new HeadlessWorld(name, IrisDataManager.loadAnyDimension(dimension), seed);
|
||||
return new HeadlessWorld(name, IrisData.loadAnyDimension(dimension), seed);
|
||||
}
|
||||
}
|
||||
|
@ -18,7 +18,7 @@
|
||||
|
||||
package com.volmit.iris.engine.jigsaw;
|
||||
|
||||
import com.volmit.iris.core.IrisDataManager;
|
||||
import com.volmit.iris.core.project.loader.IrisData;
|
||||
import com.volmit.iris.core.tools.IrisWorlds;
|
||||
import com.volmit.iris.engine.framework.Engine;
|
||||
import com.volmit.iris.engine.framework.IrisAccess;
|
||||
@ -46,7 +46,7 @@ public class PlannedPiece {
|
||||
private IrisObject object;
|
||||
private IrisJigsawPiece piece;
|
||||
private IrisObjectRotation rotation;
|
||||
private IrisDataManager data;
|
||||
private IrisData data;
|
||||
private KList<IrisJigsawPieceConnector> connected;
|
||||
private boolean dead = false;
|
||||
private AxisAlignedBB box;
|
||||
|
@ -20,7 +20,7 @@ package com.volmit.iris.engine.jigsaw;
|
||||
|
||||
import com.googlecode.concurrentlinkedhashmap.ConcurrentLinkedHashMap;
|
||||
import com.volmit.iris.Iris;
|
||||
import com.volmit.iris.core.IrisDataManager;
|
||||
import com.volmit.iris.core.project.loader.IrisData;
|
||||
import com.volmit.iris.core.tools.IrisWorlds;
|
||||
import com.volmit.iris.engine.framework.EngineParallaxManager;
|
||||
import com.volmit.iris.engine.framework.IrisAccess;
|
||||
@ -41,7 +41,7 @@ public class PlannedStructure {
|
||||
private KList<PlannedPiece> pieces;
|
||||
private IrisJigsawStructure structure;
|
||||
private IrisPosition position;
|
||||
private IrisDataManager data;
|
||||
private IrisData data;
|
||||
private RNG rng;
|
||||
private boolean verbose;
|
||||
private boolean terminating;
|
||||
|
@ -19,8 +19,8 @@
|
||||
package com.volmit.iris.engine.object;
|
||||
|
||||
import com.volmit.iris.Iris;
|
||||
import com.volmit.iris.core.IrisDataManager;
|
||||
import com.volmit.iris.core.gui.components.RenderType;
|
||||
import com.volmit.iris.core.project.loader.IrisData;
|
||||
import com.volmit.iris.engine.IrisComplex;
|
||||
import com.volmit.iris.engine.cache.AtomicCache;
|
||||
import com.volmit.iris.engine.data.B;
|
||||
@ -66,7 +66,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)
|
||||
@RegistryListSpawner
|
||||
@RegistryListResource(IrisSpawner.class)
|
||||
private KList<String> entitySpawners = new KList<>();
|
||||
|
||||
@Desc("Add random chances for terrain features")
|
||||
@ -132,7 +132,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();
|
||||
|
||||
@RegistryListBiome
|
||||
@RegistryListResource(IrisBiome.class)
|
||||
@ArrayType(min = 1, type = String.class)
|
||||
@Desc("List any biome names (file names without.json) here as children. Portions of this biome can sometimes morph into their children. Iris supports cyclic relationships such as A > B > A > B. Iris will stop checking 9 biomes down the tree.")
|
||||
private KList<String> children = new KList<>();
|
||||
@ -141,7 +141,7 @@ public class IrisBiome extends IrisRegistrant implements IRare {
|
||||
@Desc("Jigsaw structures")
|
||||
private KList<IrisJigsawStructurePlacement> jigsawStructures = new KList<>();
|
||||
|
||||
@RegistryListBiome
|
||||
@RegistryListResource(IrisBiome.class)
|
||||
@Desc("The carving biome. If specified the biome will be used when under a carving instead of this current biome.")
|
||||
private String carvingBiome = "";
|
||||
|
||||
@ -249,7 +249,7 @@ public class IrisBiome extends IrisRegistrant implements IRare {
|
||||
}).get(loadKey);
|
||||
}
|
||||
|
||||
public IrisBiome getRealCarvingBiome(IrisDataManager data) {
|
||||
public IrisBiome getRealCarvingBiome(IrisData data) {
|
||||
return realCarveBiome.aquire(() ->
|
||||
{
|
||||
IrisBiome biome = data.getBiomeLoader().load(getCarvingBiome());
|
||||
@ -311,7 +311,7 @@ public class IrisBiome extends IrisRegistrant implements IRare {
|
||||
return childrenCell.aquire(() -> getChildStyle().create(random.nextParallelRNG(sig * 2137)).bake().scale(scale).bake());
|
||||
}
|
||||
|
||||
public KList<BlockData> generateLayers(double wx, double wz, RNG random, int maxDepth, int height, IrisDataManager rdata, IrisComplex complex) {
|
||||
public KList<BlockData> generateLayers(double wx, double wz, RNG random, int maxDepth, int height, IrisData rdata, IrisComplex complex) {
|
||||
if (isLockLayers()) {
|
||||
return generateLockedLayers(wx, wz, random, maxDepth, height, rdata, complex);
|
||||
}
|
||||
@ -359,7 +359,7 @@ public class IrisBiome extends IrisRegistrant implements IRare {
|
||||
return data;
|
||||
}
|
||||
|
||||
public KList<BlockData> generateLockedLayers(double wx, double wz, RNG random, int maxDepthf, int height, IrisDataManager rdata, IrisComplex complex) {
|
||||
public KList<BlockData> generateLockedLayers(double wx, double wz, RNG random, int maxDepthf, int height, IrisData rdata, IrisComplex complex) {
|
||||
KList<BlockData> data = new KList<>();
|
||||
KList<BlockData> real = new KList<>();
|
||||
int maxDepth = Math.min(maxDepthf, getLockLayersMax());
|
||||
@ -419,7 +419,7 @@ public class IrisBiome extends IrisRegistrant implements IRare {
|
||||
});
|
||||
}
|
||||
|
||||
public int getMaxWithObjectHeight(IrisDataManager data) {
|
||||
public int getMaxWithObjectHeight(IrisData data) {
|
||||
return maxWithObjectHeight.aquire(() ->
|
||||
{
|
||||
int maxHeight = 0;
|
||||
@ -445,7 +445,7 @@ public class IrisBiome extends IrisRegistrant implements IRare {
|
||||
return this;
|
||||
}
|
||||
|
||||
public KList<BlockData> generateSeaLayers(double wx, double wz, RNG random, int maxDepth, IrisDataManager rdata) {
|
||||
public KList<BlockData> generateSeaLayers(double wx, double wz, RNG random, int maxDepth, IrisData rdata) {
|
||||
KList<BlockData> data = new KList<>();
|
||||
|
||||
for (int i = 0; i < seaLayers.size(); i++) {
|
||||
@ -477,7 +477,7 @@ public class IrisBiome extends IrisRegistrant implements IRare {
|
||||
return data;
|
||||
}
|
||||
|
||||
public KList<CNG> getLayerHeightGenerators(RNG rng, IrisDataManager rdata) {
|
||||
public KList<CNG> getLayerHeightGenerators(RNG rng, IrisData rdata) {
|
||||
return layerHeightGenerators.aquire(() ->
|
||||
{
|
||||
KList<CNG> layerHeightGenerators = new KList<>();
|
||||
@ -492,7 +492,7 @@ public class IrisBiome extends IrisRegistrant implements IRare {
|
||||
});
|
||||
}
|
||||
|
||||
public KList<CNG> getLayerSeaHeightGenerators(RNG rng, IrisDataManager data) {
|
||||
public KList<CNG> getLayerSeaHeightGenerators(RNG rng, IrisData data) {
|
||||
return layerSeaHeightGenerators.aquire(() ->
|
||||
{
|
||||
KList<CNG> layerSeaHeightGenerators = new KList<>();
|
||||
@ -609,7 +609,7 @@ public class IrisBiome extends IrisRegistrant implements IRare {
|
||||
return getBiomeGenerator(rng).fit(biomeScatter, x, y, z);
|
||||
}
|
||||
|
||||
public BlockData getSurfaceBlock(int x, int z, RNG rng, IrisDataManager idm) {
|
||||
public BlockData getSurfaceBlock(int x, int z, RNG rng, IrisData idm) {
|
||||
if (getLayers().isEmpty()) {
|
||||
return B.get("AIR");
|
||||
}
|
||||
|
@ -34,7 +34,7 @@ import lombok.experimental.Accessors;
|
||||
@Data
|
||||
public class IrisBiomeGeneratorLink {
|
||||
|
||||
@RegistryListGenerator
|
||||
@RegistryListResource(IrisGenerator.class)
|
||||
@Desc("The generator id")
|
||||
private String generator = "default";
|
||||
|
||||
|
@ -34,13 +34,13 @@ import lombok.experimental.Accessors;
|
||||
@Desc("A biome mutation if a condition is met")
|
||||
@Data
|
||||
public class IrisBiomeMutation {
|
||||
@RegistryListBiome
|
||||
@RegistryListResource(IrisBiome.class)
|
||||
@Required
|
||||
@ArrayType(min = 1, type = String.class)
|
||||
@Desc("One of The following biomes or regions must show up")
|
||||
private KList<String> sideA = new KList<>();
|
||||
|
||||
@RegistryListBiome
|
||||
@RegistryListResource(IrisBiome.class)
|
||||
@Required
|
||||
@ArrayType(min = 1, type = String.class)
|
||||
@Desc("One of The following biomes or regions must show up")
|
||||
@ -58,7 +58,7 @@ public class IrisBiomeMutation {
|
||||
@Desc("How many tries per chunk to check for this mutation")
|
||||
private int checks = 2;
|
||||
|
||||
@RegistryListObject
|
||||
@RegistryListResource(IrisObject.class)
|
||||
@ArrayType(min = 1, type = IrisObjectPlacement.class)
|
||||
@Desc("Objects define what schematics (iob files) iris will place in this biome mutation")
|
||||
private KList<IrisObjectPlacement> objects = new KList<>();
|
||||
|
@ -18,7 +18,7 @@
|
||||
|
||||
package com.volmit.iris.engine.object;
|
||||
|
||||
import com.volmit.iris.core.IrisDataManager;
|
||||
import com.volmit.iris.core.project.loader.IrisData;
|
||||
import com.volmit.iris.engine.cache.AtomicCache;
|
||||
import com.volmit.iris.engine.noise.CNG;
|
||||
import com.volmit.iris.engine.object.annotations.*;
|
||||
@ -70,11 +70,11 @@ public class IrisBiomePaletteLayer {
|
||||
private final transient AtomicCache<CNG> layerGenerator = new AtomicCache<>();
|
||||
private final transient AtomicCache<CNG> heightGenerator = new AtomicCache<>();
|
||||
|
||||
public CNG getHeightGenerator(RNG rng, IrisDataManager data) {
|
||||
public CNG getHeightGenerator(RNG rng, IrisData data) {
|
||||
return heightGenerator.aquire(() -> CNG.signature(rng.nextParallelRNG(minHeight * maxHeight + getBlockData(data).size())));
|
||||
}
|
||||
|
||||
public BlockData get(RNG rng, double x, double y, double z, IrisDataManager data) {
|
||||
public BlockData get(RNG rng, double x, double y, double z, IrisData data) {
|
||||
if (getBlockData(data).isEmpty()) {
|
||||
return null;
|
||||
}
|
||||
@ -86,7 +86,7 @@ public class IrisBiomePaletteLayer {
|
||||
return getLayerGenerator(rng, data).fit(getBlockData(data), x / zoom, y / zoom, z / zoom);
|
||||
}
|
||||
|
||||
public CNG getLayerGenerator(RNG rng, IrisDataManager data) {
|
||||
public CNG getLayerGenerator(RNG rng, IrisData data) {
|
||||
return layerGenerator.aquire(() ->
|
||||
{
|
||||
RNG rngx = rng.nextParallelRNG(minHeight + maxHeight + getBlockData(data).size());
|
||||
@ -100,7 +100,7 @@ public class IrisBiomePaletteLayer {
|
||||
return palette;
|
||||
}
|
||||
|
||||
public KList<BlockData> getBlockData(IrisDataManager data) {
|
||||
public KList<BlockData> getBlockData(IrisData data) {
|
||||
return blockData.aquire(() ->
|
||||
{
|
||||
KList<BlockData> blockData = new KList<>();
|
||||
|
@ -19,7 +19,7 @@
|
||||
package com.volmit.iris.engine.object;
|
||||
|
||||
import com.volmit.iris.Iris;
|
||||
import com.volmit.iris.core.IrisDataManager;
|
||||
import com.volmit.iris.core.project.loader.IrisData;
|
||||
import com.volmit.iris.engine.cache.AtomicCache;
|
||||
import com.volmit.iris.engine.data.B;
|
||||
import com.volmit.iris.engine.object.annotations.*;
|
||||
@ -89,7 +89,7 @@ public class IrisBlockData extends IrisRegistrant {
|
||||
return computeProperties(getData());
|
||||
}
|
||||
|
||||
public BlockData getBlockData(IrisDataManager data) {
|
||||
public BlockData getBlockData(IrisData data) {
|
||||
return blockdata.aquire(() ->
|
||||
{
|
||||
BlockData b = null;
|
||||
|
@ -18,7 +18,7 @@
|
||||
|
||||
package com.volmit.iris.engine.object;
|
||||
|
||||
import com.volmit.iris.core.IrisDataManager;
|
||||
import com.volmit.iris.core.project.loader.IrisData;
|
||||
import com.volmit.iris.engine.cache.AtomicCache;
|
||||
import com.volmit.iris.engine.object.annotations.ArrayType;
|
||||
import com.volmit.iris.engine.object.annotations.Desc;
|
||||
@ -58,7 +58,7 @@ public class IrisBlockDrops {
|
||||
|
||||
private final transient AtomicCache<KList<BlockData>> data = new AtomicCache<>();
|
||||
|
||||
public boolean shouldDropFor(BlockData data, IrisDataManager rdata) {
|
||||
public boolean shouldDropFor(BlockData data, IrisData rdata) {
|
||||
KList<BlockData> list = this.data.aquire(() ->
|
||||
{
|
||||
KList<BlockData> b = new KList<>();
|
||||
|
@ -18,7 +18,7 @@
|
||||
|
||||
package com.volmit.iris.engine.object;
|
||||
|
||||
import com.volmit.iris.core.IrisDataManager;
|
||||
import com.volmit.iris.core.project.loader.IrisData;
|
||||
import com.volmit.iris.engine.cache.AtomicCache;
|
||||
import com.volmit.iris.engine.data.B;
|
||||
import com.volmit.iris.engine.object.annotations.Desc;
|
||||
@ -52,11 +52,11 @@ public class IrisCaveFluid {
|
||||
|
||||
private final transient AtomicCache<BlockData> fluidData = new AtomicCache<>();
|
||||
|
||||
public boolean hasFluid(IrisDataManager rdata) {
|
||||
public boolean hasFluid(IrisData rdata) {
|
||||
return !B.isAir(getFluid(rdata));
|
||||
}
|
||||
|
||||
public BlockData getFluid(IrisDataManager rdata) {
|
||||
public BlockData getFluid(IrisData rdata) {
|
||||
return fluidData.aquire(() ->
|
||||
{
|
||||
BlockData b = getFluidType().getBlockData(rdata);
|
||||
|
@ -19,7 +19,7 @@
|
||||
package com.volmit.iris.engine.object;
|
||||
|
||||
import com.volmit.iris.Iris;
|
||||
import com.volmit.iris.core.IrisDataManager;
|
||||
import com.volmit.iris.core.project.loader.IrisData;
|
||||
import com.volmit.iris.engine.cache.AtomicCache;
|
||||
import com.volmit.iris.engine.noise.CNG;
|
||||
import com.volmit.iris.engine.object.annotations.*;
|
||||
@ -98,7 +98,7 @@ public class IrisDecorator {
|
||||
private final transient AtomicCache<KList<BlockData>> blockData = new AtomicCache<>();
|
||||
private final transient AtomicCache<KList<BlockData>> blockDataTops = new AtomicCache<>();
|
||||
|
||||
public int getHeight(RNG rng, double x, double z, IrisDataManager data) {
|
||||
public int getHeight(RNG rng, double x, double z, IrisData data) {
|
||||
if (stackMin == stackMax) {
|
||||
return stackMin;
|
||||
}
|
||||
@ -106,16 +106,16 @@ public class IrisDecorator {
|
||||
return getHeightGenerator(rng, data).fit(stackMin, stackMax, x / heightVariance.getZoom(), z / heightVariance.getZoom()) + 1;
|
||||
}
|
||||
|
||||
public CNG getHeightGenerator(RNG rng, IrisDataManager data) {
|
||||
public CNG getHeightGenerator(RNG rng, IrisData data) {
|
||||
return heightGenerator.aquire(() ->
|
||||
heightVariance.create(rng.nextParallelRNG(getBlockData(data).size() + stackMax + stackMin)));
|
||||
}
|
||||
|
||||
public CNG getGenerator(RNG rng, IrisDataManager data) {
|
||||
public CNG getGenerator(RNG rng, IrisData data) {
|
||||
return layerGenerator.aquire(() -> style.create(rng.nextParallelRNG(getBlockData(data).size())));
|
||||
}
|
||||
|
||||
public CNG getVarianceGenerator(RNG rng, IrisDataManager data) {
|
||||
public CNG getVarianceGenerator(RNG rng, IrisData data) {
|
||||
return varianceGenerator.aquire(() ->
|
||||
variance.create(
|
||||
rng.nextParallelRNG(getBlockData(data).size()))
|
||||
@ -128,7 +128,7 @@ public class IrisDecorator {
|
||||
return palette;
|
||||
}
|
||||
|
||||
public BlockData getBlockData(IrisBiome b, RNG rng, double x, double z, IrisDataManager data) {
|
||||
public BlockData getBlockData(IrisBiome b, RNG rng, double x, double z, IrisData data) {
|
||||
if (getBlockData(data).isEmpty()) {
|
||||
Iris.warn("Empty Block Data for " + b.getName());
|
||||
return null;
|
||||
@ -148,7 +148,7 @@ public class IrisDecorator {
|
||||
return null;
|
||||
}
|
||||
|
||||
public BlockData getBlockData100(IrisBiome b, RNG rng, double x, double y, double z, IrisDataManager data) {
|
||||
public BlockData getBlockData100(IrisBiome b, RNG rng, double x, double y, double z, IrisData data) {
|
||||
if (getBlockData(data).isEmpty()) {
|
||||
Iris.warn("Empty Block Data for " + b.getName());
|
||||
return null;
|
||||
@ -171,7 +171,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, IrisDataManager data) {
|
||||
public BlockData getBlockDataForTop(IrisBiome b, RNG rng, double x, double y, double z, IrisData data) {
|
||||
if (getBlockDataTops(data).isEmpty()) {
|
||||
return getBlockData100(b, rng, x, y, z, data);
|
||||
}
|
||||
@ -190,7 +190,7 @@ public class IrisDecorator {
|
||||
return null;
|
||||
}
|
||||
|
||||
public KList<BlockData> getBlockData(IrisDataManager data) {
|
||||
public KList<BlockData> getBlockData(IrisData data) {
|
||||
return blockData.aquire(() ->
|
||||
{
|
||||
KList<BlockData> blockData = new KList<>();
|
||||
@ -207,7 +207,7 @@ public class IrisDecorator {
|
||||
});
|
||||
}
|
||||
|
||||
public KList<BlockData> getBlockDataTops(IrisDataManager data) {
|
||||
public KList<BlockData> getBlockDataTops(IrisData data) {
|
||||
return blockDataTops.aquire(() ->
|
||||
{
|
||||
KList<BlockData> blockDataTops = new KList<>();
|
||||
|
@ -18,7 +18,7 @@
|
||||
|
||||
package com.volmit.iris.engine.object;
|
||||
|
||||
import com.volmit.iris.core.IrisDataManager;
|
||||
import com.volmit.iris.core.project.loader.IrisData;
|
||||
import com.volmit.iris.engine.cache.AtomicCache;
|
||||
import com.volmit.iris.engine.object.annotations.*;
|
||||
import com.volmit.iris.util.collection.KList;
|
||||
@ -85,7 +85,7 @@ public class IrisDepositGenerator {
|
||||
private final transient AtomicCache<KList<IrisObject>> objects = new AtomicCache<>();
|
||||
private final transient AtomicCache<KList<BlockData>> blockData = new AtomicCache<>();
|
||||
|
||||
public IrisObject getClump(RNG rng, IrisDataManager rdata) {
|
||||
public IrisObject getClump(RNG rng, IrisData rdata) {
|
||||
KList<IrisObject> objects = this.objects.aquire(() ->
|
||||
{
|
||||
RNG rngv = rng.nextParallelRNG(3957778);
|
||||
@ -104,7 +104,7 @@ public class IrisDepositGenerator {
|
||||
return Math.min(11, (int) Math.round(Math.pow(maxSize, 1D / 3D)));
|
||||
}
|
||||
|
||||
private IrisObject generateClumpObject(RNG rngv, IrisDataManager rdata) {
|
||||
private IrisObject generateClumpObject(RNG rngv, IrisData rdata) {
|
||||
int s = rngv.i(minSize, maxSize);
|
||||
int dim = Math.min(11, (int) Math.round(Math.pow(maxSize, 1D / 3D)));
|
||||
int w = dim / 2;
|
||||
@ -124,11 +124,11 @@ public class IrisDepositGenerator {
|
||||
return o;
|
||||
}
|
||||
|
||||
private BlockData nextBlock(RNG rngv, IrisDataManager rdata) {
|
||||
private BlockData nextBlock(RNG rngv, IrisData rdata) {
|
||||
return getBlockData(rdata).get(rngv.i(0, getBlockData(rdata).size() - 1));
|
||||
}
|
||||
|
||||
public KList<BlockData> getBlockData(IrisDataManager rdata) {
|
||||
public KList<BlockData> getBlockData(IrisData rdata) {
|
||||
return blockData.aquire(() ->
|
||||
{
|
||||
KList<BlockData> blockData = new KList<>();
|
||||
|
@ -19,7 +19,7 @@
|
||||
package com.volmit.iris.engine.object;
|
||||
|
||||
import com.volmit.iris.Iris;
|
||||
import com.volmit.iris.core.IrisDataManager;
|
||||
import com.volmit.iris.core.project.loader.IrisData;
|
||||
import com.volmit.iris.engine.cache.AtomicCache;
|
||||
import com.volmit.iris.engine.data.DataProvider;
|
||||
import com.volmit.iris.engine.noise.CNG;
|
||||
@ -63,7 +63,7 @@ public class IrisDimension extends IrisRegistrant {
|
||||
@Desc("Create an inverted dimension in the sky (like the nether)")
|
||||
private IrisDimension sky = null;
|
||||
|
||||
@RegistryListJigsaw
|
||||
@RegistryListResource(IrisJigsawStructure.class)
|
||||
@Desc("If defined, Iris will place the given jigsaw structure where minecraft should place the overworld stronghold.")
|
||||
private String stronghold;
|
||||
|
||||
@ -84,7 +84,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)
|
||||
@RegistryListSpawner
|
||||
@RegistryListResource(IrisSpawner.class)
|
||||
private KList<String> entitySpawners = new KList<>();
|
||||
|
||||
@Desc("Add specific features in exact positions")
|
||||
@ -188,7 +188,7 @@ public class IrisDimension extends IrisRegistrant {
|
||||
@Desc("The world environment")
|
||||
private Environment environment = Environment.NORMAL;
|
||||
|
||||
@RegistryListRegion
|
||||
@RegistryListResource(IrisRegion.class)
|
||||
@Required
|
||||
@ArrayType(min = 1, type = String.class)
|
||||
@Desc("Define all of the regions to include in this dimension. Dimensions -> Regions -> Biomes -> Objects etc")
|
||||
@ -204,11 +204,11 @@ public class IrisDimension extends IrisRegistrant {
|
||||
@Desc("The fluid height for this dimension")
|
||||
private int fluidHeight = 63;
|
||||
|
||||
@RegistryListBiome
|
||||
@RegistryListResource(IrisBiome.class)
|
||||
@Desc("Keep this either undefined or empty. Setting any biome name into this will force iris to only generate the specified biome. Great for testing.")
|
||||
private String focus = "";
|
||||
|
||||
@RegistryListBiome
|
||||
@RegistryListResource(IrisBiome.class)
|
||||
@Desc("Keep this either undefined or empty. Setting any region name into this will force iris to only generate the specified region. Great for testing.")
|
||||
private String focusRegion = "";
|
||||
|
||||
@ -372,7 +372,7 @@ public class IrisDimension extends IrisRegistrant {
|
||||
KList<IrisRegion> r = new KList<>();
|
||||
|
||||
for (String i : getRegions()) {
|
||||
r.add(IrisDataManager.loadAnyRegion(i));
|
||||
r.add(IrisData.loadAnyRegion(i));
|
||||
}
|
||||
|
||||
return r;
|
||||
|
@ -20,7 +20,7 @@ package com.volmit.iris.engine.object;
|
||||
|
||||
import com.volmit.iris.engine.object.annotations.Desc;
|
||||
import com.volmit.iris.engine.object.annotations.MinNumber;
|
||||
import com.volmit.iris.engine.object.annotations.RegistryListDimension;
|
||||
import com.volmit.iris.engine.object.annotations.RegistryListResource;
|
||||
import com.volmit.iris.engine.object.annotations.Required;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
@ -47,7 +47,7 @@ public class IrisDimensionIndex {
|
||||
private boolean primary = false;
|
||||
|
||||
@Required
|
||||
@RegistryListDimension
|
||||
@RegistryListResource(IrisDimension.class)
|
||||
@MinNumber(1)
|
||||
@Desc("Name of dimension")
|
||||
private String dimension = "";
|
||||
|
@ -23,7 +23,7 @@ import com.volmit.iris.engine.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;
|
||||
import com.volmit.iris.engine.object.annotations.RegistryListEntity;
|
||||
import com.volmit.iris.engine.object.annotations.RegistryListResource;
|
||||
import com.volmit.iris.engine.object.annotations.Required;
|
||||
import com.volmit.iris.engine.object.common.IRare;
|
||||
import com.volmit.iris.util.format.C;
|
||||
@ -42,7 +42,7 @@ import org.bukkit.entity.Entity;
|
||||
@Desc("Represents an entity spawn during initial chunk generation")
|
||||
@Data
|
||||
public class IrisEntitySpawn implements IRare {
|
||||
@RegistryListEntity
|
||||
@RegistryListResource(IrisEntity.class)
|
||||
@Required
|
||||
@Desc("The entity")
|
||||
private String entity = "";
|
||||
|
@ -22,7 +22,7 @@ import com.volmit.iris.engine.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;
|
||||
import com.volmit.iris.engine.object.annotations.RegistryListEntity;
|
||||
import com.volmit.iris.engine.object.annotations.RegistryListResource;
|
||||
import com.volmit.iris.engine.object.annotations.Required;
|
||||
import com.volmit.iris.util.math.RNG;
|
||||
import lombok.AllArgsConstructor;
|
||||
@ -40,7 +40,7 @@ import org.bukkit.event.entity.EntitySpawnEvent;
|
||||
@Desc("Represents an entity spawn")
|
||||
@Data
|
||||
public class IrisEntitySpawnOverride {
|
||||
@RegistryListEntity
|
||||
@RegistryListResource(IrisEntity.class)
|
||||
@Required
|
||||
@Desc("The entity")
|
||||
private String entity = "";
|
||||
|
@ -46,7 +46,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;
|
||||
|
||||
@RegistryListBiome
|
||||
@RegistryListResource(IrisBiome.class)
|
||||
@Desc("Apply a custom biome here")
|
||||
private String customBiome = null;
|
||||
|
||||
|
@ -22,7 +22,7 @@ import com.volmit.iris.Iris;
|
||||
import com.volmit.iris.engine.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.RegistryListObject;
|
||||
import com.volmit.iris.engine.object.annotations.RegistryListResource;
|
||||
import com.volmit.iris.engine.object.annotations.Required;
|
||||
import com.volmit.iris.util.collection.KList;
|
||||
import lombok.AllArgsConstructor;
|
||||
@ -43,7 +43,7 @@ import java.io.IOException;
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
public class IrisJigsawPiece extends IrisRegistrant {
|
||||
@RegistryListObject
|
||||
@RegistryListResource(IrisObject.class)
|
||||
@Required
|
||||
@Desc("The object this piece represents")
|
||||
private String object = "";
|
||||
|
@ -49,13 +49,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;
|
||||
|
||||
@RegistryListJigsawPool
|
||||
@RegistryListResource(IrisJigsawPool.class)
|
||||
@Desc("Pick piece pools to place onto this connector")
|
||||
@ArrayType(type = String.class, min = 1)
|
||||
@Required
|
||||
private KList<String> pools = new KList<>();
|
||||
|
||||
@RegistryListEntity
|
||||
@RegistryListResource(IrisEntity.class)
|
||||
@Desc("Pick an entity to spawn on this connector")
|
||||
private String spawnEntity;
|
||||
|
||||
|
@ -20,7 +20,7 @@ package com.volmit.iris.engine.object;
|
||||
|
||||
import com.volmit.iris.engine.object.annotations.Desc;
|
||||
import com.volmit.iris.engine.object.annotations.MinNumber;
|
||||
import com.volmit.iris.engine.object.annotations.RegistryListJigsaw;
|
||||
import com.volmit.iris.engine.object.annotations.RegistryListResource;
|
||||
import com.volmit.iris.engine.object.annotations.Required;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
@ -33,7 +33,7 @@ import lombok.experimental.Accessors;
|
||||
@Desc("Represents a jigsaw placement")
|
||||
@Data
|
||||
public class IrisJigsawPlacement {
|
||||
@RegistryListJigsaw
|
||||
@RegistryListResource(IrisJigsawStructure.class)
|
||||
@Required
|
||||
@Desc("The jigsaw structure to use")
|
||||
private String structure = "";
|
||||
|
@ -20,7 +20,7 @@ package com.volmit.iris.engine.object;
|
||||
|
||||
import com.volmit.iris.engine.object.annotations.ArrayType;
|
||||
import com.volmit.iris.engine.object.annotations.Desc;
|
||||
import com.volmit.iris.engine.object.annotations.RegistryListJigsawPiece;
|
||||
import com.volmit.iris.engine.object.annotations.RegistryListResource;
|
||||
import com.volmit.iris.engine.object.annotations.Required;
|
||||
import com.volmit.iris.util.collection.KList;
|
||||
import lombok.AllArgsConstructor;
|
||||
@ -38,7 +38,7 @@ import lombok.experimental.Accessors;
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
public class IrisJigsawPool extends IrisRegistrant {
|
||||
@RegistryListJigsawPiece
|
||||
@RegistryListResource(IrisJigsawPiece.class)
|
||||
@Required
|
||||
@ArrayType(min = 1, type = String.class)
|
||||
@Desc("A list of structure piece pools")
|
||||
|
@ -37,7 +37,7 @@ import lombok.experimental.Accessors;
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
public class IrisJigsawStructure extends IrisRegistrant {
|
||||
@RegistryListJigsawPiece
|
||||
@RegistryListResource(IrisJigsawPiece.class)
|
||||
@Required
|
||||
@ArrayType(min = 1, type = String.class)
|
||||
@Desc("The starting pieces. Randomly chooses a starting piece, then connects pieces using the pools define in the starting piece.")
|
||||
|
@ -19,7 +19,7 @@
|
||||
package com.volmit.iris.engine.object;
|
||||
|
||||
import com.volmit.iris.engine.object.annotations.Desc;
|
||||
import com.volmit.iris.engine.object.annotations.RegistryListJigsaw;
|
||||
import com.volmit.iris.engine.object.annotations.RegistryListResource;
|
||||
import com.volmit.iris.engine.object.annotations.Required;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
@ -36,7 +36,7 @@ import lombok.experimental.Accessors;
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
public class IrisJigsawStructurePlacement {
|
||||
@RegistryListJigsaw
|
||||
@RegistryListResource(IrisJigsawStructure.class)
|
||||
@Required
|
||||
@Desc("The structure to place")
|
||||
private String structure;
|
||||
|
@ -23,7 +23,7 @@ import com.volmit.iris.engine.data.DataProvider;
|
||||
import com.volmit.iris.engine.object.annotations.ArrayType;
|
||||
import com.volmit.iris.engine.object.annotations.Desc;
|
||||
import com.volmit.iris.engine.object.annotations.MinNumber;
|
||||
import com.volmit.iris.engine.object.annotations.RegistryListLoot;
|
||||
import com.volmit.iris.engine.object.annotations.RegistryListResource;
|
||||
import com.volmit.iris.util.collection.KList;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
@ -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;
|
||||
|
||||
@RegistryListLoot
|
||||
@RegistryListResource(IrisLootTable.class)
|
||||
@ArrayType(min = 1, type = String.class)
|
||||
@Desc("Add loot table registries here")
|
||||
private KList<String> tables = new KList<>();
|
||||
|
@ -18,7 +18,7 @@
|
||||
|
||||
package com.volmit.iris.engine.object;
|
||||
|
||||
import com.volmit.iris.core.IrisDataManager;
|
||||
import com.volmit.iris.core.project.loader.IrisData;
|
||||
import com.volmit.iris.engine.cache.AtomicCache;
|
||||
import com.volmit.iris.engine.noise.CNG;
|
||||
import com.volmit.iris.engine.object.annotations.ArrayType;
|
||||
@ -55,7 +55,7 @@ public class IrisMaterialPalette {
|
||||
private final transient AtomicCache<CNG> layerGenerator = new AtomicCache<>();
|
||||
private final transient AtomicCache<CNG> heightGenerator = new AtomicCache<>();
|
||||
|
||||
public BlockData get(RNG rng, double x, double y, double z, IrisDataManager rdata) {
|
||||
public BlockData get(RNG rng, double x, double y, double z, IrisData rdata) {
|
||||
if (getBlockData(rdata).isEmpty()) {
|
||||
return null;
|
||||
}
|
||||
@ -67,7 +67,7 @@ public class IrisMaterialPalette {
|
||||
return getLayerGenerator(rng, rdata).fit(getBlockData(rdata), x / zoom, y / zoom, z / zoom);
|
||||
}
|
||||
|
||||
public CNG getLayerGenerator(RNG rng, IrisDataManager rdata) {
|
||||
public CNG getLayerGenerator(RNG rng, IrisData rdata) {
|
||||
return layerGenerator.aquire(() ->
|
||||
{
|
||||
RNG rngx = rng.nextParallelRNG(-23498896 + getBlockData(rdata).size());
|
||||
@ -92,7 +92,7 @@ public class IrisMaterialPalette {
|
||||
return this;
|
||||
}
|
||||
|
||||
public KList<BlockData> getBlockData(IrisDataManager rdata) {
|
||||
public KList<BlockData> getBlockData(IrisData rdata) {
|
||||
return blockData.aquire(() ->
|
||||
{
|
||||
KList<BlockData> blockData = new KList<>();
|
||||
|
@ -48,22 +48,22 @@ public class IrisMod extends IrisRegistrant {
|
||||
private int overrideFluidHeight = -1;
|
||||
|
||||
@Desc("A list of biomes to remove")
|
||||
@RegistryListBiome
|
||||
@RegistryListResource(IrisBiome.class)
|
||||
@ArrayType(type = String.class, min = 1)
|
||||
private KList<String> removeBiomes = new KList<>();
|
||||
|
||||
@Desc("A list of objects to remove")
|
||||
@RegistryListObject
|
||||
@RegistryListResource(IrisObject.class)
|
||||
@ArrayType(type = String.class, min = 1)
|
||||
private KList<String> removeObjects = new KList<>();
|
||||
|
||||
@Desc("A list of regions to remove")
|
||||
@RegistryListRegion
|
||||
@RegistryListResource(IrisRegion.class)
|
||||
@ArrayType(type = String.class, min = 1)
|
||||
private KList<String> removeRegions = new KList<>();
|
||||
|
||||
@Desc("A list of regions to inject")
|
||||
@RegistryListRegion
|
||||
@RegistryListResource(IrisRegion.class)
|
||||
@ArrayType(type = String.class, min = 1)
|
||||
private KList<String> injectRegions = new KList<>();
|
||||
|
||||
|
@ -18,7 +18,10 @@
|
||||
|
||||
package com.volmit.iris.engine.object;
|
||||
|
||||
import com.volmit.iris.engine.object.annotations.*;
|
||||
import com.volmit.iris.engine.object.annotations.ArrayType;
|
||||
import com.volmit.iris.engine.object.annotations.Desc;
|
||||
import com.volmit.iris.engine.object.annotations.RegistryListResource;
|
||||
import com.volmit.iris.engine.object.annotations.Required;
|
||||
import com.volmit.iris.util.collection.KList;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
@ -33,12 +36,12 @@ import lombok.experimental.Accessors;
|
||||
public class IrisModBiomeInjector {
|
||||
@Required
|
||||
@Desc("The region to find")
|
||||
@RegistryListRegion
|
||||
@RegistryListResource(IrisRegion.class)
|
||||
private String region = "";
|
||||
|
||||
@Required
|
||||
@Desc("A biome to inject into the region")
|
||||
@RegistryListBiome
|
||||
@RegistryListResource(IrisBiome.class)
|
||||
@ArrayType(type = String.class, min = 1)
|
||||
private KList<String> inject = new KList<>();
|
||||
}
|
||||
|
@ -20,7 +20,7 @@ package com.volmit.iris.engine.object;
|
||||
|
||||
import com.volmit.iris.engine.object.annotations.ArrayType;
|
||||
import com.volmit.iris.engine.object.annotations.Desc;
|
||||
import com.volmit.iris.engine.object.annotations.RegistryListBiome;
|
||||
import com.volmit.iris.engine.object.annotations.RegistryListResource;
|
||||
import com.volmit.iris.engine.object.annotations.Required;
|
||||
import com.volmit.iris.util.collection.KList;
|
||||
import lombok.AllArgsConstructor;
|
||||
@ -36,12 +36,12 @@ import lombok.experimental.Accessors;
|
||||
public class IrisModBiomeReplacer {
|
||||
@Required
|
||||
@Desc("A list of biomes to find")
|
||||
@RegistryListBiome
|
||||
@RegistryListResource(IrisBiome.class)
|
||||
@ArrayType(type = String.class, min = 1)
|
||||
private KList<String> find = new KList<>();
|
||||
|
||||
@Required
|
||||
@Desc("A biome to replace it with")
|
||||
@RegistryListBiome
|
||||
@RegistryListResource(IrisBiome.class)
|
||||
private String replace = "";
|
||||
}
|
||||
|
@ -20,7 +20,7 @@ package com.volmit.iris.engine.object;
|
||||
|
||||
import com.volmit.iris.engine.object.annotations.ArrayType;
|
||||
import com.volmit.iris.engine.object.annotations.Desc;
|
||||
import com.volmit.iris.engine.object.annotations.RegistryListBiome;
|
||||
import com.volmit.iris.engine.object.annotations.RegistryListResource;
|
||||
import com.volmit.iris.engine.object.annotations.Required;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
@ -44,6 +44,6 @@ public class IrisModNoiseStyleReplacer {
|
||||
|
||||
@Required
|
||||
@Desc("A noise style to replace it with")
|
||||
@RegistryListBiome
|
||||
@RegistryListResource(IrisBiome.class)
|
||||
private IrisGeneratorStyle replace = new IrisGeneratorStyle();
|
||||
}
|
||||
|
@ -20,7 +20,7 @@ package com.volmit.iris.engine.object;
|
||||
|
||||
import com.volmit.iris.engine.object.annotations.ArrayType;
|
||||
import com.volmit.iris.engine.object.annotations.Desc;
|
||||
import com.volmit.iris.engine.object.annotations.RegistryListBiome;
|
||||
import com.volmit.iris.engine.object.annotations.RegistryListResource;
|
||||
import com.volmit.iris.engine.object.annotations.Required;
|
||||
import com.volmit.iris.util.collection.KList;
|
||||
import lombok.AllArgsConstructor;
|
||||
@ -36,7 +36,7 @@ import lombok.experimental.Accessors;
|
||||
public class IrisModObjectPlacementBiomeInjector {
|
||||
@Required
|
||||
@Desc("The biome to find")
|
||||
@RegistryListBiome
|
||||
@RegistryListResource(IrisBiome.class)
|
||||
private String biome = "";
|
||||
|
||||
@Required
|
||||
|
@ -20,7 +20,7 @@ package com.volmit.iris.engine.object;
|
||||
|
||||
import com.volmit.iris.engine.object.annotations.ArrayType;
|
||||
import com.volmit.iris.engine.object.annotations.Desc;
|
||||
import com.volmit.iris.engine.object.annotations.RegistryListRegion;
|
||||
import com.volmit.iris.engine.object.annotations.RegistryListResource;
|
||||
import com.volmit.iris.engine.object.annotations.Required;
|
||||
import com.volmit.iris.util.collection.KList;
|
||||
import lombok.AllArgsConstructor;
|
||||
@ -36,7 +36,7 @@ import lombok.experimental.Accessors;
|
||||
public class IrisModObjectPlacementRegionInjector {
|
||||
@Required
|
||||
@Desc("The biome to find")
|
||||
@RegistryListRegion
|
||||
@RegistryListResource(IrisRegion.class)
|
||||
private String biome = "";
|
||||
|
||||
@Required
|
||||
|
@ -18,7 +18,10 @@
|
||||
|
||||
package com.volmit.iris.engine.object;
|
||||
|
||||
import com.volmit.iris.engine.object.annotations.*;
|
||||
import com.volmit.iris.engine.object.annotations.ArrayType;
|
||||
import com.volmit.iris.engine.object.annotations.Desc;
|
||||
import com.volmit.iris.engine.object.annotations.RegistryListResource;
|
||||
import com.volmit.iris.engine.object.annotations.Required;
|
||||
import com.volmit.iris.util.collection.KList;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
@ -33,12 +36,12 @@ import lombok.experimental.Accessors;
|
||||
public class IrisModObjectReplacer {
|
||||
@Required
|
||||
@Desc("A list of objects to find")
|
||||
@RegistryListObject
|
||||
@RegistryListResource(IrisObject.class)
|
||||
@ArrayType(type = String.class, min = 1)
|
||||
private KList<String> find = new KList<>();
|
||||
|
||||
@Required
|
||||
@Desc("An object to replace it with")
|
||||
@RegistryListBiome
|
||||
@RegistryListResource(IrisBiome.class)
|
||||
private String replace = "";
|
||||
}
|
||||
|
@ -20,7 +20,7 @@ package com.volmit.iris.engine.object;
|
||||
|
||||
import com.volmit.iris.engine.object.annotations.ArrayType;
|
||||
import com.volmit.iris.engine.object.annotations.Desc;
|
||||
import com.volmit.iris.engine.object.annotations.RegistryListRegion;
|
||||
import com.volmit.iris.engine.object.annotations.RegistryListResource;
|
||||
import com.volmit.iris.engine.object.annotations.Required;
|
||||
import com.volmit.iris.util.collection.KList;
|
||||
import lombok.AllArgsConstructor;
|
||||
@ -36,12 +36,12 @@ import lombok.experimental.Accessors;
|
||||
public class IrisModRegionReplacer {
|
||||
@Required
|
||||
@Desc("A list of regions to find")
|
||||
@RegistryListRegion
|
||||
@RegistryListResource(IrisRegion.class)
|
||||
@ArrayType(type = String.class, min = 1)
|
||||
private KList<String> find = new KList<>();
|
||||
|
||||
@Required
|
||||
@Desc("A region to replace it with")
|
||||
@RegistryListRegion
|
||||
@RegistryListResource(IrisRegion.class)
|
||||
private String replace = "";
|
||||
}
|
||||
|
@ -19,7 +19,7 @@
|
||||
package com.volmit.iris.engine.object;
|
||||
|
||||
import com.volmit.iris.Iris;
|
||||
import com.volmit.iris.core.IrisDataManager;
|
||||
import com.volmit.iris.core.project.loader.IrisData;
|
||||
import com.volmit.iris.engine.cache.AtomicCache;
|
||||
import com.volmit.iris.engine.data.B;
|
||||
import com.volmit.iris.engine.framework.placer.HeightmapObjectPlacer;
|
||||
@ -404,23 +404,23 @@ public class IrisObject extends IrisRegistrant {
|
||||
}
|
||||
}
|
||||
|
||||
public int place(int x, int z, IObjectPlacer placer, IrisObjectPlacement config, RNG rng, IrisDataManager rdata) {
|
||||
public int place(int x, int z, IObjectPlacer placer, IrisObjectPlacement config, RNG rng, IrisData rdata) {
|
||||
return place(x, -1, z, placer, config, rng, rdata);
|
||||
}
|
||||
|
||||
public int place(int x, int z, IObjectPlacer placer, IrisObjectPlacement config, RNG rng, CarveResult c, IrisDataManager rdata) {
|
||||
public int place(int x, int z, IObjectPlacer placer, IrisObjectPlacement config, RNG rng, CarveResult c, IrisData rdata) {
|
||||
return place(x, -1, z, placer, config, rng, null, c, rdata);
|
||||
}
|
||||
|
||||
public int place(int x, int yv, int z, IObjectPlacer placer, IrisObjectPlacement config, RNG rng, IrisDataManager rdata) {
|
||||
public int place(int x, int yv, int z, IObjectPlacer placer, IrisObjectPlacement config, RNG rng, IrisData rdata) {
|
||||
return place(x, yv, z, placer, config, rng, null, null, rdata);
|
||||
}
|
||||
|
||||
public int place(Location loc, IObjectPlacer placer, IrisObjectPlacement config, RNG rng, IrisDataManager rdata) {
|
||||
public int place(Location loc, IObjectPlacer placer, IrisObjectPlacement config, RNG rng, IrisData rdata) {
|
||||
return place(loc.getBlockX(), loc.getBlockY(), loc.getBlockZ(), placer, config, rng, rdata);
|
||||
}
|
||||
|
||||
public int place(int x, int yv, int z, IObjectPlacer oplacer, IrisObjectPlacement config, RNG rng, Consumer<BlockPosition> listener, CarveResult c, IrisDataManager rdata) {
|
||||
public int place(int x, int yv, int z, IObjectPlacer oplacer, IrisObjectPlacement config, RNG rng, Consumer<BlockPosition> listener, CarveResult c, IrisData rdata) {
|
||||
IObjectPlacer placer = (config.getHeightmap() != null) ? new HeightmapObjectPlacer(rng, x, yv, z, config, oplacer) : oplacer;
|
||||
|
||||
if (config.isSmartBore()) {
|
||||
|
@ -18,11 +18,11 @@
|
||||
|
||||
package com.volmit.iris.engine.object;
|
||||
|
||||
import com.volmit.iris.core.IrisDataManager;
|
||||
import com.volmit.iris.core.project.loader.IrisData;
|
||||
import com.volmit.iris.engine.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.RegistryListLoot;
|
||||
import com.volmit.iris.engine.object.annotations.RegistryListResource;
|
||||
import com.volmit.iris.engine.object.annotations.Required;
|
||||
import com.volmit.iris.util.collection.KList;
|
||||
import lombok.AllArgsConstructor;
|
||||
@ -46,7 +46,7 @@ public class IrisObjectLoot {
|
||||
|
||||
@Desc("The loot table name")
|
||||
@Required
|
||||
@RegistryListLoot
|
||||
@RegistryListResource(IrisLootTable.class)
|
||||
private String name;
|
||||
|
||||
@Desc("The weight of this loot table being chosen")
|
||||
@ -54,7 +54,7 @@ public class IrisObjectLoot {
|
||||
|
||||
private final transient AtomicCache<KList<BlockData>> filterCache = new AtomicCache<>();
|
||||
|
||||
public KList<BlockData> getFilter(IrisDataManager rdata) {
|
||||
public KList<BlockData> getFilter(IrisData rdata) {
|
||||
return filterCache.aquire(() ->
|
||||
{
|
||||
KList<BlockData> b = new KList<>();
|
||||
@ -71,7 +71,7 @@ public class IrisObjectLoot {
|
||||
});
|
||||
}
|
||||
|
||||
public boolean matchesFilter(IrisDataManager manager, BlockData data) {
|
||||
public boolean matchesFilter(IrisData manager, BlockData data) {
|
||||
for (BlockData filterData : getFilter(manager)) {
|
||||
if (filterData.matches(data)) return true;
|
||||
}
|
||||
|
@ -19,7 +19,7 @@
|
||||
package com.volmit.iris.engine.object;
|
||||
|
||||
import com.volmit.iris.Iris;
|
||||
import com.volmit.iris.core.IrisDataManager;
|
||||
import com.volmit.iris.core.project.loader.IrisData;
|
||||
import com.volmit.iris.engine.cache.AtomicCache;
|
||||
import com.volmit.iris.engine.data.B;
|
||||
import com.volmit.iris.engine.data.DataProvider;
|
||||
@ -46,7 +46,7 @@ import org.bukkit.block.data.BlockData;
|
||||
@Desc("Represents an iris object placer. It places objects.")
|
||||
@Data
|
||||
public class IrisObjectPlacement {
|
||||
@RegistryListObject
|
||||
@RegistryListResource(IrisObject.class)
|
||||
@Required
|
||||
@ArrayType(min = 1, type = String.class)
|
||||
@Desc("List of objects to place")
|
||||
@ -231,7 +231,7 @@ public class IrisObjectPlacement {
|
||||
final transient KMap<Material, KMap<BlockData, WeightedRandom<IrisLootTable>>> exact = new KMap<>();
|
||||
}
|
||||
|
||||
private TableCache getCache(IrisDataManager manager) {
|
||||
private TableCache getCache(IrisData manager) {
|
||||
return cache.aquire(() -> {
|
||||
TableCache tc = new TableCache();
|
||||
|
||||
@ -280,7 +280,7 @@ public class IrisObjectPlacement {
|
||||
* @param dataManager Iris Data Manager
|
||||
* @return The loot table it should use.
|
||||
*/
|
||||
public IrisLootTable getTable(BlockData data, IrisDataManager dataManager) {
|
||||
public IrisLootTable getTable(BlockData data, IrisData dataManager) {
|
||||
TableCache cache = getCache(dataManager);
|
||||
|
||||
if (B.isStorageChest(data)) {
|
||||
|
@ -18,7 +18,7 @@
|
||||
|
||||
package com.volmit.iris.engine.object;
|
||||
|
||||
import com.volmit.iris.core.IrisDataManager;
|
||||
import com.volmit.iris.core.project.loader.IrisData;
|
||||
import com.volmit.iris.engine.cache.AtomicCache;
|
||||
import com.volmit.iris.engine.noise.CNG;
|
||||
import com.volmit.iris.engine.object.annotations.*;
|
||||
@ -57,7 +57,7 @@ public class IrisObjectReplace {
|
||||
private final transient AtomicCache<KList<BlockData>> findData = new AtomicCache<>();
|
||||
private final transient AtomicCache<KList<BlockData>> replaceData = new AtomicCache<>();
|
||||
|
||||
public KList<BlockData> getFind(IrisDataManager rdata) {
|
||||
public KList<BlockData> getFind(IrisData rdata) {
|
||||
return findData.aquire(() ->
|
||||
{
|
||||
KList<BlockData> b = new KList<>();
|
||||
@ -74,7 +74,7 @@ public class IrisObjectReplace {
|
||||
});
|
||||
}
|
||||
|
||||
public BlockData getReplace(RNG seed, double x, double y, double z, IrisDataManager rdata) {
|
||||
public BlockData getReplace(RNG seed, double x, double y, double z, IrisData rdata) {
|
||||
return getReplace().get(seed, x, y, z, rdata);
|
||||
}
|
||||
}
|
||||
|
@ -20,7 +20,7 @@ package com.volmit.iris.engine.object;
|
||||
|
||||
import com.volmit.iris.engine.object.annotations.Desc;
|
||||
import com.volmit.iris.engine.object.annotations.MinNumber;
|
||||
import com.volmit.iris.engine.object.annotations.RegistryListObject;
|
||||
import com.volmit.iris.engine.object.annotations.RegistryListResource;
|
||||
import com.volmit.iris.engine.object.annotations.Required;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
@ -42,7 +42,7 @@ public class IrisRareObject {
|
||||
@Desc("The rarity is 1 in X")
|
||||
private int rarity = 1;
|
||||
|
||||
@RegistryListObject
|
||||
@RegistryListResource(IrisObject.class)
|
||||
@Required
|
||||
@Desc("The object to place if rarity check passed")
|
||||
private String object = "";
|
||||
|
@ -19,8 +19,8 @@
|
||||
package com.volmit.iris.engine.object;
|
||||
|
||||
import com.volmit.iris.Iris;
|
||||
import com.volmit.iris.core.IrisDataManager;
|
||||
import com.volmit.iris.core.gui.components.RenderType;
|
||||
import com.volmit.iris.core.project.loader.IrisData;
|
||||
import com.volmit.iris.engine.cache.AtomicCache;
|
||||
import com.volmit.iris.engine.data.DataProvider;
|
||||
import com.volmit.iris.engine.noise.CNG;
|
||||
@ -69,7 +69,7 @@ public class IrisRegion extends IrisRegistrant implements IRare {
|
||||
|
||||
@Desc("Spawn Entities in this region over time. Iris will continually replenish these mobs just like vanilla does.")
|
||||
@ArrayType(min = 1, type = String.class)
|
||||
@RegistryListSpawner
|
||||
@RegistryListResource(IrisSpawner.class)
|
||||
private KList<String> entitySpawners = new KList<>();
|
||||
|
||||
@MinNumber(1)
|
||||
@ -134,35 +134,35 @@ public class IrisRegion extends IrisRegistrant implements IRare {
|
||||
@Desc("The biome implosion ratio, how much to implode biomes into children (chance)")
|
||||
private double biomeImplosionRatio = 0.4;
|
||||
|
||||
@RegistryListBiome
|
||||
@RegistryListResource(IrisBiome.class)
|
||||
@Required
|
||||
@ArrayType(min = 1, type = String.class)
|
||||
@Desc("A list of root-level biomes in this region. Don't specify child biomes of other biomes here. Just the root parents.")
|
||||
private KList<String> landBiomes = new KList<>();
|
||||
|
||||
@RegistryListBiome
|
||||
@RegistryListResource(IrisBiome.class)
|
||||
@Required
|
||||
@ArrayType(min = 1, type = String.class)
|
||||
@Desc("A list of root-level biomes in this region. Don't specify child biomes of other biomes here. Just the root parents.")
|
||||
private KList<String> seaBiomes = new KList<>();
|
||||
|
||||
@RegistryListBiome
|
||||
@RegistryListResource(IrisBiome.class)
|
||||
@Required
|
||||
@ArrayType(min = 1, type = String.class)
|
||||
@Desc("A list of root-level biomes in this region. Don't specify child biomes of other biomes here. Just the root parents.")
|
||||
private KList<String> shoreBiomes = new KList<>();
|
||||
|
||||
@RegistryListBiome
|
||||
@RegistryListResource(IrisBiome.class)
|
||||
@ArrayType(min = 1, type = String.class)
|
||||
@Desc("A list of root-level biomes in this region. Don't specify child biomes of other biomes here. Just the root parents.")
|
||||
private KList<String> riverBiomes = new KList<>();
|
||||
|
||||
@RegistryListBiome
|
||||
@RegistryListResource(IrisBiome.class)
|
||||
@ArrayType(min = 1, type = String.class)
|
||||
@Desc("A list of root-level biomes in this region. Don't specify child biomes of other biomes here. Just the root parents.")
|
||||
private KList<String> lakeBiomes = new KList<>();
|
||||
|
||||
@RegistryListBiome
|
||||
@RegistryListResource(IrisBiome.class)
|
||||
@ArrayType(min = 1, type = String.class)
|
||||
@Desc("A list of root-level biomes in this region. Don't specify child biomes of other biomes here. Just the root parents.")
|
||||
private KList<String> caveBiomes = new KList<>();
|
||||
@ -493,7 +493,7 @@ public class IrisRegion extends IrisRegistrant implements IRare {
|
||||
continue;
|
||||
}
|
||||
|
||||
IrisBiome biome = IrisDataManager.loadAnyBiome(i);
|
||||
IrisBiome biome = IrisData.loadAnyBiome(i);
|
||||
|
||||
names.remove(i);
|
||||
if (biome == null) {
|
||||
|
@ -33,7 +33,7 @@ import lombok.experimental.Accessors;
|
||||
@Desc("A ridge config")
|
||||
@Data
|
||||
public class IrisRegionRidge {
|
||||
@RegistryListBiome
|
||||
@RegistryListResource(IrisBiome.class)
|
||||
@Required
|
||||
@Desc("The biome name")
|
||||
private String biome = "";
|
||||
|
@ -22,7 +22,7 @@ import com.volmit.iris.engine.cache.AtomicCache;
|
||||
import com.volmit.iris.engine.noise.CellGenerator;
|
||||
import com.volmit.iris.engine.object.annotations.Desc;
|
||||
import com.volmit.iris.engine.object.annotations.MinNumber;
|
||||
import com.volmit.iris.engine.object.annotations.RegistryListBiome;
|
||||
import com.volmit.iris.engine.object.annotations.RegistryListResource;
|
||||
import com.volmit.iris.engine.object.annotations.Required;
|
||||
import com.volmit.iris.util.math.RNG;
|
||||
import lombok.AllArgsConstructor;
|
||||
@ -36,7 +36,7 @@ import lombok.experimental.Accessors;
|
||||
@Desc("A spot config")
|
||||
@Data
|
||||
public class IrisRegionSpot {
|
||||
@RegistryListBiome
|
||||
@RegistryListResource(IrisBiome.class)
|
||||
@Required
|
||||
@Desc("The biome to be placed")
|
||||
private String biome = "";
|
||||
|
@ -19,7 +19,7 @@
|
||||
package com.volmit.iris.engine.object;
|
||||
|
||||
import com.volmit.iris.Iris;
|
||||
import com.volmit.iris.core.IrisDataManager;
|
||||
import com.volmit.iris.core.project.loader.IrisData;
|
||||
import lombok.Data;
|
||||
|
||||
import java.awt.*;
|
||||
@ -27,7 +27,7 @@ import java.io.File;
|
||||
|
||||
@Data
|
||||
public abstract class IrisRegistrant {
|
||||
private transient IrisDataManager loader;
|
||||
private transient IrisData loader;
|
||||
|
||||
private transient String loadKey;
|
||||
|
||||
|
@ -1,31 +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.annotations;
|
||||
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
import static java.lang.annotation.ElementType.*;
|
||||
import static java.lang.annotation.RetentionPolicy.RUNTIME;
|
||||
|
||||
@Retention(RUNTIME)
|
||||
@Target({PARAMETER, TYPE, FIELD})
|
||||
public @interface RegistryListBiome {
|
||||
|
||||
}
|
@ -1,31 +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.annotations;
|
||||
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
import static java.lang.annotation.ElementType.*;
|
||||
import static java.lang.annotation.RetentionPolicy.RUNTIME;
|
||||
|
||||
@Retention(RUNTIME)
|
||||
@Target({PARAMETER, TYPE, FIELD})
|
||||
public @interface RegistryListDimension {
|
||||
|
||||
}
|
@ -1,31 +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.annotations;
|
||||
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
import static java.lang.annotation.ElementType.*;
|
||||
import static java.lang.annotation.RetentionPolicy.RUNTIME;
|
||||
|
||||
@Retention(RUNTIME)
|
||||
@Target({PARAMETER, TYPE, FIELD})
|
||||
public @interface RegistryListEntity {
|
||||
|
||||
}
|
@ -1,31 +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.annotations;
|
||||
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
import static java.lang.annotation.ElementType.*;
|
||||
import static java.lang.annotation.RetentionPolicy.RUNTIME;
|
||||
|
||||
@Retention(RUNTIME)
|
||||
@Target({PARAMETER, TYPE, FIELD})
|
||||
public @interface RegistryListJigsaw {
|
||||
|
||||
}
|
@ -1,31 +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.annotations;
|
||||
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
import static java.lang.annotation.ElementType.*;
|
||||
import static java.lang.annotation.RetentionPolicy.RUNTIME;
|
||||
|
||||
@Retention(RUNTIME)
|
||||
@Target({PARAMETER, TYPE, FIELD})
|
||||
public @interface RegistryListJigsawPiece {
|
||||
|
||||
}
|
@ -1,31 +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.annotations;
|
||||
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
import static java.lang.annotation.ElementType.*;
|
||||
import static java.lang.annotation.RetentionPolicy.RUNTIME;
|
||||
|
||||
@Retention(RUNTIME)
|
||||
@Target({PARAMETER, TYPE, FIELD})
|
||||
public @interface RegistryListJigsawPool {
|
||||
|
||||
}
|
@ -1,31 +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.annotations;
|
||||
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
import static java.lang.annotation.ElementType.*;
|
||||
import static java.lang.annotation.RetentionPolicy.RUNTIME;
|
||||
|
||||
@Retention(RUNTIME)
|
||||
@Target({PARAMETER, TYPE, FIELD})
|
||||
public @interface RegistryListLoot {
|
||||
|
||||
}
|
@ -1,31 +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.annotations;
|
||||
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
import static java.lang.annotation.ElementType.*;
|
||||
import static java.lang.annotation.RetentionPolicy.RUNTIME;
|
||||
|
||||
@Retention(RUNTIME)
|
||||
@Target({PARAMETER, TYPE, FIELD})
|
||||
public @interface RegistryListObject {
|
||||
|
||||
}
|
@ -1,31 +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.annotations;
|
||||
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
import static java.lang.annotation.ElementType.*;
|
||||
import static java.lang.annotation.RetentionPolicy.RUNTIME;
|
||||
|
||||
@Retention(RUNTIME)
|
||||
@Target({PARAMETER, TYPE, FIELD})
|
||||
public @interface RegistryListRegion {
|
||||
|
||||
}
|
@ -18,6 +18,8 @@
|
||||
|
||||
package com.volmit.iris.engine.object.annotations;
|
||||
|
||||
import com.volmit.iris.engine.object.IrisRegistrant;
|
||||
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
@ -26,6 +28,6 @@ import static java.lang.annotation.RetentionPolicy.RUNTIME;
|
||||
|
||||
@Retention(RUNTIME)
|
||||
@Target({PARAMETER, TYPE, FIELD})
|
||||
public @interface RegistryListGenerator {
|
||||
|
||||
public @interface RegistryListResource {
|
||||
Class<? extends IrisRegistrant> value();
|
||||
}
|
@ -1,31 +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.annotations;
|
||||
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
import static java.lang.annotation.ElementType.*;
|
||||
import static java.lang.annotation.RetentionPolicy.RUNTIME;
|
||||
|
||||
@Retention(RUNTIME)
|
||||
@Target({PARAMETER, TYPE, FIELD})
|
||||
public @interface RegistryListSpawner {
|
||||
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user