mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2025-07-18 18:23:06 +00:00
Cleanup
This commit is contained in:
parent
9a7dcc8c1a
commit
d7cda90acd
@ -565,7 +565,7 @@ public class Iris extends VolmitPlugin implements Listener {
|
||||
|
||||
public static void reportErrorChunk(int x, int z, Throwable e, String extra) {
|
||||
if (IrisSettings.get().getGeneral().isDebug()) {
|
||||
File f = instance.getDataFile("debug", "chunk-errors", "chunk."+ x + "." + z + ".txt");
|
||||
File f = instance.getDataFile("debug", "chunk-errors", "chunk." + x + "." + z + ".txt");
|
||||
|
||||
if (!f.exists()) {
|
||||
J.attempt(() -> {
|
||||
|
@ -21,7 +21,6 @@ package com.volmit.iris.core;
|
||||
import com.volmit.iris.Iris;
|
||||
import com.volmit.iris.core.tools.IrisWorlds;
|
||||
import com.volmit.iris.engine.framework.Engine;
|
||||
import com.volmit.iris.engine.framework.EngineParallaxManager;
|
||||
import com.volmit.iris.engine.framework.IrisAccess;
|
||||
import com.volmit.iris.engine.object.IrisFeaturePositional;
|
||||
import com.volmit.iris.util.board.BoardManager;
|
||||
@ -31,7 +30,6 @@ import com.volmit.iris.util.board.ScoreDirection;
|
||||
import com.volmit.iris.util.collection.KList;
|
||||
import com.volmit.iris.util.format.C;
|
||||
import com.volmit.iris.util.format.Form;
|
||||
import com.volmit.iris.util.math.Position2;
|
||||
import com.volmit.iris.util.math.RollingSequence;
|
||||
import com.volmit.iris.util.scheduling.ChronoLatch;
|
||||
import com.volmit.iris.util.scheduling.J;
|
||||
@ -106,8 +104,7 @@ public class IrisBoardManager implements BoardProvider, Listener {
|
||||
int y = player.getLocation().getBlockY();
|
||||
int z = player.getLocation().getBlockZ();
|
||||
|
||||
if(g.getCompound() == null)
|
||||
{
|
||||
if (g.getCompound() == null) {
|
||||
v.add("Loading...");
|
||||
return v;
|
||||
}
|
||||
|
@ -21,10 +21,8 @@ package com.volmit.iris.core;
|
||||
import com.google.gson.Gson;
|
||||
import com.volmit.iris.Iris;
|
||||
import com.volmit.iris.core.nms.INMS;
|
||||
import com.volmit.iris.core.pregenerator.PregenTask;
|
||||
import com.volmit.iris.core.report.Report;
|
||||
import com.volmit.iris.core.report.ReportType;
|
||||
import com.volmit.iris.core.tools.IrisToolbelt;
|
||||
import com.volmit.iris.core.tools.IrisWorldCreator;
|
||||
import com.volmit.iris.engine.framework.Engine;
|
||||
import com.volmit.iris.engine.framework.IrisAccess;
|
||||
@ -53,7 +51,6 @@ import org.zeroturnaround.zip.ZipUtil;
|
||||
|
||||
import java.awt.*;
|
||||
import java.io.File;
|
||||
import java.io.FileReader;
|
||||
import java.io.IOException;
|
||||
import java.util.Objects;
|
||||
import java.util.UUID;
|
||||
@ -77,12 +74,8 @@ public class IrisProject {
|
||||
MultiBurst.burst.burst(collectFiles("json").convert((i) -> () -> {
|
||||
try {
|
||||
new JSONObject(IO.readAll(i));
|
||||
}
|
||||
|
||||
catch(Throwable e)
|
||||
{
|
||||
synchronized (reports)
|
||||
{
|
||||
} catch (Throwable e) {
|
||||
synchronized (reports) {
|
||||
reports.add(Report.builder()
|
||||
.title("Invalid Json: " + i.getName())
|
||||
.message(i.getAbsolutePath() + e.getMessage())
|
||||
@ -94,18 +87,14 @@ public class IrisProject {
|
||||
}));
|
||||
|
||||
try {
|
||||
if(activeProvider != null && activeProvider.getCompound() != null)
|
||||
{
|
||||
if (activeProvider != null && activeProvider.getCompound() != null) {
|
||||
for (int i = 0; i < getActiveProvider().getCompound().getSize(); i++) {
|
||||
Engine e = getActiveProvider().getCompound().getEngine(i);
|
||||
IrisDimension dim = e.getDimension();
|
||||
reports.add(scanForErrors(dim));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
catch(Throwable e)
|
||||
{
|
||||
} catch (Throwable e) {
|
||||
reports.add(Report.builder()
|
||||
.title("Failed to check all errors")
|
||||
.message("There may be some json errors, correct those first")
|
||||
@ -228,15 +217,12 @@ public class IrisProject {
|
||||
KList<Report> reports = scanForErrors();
|
||||
sender.sendMessage("There are " + reports.size() + " problems detected with this project. See console!");
|
||||
Iris.error("===========================================================");
|
||||
for(Report i : reports)
|
||||
{
|
||||
if(i.getType().equals(ReportType.ERROR))
|
||||
{
|
||||
for (Report i : reports) {
|
||||
if (i.getType().equals(ReportType.ERROR)) {
|
||||
hasError = true;
|
||||
}
|
||||
|
||||
switch (i.getType())
|
||||
{
|
||||
switch (i.getType()) {
|
||||
case ERROR -> Iris.error(i.toString());
|
||||
case SEVERE_WARNING -> Iris.warn(i.toString());
|
||||
case WARNING -> Iris.warn(i.toString());
|
||||
@ -244,16 +230,12 @@ public class IrisProject {
|
||||
}
|
||||
}
|
||||
Iris.error("===========================================================");
|
||||
}
|
||||
|
||||
catch(Throwable e)
|
||||
{
|
||||
} catch (Throwable e) {
|
||||
hasError = true;
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
if(hasError)
|
||||
{
|
||||
if (hasError) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -499,22 +481,19 @@ public class IrisProject {
|
||||
|
||||
//TODO: EXPORT JIGSAW PIECES FROM STRUCTURES
|
||||
dimension.getFeatures().forEach((i) -> {
|
||||
if (i.getZone().getCustomBiome() != null)
|
||||
{
|
||||
if (i.getZone().getCustomBiome() != null) {
|
||||
biomes.add(dm.getBiomeLoader().load(i.getZone().getCustomBiome()));
|
||||
}
|
||||
});
|
||||
dimension.getSpecificFeatures().forEach((i) -> {
|
||||
if (i.getFeature().getCustomBiome() != null)
|
||||
{
|
||||
if (i.getFeature().getCustomBiome() != null) {
|
||||
biomes.add(dm.getBiomeLoader().load(i.getFeature().getCustomBiome()));
|
||||
}
|
||||
});
|
||||
dimension.getRegions().forEach((i) -> regions.add(dm.getRegionLoader().load(i)));
|
||||
regions.forEach((r) -> {
|
||||
r.getFeatures().forEach((i) -> {
|
||||
if (i.getZone().getCustomBiome() != null)
|
||||
{
|
||||
if (i.getZone().getCustomBiome() != null) {
|
||||
biomes.add(dm.getBiomeLoader().load(i.getZone().getCustomBiome()));
|
||||
}
|
||||
});
|
||||
@ -529,12 +508,10 @@ public class IrisProject {
|
||||
dimension.getEntitySpawnOverrides().forEach((sp) -> entities.add(dm.getEntityLoader().load(sp.getEntity())));
|
||||
biomes.forEach((r) -> r.getEntityInitialSpawns().forEach((sp) -> entities.add(dm.getEntityLoader().load(sp.getEntity()))));
|
||||
|
||||
for(int f = 0; f < IrisSettings.get().getGenerator().getMaxBiomeChildDepth(); f++)
|
||||
{
|
||||
for (int f = 0; f < IrisSettings.get().getGenerator().getMaxBiomeChildDepth(); f++) {
|
||||
biomes.copy().forEach((r) -> {
|
||||
r.getFeatures().forEach((i) -> {
|
||||
if (i.getZone().getCustomBiome() != null)
|
||||
{
|
||||
if (i.getZone().getCustomBiome() != null) {
|
||||
biomes.add(dm.getBiomeLoader().load(i.getZone().getCustomBiome()));
|
||||
}
|
||||
});
|
||||
|
@ -20,12 +20,8 @@ package com.volmit.iris.core.command;
|
||||
|
||||
import com.volmit.iris.Iris;
|
||||
import com.volmit.iris.util.collection.KList;
|
||||
import com.volmit.iris.util.format.C;
|
||||
import com.volmit.iris.util.plugin.MortarCommand;
|
||||
import com.volmit.iris.util.plugin.VolmitSender;
|
||||
import com.volmit.iris.util.scheduling.J;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
public class CommandIrisBitwise extends MortarCommand {
|
||||
public CommandIrisBitwise() {
|
||||
@ -43,19 +39,15 @@ public class CommandIrisBitwise extends MortarCommand {
|
||||
|
||||
@Override
|
||||
public boolean handle(VolmitSender sender, String[] args) {
|
||||
if(args.length != 3)
|
||||
{
|
||||
if (args.length != 3) {
|
||||
sender.sendMessage("/iris bw " + getArgsUsage());
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
if(args[0].contains(","))
|
||||
{
|
||||
try {
|
||||
if (args[0].contains(",")) {
|
||||
KList<Integer> r = new KList<>();
|
||||
|
||||
for(String i : args[0].split("\\Q,\\E"))
|
||||
{
|
||||
for (String i : args[0].split("\\Q,\\E")) {
|
||||
int a = Integer.parseInt(i);
|
||||
String op = args[1];
|
||||
int b = Integer.parseInt(args[2]);
|
||||
@ -75,15 +67,11 @@ public class CommandIrisBitwise extends MortarCommand {
|
||||
}
|
||||
}
|
||||
}
|
||||
;
|
||||
|
||||
r.add(v);
|
||||
sender.sendMessage("Result: " + r.toString(","));
|
||||
}
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
} else {
|
||||
int a = Integer.parseInt(args[0]);
|
||||
String op = args[1];
|
||||
int b = Integer.parseInt(args[2]);
|
||||
@ -103,14 +91,10 @@ public class CommandIrisBitwise extends MortarCommand {
|
||||
}
|
||||
}
|
||||
}
|
||||
;
|
||||
|
||||
sender.sendMessage("Result: " + v);
|
||||
}
|
||||
}
|
||||
|
||||
catch(Throwable ignored)
|
||||
{
|
||||
} catch (Throwable ignored) {
|
||||
|
||||
}
|
||||
|
||||
|
@ -46,9 +46,9 @@ public class CommandIrisJigsawPlace extends MortarCommand {
|
||||
IrisDataManager 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) {
|
||||
} else if (args.length == 0) {
|
||||
list.add(data.getJigsawStructureLoader().getPossibleKeys());
|
||||
}else if(args.length == 1) {
|
||||
} else if (args.length == 1) {
|
||||
list.add(data.getJigsawStructureLoader().getPossibleKeys(args[0]));
|
||||
}
|
||||
}
|
||||
|
@ -33,8 +33,6 @@ import org.bukkit.Sound;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
public class CommandIrisObjectPaste extends MortarCommand {
|
||||
public CommandIrisObjectPaste() {
|
||||
super("paste", "pasta", "place", "p");
|
||||
|
@ -19,10 +19,8 @@
|
||||
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.tools.IrisWorlds;
|
||||
import com.volmit.iris.util.collection.KList;
|
||||
import com.volmit.iris.util.plugin.Command;
|
||||
import com.volmit.iris.util.plugin.MortarCommand;
|
||||
|
@ -43,9 +43,9 @@ public class CommandIrisStudioExplorerGenerator extends MortarCommand {
|
||||
IrisDataManager 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) {
|
||||
} else if (args.length == 0) {
|
||||
list.add(data.getGeneratorLoader().getPossibleKeys());
|
||||
}else if(args.length == 1) {
|
||||
} else if (args.length == 1) {
|
||||
list.add(data.getGeneratorLoader().getPossibleKeys(args[0]));
|
||||
}
|
||||
}
|
||||
|
@ -37,7 +37,6 @@ import org.bukkit.entity.Player;
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.atomic.AtomicBoolean;
|
||||
|
||||
public class CommandIrisStudioGoto extends MortarCommand {
|
||||
public CommandIrisStudioGoto() {
|
||||
@ -53,10 +52,10 @@ public class CommandIrisStudioGoto extends MortarCommand {
|
||||
IrisDataManager 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) {
|
||||
} else if (args.length == 0) {
|
||||
list.add(data.getBiomeLoader().getPossibleKeys());
|
||||
list.add(data.getRegionLoader().getPossibleKeys());
|
||||
}else if(args.length == 1) {
|
||||
} else if (args.length == 1) {
|
||||
list.add(data.getBiomeLoader().getPossibleKeys(args[0]));
|
||||
list.add(data.getRegionLoader().getPossibleKeys(args[0]));
|
||||
}
|
||||
|
@ -63,7 +63,7 @@ public class CommandIrisStudioHotload extends MortarCommand {
|
||||
}
|
||||
|
||||
IrisAccess worldAccess = IrisWorlds.access(world);
|
||||
if (worldAccess == null){
|
||||
if (worldAccess == null) {
|
||||
sender.sendMessage("Could not gain access to the world you are in");
|
||||
} else {
|
||||
worldAccess.hotload();
|
||||
|
@ -55,28 +55,21 @@ public class CommandIrisVerify extends MortarCommand {
|
||||
File r = new File(folder, "region");
|
||||
BurstExecutor e = MultiBurst.burst.burst(r.listFiles().length);
|
||||
AtomicInteger f = new AtomicInteger(0);
|
||||
for(File i : r.listFiles())
|
||||
{
|
||||
for (File i : r.listFiles()) {
|
||||
e.queue(() -> {
|
||||
MCAFile file = null;
|
||||
try {
|
||||
file = MCAUtil.read(i);
|
||||
int rx = Integer.valueOf(i.getName().split("\\Q.\\E")[1]);
|
||||
int rz = Integer.valueOf(i.getName().split("\\Q.\\E")[2]);
|
||||
for(int j = 0; j < 32; j++)
|
||||
{
|
||||
for(int k = 0; k < 32; k++)
|
||||
{
|
||||
for (int j = 0; j < 32; j++) {
|
||||
for (int k = 0; k < 32; k++) {
|
||||
f.incrementAndGet();
|
||||
Chunk c = file.getChunk(j, k);
|
||||
if(c == null)
|
||||
{
|
||||
sender.sendMessage("Found Missing Chunk " + i.getName() + ", chunk #" + j + "," + k + " (see " + (((rx << 5)<<4)+(j<<4)) + "," + (((rz << 5)<<4)+(k<<4)));
|
||||
}
|
||||
|
||||
else if(c.sectionCount() == 0)
|
||||
{
|
||||
sender.sendMessage("Found Missing Chunk (valid, but 0 sections) " + i.getName() + ", chunk #" + j + "," + k + " (see " + (((rx << 5)<<4)+(j<<4)) + "," + (((rz << 5)<<4)+(k<<4)));
|
||||
if (c == null) {
|
||||
sender.sendMessage("Found Missing Chunk " + i.getName() + ", chunk #" + j + "," + k + " (see " + (((rx << 5) << 4) + (j << 4)) + "," + (((rz << 5) << 4) + (k << 4)));
|
||||
} else if (c.sectionCount() == 0) {
|
||||
sender.sendMessage("Found Missing Chunk (valid, but 0 sections) " + i.getName() + ", chunk #" + j + "," + k + " (see " + (((rx << 5) << 4) + (j << 4)) + "," + (((rz << 5) << 4) + (k << 4)));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -19,8 +19,6 @@
|
||||
package com.volmit.iris.core.gui;
|
||||
|
||||
import com.volmit.iris.Iris;
|
||||
import com.volmit.iris.engine.hunk.Hunk;
|
||||
import com.volmit.iris.engine.hunk.storage.ArrayHunk;
|
||||
import com.volmit.iris.engine.noise.CNG;
|
||||
import com.volmit.iris.engine.object.NoiseStyle;
|
||||
import com.volmit.iris.engine.parallel.BurstExecutor;
|
||||
@ -30,7 +28,6 @@ import com.volmit.iris.util.function.Function2;
|
||||
import com.volmit.iris.util.math.M;
|
||||
import com.volmit.iris.util.math.RNG;
|
||||
import com.volmit.iris.util.math.RollingSequence;
|
||||
import com.volmit.iris.util.scheduling.GroupedExecutor;
|
||||
import com.volmit.iris.util.scheduling.J;
|
||||
import com.volmit.iris.util.scheduling.PrecisionStopwatch;
|
||||
|
||||
@ -179,29 +176,25 @@ public class NoiseExplorerGUI extends JPanel implements MouseWheelListener {
|
||||
}
|
||||
|
||||
if (img == null) {
|
||||
img = new BufferedImage(w/accuracy, h/accuracy, BufferedImage.TYPE_INT_RGB);
|
||||
img = new BufferedImage(w / accuracy, h / accuracy, BufferedImage.TYPE_INT_RGB);
|
||||
}
|
||||
|
||||
BurstExecutor e = gx.burst(w);
|
||||
|
||||
for (int x = 0; x < w/accuracy; x ++) {
|
||||
for (int x = 0; x < w / accuracy; x++) {
|
||||
int xx = x;
|
||||
|
||||
int finalAccuracy = accuracy;
|
||||
e.queue(() -> {
|
||||
for (int z = 0; z < h/finalAccuracy; z++) {
|
||||
double n = generator != null ? generator.apply(((xx*finalAccuracy) * ascale) + oxp, ((z*finalAccuracy) * ascale) + ozp) : cng.noise(((xx*finalAccuracy) * ascale) + oxp, ((z*finalAccuracy) * ascale) + ozp);
|
||||
for (int z = 0; z < h / finalAccuracy; z++) {
|
||||
double n = generator != null ? generator.apply(((xx * finalAccuracy) * ascale) + oxp, ((z * finalAccuracy) * ascale) + ozp) : cng.noise(((xx * finalAccuracy) * ascale) + oxp, ((z * finalAccuracy) * ascale) + ozp);
|
||||
n = n > 1 ? 1 : n < 0 ? 0 : n;
|
||||
|
||||
try
|
||||
{
|
||||
try {
|
||||
Color color = colorMode ? Color.getHSBColor((float) (n), 1f - (float) (n * n * n * n * n * n), 1f - (float) n) : Color.getHSBColor(0f, 0f, (float) n);
|
||||
int rgb = color.getRGB();
|
||||
img.setRGB(xx, z, rgb);
|
||||
}
|
||||
|
||||
catch(Throwable xxx)
|
||||
{
|
||||
} catch (Throwable xxx) {
|
||||
|
||||
}
|
||||
}
|
||||
@ -209,7 +202,7 @@ public class NoiseExplorerGUI extends JPanel implements MouseWheelListener {
|
||||
}
|
||||
|
||||
e.complete(1000);
|
||||
gg.drawImage(img, 0, 0, getParent().getWidth()*accuracy, getParent().getHeight()*accuracy, (img, infoflags, x, y, width, height) -> true);
|
||||
gg.drawImage(img, 0, 0, getParent().getWidth() * accuracy, getParent().getHeight() * accuracy, (img, infoflags, x, y, width, height) -> true);
|
||||
}
|
||||
|
||||
p.end();
|
||||
|
@ -48,14 +48,14 @@ public class PregeneratorJob implements PregenListener {
|
||||
private static final Color COLOR_GENERATED = parseColor("#34eb93");
|
||||
private JFrame frame;
|
||||
private final PregenTask task;
|
||||
private boolean saving;
|
||||
private KList<Consumer<Double>> onProgress = new KList<>();
|
||||
private KList<Runnable> whenDone = new KList<>();
|
||||
private final boolean saving;
|
||||
private final KList<Consumer<Double>> onProgress = new KList<>();
|
||||
private final KList<Runnable> whenDone = new KList<>();
|
||||
private final IrisPregenerator pregenerator;
|
||||
private PregenRenderer renderer;
|
||||
private String[] info;
|
||||
private Position2 min;
|
||||
private Position2 max;
|
||||
private final Position2 min;
|
||||
private final Position2 max;
|
||||
|
||||
public PregeneratorJob(PregenTask task, PregeneratorMethod method) {
|
||||
instance = this;
|
||||
|
@ -32,10 +32,9 @@ public class INMS {
|
||||
//@builder
|
||||
private static final KMap<String, Class<? extends INMSBinding>> bindings = new KMap<String, Class<? extends INMSBinding>>()
|
||||
.qput("v1_17_R1", NMSBinding17_1.class)
|
||||
.qput("v1_16_R3", NMSBinding16_3 .class)
|
||||
.qput("v1_16_R3", NMSBinding16_3.class)
|
||||
.qput("v1_16_R2", NMSBinding16_2.class)
|
||||
.qput("v1_16_R1", NMSBinding16_1.class)
|
||||
;
|
||||
.qput("v1_16_R1", NMSBinding16_1.class);
|
||||
//@done
|
||||
private static final INMSBinding binding = bind();
|
||||
|
||||
|
@ -21,7 +21,8 @@ package com.volmit.iris.core.nms.v16_1;
|
||||
import com.volmit.iris.Iris;
|
||||
import com.volmit.iris.core.nms.INMSBinding;
|
||||
import com.volmit.iris.util.collection.KMap;
|
||||
import net.minecraft.server.v1_16_R1.*;
|
||||
import net.minecraft.server.v1_16_R1.BiomeBase;
|
||||
import net.minecraft.server.v1_16_R1.IRegistryWritable;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.block.Biome;
|
||||
|
@ -24,23 +24,18 @@ import org.bukkit.World;
|
||||
import org.bukkit.block.Biome;
|
||||
import org.bukkit.generator.ChunkGenerator;
|
||||
|
||||
import java.lang.reflect.Method;
|
||||
|
||||
public class NMSBinding1X implements INMSBinding {
|
||||
private static final boolean supportsCustomHeight = testCustomHeight();
|
||||
|
||||
@SuppressWarnings("ConstantConditions")
|
||||
private static boolean testCustomHeight() {
|
||||
try
|
||||
{
|
||||
if(World.class.getDeclaredMethod("getMaxHeight") != null && World.class.getDeclaredMethod("getMinHeight") != null);
|
||||
try {
|
||||
if (World.class.getDeclaredMethod("getMaxHeight") != null && World.class.getDeclaredMethod("getMinHeight") != null)
|
||||
;
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
catch(Throwable ignored)
|
||||
{
|
||||
} catch (Throwable ignored) {
|
||||
|
||||
}
|
||||
|
||||
|
@ -38,15 +38,15 @@ import java.util.concurrent.atomic.AtomicInteger;
|
||||
|
||||
public class SyndicatePregenMethod implements PregeneratorMethod {
|
||||
@Getter
|
||||
private String address;
|
||||
private final String address;
|
||||
private String nickname;
|
||||
private int port;
|
||||
private String password;
|
||||
private IrisDimension dimension;
|
||||
private final int port;
|
||||
private final String password;
|
||||
private final IrisDimension dimension;
|
||||
private boolean ready = false;
|
||||
private File worldFolder;
|
||||
private UUID pack = UUID.randomUUID();
|
||||
private long seed;
|
||||
private final File worldFolder;
|
||||
private final UUID pack = UUID.randomUUID();
|
||||
private final long seed;
|
||||
|
||||
public SyndicatePregenMethod(String nickname, File worldFolder, String address, int port, String password, IrisDimension dimension, long seed) {
|
||||
this.seed = seed;
|
||||
|
@ -29,10 +29,10 @@ import java.util.function.Consumer;
|
||||
|
||||
@Builder
|
||||
public class SyndicateClient {
|
||||
private String address;
|
||||
private int port;
|
||||
private SyndicateCommand command;
|
||||
private Consumer<DataOutputStream> output;
|
||||
private final String address;
|
||||
private final int port;
|
||||
private final SyndicateCommand command;
|
||||
private final Consumer<DataOutputStream> output;
|
||||
|
||||
public void go(Consumer2<SyndicateCommand, DataInputStream> handler) throws Throwable {
|
||||
Socket socket = new Socket(address, port);
|
||||
|
@ -35,15 +35,15 @@ import java.util.UUID;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
|
||||
public class SyndicateServer extends Thread implements PregenListener {
|
||||
private int port;
|
||||
private String password;
|
||||
private final int port;
|
||||
private final String password;
|
||||
private boolean busy;
|
||||
private int tc;
|
||||
private final int tc;
|
||||
private HeadlessGenerator generator;
|
||||
private ServerSocket server;
|
||||
private File cache;
|
||||
private final ServerSocket server;
|
||||
private final File cache;
|
||||
private UUID currentId = null;
|
||||
private AtomicInteger g = new AtomicInteger(0);
|
||||
private final AtomicInteger g = new AtomicInteger(0);
|
||||
private File lastGeneratedRegion = null;
|
||||
|
||||
public SyndicateServer(File cache, int port, String password, int tc) throws IOException {
|
||||
@ -115,7 +115,7 @@ public class SyndicateServer extends Thread implements PregenListener {
|
||||
fos.close();
|
||||
ZipUtil.unpack(cacheload, cachestore);
|
||||
cacheload.deleteOnExit();
|
||||
HeadlessWorld w = new HeadlessWorld("turbo/" + id.toString(), ((SyndicateInstallPack) command).getDimension(), ((SyndicateInstallPack) command).getSeed());
|
||||
HeadlessWorld w = new HeadlessWorld("turbo/" + id, ((SyndicateInstallPack) command).getDimension(), ((SyndicateInstallPack) command).getSeed());
|
||||
w.setStudio(true);
|
||||
generator = w.generate();
|
||||
return new SyndicateOK();
|
||||
|
@ -38,7 +38,6 @@ import net.md_5.bungee.api.chat.TextComponent;
|
||||
import org.bukkit.WorldCreator;
|
||||
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
import java.util.concurrent.ExecutionException;
|
||||
import java.util.function.Consumer;
|
||||
|
||||
/**
|
||||
|
@ -39,7 +39,6 @@ import org.bukkit.block.Biome;
|
||||
import org.bukkit.block.data.BlockData;
|
||||
|
||||
import java.util.concurrent.atomic.AtomicBoolean;
|
||||
import java.util.concurrent.atomic.AtomicReference;
|
||||
|
||||
@Data
|
||||
public class IrisComplex implements DataProvider {
|
||||
@ -117,8 +116,7 @@ public class IrisComplex implements DataProvider {
|
||||
generators = new KList<>();
|
||||
focus = engine.getFocus();
|
||||
|
||||
if(focus != null)
|
||||
{
|
||||
if (focus != null) {
|
||||
focus.setInferredType(InferredType.LAND);
|
||||
}
|
||||
|
||||
@ -216,13 +214,11 @@ public class IrisComplex implements DataProvider {
|
||||
});
|
||||
|
||||
trueBiomeStream = focus != null ? ProceduralStream.of((x, y) -> focus, Interpolated.of(a -> 0D,
|
||||
b -> focus)).convertAware2D((b, x,z) -> {
|
||||
for(IrisFeaturePositional i : engine.getFramework().getEngineParallax().forEachFeature(x, z))
|
||||
{
|
||||
b -> focus)).convertAware2D((b, x, z) -> {
|
||||
for (IrisFeaturePositional i : engine.getFramework().getEngineParallax().forEachFeature(x, z)) {
|
||||
IrisBiome bx = i.filter(x, z, b, rng);
|
||||
|
||||
if(bx != null)
|
||||
{
|
||||
if (bx != null) {
|
||||
bx.setInferredType(b.getInferredType());
|
||||
return bx;
|
||||
}
|
||||
@ -234,13 +230,11 @@ public class IrisComplex implements DataProvider {
|
||||
.convertAware2D((h, x, z) ->
|
||||
fixBiomeType(h, baseBiomeStream.get(x, z),
|
||||
regionStream.get(x, z), x, z, fluidHeight))
|
||||
.convertAware2D((b, x,z) -> {
|
||||
for(IrisFeaturePositional i : engine.getFramework().getEngineParallax().forEachFeature(x, z))
|
||||
{
|
||||
.convertAware2D((b, x, z) -> {
|
||||
for (IrisFeaturePositional i : engine.getFramework().getEngineParallax().forEachFeature(x, z)) {
|
||||
IrisBiome bx = i.filter(x, z, b, rng);
|
||||
|
||||
if(bx != null)
|
||||
{
|
||||
if (bx != null) {
|
||||
bx.setInferredType(b.getInferredType());
|
||||
return bx;
|
||||
}
|
||||
|
@ -26,7 +26,6 @@ import com.volmit.iris.engine.object.IrisBiomePaletteLayer;
|
||||
import com.volmit.iris.engine.object.IrisDecorator;
|
||||
import com.volmit.iris.engine.object.IrisObjectPlacement;
|
||||
import com.volmit.iris.engine.parallel.BurstExecutor;
|
||||
import com.volmit.iris.engine.parallel.MultiBurst;
|
||||
import com.volmit.iris.util.documentation.ChunkCoordinates;
|
||||
import com.volmit.iris.util.math.RNG;
|
||||
import com.volmit.iris.util.scheduling.J;
|
||||
@ -169,13 +168,11 @@ public class IrisEngine extends BlockPopulator implements Engine {
|
||||
// makes the biome stream, interpolation & noise engine run in parallel without mca
|
||||
BurstExecutor b = burst().burst(16);
|
||||
|
||||
for(int i = 0; i < vblocks.getWidth(); i++)
|
||||
{
|
||||
for (int i = 0; i < vblocks.getWidth(); i++) {
|
||||
int finalI = i;
|
||||
b.queue(() -> {
|
||||
for(int j = 0; j < vblocks.getDepth(); j++)
|
||||
{
|
||||
getFramework().getComplex().getTrueBiomeStream().get(x+ finalI,z+j);
|
||||
for (int j = 0; j < vblocks.getDepth(); j++) {
|
||||
getFramework().getComplex().getTrueBiomeStream().get(x + finalI, z + j);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -51,7 +51,7 @@ import java.util.List;
|
||||
|
||||
public class IrisEngineCompound implements EngineCompound {
|
||||
@Getter
|
||||
private IrisWorld world;
|
||||
private final IrisWorld world;
|
||||
|
||||
private final AtomicRollingSequence wallClock;
|
||||
|
||||
|
@ -25,7 +25,10 @@ import com.volmit.iris.engine.actuator.IrisDecorantActuator;
|
||||
import com.volmit.iris.engine.actuator.IrisTerrainIslandActuator;
|
||||
import com.volmit.iris.engine.actuator.IrisTerrainNormalActuator;
|
||||
import com.volmit.iris.engine.framework.*;
|
||||
import com.volmit.iris.engine.modifier.*;
|
||||
import com.volmit.iris.engine.modifier.IrisCaveModifier;
|
||||
import com.volmit.iris.engine.modifier.IrisDepositModifier;
|
||||
import com.volmit.iris.engine.modifier.IrisPostModifier;
|
||||
import com.volmit.iris.engine.modifier.IrisRavineModifier;
|
||||
import com.volmit.iris.util.scheduling.ChronoLatch;
|
||||
import lombok.Getter;
|
||||
import org.bukkit.block.Biome;
|
||||
|
@ -18,7 +18,6 @@
|
||||
|
||||
package com.volmit.iris.engine.actuator;
|
||||
|
||||
import com.volmit.iris.Iris;
|
||||
import com.volmit.iris.engine.decorator.*;
|
||||
import com.volmit.iris.engine.framework.Engine;
|
||||
import com.volmit.iris.engine.framework.EngineAssignedActuator;
|
||||
|
@ -42,7 +42,7 @@ public class IrisTerrainIslandActuator extends EngineAssignedActuator<BlockData>
|
||||
private final boolean carving;
|
||||
private final boolean hasUnder;
|
||||
@Getter
|
||||
private int lastBedrock = -1;
|
||||
private final int lastBedrock = -1;
|
||||
|
||||
public IrisTerrainIslandActuator(Engine engine) {
|
||||
super(engine, "TerrainIsland");
|
||||
|
@ -144,8 +144,7 @@ public class B {
|
||||
|
||||
BlockData bx = Bukkit.createBlockData(ix);
|
||||
|
||||
if(bx instanceof Leaves)
|
||||
{
|
||||
if (bx instanceof Leaves) {
|
||||
((Leaves) bx).setPersistent(true);
|
||||
}
|
||||
|
||||
|
@ -33,13 +33,13 @@ import org.jetbrains.annotations.NotNull;
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
public class MCATerrainChunk implements TerrainChunk {
|
||||
private NBTWorld writer;
|
||||
private BiomeBaseInjector injector;
|
||||
private int ox;
|
||||
private int oz;
|
||||
private int minHeight;
|
||||
private int maxHeight;
|
||||
private Chunk mcaChunk;
|
||||
private final NBTWorld writer;
|
||||
private final BiomeBaseInjector injector;
|
||||
private final int ox;
|
||||
private final int oz;
|
||||
private final int minHeight;
|
||||
private final int maxHeight;
|
||||
private final Chunk mcaChunk;
|
||||
|
||||
@Override
|
||||
public BiomeBaseInjector getBiomeBaseInjector() {
|
||||
|
@ -93,27 +93,19 @@ public class ResourceLoader<T extends IrisRegistrant> {
|
||||
J.a(() -> Iris.warn("Couldn't Load " + resourceTypeName + " file: " + path.getPath() + ": " + e.getMessage()));
|
||||
}
|
||||
|
||||
private KList<File> matchAllFiles(File root, Predicate<File> f)
|
||||
{
|
||||
private KList<File> matchAllFiles(File root, Predicate<File> f) {
|
||||
KList<File> fx = new KList<>();
|
||||
matchFiles(root, fx, f);
|
||||
return fx;
|
||||
}
|
||||
|
||||
private void matchFiles(File at, KList<File> files, Predicate<File> f)
|
||||
{
|
||||
if(at.isDirectory())
|
||||
{
|
||||
for(File i : at.listFiles())
|
||||
{
|
||||
private void matchFiles(File at, KList<File> files, Predicate<File> f) {
|
||||
if (at.isDirectory()) {
|
||||
for (File i : at.listFiles()) {
|
||||
matchFiles(i, files, f);
|
||||
}
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
if(f.test(at))
|
||||
{
|
||||
} else {
|
||||
if (f.test(at)) {
|
||||
files.add(at);
|
||||
}
|
||||
}
|
||||
@ -127,10 +119,8 @@ public class ResourceLoader<T extends IrisRegistrant> {
|
||||
Iris.info("Building " + resourceTypeName + " Registry Lists");
|
||||
KSet<String> m = new KSet<>();
|
||||
|
||||
for(File i : getFolders())
|
||||
{
|
||||
for(File j : matchAllFiles(i, (f) -> f.getName().endsWith(".json")))
|
||||
{
|
||||
for (File i : getFolders()) {
|
||||
for (File j : matchAllFiles(i, (f) -> f.getName().endsWith(".json"))) {
|
||||
m.add(i.toURI().relativize(j.toURI()).getPath().replaceAll("\\Q.json\\E", ""));
|
||||
}
|
||||
}
|
||||
@ -308,10 +298,8 @@ public class ResourceLoader<T extends IrisRegistrant> {
|
||||
public KList<String> getPossibleKeys(String arg) {
|
||||
KList<String> f = new KList<>();
|
||||
|
||||
for(String i : getPossibleKeys())
|
||||
{
|
||||
if(i.equalsIgnoreCase(arg) || i.toLowerCase(Locale.ROOT).startsWith(arg.toLowerCase(Locale.ROOT)) || i.toLowerCase(Locale.ROOT).contains(arg.toLowerCase(Locale.ROOT)) || arg.toLowerCase(Locale.ROOT).contains(i.toLowerCase(Locale.ROOT)))
|
||||
{
|
||||
for (String i : getPossibleKeys()) {
|
||||
if (i.equalsIgnoreCase(arg) || i.toLowerCase(Locale.ROOT).startsWith(arg.toLowerCase(Locale.ROOT)) || i.toLowerCase(Locale.ROOT).contains(arg.toLowerCase(Locale.ROOT)) || arg.toLowerCase(Locale.ROOT).contains(i.toLowerCase(Locale.ROOT))) {
|
||||
f.add(i);
|
||||
}
|
||||
}
|
||||
|
@ -634,8 +634,7 @@ public class Chunk {
|
||||
}
|
||||
|
||||
public void cleanupPalettesAndBlockStates() {
|
||||
for (int i = 0; i < sections.length(); i++)
|
||||
{
|
||||
for (int i = 0; i < sections.length(); i++) {
|
||||
Section section = sections.get(i);
|
||||
if (section != null) {
|
||||
section.cleanupPaletteAndBlockStates();
|
||||
@ -691,12 +690,10 @@ public class Chunk {
|
||||
}
|
||||
|
||||
public void runLighting() {
|
||||
for(int s = 15; s >= 0; s--)
|
||||
{
|
||||
for (int s = 15; s >= 0; s--) {
|
||||
Section section = getSection(s);
|
||||
|
||||
if(section != null)
|
||||
{
|
||||
if (section != null) {
|
||||
section.runLighting();
|
||||
}
|
||||
}
|
||||
|
@ -25,7 +25,6 @@ import com.volmit.iris.engine.data.nbt.tag.ListTag;
|
||||
import com.volmit.iris.engine.data.nbt.tag.LongArrayTag;
|
||||
import com.volmit.iris.util.collection.KMap;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
@ -108,12 +107,9 @@ public class Section {
|
||||
}
|
||||
|
||||
public void runLighting() {
|
||||
for(int x = 1; x < 14; x++)
|
||||
{
|
||||
for(int z = 1; z < 14; z++)
|
||||
{
|
||||
for(int y = 0; y < 16; y++)
|
||||
{
|
||||
for (int x = 1; x < 14; x++) {
|
||||
for (int z = 1; z < 14; z++) {
|
||||
for (int y = 0; y < 16; y++) {
|
||||
|
||||
}
|
||||
}
|
||||
@ -444,8 +440,7 @@ public class Section {
|
||||
if (blockStates != null) {
|
||||
long[] c = new long[blockStates.length()];
|
||||
|
||||
for(int i = 0; i < c.length; i++)
|
||||
{
|
||||
for (int i = 0; i < c.length; i++) {
|
||||
c[i] = blockStates.get(i);
|
||||
}
|
||||
|
||||
|
@ -45,7 +45,7 @@ public class IrisCeilingDecorator extends IrisEngineDecorator {
|
||||
} else {
|
||||
int stack = decorator.getHeight(getRng().nextParallelRNG(Cache.key(realX, realZ)), realX, realZ, getData());
|
||||
if (decorator.isScaleStack()) {
|
||||
stack = (int) Math.ceil((double)max * ((double)stack / 100));
|
||||
stack = (int) Math.ceil((double) max * ((double) stack / 100));
|
||||
} else stack = Math.min(max, stack);
|
||||
|
||||
if (stack == 1) {
|
||||
|
@ -18,7 +18,6 @@
|
||||
|
||||
package com.volmit.iris.engine.decorator;
|
||||
|
||||
import com.volmit.iris.Iris;
|
||||
import com.volmit.iris.engine.cache.Cache;
|
||||
import com.volmit.iris.engine.framework.Engine;
|
||||
import com.volmit.iris.engine.hunk.Hunk;
|
||||
@ -47,7 +46,7 @@ public class IrisSeaFloorDecorator extends IrisEngineDecorator {
|
||||
int stack = decorator.getHeight(getRng().nextParallelRNG(Cache.key(realX, realZ)), realX, realZ, getData());
|
||||
if (decorator.isScaleStack()) {
|
||||
int maxStack = max - height;
|
||||
stack = (int)Math.ceil((double)maxStack * ((double)stack / 100));
|
||||
stack = (int) Math.ceil((double) maxStack * ((double) stack / 100));
|
||||
} else stack = Math.min(stack, max - height);
|
||||
|
||||
if (stack == 1) {
|
||||
|
@ -18,7 +18,6 @@
|
||||
|
||||
package com.volmit.iris.engine.decorator;
|
||||
|
||||
import com.volmit.iris.Iris;
|
||||
import com.volmit.iris.engine.cache.Cache;
|
||||
import com.volmit.iris.engine.framework.Engine;
|
||||
import com.volmit.iris.engine.hunk.Hunk;
|
||||
@ -47,7 +46,7 @@ public class IrisSeaSurfaceDecorator extends IrisEngineDecorator {
|
||||
int stack = decorator.getHeight(getRng().nextParallelRNG(Cache.key(realX, realZ)), realX, realZ, getData());
|
||||
if (decorator.isScaleStack()) {
|
||||
int maxStack = max - height;
|
||||
stack = (int) Math.ceil((double)maxStack * ((double)stack / 100));
|
||||
stack = (int) Math.ceil((double) maxStack * ((double) stack / 100));
|
||||
}
|
||||
|
||||
if (stack == 1) {
|
||||
|
@ -51,7 +51,7 @@ public class IrisShoreLineDecorator extends IrisEngineDecorator {
|
||||
int stack = decorator.getHeight(getRng().nextParallelRNG(Cache.key(realX, realZ)), realX, realZ, getData());
|
||||
if (decorator.isScaleStack()) {
|
||||
int maxStack = max - height;
|
||||
stack = (int)Math.ceil((double)maxStack * ((double)stack / 100));
|
||||
stack = (int) Math.ceil((double) maxStack * ((double) stack / 100));
|
||||
} else stack = Math.min(max - height, stack);
|
||||
|
||||
if (stack == 1) {
|
||||
|
@ -79,7 +79,7 @@ public class IrisSurfaceDecorator extends IrisEngineDecorator {
|
||||
int stack = decorator.getHeight(getRng().nextParallelRNG(Cache.key(realX, realZ)), realX, realZ, getData());
|
||||
if (decorator.isScaleStack()) {
|
||||
int maxStack = max - height;
|
||||
stack = (int) Math.ceil((double)maxStack * ((double)stack / 100));
|
||||
stack = (int) Math.ceil((double) maxStack * ((double) stack / 100));
|
||||
} else stack = Math.min(height - max, stack);
|
||||
|
||||
if (stack == 1) {
|
||||
|
@ -38,23 +38,15 @@ import com.volmit.iris.util.scheduling.PrecisionStopwatch;
|
||||
import org.bukkit.Chunk;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.NamespacedKey;
|
||||
import org.bukkit.block.Biome;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.block.Chest;
|
||||
import org.bukkit.block.data.BlockData;
|
||||
import org.bukkit.inventory.Inventory;
|
||||
import org.bukkit.inventory.InventoryHolder;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.loot.LootContext;
|
||||
import org.bukkit.loot.LootTable;
|
||||
import org.bukkit.loot.Lootable;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.awt.*;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
import java.util.Random;
|
||||
|
||||
public interface Engine extends DataProvider, Fallible, GeneratorAccess, LootProvider, BlockUpdater, Renderer, Hotloadable {
|
||||
void close();
|
||||
|
@ -21,7 +21,6 @@ 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.BiomeBaseInjector;
|
||||
import com.volmit.iris.core.nms.INMS;
|
||||
import com.volmit.iris.core.pregenerator.PregenListener;
|
||||
import com.volmit.iris.core.pregenerator.PregenTask;
|
||||
@ -29,12 +28,10 @@ import com.volmit.iris.engine.IrisEngineCompound;
|
||||
import com.volmit.iris.engine.data.B;
|
||||
import com.volmit.iris.engine.data.chunk.MCATerrainChunk;
|
||||
import com.volmit.iris.engine.data.chunk.TerrainChunk;
|
||||
import com.volmit.iris.engine.data.mca.MCAUtil;
|
||||
import com.volmit.iris.engine.data.mca.NBTWorld;
|
||||
import com.volmit.iris.engine.data.nbt.tag.CompoundTag;
|
||||
import com.volmit.iris.engine.headless.HeadlessGenerator;
|
||||
import com.volmit.iris.engine.hunk.Hunk;
|
||||
import com.volmit.iris.engine.lighting.LightingChunk;
|
||||
import com.volmit.iris.engine.object.IrisBiome;
|
||||
import com.volmit.iris.engine.object.IrisDimension;
|
||||
import com.volmit.iris.engine.object.IrisPosition;
|
||||
@ -61,7 +58,6 @@ import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.generator.BlockPopulator;
|
||||
import org.bukkit.generator.ChunkGenerator;
|
||||
import org.bukkit.material.MaterialData;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
@ -320,8 +316,7 @@ public class EngineCompositeGenerator extends ChunkGenerator implements IrisAcce
|
||||
// placeStrongholds(world.realWorld());
|
||||
// }
|
||||
|
||||
if(isStudio())
|
||||
{
|
||||
if (isStudio()) {
|
||||
dim.installDataPack(() -> data, Iris.instance.getDatapacksFolder());
|
||||
}
|
||||
} catch (Throwable e) {
|
||||
@ -458,8 +453,7 @@ public class EngineCompositeGenerator extends ChunkGenerator implements IrisAcce
|
||||
@NotNull
|
||||
@Override
|
||||
public ChunkData generateChunkData(@NotNull World world, @NotNull Random ignored, int x, int z, @NotNull BiomeGrid biome) {
|
||||
try
|
||||
{
|
||||
try {
|
||||
PrecisionStopwatch ps = PrecisionStopwatch.start();
|
||||
TerrainChunk tc = TerrainChunk.create(world, biome);
|
||||
IrisWorld ww = (getComposite() == null || getComposite().getWorld() == null) ? IrisWorld.fromWorld(world) : getComposite().getWorld();
|
||||
@ -477,10 +471,7 @@ public class EngineCompositeGenerator extends ChunkGenerator implements IrisAcce
|
||||
}
|
||||
|
||||
return tc.getRaw();
|
||||
}
|
||||
|
||||
catch(Throwable e)
|
||||
{
|
||||
} catch (Throwable e) {
|
||||
Iris.error("======================================");
|
||||
e.printStackTrace();
|
||||
Iris.reportErrorChunk(x, z, e, "CHUNK");
|
||||
@ -488,10 +479,8 @@ public class EngineCompositeGenerator extends ChunkGenerator implements IrisAcce
|
||||
|
||||
ChunkData d = Bukkit.createChunkData(world);
|
||||
|
||||
for(int i = 0; i < 16; i++)
|
||||
{
|
||||
for(int j = 0; j < 16; j++)
|
||||
{
|
||||
for (int i = 0; i < 16; i++) {
|
||||
for (int j = 0; j < 16; j++) {
|
||||
d.setBlock(i, 0, j, ERROR_BLOCK);
|
||||
}
|
||||
}
|
||||
@ -542,8 +531,8 @@ public class EngineCompositeGenerator extends ChunkGenerator implements IrisAcce
|
||||
|
||||
@Override
|
||||
public void directWriteChunk(IrisWorld w, int x, int z, NBTWorld writer) {
|
||||
try
|
||||
{int ox = x << 4;
|
||||
try {
|
||||
int ox = x << 4;
|
||||
int oz = z << 4;
|
||||
com.volmit.iris.engine.data.mca.Chunk chunk = writer.getChunk(x, z);
|
||||
generateChunkRawData(w, x, z, MCATerrainChunk.builder()
|
||||
@ -552,20 +541,15 @@ public class EngineCompositeGenerator extends ChunkGenerator implements IrisAcce
|
||||
.injector((xx, yy, zz, biomeBase) -> chunk.setBiomeAt(ox + xx, yy, oz + zz,
|
||||
INMS.get().getTrueBiomeBaseId(biomeBase)))
|
||||
.build()).run();
|
||||
}
|
||||
|
||||
catch(Throwable e)
|
||||
{
|
||||
} catch (Throwable e) {
|
||||
Iris.error("======================================");
|
||||
e.printStackTrace();
|
||||
Iris.reportErrorChunk(x, z, e, "MCA");
|
||||
Iris.error("======================================");
|
||||
com.volmit.iris.engine.data.mca.Chunk chunk = writer.getChunk(x, z);
|
||||
CompoundTag c = NBTWorld.getCompound(ERROR_BLOCK);
|
||||
for(int i = 0; i < 16; i++)
|
||||
{
|
||||
for(int j = 0; j < 16; j++)
|
||||
{
|
||||
for (int i = 0; i < 16; i++) {
|
||||
for (int j = 0; j < 16; j++) {
|
||||
chunk.setBlockStateAt(i, 0, j, c, false);
|
||||
}
|
||||
}
|
||||
|
@ -41,12 +41,10 @@ import com.volmit.iris.util.documentation.BlockCoordinates;
|
||||
import com.volmit.iris.util.documentation.ChunkCoordinates;
|
||||
import com.volmit.iris.util.format.Form;
|
||||
import com.volmit.iris.util.function.Consumer4;
|
||||
import com.volmit.iris.util.math.Position2;
|
||||
import com.volmit.iris.util.math.RNG;
|
||||
import com.volmit.iris.util.scheduling.IrisLock;
|
||||
import com.volmit.iris.util.scheduling.J;
|
||||
import com.volmit.iris.util.scheduling.PrecisionStopwatch;
|
||||
import io.lumine.xikage.mythicmobs.utils.serialize.ChunkPosition;
|
||||
import org.bukkit.Chunk;
|
||||
import org.bukkit.ChunkSnapshot;
|
||||
import org.bukkit.block.TileState;
|
||||
@ -572,7 +570,8 @@ public interface EngineParallaxManager extends DataProvider, IObjectPlacer {
|
||||
}
|
||||
|
||||
default void place(RNG rng, int x, int forceY, int z, IrisObjectPlacement objectPlacement) {
|
||||
placing: for (int i = 0; i < objectPlacement.getDensity(); i++) {
|
||||
placing:
|
||||
for (int i = 0; i < objectPlacement.getDensity(); i++) {
|
||||
IrisObject v = objectPlacement.getScale().get(rng, objectPlacement.getObject(getComplex(), rng));
|
||||
if (v == null) {
|
||||
return;
|
||||
@ -603,10 +602,8 @@ public interface EngineParallaxManager extends DataProvider, IObjectPlacer {
|
||||
f.setInterpolator(objectPlacement.getVacuumInterpolationMethod());
|
||||
f.setStrength(1D);
|
||||
|
||||
for(IrisFeaturePositional j : rw.getFeatures())
|
||||
{
|
||||
if(j.getX() == xx && j.getZ() == zz)
|
||||
{
|
||||
for (IrisFeaturePositional j : rw.getFeatures()) {
|
||||
if (j.getX() == xx && j.getZ() == zz) {
|
||||
continue placing;
|
||||
}
|
||||
}
|
||||
|
@ -21,7 +21,6 @@ package com.volmit.iris.engine.hunk.io;
|
||||
import com.volmit.iris.Iris;
|
||||
import com.volmit.iris.engine.hunk.Hunk;
|
||||
import com.volmit.iris.engine.object.tile.TileData;
|
||||
import com.volmit.iris.engine.parallel.BurstExecutor;
|
||||
import com.volmit.iris.engine.parallel.MultiBurst;
|
||||
import com.volmit.iris.util.collection.KList;
|
||||
import com.volmit.iris.util.collection.KMap;
|
||||
|
@ -245,7 +245,8 @@ public class PlannedStructure {
|
||||
}
|
||||
|
||||
private boolean generateRotatedPiece(PlannedPiece piece, IrisJigsawPieceConnector pieceConnector, IrisJigsawPiece idea, IrisObjectRotation rotation) {
|
||||
if (!idea.getPlacementOptions().getRotation().isEnabled()) rotation = piece.getRotation(); //Inherit parent rotation
|
||||
if (!idea.getPlacementOptions().getRotation().isEnabled())
|
||||
rotation = piece.getRotation(); //Inherit parent rotation
|
||||
|
||||
PlannedPiece test = new PlannedPiece(this, piece.getPosition(), idea, rotation);
|
||||
|
||||
|
@ -24,7 +24,6 @@ import com.bergerkiller.bukkit.common.wrappers.BlockData;
|
||||
import com.bergerkiller.bukkit.common.wrappers.ChunkSection;
|
||||
import com.bergerkiller.generated.net.minecraft.server.NibbleArrayHandle;
|
||||
import com.volmit.iris.Iris;
|
||||
import com.volmit.iris.util.data.NibbleArray;
|
||||
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
|
||||
|
@ -22,8 +22,7 @@ public class CloverNoise implements NoiseGenerator {
|
||||
private final Noise2D n2;
|
||||
private final Noise3D n3;
|
||||
|
||||
public CloverNoise(long seed)
|
||||
{
|
||||
public CloverNoise(long seed) {
|
||||
n2 = new CloverNoise.Noise2D(seed);
|
||||
n3 = new CloverNoise.Noise3D(seed);
|
||||
}
|
||||
@ -40,9 +39,8 @@ public class CloverNoise implements NoiseGenerator {
|
||||
|
||||
@Override
|
||||
public double noise(double x, double y, double z) {
|
||||
if(z == 0)
|
||||
{
|
||||
return n2.noise(x,y);
|
||||
if (z == 0) {
|
||||
return n2.noise(x, y);
|
||||
}
|
||||
|
||||
return n3.noise(x, y, z);
|
||||
@ -52,10 +50,11 @@ public class CloverNoise implements NoiseGenerator {
|
||||
* Java implementation of 2D Clover Noise. See https://github.com/ValgoBoi/clover-noise
|
||||
*/
|
||||
public static class Noise2D {
|
||||
private long seed;
|
||||
private final long seed;
|
||||
|
||||
/**
|
||||
* Constructs a new 2D Clover Noise generator with a specific seed.
|
||||
*
|
||||
* @param seed The seed for the noise generator.
|
||||
*/
|
||||
public Noise2D(long seed) {
|
||||
@ -109,6 +108,7 @@ public class CloverNoise implements NoiseGenerator {
|
||||
|
||||
/**
|
||||
* Generates 2D Clover Noise at a specific point.
|
||||
*
|
||||
* @param p The point to generate noise at.
|
||||
* @return The value of noise, from 0 to 1.
|
||||
*/
|
||||
@ -205,6 +205,7 @@ public class CloverNoise implements NoiseGenerator {
|
||||
|
||||
/**
|
||||
* Generates 2D Clover Noise at a specific point.
|
||||
*
|
||||
* @param x The x coordinate of the point.
|
||||
* @param y The y coordinate of the point.
|
||||
* @return The value of noise, from 0 to 1.
|
||||
@ -215,6 +216,7 @@ public class CloverNoise implements NoiseGenerator {
|
||||
|
||||
/**
|
||||
* Generates fractal 2D Clover Noise at a specific point.
|
||||
*
|
||||
* @param p The point to generate noise at.
|
||||
* @param iterations The number of iterations for the fractal noise.
|
||||
* @return The value of noise, from 0 to 1.
|
||||
@ -236,6 +238,7 @@ public class CloverNoise implements NoiseGenerator {
|
||||
|
||||
/**
|
||||
* Generates fractal 2D Clover Noise at a specific point.
|
||||
*
|
||||
* @param x The x coordinate of the point.
|
||||
* @param y The y coordinate of the point.
|
||||
* @param iterations The number of iterations for the fractal noise.
|
||||
@ -249,6 +252,7 @@ public class CloverNoise implements NoiseGenerator {
|
||||
|
||||
/**
|
||||
* Generates curl 2D Clover Noise at a specific point.
|
||||
*
|
||||
* @param p The point to generate noise at.
|
||||
* @return The value of curl noise, a normalized 2D vector.
|
||||
*/
|
||||
@ -262,6 +266,7 @@ public class CloverNoise implements NoiseGenerator {
|
||||
|
||||
/**
|
||||
* Generates curl 2D Clover Noise at a specific point.
|
||||
*
|
||||
* @param x The x coordinate of the point.
|
||||
* @param y The y coordinate of the point.
|
||||
* @return The value of curl noise, a normalized 2D vector.
|
||||
@ -272,6 +277,7 @@ public class CloverNoise implements NoiseGenerator {
|
||||
|
||||
/**
|
||||
* Generates fractal curl 2D Clover Noise at a specific point.
|
||||
*
|
||||
* @param p The point to generate noise at.
|
||||
* @param iterations The number of iterations for the fractal noise.
|
||||
* @return The value of curl noise, a normalized 2D vector.
|
||||
@ -286,6 +292,7 @@ public class CloverNoise implements NoiseGenerator {
|
||||
|
||||
/**
|
||||
* Generates fractal curl 2D Clover Noise at a specific point.
|
||||
*
|
||||
* @param x The x coordinate of the point.
|
||||
* @param y The y coordinate of the point.
|
||||
* @param iterations The number of iterations for the fractal noise.
|
||||
@ -297,6 +304,7 @@ public class CloverNoise implements NoiseGenerator {
|
||||
|
||||
/**
|
||||
* Generates 2D Frost Noise at a specific point. See https://github.com/ValgoBoi/clover-noise/blob/master/variations/frost.md
|
||||
*
|
||||
* @param p The point to generate noise at.
|
||||
* @return The value of noise, from 0 to 1.
|
||||
*/
|
||||
@ -311,6 +319,7 @@ public class CloverNoise implements NoiseGenerator {
|
||||
|
||||
/**
|
||||
* Generates 2D Frost Noise at a specific point. See https://github.com/ValgoBoi/clover-noise/blob/master/variations/frost.md
|
||||
*
|
||||
* @param x The x coordinate of the point.
|
||||
* @param y The y coordinate of the point.
|
||||
* @return The value of noise, from 0 to 1.
|
||||
@ -321,6 +330,7 @@ public class CloverNoise implements NoiseGenerator {
|
||||
|
||||
/**
|
||||
* Generates 2D Marble Noise at a specific point. See https://github.com/ValgoBoi/clover-noise/blob/master/variations/marble.md
|
||||
*
|
||||
* @param p The point to generate noise at.
|
||||
* @return The value of noise, from 0 to 1.
|
||||
*/
|
||||
@ -345,6 +355,7 @@ public class CloverNoise implements NoiseGenerator {
|
||||
|
||||
/**
|
||||
* Generates 2D Marble Noise at a specific point. See https://github.com/ValgoBoi/clover-noise/blob/master/variations/marble.md
|
||||
*
|
||||
* @param x The x coordinate of the point.
|
||||
* @param y The y coordinate of the point.
|
||||
* @return The value of noise, from 0 to 1.
|
||||
@ -355,7 +366,7 @@ public class CloverNoise implements NoiseGenerator {
|
||||
}
|
||||
|
||||
public static class Noise3D {
|
||||
private long seed;
|
||||
private final long seed;
|
||||
|
||||
public Noise3D(long seed) {
|
||||
this.seed = seed;
|
||||
@ -469,6 +480,7 @@ public class CloverNoise implements NoiseGenerator {
|
||||
|
||||
/**
|
||||
* Generates 3D Clover Noise at a specific point.
|
||||
*
|
||||
* @param p The point to generate noise at.
|
||||
* @return The value of noise, from 0 to 1.
|
||||
*/
|
||||
@ -663,6 +675,7 @@ public class CloverNoise implements NoiseGenerator {
|
||||
|
||||
/**
|
||||
* Generates 3D Clover Noise at a specific point.
|
||||
*
|
||||
* @param x The x coordinate of the point.
|
||||
* @param y The y coordinate of the point.
|
||||
* @param z The z coordinate of the point.
|
||||
@ -674,6 +687,7 @@ public class CloverNoise implements NoiseGenerator {
|
||||
|
||||
/**
|
||||
* Generates fractal 3D Clover Noise at a specific point.
|
||||
*
|
||||
* @param p The point to generate noise at.
|
||||
* @param iterations The number of iterations for the fractal noise.
|
||||
* @return The value of noise, from 0 to 1.
|
||||
@ -695,6 +709,7 @@ public class CloverNoise implements NoiseGenerator {
|
||||
|
||||
/**
|
||||
* Generates fractal 3D Clover Noise at a specific point.
|
||||
*
|
||||
* @param x The x coordinate of the point.
|
||||
* @param y The y coordinate of the point.
|
||||
* @param z The z coordinate of the point.
|
||||
@ -709,6 +724,7 @@ public class CloverNoise implements NoiseGenerator {
|
||||
|
||||
/**
|
||||
* Generates curl 3D Clover Noise at a specific point.
|
||||
*
|
||||
* @param p The point to generate noise at.
|
||||
* @return The value of curl noise, a normalized 3D vector.
|
||||
*/
|
||||
@ -723,6 +739,7 @@ public class CloverNoise implements NoiseGenerator {
|
||||
|
||||
/**
|
||||
* Generates curl 3D Clover Noise at a specific point.
|
||||
*
|
||||
* @param x The x coordinate of the point.
|
||||
* @param y The y coordinate of the point.
|
||||
* @param z The z coordinate of the point.
|
||||
@ -734,6 +751,7 @@ public class CloverNoise implements NoiseGenerator {
|
||||
|
||||
/**
|
||||
* Generates fractal curl 3D Clover Noise at a specific point.
|
||||
*
|
||||
* @param p The point to generate noise at.
|
||||
* @param iterations The number of iterations for the fractal noise.
|
||||
* @return The value of curl noise, a normalized 3D vector.
|
||||
@ -749,6 +767,7 @@ public class CloverNoise implements NoiseGenerator {
|
||||
|
||||
/**
|
||||
* Generates fractal curl 3D Clover Noise at a specific point.
|
||||
*
|
||||
* @param x The x coordinate of the point.
|
||||
* @param y The y coordinate of the point.
|
||||
* @param z The z coordinate of the point.
|
||||
@ -761,6 +780,7 @@ public class CloverNoise implements NoiseGenerator {
|
||||
|
||||
/**
|
||||
* Generates 3D Frost Noise at a specific point. See https://github.com/ValgoBoi/clover-noise/blob/master/variations/frost.md
|
||||
*
|
||||
* @param p The point to generate noise at.
|
||||
* @return The value of noise, from 0 to 1.
|
||||
*/
|
||||
@ -775,6 +795,7 @@ public class CloverNoise implements NoiseGenerator {
|
||||
|
||||
/**
|
||||
* Generates 3D Frost Noise at a specific point. See https://github.com/ValgoBoi/clover-noise/blob/master/variations/frost.md
|
||||
*
|
||||
* @param x The x coordinate of the point.
|
||||
* @param y The y coordinate of the point.
|
||||
* @param z The z coordinate of the point.
|
||||
@ -786,6 +807,7 @@ public class CloverNoise implements NoiseGenerator {
|
||||
|
||||
/**
|
||||
* Generates 3D Marble Noise at a specific point. See https://github.com/ValgoBoi/clover-noise/blob/master/variations/marble.md
|
||||
*
|
||||
* @param p The point to generate noise at.
|
||||
* @return The value of noise, from 0 to 1.
|
||||
*/
|
||||
@ -810,6 +832,7 @@ public class CloverNoise implements NoiseGenerator {
|
||||
|
||||
/**
|
||||
* Generates 3D Marble Noise at a specific point. See https://github.com/ValgoBoi/clover-noise/blob/master/variations/marble.md
|
||||
*
|
||||
* @param x The x coordinate of the point.
|
||||
* @param y The y coordinate of the point.
|
||||
* @param z The z coordinate of the point.
|
||||
|
@ -18,7 +18,6 @@
|
||||
|
||||
package com.volmit.iris.engine.noise;
|
||||
|
||||
import com.google.common.util.concurrent.AtomicDouble;
|
||||
import com.volmit.iris.engine.interpolation.InterpolationMethod;
|
||||
import com.volmit.iris.engine.interpolation.IrisInterpolation;
|
||||
import com.volmit.iris.util.function.NoiseProvider;
|
||||
@ -40,16 +39,15 @@ public class InterpolatedNoise implements NoiseGenerator {
|
||||
|
||||
@Override
|
||||
public double noise(double x, double z) {
|
||||
return IrisInterpolation.getNoise(method, (int)x, (int)z, 32, p);
|
||||
return IrisInterpolation.getNoise(method, (int) x, (int) z, 32, p);
|
||||
}
|
||||
|
||||
@Override
|
||||
public double noise(double x, double y, double z) {
|
||||
if(z == 0)
|
||||
{
|
||||
if (z == 0) {
|
||||
return noise(x, y);
|
||||
}
|
||||
|
||||
return IrisInterpolation.getNoise(method, (int)x, (int)z, 32, p);
|
||||
return IrisInterpolation.getNoise(method, (int) x, (int) z, 32, p);
|
||||
}
|
||||
}
|
||||
|
@ -92,7 +92,7 @@ public class IrisEntityInitialSpawn {
|
||||
private Entity spawn100(Engine g, Location at) {
|
||||
try {
|
||||
return getRealEntity(g).spawn(g, at.clone().add(0.5, 1, 0.5), rng.aquire(() -> new RNG(g.getTarget().getWorld().seed() + 4)));
|
||||
} catch (Throwable e){
|
||||
} catch (Throwable e) {
|
||||
Iris.reportError(e);
|
||||
Iris.debug("Failed to retrieve real entity @ " + at);
|
||||
return null;
|
||||
|
@ -87,9 +87,8 @@ public class IrisFeature {
|
||||
return actualRadius.aquire(() -> {
|
||||
double o = 0;
|
||||
|
||||
if(fractureRadius != null)
|
||||
{
|
||||
o+=fractureRadius.getMaxFractureDistance();
|
||||
if (fractureRadius != null) {
|
||||
o += fractureRadius.getMaxFractureDistance();
|
||||
}
|
||||
|
||||
return o + IrisInterpolation.getRealRadius(getInterpolator(), getInterpolationRadius());
|
||||
|
@ -22,8 +22,6 @@ import com.google.gson.Gson;
|
||||
import com.volmit.iris.engine.cache.AtomicCache;
|
||||
import com.volmit.iris.engine.interpolation.IrisInterpolation;
|
||||
import com.volmit.iris.engine.object.annotations.Desc;
|
||||
import com.volmit.iris.engine.object.annotations.MaxNumber;
|
||||
import com.volmit.iris.engine.object.annotations.MinNumber;
|
||||
import com.volmit.iris.engine.object.annotations.Required;
|
||||
import com.volmit.iris.util.function.NoiseProvider;
|
||||
import com.volmit.iris.util.math.M;
|
||||
@ -123,12 +121,9 @@ public class IrisFeaturePositional {
|
||||
return M.lerp(1, getFeature().getObjectChance(), getStrength(x, z, rng));
|
||||
}
|
||||
|
||||
public IrisBiome filter(double x, double z, IrisBiome biome, RNG rng)
|
||||
{
|
||||
if(getFeature().getCustomBiome() != null)
|
||||
{
|
||||
if(getStrength(x, z, rng) >= getFeature().getBiomeStrengthThreshold())
|
||||
{
|
||||
public IrisBiome filter(double x, double z, IrisBiome biome, RNG rng) {
|
||||
if (getFeature().getCustomBiome() != null) {
|
||||
if (getStrength(x, z, rng) >= getFeature().getBiomeStrengthThreshold()) {
|
||||
IrisBiome b = biome.getLoader().getBiomeLoader().load(getFeature().getCustomBiome());
|
||||
b.setInferredType(biome.getInferredType());
|
||||
return b;
|
||||
@ -158,16 +153,16 @@ public class IrisFeaturePositional {
|
||||
}
|
||||
|
||||
public double distance(double x, double z, RNG rng) {
|
||||
double mul = getFeature().getFractureRadius() != null ? getFeature().getFractureRadius().getMultiplier()/2 : 1;
|
||||
double mul = getFeature().getFractureRadius() != null ? getFeature().getFractureRadius().getMultiplier() / 2 : 1;
|
||||
double mod = getFeature().getFractureRadius() != null ? getFeature().getFractureRadius().create(rng).fitDouble(-mul, mul, x, z) : 0;
|
||||
return Math.sqrt(Math.pow(this.x - (x + mod), 2) + Math.pow(this.z - (z + mod), 2));
|
||||
}
|
||||
|
||||
public double distance2(double x, double z, RNG rng) {
|
||||
double mul = getFeature().getFractureRadius() != null ? getFeature().getFractureRadius().getMultiplier()/2 : 1;
|
||||
double mul = getFeature().getFractureRadius() != null ? getFeature().getFractureRadius().getMultiplier() / 2 : 1;
|
||||
double mod = getFeature().getFractureRadius() != null ? getFeature().getFractureRadius().create(rng).fitDouble(-mul, mul, x, z) : 0;
|
||||
|
||||
return Math.pow(this.x - (x+mod), 2) + Math.pow(this.z - (z+mod), 2);
|
||||
return Math.pow(this.x - (x + mod), 2) + Math.pow(this.z - (z + mod), 2);
|
||||
}
|
||||
|
||||
private NoiseProvider getNoiseProvider(RNG rng) {
|
||||
|
@ -18,27 +18,13 @@
|
||||
|
||||
package com.volmit.iris.engine.object;
|
||||
|
||||
import com.volmit.iris.Iris;
|
||||
import com.volmit.iris.core.IrisDataManager;
|
||||
import com.volmit.iris.engine.cache.AtomicCache;
|
||||
import com.volmit.iris.engine.data.DataProvider;
|
||||
import com.volmit.iris.engine.noise.CNG;
|
||||
import com.volmit.iris.engine.object.annotations.*;
|
||||
import com.volmit.iris.util.collection.KList;
|
||||
import com.volmit.iris.util.io.IO;
|
||||
import com.volmit.iris.util.math.Position2;
|
||||
import com.volmit.iris.util.math.RNG;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.World.Environment;
|
||||
import org.bukkit.block.data.BlockData;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
|
||||
@SuppressWarnings("DefaultAnnotationParam")
|
||||
@Accessors(chain = true)
|
||||
|
@ -18,12 +18,11 @@
|
||||
|
||||
package com.volmit.iris.engine.object;
|
||||
|
||||
import com.volmit.iris.engine.cache.AtomicCache;
|
||||
import com.volmit.iris.engine.interpolation.IrisInterpolation;
|
||||
import com.volmit.iris.engine.noise.CNG;
|
||||
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.RegistryListBiome;
|
||||
import com.volmit.iris.engine.object.annotations.Required;
|
||||
import com.volmit.iris.util.collection.KList;
|
||||
import com.volmit.iris.util.math.RNG;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
@ -18,8 +18,10 @@
|
||||
|
||||
package com.volmit.iris.engine.object;
|
||||
|
||||
import com.volmit.iris.engine.object.annotations.*;
|
||||
import com.volmit.iris.util.collection.KList;
|
||||
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.Required;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
@ -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.RegistryListRegion;
|
||||
import com.volmit.iris.engine.object.annotations.Required;
|
||||
import com.volmit.iris.util.collection.KList;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
|
@ -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.RegistryListRegion;
|
||||
import com.volmit.iris.engine.object.annotations.Required;
|
||||
import com.volmit.iris.util.collection.KList;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
|
@ -21,11 +21,7 @@ package com.volmit.iris.engine.object;
|
||||
import com.volmit.iris.engine.cache.AtomicCache;
|
||||
import com.volmit.iris.engine.interpolation.IrisInterpolation;
|
||||
import com.volmit.iris.engine.noise.CNG;
|
||||
import com.volmit.iris.engine.object.annotations.ArrayType;
|
||||
import com.volmit.iris.engine.object.annotations.Desc;
|
||||
import com.volmit.iris.engine.object.annotations.MaxNumber;
|
||||
import com.volmit.iris.engine.object.annotations.MinNumber;
|
||||
import com.volmit.iris.engine.object.annotations.Required;
|
||||
import com.volmit.iris.engine.object.annotations.*;
|
||||
import com.volmit.iris.util.collection.KList;
|
||||
import com.volmit.iris.util.math.RNG;
|
||||
import lombok.AllArgsConstructor;
|
||||
|
@ -44,7 +44,6 @@ import org.bukkit.block.TileState;
|
||||
import org.bukkit.block.data.BlockData;
|
||||
import org.bukkit.block.data.Waterlogged;
|
||||
import org.bukkit.block.data.type.Leaves;
|
||||
import org.bukkit.entity.ThrownExpBottle;
|
||||
import org.bukkit.util.BlockVector;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
@ -582,8 +581,7 @@ public class IrisObject extends IrisRegistrant {
|
||||
int lowest = Integer.MAX_VALUE;
|
||||
y += yrand;
|
||||
readLock.lock();
|
||||
try
|
||||
{
|
||||
try {
|
||||
for (BlockVector g : getBlocks().keySet()) {
|
||||
BlockData d;
|
||||
TileData<? extends TileState> tile = null;
|
||||
@ -621,12 +619,9 @@ public class IrisObject extends IrisRegistrant {
|
||||
if (j.isExact() ? k.matches(data) : k.getMaterial().equals(data.getMaterial())) {
|
||||
BlockData newData = j.getReplace(rng, i.getX() + x, i.getY() + y, i.getZ() + z, rdata).clone();
|
||||
|
||||
if (newData.getMaterial() == data.getMaterial())
|
||||
{
|
||||
if (newData.getMaterial() == data.getMaterial()) {
|
||||
data = data.merge(newData);
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
data = newData;
|
||||
}
|
||||
}
|
||||
@ -680,10 +675,7 @@ public class IrisObject extends IrisRegistrant {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
catch(Throwable e)
|
||||
{
|
||||
} catch (Throwable e) {
|
||||
Iris.reportError(e);
|
||||
}
|
||||
readLock.unlock();
|
||||
|
@ -64,8 +64,7 @@ public class IrisObjectRotation {
|
||||
}
|
||||
|
||||
public IrisObject rotateCopy(IrisObject e) {
|
||||
if(e == null)
|
||||
{
|
||||
if (e == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
@ -1,6 +1,8 @@
|
||||
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.Required;
|
||||
import com.volmit.iris.util.collection.KList;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
|
@ -24,10 +24,11 @@ public class IrisTreeSize {
|
||||
|
||||
/**
|
||||
* Does the size match
|
||||
*
|
||||
* @param size the size to check match
|
||||
* @return true if it matches (fits within width and depth)
|
||||
*/
|
||||
public boolean doesMatch(IrisTreeSize size){
|
||||
public boolean doesMatch(IrisTreeSize size) {
|
||||
return (width == size.getWidth() && depth == size.getDepth()) || (depth == size.getWidth() && width == size.getDepth());
|
||||
}
|
||||
}
|
||||
|
@ -25,6 +25,7 @@ import com.volmit.iris.engine.object.IrisFeaturePositional;
|
||||
import com.volmit.iris.util.oldnbt.CompoundTag;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.DataInputStream;
|
||||
import java.io.DataOutputStream;
|
||||
import java.io.IOException;
|
||||
@ -49,8 +50,7 @@ public class ParallaxChunkMeta {
|
||||
dos.writeInt(parallaxChunkMeta.count);
|
||||
dos.writeInt(parallaxChunkMeta.features.size());
|
||||
|
||||
for(IrisFeaturePositional i : parallaxChunkMeta.features)
|
||||
{
|
||||
for (IrisFeaturePositional i : parallaxChunkMeta.features) {
|
||||
dos.writeUTF(gson.toJson(i));
|
||||
}
|
||||
}
|
||||
@ -70,8 +70,7 @@ public class ParallaxChunkMeta {
|
||||
pcm.setFeatures(new CopyOnWriteArrayList<>());
|
||||
int c = din.readInt();
|
||||
|
||||
for(int i = 0; i < c; i++)
|
||||
{
|
||||
for (int i = 0; i < c; i++) {
|
||||
pcm.getFeatures().add(gson.fromJson(din.readUTF(), IrisFeaturePositional.class));
|
||||
}
|
||||
|
||||
|
@ -28,14 +28,11 @@ import com.volmit.iris.util.collection.KMap;
|
||||
import com.volmit.iris.util.documentation.ChunkCoordinates;
|
||||
import com.volmit.iris.util.documentation.RegionCoordinates;
|
||||
import com.volmit.iris.util.format.C;
|
||||
import com.volmit.iris.util.plugin.Command;
|
||||
import com.volmit.iris.util.scheduling.J;
|
||||
import org.bukkit.block.TileState;
|
||||
import org.bukkit.block.data.BlockData;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
|
||||
@SuppressWarnings("ALL")
|
||||
public class ParallaxWorld implements ParallaxAccess {
|
||||
|
@ -19,7 +19,6 @@
|
||||
package com.volmit.iris.engine.stream.utility;
|
||||
|
||||
import com.googlecode.concurrentlinkedhashmap.ConcurrentLinkedHashMap;
|
||||
import com.volmit.iris.engine.IrisComplex;
|
||||
import com.volmit.iris.engine.cache.Cache;
|
||||
import com.volmit.iris.engine.stream.BasicStream;
|
||||
import com.volmit.iris.engine.stream.ProceduralStream;
|
||||
|
@ -100,9 +100,8 @@ public class NibbleArray implements Writable {
|
||||
}
|
||||
}
|
||||
|
||||
public byte get(int x, int y, int z)
|
||||
{
|
||||
return get(index(x,y,z));
|
||||
public byte get(int x, int y, int z) {
|
||||
return get(index(x, y, z));
|
||||
}
|
||||
|
||||
public int index(int x, int y, int z) {
|
||||
@ -111,9 +110,8 @@ public class NibbleArray implements Writable {
|
||||
|
||||
private transient int bitIndex, byteIndex, bitInByte;
|
||||
|
||||
public void set(int x, int y, int z, int nibble)
|
||||
{
|
||||
set(index(x,y,z), nibble);
|
||||
public void set(int x, int y, int z, int nibble) {
|
||||
set(index(x, y, z), nibble);
|
||||
}
|
||||
|
||||
public void set(int index, int nibble) {
|
||||
|
@ -323,9 +323,7 @@ public class IO {
|
||||
public static void writeAll(File f, Object c) throws IOException {
|
||||
try {
|
||||
f.getParentFile().mkdirs();
|
||||
}
|
||||
catch(Throwable ignored)
|
||||
{
|
||||
} catch (Throwable ignored) {
|
||||
|
||||
}
|
||||
|
||||
|
@ -92,13 +92,12 @@ public class BlockPosition {
|
||||
return var3;
|
||||
}
|
||||
|
||||
public Block toBlock(World world)
|
||||
{
|
||||
return world.getBlockAt(x,y,z);
|
||||
public Block toBlock(World world) {
|
||||
return world.getBlockAt(x, y, z);
|
||||
}
|
||||
|
||||
public BlockPosition add(int x, int y, int z) {
|
||||
return new BlockPosition(x,y,z);
|
||||
return new BlockPosition(x, y, z);
|
||||
}
|
||||
|
||||
public void min(BlockPosition i) {
|
||||
|
@ -18,11 +18,6 @@
|
||||
|
||||
package com.volmit.iris.util.math;
|
||||
|
||||
import com.volmit.iris.engine.object.IrisBiomePaletteLayer;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.block.Block;
|
||||
|
||||
public class Position2 {
|
||||
private int x;
|
||||
private int z;
|
||||
|
Loading…
x
Reference in New Issue
Block a user