mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2026-06-17 14:21:33 +00:00
Cleanup
This commit is contained in:
@@ -30,13 +30,12 @@ import com.volmit.iris.core.link.OraxenLink;
|
|||||||
import com.volmit.iris.core.nms.INMS;
|
import com.volmit.iris.core.nms.INMS;
|
||||||
import com.volmit.iris.core.project.loader.IrisData;
|
import com.volmit.iris.core.project.loader.IrisData;
|
||||||
import com.volmit.iris.core.tools.IrisToolbelt;
|
import com.volmit.iris.core.tools.IrisToolbelt;
|
||||||
import com.volmit.iris.engine.object.noise.NoiseStyle;
|
|
||||||
import com.volmit.iris.engine.platform.BukkitChunkGenerator;
|
|
||||||
import com.volmit.iris.engine.object.biome.IrisBiome;
|
import com.volmit.iris.engine.object.biome.IrisBiome;
|
||||||
import com.volmit.iris.engine.object.biome.IrisBiomeCustom;
|
import com.volmit.iris.engine.object.biome.IrisBiomeCustom;
|
||||||
import com.volmit.iris.engine.object.common.IrisWorld;
|
import com.volmit.iris.engine.object.common.IrisWorld;
|
||||||
import com.volmit.iris.engine.object.compat.IrisCompat;
|
import com.volmit.iris.engine.object.compat.IrisCompat;
|
||||||
import com.volmit.iris.engine.object.dimensional.IrisDimension;
|
import com.volmit.iris.engine.object.dimensional.IrisDimension;
|
||||||
|
import com.volmit.iris.engine.platform.BukkitChunkGenerator;
|
||||||
import com.volmit.iris.util.collection.KList;
|
import com.volmit.iris.util.collection.KList;
|
||||||
import com.volmit.iris.util.collection.KSet;
|
import com.volmit.iris.util.collection.KSet;
|
||||||
import com.volmit.iris.util.format.C;
|
import com.volmit.iris.util.format.C;
|
||||||
@@ -69,7 +68,6 @@ import org.bukkit.entity.Player;
|
|||||||
import org.bukkit.event.Event;
|
import org.bukkit.event.Event;
|
||||||
import org.bukkit.event.HandlerList;
|
import org.bukkit.event.HandlerList;
|
||||||
import org.bukkit.event.Listener;
|
import org.bukkit.event.Listener;
|
||||||
import org.bukkit.event.player.AsyncPlayerChatEvent;
|
|
||||||
import org.bukkit.generator.ChunkGenerator;
|
import org.bukkit.generator.ChunkGenerator;
|
||||||
import org.bukkit.plugin.Plugin;
|
import org.bukkit.plugin.Plugin;
|
||||||
|
|
||||||
@@ -77,7 +75,6 @@ import java.io.*;
|
|||||||
import java.lang.annotation.Annotation;
|
import java.lang.annotation.Annotation;
|
||||||
import java.net.URL;
|
import java.net.URL;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.UUID;
|
|
||||||
|
|
||||||
@SuppressWarnings("CanBeFinal")
|
@SuppressWarnings("CanBeFinal")
|
||||||
public class Iris extends VolmitPlugin implements Listener {
|
public class Iris extends VolmitPlugin implements Listener {
|
||||||
@@ -172,13 +169,9 @@ public class Iris extends VolmitPlugin implements Listener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static void callEvent(Event e) {
|
public static void callEvent(Event e) {
|
||||||
if(!e.isAsynchronous())
|
if (!e.isAsynchronous()) {
|
||||||
{
|
|
||||||
J.s(() -> Bukkit.getPluginManager().callEvent(e));
|
J.s(() -> Bukkit.getPluginManager().callEvent(e));
|
||||||
}
|
} else {
|
||||||
|
|
||||||
else
|
|
||||||
{
|
|
||||||
Bukkit.getPluginManager().callEvent(e);
|
Bukkit.getPluginManager().callEvent(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -457,18 +450,13 @@ public class Iris extends VolmitPlugin implements Listener {
|
|||||||
|
|
||||||
IrisDimension d = IrisData.loadAnyDimension(dimension);
|
IrisDimension d = IrisData.loadAnyDimension(dimension);
|
||||||
|
|
||||||
if(d == null)
|
if (d == null) {
|
||||||
{
|
|
||||||
Iris.warn("Unable to find dimension type " + id + " Looking for online packs...");
|
Iris.warn("Unable to find dimension type " + id + " Looking for online packs...");
|
||||||
d = IrisData.loadAnyDimension(dimension);
|
d = IrisData.loadAnyDimension(dimension);
|
||||||
|
|
||||||
if(d == null)
|
if (d == null) {
|
||||||
{
|
|
||||||
throw new RuntimeException("Can't find dimension " + dimension + "!");
|
throw new RuntimeException("Can't find dimension " + dimension + "!");
|
||||||
}
|
} else {
|
||||||
|
|
||||||
else
|
|
||||||
{
|
|
||||||
Iris.info("Resolved missing dimension, proceeding with generation.");
|
Iris.info("Resolved missing dimension, proceeding with generation.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -727,13 +715,9 @@ public class Iris extends VolmitPlugin implements Listener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static {
|
static {
|
||||||
try
|
try {
|
||||||
{
|
|
||||||
InstanceState.updateInstanceId();
|
InstanceState.updateInstanceId();
|
||||||
}
|
} catch (Throwable e) {
|
||||||
|
|
||||||
catch(Throwable e)
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,7 +21,6 @@ package com.volmit.iris.core;
|
|||||||
import com.volmit.iris.Iris;
|
import com.volmit.iris.Iris;
|
||||||
import com.volmit.iris.core.project.loader.IrisData;
|
import com.volmit.iris.core.project.loader.IrisData;
|
||||||
import com.volmit.iris.core.tools.IrisToolbelt;
|
import com.volmit.iris.core.tools.IrisToolbelt;
|
||||||
import com.volmit.iris.engine.framework.Engine;
|
|
||||||
import com.volmit.iris.engine.object.biome.IrisBiome;
|
import com.volmit.iris.engine.object.biome.IrisBiome;
|
||||||
import com.volmit.iris.engine.object.common.IObjectPlacer;
|
import com.volmit.iris.engine.object.common.IObjectPlacer;
|
||||||
import com.volmit.iris.engine.object.objects.IrisObject;
|
import com.volmit.iris.engine.object.objects.IrisObject;
|
||||||
|
|||||||
@@ -20,7 +20,6 @@ package com.volmit.iris.core.command;
|
|||||||
|
|
||||||
import com.volmit.iris.Iris;
|
import com.volmit.iris.Iris;
|
||||||
import com.volmit.iris.core.tools.IrisToolbelt;
|
import com.volmit.iris.core.tools.IrisToolbelt;
|
||||||
import com.volmit.iris.engine.IrisEngine;
|
|
||||||
import com.volmit.iris.util.collection.KList;
|
import com.volmit.iris.util.collection.KList;
|
||||||
import com.volmit.iris.util.plugin.MortarCommand;
|
import com.volmit.iris.util.plugin.MortarCommand;
|
||||||
import com.volmit.iris.util.plugin.VolmitSender;
|
import com.volmit.iris.util.plugin.VolmitSender;
|
||||||
|
|||||||
@@ -20,7 +20,6 @@ package com.volmit.iris.core.command;
|
|||||||
|
|
||||||
import com.volmit.iris.Iris;
|
import com.volmit.iris.Iris;
|
||||||
import com.volmit.iris.core.tools.IrisToolbelt;
|
import com.volmit.iris.core.tools.IrisToolbelt;
|
||||||
import com.volmit.iris.engine.IrisEngine;
|
|
||||||
import com.volmit.iris.engine.framework.Engine;
|
import com.volmit.iris.engine.framework.Engine;
|
||||||
import com.volmit.iris.util.collection.KList;
|
import com.volmit.iris.util.collection.KList;
|
||||||
import com.volmit.iris.util.plugin.MortarCommand;
|
import com.volmit.iris.util.plugin.MortarCommand;
|
||||||
|
|||||||
@@ -11,8 +11,6 @@ import com.volmit.iris.util.plugin.VolmitSender;
|
|||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.World;
|
import org.bukkit.World;
|
||||||
|
|
||||||
import java.util.Objects;
|
|
||||||
|
|
||||||
|
|
||||||
public class CommandIrisPregenStart extends MortarCommand {
|
public class CommandIrisPregenStart extends MortarCommand {
|
||||||
|
|
||||||
@@ -282,6 +280,7 @@ public class CommandIrisPregenStart extends MortarCommand {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Get command help
|
* Get command help
|
||||||
|
*
|
||||||
* @return help string
|
* @return help string
|
||||||
*/
|
*/
|
||||||
private String getHelp() {
|
private String getHelp() {
|
||||||
|
|||||||
@@ -22,8 +22,6 @@ import com.volmit.iris.Iris;
|
|||||||
import com.volmit.iris.core.IrisSettings;
|
import com.volmit.iris.core.IrisSettings;
|
||||||
import com.volmit.iris.core.project.loader.IrisData;
|
import com.volmit.iris.core.project.loader.IrisData;
|
||||||
import com.volmit.iris.core.tools.IrisToolbelt;
|
import com.volmit.iris.core.tools.IrisToolbelt;
|
||||||
import com.volmit.iris.engine.framework.Engine;
|
|
||||||
import com.volmit.iris.engine.platform.PlatformChunkGenerator;
|
|
||||||
import com.volmit.iris.util.collection.KList;
|
import com.volmit.iris.util.collection.KList;
|
||||||
import com.volmit.iris.util.plugin.MortarCommand;
|
import com.volmit.iris.util.plugin.MortarCommand;
|
||||||
import com.volmit.iris.util.plugin.VolmitSender;
|
import com.volmit.iris.util.plugin.VolmitSender;
|
||||||
|
|||||||
@@ -32,7 +32,6 @@ import com.volmit.iris.util.format.Form;
|
|||||||
import com.volmit.iris.util.plugin.MortarCommand;
|
import com.volmit.iris.util.plugin.MortarCommand;
|
||||||
import com.volmit.iris.util.plugin.VolmitSender;
|
import com.volmit.iris.util.plugin.VolmitSender;
|
||||||
import com.volmit.iris.util.scheduling.J;
|
import com.volmit.iris.util.scheduling.J;
|
||||||
import org.bukkit.Location;
|
|
||||||
import org.bukkit.World;
|
import org.bukkit.World;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
|
|||||||
@@ -23,11 +23,8 @@ import com.volmit.iris.core.IrisSettings;
|
|||||||
import com.volmit.iris.core.tools.IrisToolbelt;
|
import com.volmit.iris.core.tools.IrisToolbelt;
|
||||||
import com.volmit.iris.engine.platform.PlatformChunkGenerator;
|
import com.volmit.iris.engine.platform.PlatformChunkGenerator;
|
||||||
import com.volmit.iris.util.collection.KList;
|
import com.volmit.iris.util.collection.KList;
|
||||||
import com.volmit.iris.util.format.C;
|
|
||||||
import com.volmit.iris.util.parallel.MultiBurst;
|
|
||||||
import com.volmit.iris.util.plugin.MortarCommand;
|
import com.volmit.iris.util.plugin.MortarCommand;
|
||||||
import com.volmit.iris.util.plugin.VolmitSender;
|
import com.volmit.iris.util.plugin.VolmitSender;
|
||||||
import com.volmit.iris.util.scheduling.J;
|
|
||||||
import org.bukkit.World;
|
import org.bukkit.World;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ public class CommandIrisWhatFeatures extends MortarCommand {
|
|||||||
|
|
||||||
if (IrisToolbelt.isIrisWorld(c.getWorld())) {
|
if (IrisToolbelt.isIrisWorld(c.getWorld())) {
|
||||||
int m = 1;
|
int m = 1;
|
||||||
for (IrisFeaturePositional i : ((Engine) IrisToolbelt.access(c.getWorld()).getEngine()).getMantle().getFeaturesInChunk(c)) {
|
for (IrisFeaturePositional i : IrisToolbelt.access(c.getWorld()).getEngine().getMantle().getFeaturesInChunk(c)) {
|
||||||
sender.sendMessage("#" + m++ + " " + new JSONObject(new Gson().toJson(i)).toString(4));
|
sender.sendMessage("#" + m++ + " " + new JSONObject(new Gson().toJson(i)).toString(4));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -149,6 +149,7 @@ public class CommandIrisCreate extends MortarCommand {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Ran when world is created
|
* Ran when world is created
|
||||||
|
*
|
||||||
* @param sender The sender to send updates to
|
* @param sender The sender to send updates to
|
||||||
* @param world The created world
|
* @param world The created world
|
||||||
*/
|
*/
|
||||||
@@ -184,6 +185,7 @@ public class CommandIrisCreate extends MortarCommand {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a world with either Multiverse (preferred, if supported) or NMS
|
* Create a world with either Multiverse (preferred, if supported) or NMS
|
||||||
|
*
|
||||||
* @param sender The sender to send updates to
|
* @param sender The sender to send updates to
|
||||||
* @param worldName The name of the world to create
|
* @param worldName The name of the world to create
|
||||||
* @param dimension The dimension to create the world with
|
* @param dimension The dimension to create the world with
|
||||||
@@ -200,6 +202,7 @@ public class CommandIrisCreate extends MortarCommand {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a world with Multiverse
|
* Create a world with Multiverse
|
||||||
|
*
|
||||||
* @param sender The sender to send updates to
|
* @param sender The sender to send updates to
|
||||||
* @param worldName The name of the world to create
|
* @param worldName The name of the world to create
|
||||||
* @param dimension The dimension to create the world with
|
* @param dimension The dimension to create the world with
|
||||||
@@ -231,6 +234,7 @@ public class CommandIrisCreate extends MortarCommand {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a world using NMS
|
* Create a world using NMS
|
||||||
|
*
|
||||||
* @param sender The sender to send updates to
|
* @param sender The sender to send updates to
|
||||||
* @param worldName The name of the world to create
|
* @param worldName The name of the world to create
|
||||||
* @param dimension The dimension to create the world with
|
* @param dimension The dimension to create the world with
|
||||||
|
|||||||
@@ -21,7 +21,6 @@ package com.volmit.iris.core.command.world;
|
|||||||
import com.volmit.iris.Iris;
|
import com.volmit.iris.Iris;
|
||||||
import com.volmit.iris.core.tools.IrisToolbelt;
|
import com.volmit.iris.core.tools.IrisToolbelt;
|
||||||
import com.volmit.iris.engine.framework.Engine;
|
import com.volmit.iris.engine.framework.Engine;
|
||||||
import com.volmit.iris.engine.platform.PlatformChunkGenerator;
|
|
||||||
import com.volmit.iris.util.collection.KList;
|
import com.volmit.iris.util.collection.KList;
|
||||||
import com.volmit.iris.util.nbt.mca.Chunk;
|
import com.volmit.iris.util.nbt.mca.Chunk;
|
||||||
import com.volmit.iris.util.nbt.mca.MCAFile;
|
import com.volmit.iris.util.nbt.mca.MCAFile;
|
||||||
|
|||||||
@@ -21,9 +21,6 @@ package com.volmit.iris.core.edit;
|
|||||||
import com.volmit.iris.Iris;
|
import com.volmit.iris.Iris;
|
||||||
import com.volmit.iris.core.tools.IrisToolbelt;
|
import com.volmit.iris.core.tools.IrisToolbelt;
|
||||||
import com.volmit.iris.engine.framework.Engine;
|
import com.volmit.iris.engine.framework.Engine;
|
||||||
import com.volmit.iris.engine.framework.PlacedObject;
|
|
||||||
import com.volmit.iris.engine.mantle.EngineMantle;
|
|
||||||
import com.volmit.iris.engine.object.objects.IrisObjectPlacement;
|
|
||||||
import com.volmit.iris.util.collection.KList;
|
import com.volmit.iris.util.collection.KList;
|
||||||
import com.volmit.iris.util.math.BlockPosition;
|
import com.volmit.iris.util.math.BlockPosition;
|
||||||
import com.volmit.iris.util.math.RNG;
|
import com.volmit.iris.util.math.RNG;
|
||||||
|
|||||||
@@ -20,7 +20,6 @@ package com.volmit.iris.core.link;
|
|||||||
|
|
||||||
import com.volmit.iris.Iris;
|
import com.volmit.iris.Iris;
|
||||||
import com.volmit.iris.core.tools.IrisToolbelt;
|
import com.volmit.iris.core.tools.IrisToolbelt;
|
||||||
import com.volmit.iris.engine.framework.Engine;
|
|
||||||
import com.volmit.iris.engine.platform.PlatformChunkGenerator;
|
import com.volmit.iris.engine.platform.PlatformChunkGenerator;
|
||||||
import me.clip.placeholderapi.expansion.PlaceholderExpansion;
|
import me.clip.placeholderapi.expansion.PlaceholderExpansion;
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
@@ -90,7 +89,7 @@ public class IrisPapiExpansion extends PlaceholderExpansion {
|
|||||||
}
|
}
|
||||||
} else if (p.equalsIgnoreCase("terrain_height")) {
|
} else if (p.equalsIgnoreCase("terrain_height")) {
|
||||||
if (a != null) {
|
if (a != null) {
|
||||||
return (int) Math.round(a.getEngine().getHeight(l.getBlockX(), l.getBlockZ())) + "";
|
return Math.round(a.getEngine().getHeight(l.getBlockX(), l.getBlockZ())) + "";
|
||||||
}
|
}
|
||||||
} else if (p.equalsIgnoreCase("world_mode")) {
|
} else if (p.equalsIgnoreCase("world_mode")) {
|
||||||
if (a != null) {
|
if (a != null) {
|
||||||
|
|||||||
@@ -20,8 +20,8 @@ package com.volmit.iris.core.pregenerator.methods;
|
|||||||
|
|
||||||
import com.volmit.iris.core.pregenerator.PregenListener;
|
import com.volmit.iris.core.pregenerator.PregenListener;
|
||||||
import com.volmit.iris.core.pregenerator.PregeneratorMethod;
|
import com.volmit.iris.core.pregenerator.PregeneratorMethod;
|
||||||
import com.volmit.iris.engine.platform.HeadlessGenerator;
|
|
||||||
import com.volmit.iris.engine.object.common.HeadlessWorld;
|
import com.volmit.iris.engine.object.common.HeadlessWorld;
|
||||||
|
import com.volmit.iris.engine.platform.HeadlessGenerator;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
|
|
||||||
public class HeadlessPregenMethod implements PregeneratorMethod {
|
public class HeadlessPregenMethod implements PregeneratorMethod {
|
||||||
|
|||||||
@@ -20,8 +20,8 @@ package com.volmit.iris.core.pregenerator.syndicate;
|
|||||||
|
|
||||||
import com.volmit.iris.core.pregenerator.PregenListener;
|
import com.volmit.iris.core.pregenerator.PregenListener;
|
||||||
import com.volmit.iris.core.pregenerator.syndicate.command.*;
|
import com.volmit.iris.core.pregenerator.syndicate.command.*;
|
||||||
import com.volmit.iris.engine.platform.HeadlessGenerator;
|
|
||||||
import com.volmit.iris.engine.object.common.HeadlessWorld;
|
import com.volmit.iris.engine.object.common.HeadlessWorld;
|
||||||
|
import com.volmit.iris.engine.platform.HeadlessGenerator;
|
||||||
import com.volmit.iris.util.io.IO;
|
import com.volmit.iris.util.io.IO;
|
||||||
import com.volmit.iris.util.scheduling.J;
|
import com.volmit.iris.util.scheduling.J;
|
||||||
import org.zeroturnaround.zip.ZipUtil;
|
import org.zeroturnaround.zip.ZipUtil;
|
||||||
|
|||||||
@@ -24,13 +24,9 @@ import com.volmit.iris.core.IrisSettings;
|
|||||||
import com.volmit.iris.core.nms.INMS;
|
import com.volmit.iris.core.nms.INMS;
|
||||||
import com.volmit.iris.core.project.loader.IrisData;
|
import com.volmit.iris.core.project.loader.IrisData;
|
||||||
import com.volmit.iris.core.project.loader.ResourceLoader;
|
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.IrisToolbelt;
|
import com.volmit.iris.core.tools.IrisToolbelt;
|
||||||
import com.volmit.iris.core.tools.IrisWorldCreator;
|
import com.volmit.iris.core.tools.IrisWorldCreator;
|
||||||
import com.volmit.iris.engine.framework.Engine;
|
|
||||||
import com.volmit.iris.engine.object.biome.IrisBiome;
|
import com.volmit.iris.engine.object.biome.IrisBiome;
|
||||||
import com.volmit.iris.engine.object.biome.IrisBiomePaletteLayer;
|
|
||||||
import com.volmit.iris.engine.object.block.IrisBlockData;
|
import com.volmit.iris.engine.object.block.IrisBlockData;
|
||||||
import com.volmit.iris.engine.object.dimensional.IrisDimension;
|
import com.volmit.iris.engine.object.dimensional.IrisDimension;
|
||||||
import com.volmit.iris.engine.object.entity.IrisEntity;
|
import com.volmit.iris.engine.object.entity.IrisEntity;
|
||||||
@@ -50,7 +46,6 @@ import com.volmit.iris.util.io.IO;
|
|||||||
import com.volmit.iris.util.json.JSONArray;
|
import com.volmit.iris.util.json.JSONArray;
|
||||||
import com.volmit.iris.util.json.JSONObject;
|
import com.volmit.iris.util.json.JSONObject;
|
||||||
import com.volmit.iris.util.math.M;
|
import com.volmit.iris.util.math.M;
|
||||||
import com.volmit.iris.util.parallel.MultiBurst;
|
|
||||||
import com.volmit.iris.util.plugin.VolmitSender;
|
import com.volmit.iris.util.plugin.VolmitSender;
|
||||||
import com.volmit.iris.util.scheduling.ChronoLatch;
|
import com.volmit.iris.util.scheduling.ChronoLatch;
|
||||||
import com.volmit.iris.util.scheduling.J;
|
import com.volmit.iris.util.scheduling.J;
|
||||||
|
|||||||
@@ -18,12 +18,10 @@
|
|||||||
|
|
||||||
package com.volmit.iris.core.tools;
|
package com.volmit.iris.core.tools;
|
||||||
|
|
||||||
import com.sun.jna.Platform;
|
|
||||||
import com.volmit.iris.core.project.loader.IrisData;
|
import com.volmit.iris.core.project.loader.IrisData;
|
||||||
import com.volmit.iris.engine.object.common.IrisWorld;
|
import com.volmit.iris.engine.object.common.IrisWorld;
|
||||||
import com.volmit.iris.engine.object.dimensional.IrisDimension;
|
import com.volmit.iris.engine.object.dimensional.IrisDimension;
|
||||||
import com.volmit.iris.engine.platform.BukkitChunkGenerator;
|
import com.volmit.iris.engine.platform.BukkitChunkGenerator;
|
||||||
import com.volmit.iris.engine.platform.PlatformChunkGenerator;
|
|
||||||
import org.bukkit.World;
|
import org.bukkit.World;
|
||||||
import org.bukkit.WorldCreator;
|
import org.bukkit.WorldCreator;
|
||||||
import org.bukkit.generator.ChunkGenerator;
|
import org.bukkit.generator.ChunkGenerator;
|
||||||
|
|||||||
@@ -22,7 +22,6 @@ import com.google.common.util.concurrent.AtomicDouble;
|
|||||||
import com.google.gson.Gson;
|
import com.google.gson.Gson;
|
||||||
import com.volmit.iris.Iris;
|
import com.volmit.iris.Iris;
|
||||||
import com.volmit.iris.core.IrisSettings;
|
import com.volmit.iris.core.IrisSettings;
|
||||||
import com.volmit.iris.core.events.IrisEngineHotloadEvent;
|
|
||||||
import com.volmit.iris.engine.actuator.IrisBiomeActuator;
|
import com.volmit.iris.engine.actuator.IrisBiomeActuator;
|
||||||
import com.volmit.iris.engine.actuator.IrisDecorantActuator;
|
import com.volmit.iris.engine.actuator.IrisDecorantActuator;
|
||||||
import com.volmit.iris.engine.actuator.IrisTerrainIslandActuator;
|
import com.volmit.iris.engine.actuator.IrisTerrainIslandActuator;
|
||||||
@@ -41,7 +40,6 @@ import com.volmit.iris.engine.object.engine.IrisEngineData;
|
|||||||
import com.volmit.iris.engine.object.objects.IrisObjectPlacement;
|
import com.volmit.iris.engine.object.objects.IrisObjectPlacement;
|
||||||
import com.volmit.iris.engine.scripting.EngineExecutionEnvironment;
|
import com.volmit.iris.engine.scripting.EngineExecutionEnvironment;
|
||||||
import com.volmit.iris.util.atomics.AtomicRollingSequence;
|
import com.volmit.iris.util.atomics.AtomicRollingSequence;
|
||||||
import com.volmit.iris.util.collection.KList;
|
|
||||||
import com.volmit.iris.util.collection.KMap;
|
import com.volmit.iris.util.collection.KMap;
|
||||||
import com.volmit.iris.util.context.IrisContext;
|
import com.volmit.iris.util.context.IrisContext;
|
||||||
import com.volmit.iris.util.documentation.BlockCoordinates;
|
import com.volmit.iris.util.documentation.BlockCoordinates;
|
||||||
@@ -49,8 +47,6 @@ import com.volmit.iris.util.documentation.ChunkCoordinates;
|
|||||||
import com.volmit.iris.util.format.C;
|
import com.volmit.iris.util.format.C;
|
||||||
import com.volmit.iris.util.format.Form;
|
import com.volmit.iris.util.format.Form;
|
||||||
import com.volmit.iris.util.hunk.Hunk;
|
import com.volmit.iris.util.hunk.Hunk;
|
||||||
import com.volmit.iris.util.hunk.storage.AtomicDoubleHunk;
|
|
||||||
import com.volmit.iris.util.hunk.storage.AtomicLongHunk;
|
|
||||||
import com.volmit.iris.util.io.IO;
|
import com.volmit.iris.util.io.IO;
|
||||||
import com.volmit.iris.util.math.M;
|
import com.volmit.iris.util.math.M;
|
||||||
import com.volmit.iris.util.math.RNG;
|
import com.volmit.iris.util.math.RNG;
|
||||||
@@ -187,13 +183,11 @@ public class IrisEngine extends BlockPopulator implements Engine {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public double getGeneratedPerSecond() {
|
public double getGeneratedPerSecond() {
|
||||||
if(perSecondLatch.flip())
|
if (perSecondLatch.flip()) {
|
||||||
{
|
|
||||||
double g = generated.get() - generatedLast.get();
|
double g = generated.get() - generatedLast.get();
|
||||||
generatedLast.set(generated.get());
|
generatedLast.set(generated.get());
|
||||||
|
|
||||||
if(g == 0)
|
if (g == 0) {
|
||||||
{
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -21,7 +21,6 @@ package com.volmit.iris.engine;
|
|||||||
import com.volmit.iris.Iris;
|
import com.volmit.iris.Iris;
|
||||||
import com.volmit.iris.engine.framework.Engine;
|
import com.volmit.iris.engine.framework.Engine;
|
||||||
import com.volmit.iris.engine.mantle.EngineMantle;
|
import com.volmit.iris.engine.mantle.EngineMantle;
|
||||||
import com.volmit.iris.engine.mantle.IrisMantleComponent;
|
|
||||||
import com.volmit.iris.engine.mantle.MantleComponent;
|
import com.volmit.iris.engine.mantle.MantleComponent;
|
||||||
import com.volmit.iris.engine.mantle.components.MantleFeatureComponent;
|
import com.volmit.iris.engine.mantle.components.MantleFeatureComponent;
|
||||||
import com.volmit.iris.engine.mantle.components.MantleJigsawComponent;
|
import com.volmit.iris.engine.mantle.components.MantleJigsawComponent;
|
||||||
@@ -287,10 +286,7 @@ public class IrisEngineMantle implements EngineMantle {
|
|||||||
z = Math.max(max, z);
|
z = Math.max(max, z);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -47,7 +47,6 @@ import com.volmit.iris.util.documentation.BlockCoordinates;
|
|||||||
import com.volmit.iris.util.documentation.ChunkCoordinates;
|
import com.volmit.iris.util.documentation.ChunkCoordinates;
|
||||||
import com.volmit.iris.util.function.Function2;
|
import com.volmit.iris.util.function.Function2;
|
||||||
import com.volmit.iris.util.hunk.Hunk;
|
import com.volmit.iris.util.hunk.Hunk;
|
||||||
import com.volmit.iris.util.mantle.Mantle;
|
|
||||||
import com.volmit.iris.util.mantle.MantleFlag;
|
import com.volmit.iris.util.mantle.MantleFlag;
|
||||||
import com.volmit.iris.util.math.BlockPosition;
|
import com.volmit.iris.util.math.BlockPosition;
|
||||||
import com.volmit.iris.util.math.M;
|
import com.volmit.iris.util.math.M;
|
||||||
@@ -129,8 +128,7 @@ public interface Engine extends DataProvider, Fallible, LootProvider, BlockUpdat
|
|||||||
|
|
||||||
void setMinHeight(int min);
|
void setMinHeight(int min);
|
||||||
|
|
||||||
default int getMinHeight()
|
default int getMinHeight() {
|
||||||
{
|
|
||||||
return getTarget().getWorld().minHeight();
|
return getTarget().getWorld().minHeight();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -448,28 +446,23 @@ public interface Engine extends DataProvider, Fallible, LootProvider, BlockUpdat
|
|||||||
|
|
||||||
int getGenerated();
|
int getGenerated();
|
||||||
|
|
||||||
default <T> IrisPosition lookForStreamResult(T find, ProceduralStream<T> stream, Function2<T, T, Boolean> matcher, long timeout)
|
default <T> IrisPosition lookForStreamResult(T find, ProceduralStream<T> stream, Function2<T, T, Boolean> matcher, long timeout) {
|
||||||
{
|
|
||||||
AtomicInteger checked = new AtomicInteger();
|
AtomicInteger checked = new AtomicInteger();
|
||||||
AtomicLong time = new AtomicLong(M.ms());
|
AtomicLong time = new AtomicLong(M.ms());
|
||||||
AtomicReference<IrisPosition> r = new AtomicReference<>();
|
AtomicReference<IrisPosition> r = new AtomicReference<>();
|
||||||
BurstExecutor b = burst().burst();
|
BurstExecutor b = burst().burst();
|
||||||
|
|
||||||
while(M.ms() - time.get() < timeout && r.get() == null)
|
while (M.ms() - time.get() < timeout && r.get() == null) {
|
||||||
{
|
|
||||||
b.queue(() -> {
|
b.queue(() -> {
|
||||||
for(int i = 0; i < 1000; i++)
|
for (int i = 0; i < 1000; i++) {
|
||||||
{
|
if (M.ms() - time.get() > timeout) {
|
||||||
if(M.ms() - time.get() > timeout)
|
|
||||||
{
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
int x = RNG.r.i(-29999970, 29999970);
|
int x = RNG.r.i(-29999970, 29999970);
|
||||||
int z = RNG.r.i(-29999970, 29999970);
|
int z = RNG.r.i(-29999970, 29999970);
|
||||||
checked.incrementAndGet();
|
checked.incrementAndGet();
|
||||||
if(matcher.apply(stream.get(x, z), find))
|
if (matcher.apply(stream.get(x, z), find)) {
|
||||||
{
|
|
||||||
r.set(new IrisPosition(x, 120, z));
|
r.set(new IrisPosition(x, 120, z));
|
||||||
time.set(0);
|
time.set(0);
|
||||||
}
|
}
|
||||||
@@ -618,8 +611,7 @@ public interface Engine extends DataProvider, Fallible, LootProvider, BlockUpdat
|
|||||||
|
|
||||||
double getGeneratedPerSecond();
|
double getGeneratedPerSecond();
|
||||||
|
|
||||||
default int getHeight()
|
default int getHeight() {
|
||||||
{
|
|
||||||
return getWorld().getHeight();
|
return getWorld().getHeight();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -633,12 +625,10 @@ public interface Engine extends DataProvider, Fallible, LootProvider, BlockUpdat
|
|||||||
return getSurfaceBiome(x, z);
|
return getSurfaceBiome(x, z);
|
||||||
}
|
}
|
||||||
|
|
||||||
default String getObjectPlacementKey(int x, int y, int z)
|
default String getObjectPlacementKey(int x, int y, int z) {
|
||||||
{
|
|
||||||
PlacedObject o = getObjectPlacement(x, y, z);
|
PlacedObject o = getObjectPlacement(x, y, z);
|
||||||
|
|
||||||
if(o != null && o.getObject() != null)
|
if (o != null && o.getObject() != null) {
|
||||||
{
|
|
||||||
return o.getObject().getLoadKey() + "@" + o.getId();
|
return o.getObject().getLoadKey() + "@" + o.getId();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -55,8 +55,7 @@ public abstract class EngineAssignedWorldManager extends EngineAssignedComponent
|
|||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void on(IrisEngineHotloadEvent e) {
|
public void on(IrisEngineHotloadEvent e) {
|
||||||
for(Player i : e.getEngine().getWorld().getPlayers())
|
for (Player i : e.getEngine().getWorld().getPlayers()) {
|
||||||
{
|
|
||||||
i.playSound(i.getLocation(), Sound.ITEM_TRIDENT_RETURN, 1f, 1.6f);
|
i.playSound(i.getLocation(), Sound.ITEM_TRIDENT_RETURN, 1f, 1.6f);
|
||||||
VolmitSender s = new VolmitSender(i);
|
VolmitSender s = new VolmitSender(i);
|
||||||
s.sendTitle(C.IRIS + "Engine " + C.AQUA + "<font:minecraft:uniform>Hotloaded", 70, 60, 410);
|
s.sendTitle(C.IRIS + "Engine " + C.AQUA + "<font:minecraft:uniform>Hotloaded", 70, 60, 410);
|
||||||
|
|||||||
@@ -41,8 +41,7 @@ public class EngineTarget {
|
|||||||
IrisSettings.getThreadCount(IrisSettings.get().getConcurrency().getEngineThreadCount()));
|
IrisSettings.getThreadCount(IrisSettings.get().getConcurrency().getEngineThreadCount()));
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getHeight()
|
public int getHeight() {
|
||||||
{
|
|
||||||
return world.maxHeight() - world.minHeight();
|
return world.maxHeight() - world.minHeight();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -31,7 +31,6 @@ import com.volmit.iris.util.collection.KList;
|
|||||||
import com.volmit.iris.util.data.B;
|
import com.volmit.iris.util.data.B;
|
||||||
import com.volmit.iris.util.documentation.BlockCoordinates;
|
import com.volmit.iris.util.documentation.BlockCoordinates;
|
||||||
import com.volmit.iris.util.documentation.ChunkCoordinates;
|
import com.volmit.iris.util.documentation.ChunkCoordinates;
|
||||||
import com.volmit.iris.util.format.Form;
|
|
||||||
import com.volmit.iris.util.hunk.Hunk;
|
import com.volmit.iris.util.hunk.Hunk;
|
||||||
import com.volmit.iris.util.mantle.Mantle;
|
import com.volmit.iris.util.mantle.Mantle;
|
||||||
import com.volmit.iris.util.mantle.MantleFlag;
|
import com.volmit.iris.util.mantle.MantleFlag;
|
||||||
@@ -46,7 +45,6 @@ import java.util.Collections;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.concurrent.CompletableFuture;
|
import java.util.concurrent.CompletableFuture;
|
||||||
import java.util.concurrent.ExecutionException;
|
import java.util.concurrent.ExecutionException;
|
||||||
import java.util.concurrent.atomic.AtomicInteger;
|
|
||||||
import java.util.function.Consumer;
|
import java.util.function.Consumer;
|
||||||
|
|
||||||
// TODO: MOVE PLACER OUT OF MATTER INTO ITS OWN THING
|
// TODO: MOVE PLACER OUT OF MATTER INTO ITS OWN THING
|
||||||
@@ -156,28 +154,23 @@ public interface EngineMantle extends IObjectPlacer {
|
|||||||
getMantle().close();
|
getMantle().close();
|
||||||
}
|
}
|
||||||
|
|
||||||
default void saveAllNow()
|
default void saveAllNow() {
|
||||||
{
|
|
||||||
getMantle().saveAll();
|
getMantle().saveAll();
|
||||||
}
|
}
|
||||||
|
|
||||||
default void save()
|
default void save() {
|
||||||
{
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
default void trim()
|
default void trim() {
|
||||||
{
|
|
||||||
getMantle().trim(60000);
|
getMantle().trim(60000);
|
||||||
}
|
}
|
||||||
|
|
||||||
default MultiBurst burst()
|
default MultiBurst burst() {
|
||||||
{
|
|
||||||
return getEngine().burst();
|
return getEngine().burst();
|
||||||
}
|
}
|
||||||
|
|
||||||
default int getRealRadius()
|
default int getRealRadius() {
|
||||||
{
|
|
||||||
try {
|
try {
|
||||||
return (int) Math.ceil(getRadius().get() / 2D);
|
return (int) Math.ceil(getRadius().get() / 2D);
|
||||||
} catch (InterruptedException e) {
|
} catch (InterruptedException e) {
|
||||||
@@ -191,8 +184,7 @@ public interface EngineMantle extends IObjectPlacer {
|
|||||||
|
|
||||||
|
|
||||||
@ChunkCoordinates
|
@ChunkCoordinates
|
||||||
default void generateMatter(int x, int z)
|
default void generateMatter(int x, int z) {
|
||||||
{
|
|
||||||
if (!getEngine().getDimension().isUseMantle()) {
|
if (!getEngine().getDimension().isUseMantle()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -217,14 +209,12 @@ public interface EngineMantle extends IObjectPlacer {
|
|||||||
burst().burst(post);
|
burst().burst(post);
|
||||||
}
|
}
|
||||||
|
|
||||||
default void generateMantleComponent(int x, int z, MantleComponent c, Consumer<Runnable> post)
|
default void generateMantleComponent(int x, int z, MantleComponent c, Consumer<Runnable> post) {
|
||||||
{
|
|
||||||
getMantle().raiseFlag(x, z, c.getFlag(), () -> c.generateLayer(x, z, post));
|
getMantle().raiseFlag(x, z, c.getFlag(), () -> c.generateLayer(x, z, post));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ChunkCoordinates
|
@ChunkCoordinates
|
||||||
default <T> void insertMatter(int x, int z, Class<T> t, Hunk<T> blocks)
|
default <T> void insertMatter(int x, int z, Class<T> t, Hunk<T> blocks) {
|
||||||
{
|
|
||||||
if (!getEngine().getDimension().isUseMantle()) {
|
if (!getEngine().getDimension().isUseMantle()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -233,21 +223,18 @@ public interface EngineMantle extends IObjectPlacer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@BlockCoordinates
|
@BlockCoordinates
|
||||||
default void updateBlock(int x, int y, int z)
|
default void updateBlock(int x, int y, int z) {
|
||||||
{
|
|
||||||
getMantle().flag(x >> 4, z >> 4, MantleFlag.UPDATE, true);
|
getMantle().flag(x >> 4, z >> 4, MantleFlag.UPDATE, true);
|
||||||
getMantle().set(x, y, z, true);
|
getMantle().set(x, y, z, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ChunkCoordinates
|
@ChunkCoordinates
|
||||||
default KList<IrisFeaturePositional> getFeaturesInChunk(Chunk c)
|
default KList<IrisFeaturePositional> getFeaturesInChunk(Chunk c) {
|
||||||
{
|
|
||||||
return getFeaturesInChunk(c.getX(), c.getZ());
|
return getFeaturesInChunk(c.getX(), c.getZ());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ChunkCoordinates
|
@ChunkCoordinates
|
||||||
default KList<IrisFeaturePositional> getFeaturesInChunk(int x, int z)
|
default KList<IrisFeaturePositional> getFeaturesInChunk(int x, int z) {
|
||||||
{
|
|
||||||
KList<IrisFeaturePositional> pos = new KList<>();
|
KList<IrisFeaturePositional> pos = new KList<>();
|
||||||
getMantle().iterateChunk(x, z, IrisFeaturePositional.class, (a, b, c, f) -> pos.add(f), MantleFlag.FEATURE);
|
getMantle().iterateChunk(x, z, IrisFeaturePositional.class, (a, b, c, f) -> pos.add(f), MantleFlag.FEATURE);
|
||||||
return pos;
|
return pos;
|
||||||
|
|||||||
@@ -27,44 +27,35 @@ import com.volmit.iris.util.mantle.MantleFlag;
|
|||||||
import com.volmit.iris.util.parallel.BurstExecutor;
|
import com.volmit.iris.util.parallel.BurstExecutor;
|
||||||
|
|
||||||
import java.util.function.Consumer;
|
import java.util.function.Consumer;
|
||||||
import java.util.function.Supplier;
|
|
||||||
|
|
||||||
public interface MantleComponent
|
public interface MantleComponent {
|
||||||
{
|
default int getRadius() {
|
||||||
default int getRadius()
|
|
||||||
{
|
|
||||||
return getEngineMantle().getRealRadius();
|
return getEngineMantle().getRealRadius();
|
||||||
}
|
}
|
||||||
|
|
||||||
default IrisData getData()
|
default IrisData getData() {
|
||||||
{
|
|
||||||
return getEngineMantle().getData();
|
return getEngineMantle().getData();
|
||||||
}
|
}
|
||||||
|
|
||||||
default IrisDimension getDimension()
|
default IrisDimension getDimension() {
|
||||||
{
|
|
||||||
return getEngineMantle().getEngine().getDimension();
|
return getEngineMantle().getEngine().getDimension();
|
||||||
}
|
}
|
||||||
|
|
||||||
default IrisComplex getComplex()
|
default IrisComplex getComplex() {
|
||||||
{
|
|
||||||
return getEngineMantle().getComplex();
|
return getEngineMantle().getComplex();
|
||||||
}
|
}
|
||||||
|
|
||||||
default long seed()
|
default long seed() {
|
||||||
{
|
|
||||||
return getEngineMantle().getEngine().getTarget().getWorld().seed();
|
return getEngineMantle().getEngine().getTarget().getWorld().seed();
|
||||||
}
|
}
|
||||||
|
|
||||||
default BurstExecutor burst()
|
default BurstExecutor burst() {
|
||||||
{
|
|
||||||
return getEngineMantle().getEngine().burst().burst();
|
return getEngineMantle().getEngine().burst().burst();
|
||||||
}
|
}
|
||||||
|
|
||||||
EngineMantle getEngineMantle();
|
EngineMantle getEngineMantle();
|
||||||
|
|
||||||
default Mantle getMantle()
|
default Mantle getMantle() {
|
||||||
{
|
|
||||||
return getEngineMantle().getMantle();
|
return getEngineMantle().getMantle();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -29,7 +29,6 @@ import com.volmit.iris.util.collection.KList;
|
|||||||
import com.volmit.iris.util.documentation.ChunkCoordinates;
|
import com.volmit.iris.util.documentation.ChunkCoordinates;
|
||||||
import com.volmit.iris.util.mantle.MantleFlag;
|
import com.volmit.iris.util.mantle.MantleFlag;
|
||||||
import com.volmit.iris.util.math.RNG;
|
import com.volmit.iris.util.math.RNG;
|
||||||
import com.volmit.iris.util.parallel.BurstExecutor;
|
|
||||||
|
|
||||||
import java.util.function.Consumer;
|
import java.util.function.Consumer;
|
||||||
|
|
||||||
|
|||||||
@@ -33,13 +33,11 @@ import com.volmit.iris.util.documentation.ChunkCoordinates;
|
|||||||
import com.volmit.iris.util.mantle.MantleFlag;
|
import com.volmit.iris.util.mantle.MantleFlag;
|
||||||
import com.volmit.iris.util.math.Position2;
|
import com.volmit.iris.util.math.Position2;
|
||||||
import com.volmit.iris.util.math.RNG;
|
import com.volmit.iris.util.math.RNG;
|
||||||
import com.volmit.iris.util.parallel.BurstExecutor;
|
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.function.Consumer;
|
import java.util.function.Consumer;
|
||||||
|
|
||||||
public class MantleJigsawComponent extends IrisMantleComponent
|
public class MantleJigsawComponent extends IrisMantleComponent {
|
||||||
{
|
|
||||||
public MantleJigsawComponent(EngineMantle engineMantle) {
|
public MantleJigsawComponent(EngineMantle engineMantle) {
|
||||||
super(engineMantle, MantleFlag.JIGSAW);
|
super(engineMantle, MantleFlag.JIGSAW);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -31,11 +31,8 @@ import com.volmit.iris.engine.object.objects.IrisObjectPlacement;
|
|||||||
import com.volmit.iris.engine.object.regional.IrisRegion;
|
import com.volmit.iris.engine.object.regional.IrisRegion;
|
||||||
import com.volmit.iris.util.documentation.BlockCoordinates;
|
import com.volmit.iris.util.documentation.BlockCoordinates;
|
||||||
import com.volmit.iris.util.documentation.ChunkCoordinates;
|
import com.volmit.iris.util.documentation.ChunkCoordinates;
|
||||||
import com.volmit.iris.util.format.Form;
|
|
||||||
import com.volmit.iris.util.mantle.MantleFlag;
|
import com.volmit.iris.util.mantle.MantleFlag;
|
||||||
import com.volmit.iris.util.math.RNG;
|
import com.volmit.iris.util.math.RNG;
|
||||||
import com.volmit.iris.util.parallel.BurstExecutor;
|
|
||||||
import com.volmit.iris.util.scheduling.PrecisionStopwatch;
|
|
||||||
|
|
||||||
import java.util.function.Consumer;
|
import java.util.function.Consumer;
|
||||||
|
|
||||||
@@ -124,10 +121,7 @@ public class MantleObjectComponent extends IrisMantleComponent {
|
|||||||
|
|
||||||
if (objectPlacement.usesFeatures()) {
|
if (objectPlacement.usesFeatures()) {
|
||||||
r.run();
|
r.run();
|
||||||
}
|
} else {
|
||||||
|
|
||||||
else
|
|
||||||
{
|
|
||||||
post.accept(r);
|
post.accept(r);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,7 +22,6 @@ import com.volmit.iris.Iris;
|
|||||||
import com.volmit.iris.core.gui.components.RenderType;
|
import com.volmit.iris.core.gui.components.RenderType;
|
||||||
import com.volmit.iris.core.project.loader.IrisData;
|
import com.volmit.iris.core.project.loader.IrisData;
|
||||||
import com.volmit.iris.core.project.loader.IrisRegistrant;
|
import com.volmit.iris.core.project.loader.IrisRegistrant;
|
||||||
import com.volmit.iris.core.tools.IrisToolbelt;
|
|
||||||
import com.volmit.iris.engine.IrisComplex;
|
import com.volmit.iris.engine.IrisComplex;
|
||||||
import com.volmit.iris.engine.data.cache.AtomicCache;
|
import com.volmit.iris.engine.data.cache.AtomicCache;
|
||||||
import com.volmit.iris.engine.framework.Engine;
|
import com.volmit.iris.engine.framework.Engine;
|
||||||
|
|||||||
@@ -21,9 +21,9 @@ package com.volmit.iris.engine.object.common;
|
|||||||
import com.volmit.iris.Iris;
|
import com.volmit.iris.Iris;
|
||||||
import com.volmit.iris.core.project.loader.IrisData;
|
import com.volmit.iris.core.project.loader.IrisData;
|
||||||
import com.volmit.iris.core.tools.IrisToolbelt;
|
import com.volmit.iris.core.tools.IrisToolbelt;
|
||||||
import com.volmit.iris.engine.platform.HeadlessGenerator;
|
|
||||||
import com.volmit.iris.engine.platform.BukkitChunkGenerator;
|
|
||||||
import com.volmit.iris.engine.object.dimensional.IrisDimension;
|
import com.volmit.iris.engine.object.dimensional.IrisDimension;
|
||||||
|
import com.volmit.iris.engine.platform.BukkitChunkGenerator;
|
||||||
|
import com.volmit.iris.engine.platform.HeadlessGenerator;
|
||||||
import com.volmit.iris.util.plugin.VolmitSender;
|
import com.volmit.iris.util.plugin.VolmitSender;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
|
|||||||
@@ -81,8 +81,7 @@ public class IrisWorld {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void bind(World world) {
|
public void bind(World world) {
|
||||||
if(hasRealWorld())
|
if (hasRealWorld()) {
|
||||||
{
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -29,7 +29,6 @@ import lombok.AllArgsConstructor;
|
|||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
import lombok.experimental.Accessors;
|
import lombok.experimental.Accessors;
|
||||||
import net.minecraft.world.level.GeneratorAccess;
|
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
import org.bukkit.Particle;
|
import org.bukkit.Particle;
|
||||||
import org.bukkit.Sound;
|
import org.bukkit.Sound;
|
||||||
|
|||||||
@@ -19,21 +19,13 @@
|
|||||||
package com.volmit.iris.engine.platform;
|
package com.volmit.iris.engine.platform;
|
||||||
|
|
||||||
import com.volmit.iris.Iris;
|
import com.volmit.iris.Iris;
|
||||||
import com.volmit.iris.core.events.IrisEngineHotloadEvent;
|
|
||||||
import com.volmit.iris.core.project.loader.IrisData;
|
|
||||||
import com.volmit.iris.engine.IrisEngine;
|
|
||||||
import com.volmit.iris.engine.data.chunk.TerrainChunk;
|
import com.volmit.iris.engine.data.chunk.TerrainChunk;
|
||||||
import com.volmit.iris.engine.framework.Engine;
|
import com.volmit.iris.engine.framework.Engine;
|
||||||
import com.volmit.iris.engine.framework.EngineTarget;
|
|
||||||
import com.volmit.iris.engine.object.common.IrisWorld;
|
import com.volmit.iris.engine.object.common.IrisWorld;
|
||||||
import com.volmit.iris.engine.object.dimensional.IrisDimension;
|
|
||||||
import com.volmit.iris.util.collection.KList;
|
import com.volmit.iris.util.collection.KList;
|
||||||
import com.volmit.iris.util.hunk.Hunk;
|
import com.volmit.iris.util.hunk.Hunk;
|
||||||
import com.volmit.iris.util.io.IO;
|
|
||||||
import com.volmit.iris.util.io.ReactiveFolder;
|
import com.volmit.iris.util.io.ReactiveFolder;
|
||||||
import com.volmit.iris.util.parallel.MultiBurst;
|
|
||||||
import com.volmit.iris.util.scheduling.ChronoLatch;
|
import com.volmit.iris.util.scheduling.ChronoLatch;
|
||||||
import com.volmit.iris.util.scheduling.J;
|
|
||||||
import com.volmit.iris.util.scheduling.Looper;
|
import com.volmit.iris.util.scheduling.Looper;
|
||||||
import com.volmit.iris.util.scheduling.PrecisionStopwatch;
|
import com.volmit.iris.util.scheduling.PrecisionStopwatch;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
@@ -48,7 +40,6 @@ import org.jetbrains.annotations.NotNull;
|
|||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
import java.util.concurrent.atomic.AtomicBoolean;
|
|
||||||
|
|
||||||
public class BukkitChunkGenerator extends ChunkGenerator implements PlatformChunkGenerator {
|
public class BukkitChunkGenerator extends ChunkGenerator implements PlatformChunkGenerator {
|
||||||
private final EngineProvider provider;
|
private final EngineProvider provider;
|
||||||
@@ -61,8 +52,7 @@ public class BukkitChunkGenerator extends ChunkGenerator implements PlatformChun
|
|||||||
private final Looper hotloader;
|
private final Looper hotloader;
|
||||||
private final boolean studio;
|
private final boolean studio;
|
||||||
|
|
||||||
public BukkitChunkGenerator(IrisWorld world, boolean studio, File dataLocation, String dimensionKey)
|
public BukkitChunkGenerator(IrisWorld world, boolean studio, File dataLocation, String dimensionKey) {
|
||||||
{
|
|
||||||
populators = new KList<>();
|
populators = new KList<>();
|
||||||
this.world = world;
|
this.world = world;
|
||||||
this.hotloadChecker = new ChronoLatch(1000, false);
|
this.hotloadChecker = new ChronoLatch(1000, false);
|
||||||
@@ -76,8 +66,7 @@ public class BukkitChunkGenerator extends ChunkGenerator implements PlatformChun
|
|||||||
this.hotloader = new Looper() {
|
this.hotloader = new Looper() {
|
||||||
@Override
|
@Override
|
||||||
protected long loop() {
|
protected long loop() {
|
||||||
if(hotloadChecker.flip())
|
if (hotloadChecker.flip()) {
|
||||||
{
|
|
||||||
folder.check();
|
folder.check();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -89,8 +78,7 @@ public class BukkitChunkGenerator extends ChunkGenerator implements PlatformChun
|
|||||||
hotloader.setName(getTarget().getWorld().name() + " Hotloader");
|
hotloader.setName(getTarget().getWorld().name() + " Hotloader");
|
||||||
}
|
}
|
||||||
|
|
||||||
public Engine getEngine()
|
public Engine getEngine() {
|
||||||
{
|
|
||||||
return provider.getEngine();
|
return provider.getEngine();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -115,8 +103,7 @@ public class BukkitChunkGenerator extends ChunkGenerator implements PlatformChun
|
|||||||
initialize();
|
initialize();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void initialize()
|
private void initialize() {
|
||||||
{
|
|
||||||
provider.provideEngine(world, dimensionKey, dataLocation, isStudio(), (e) -> {
|
provider.provideEngine(world, dimensionKey, dataLocation, isStudio(), (e) -> {
|
||||||
populators.clear();
|
populators.clear();
|
||||||
populators.add((BlockPopulator) e);
|
populators.add((BlockPopulator) e);
|
||||||
@@ -126,8 +113,7 @@ public class BukkitChunkGenerator extends ChunkGenerator implements PlatformChun
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public @NotNull ChunkData generateChunkData(@NotNull World world, @NotNull Random ignored, int x, int z, @NotNull BiomeGrid biome) {
|
public @NotNull ChunkData generateChunkData(@NotNull World world, @NotNull Random ignored, int x, int z, @NotNull BiomeGrid biome) {
|
||||||
try
|
try {
|
||||||
{
|
|
||||||
Iris.debug("Generated " + x + " " + z);
|
Iris.debug("Generated " + x + " " + z);
|
||||||
PrecisionStopwatch ps = PrecisionStopwatch.start();
|
PrecisionStopwatch ps = PrecisionStopwatch.start();
|
||||||
TerrainChunk tc = TerrainChunk.create(world, biome);
|
TerrainChunk tc = TerrainChunk.create(world, biome);
|
||||||
@@ -136,10 +122,7 @@ public class BukkitChunkGenerator extends ChunkGenerator implements PlatformChun
|
|||||||
this.world.bind(world);
|
this.world.bind(world);
|
||||||
getEngine().generate(x * 16, z * 16, blocks, biomes, true);
|
getEngine().generate(x * 16, z * 16, blocks, biomes, true);
|
||||||
return tc.getRaw();
|
return tc.getRaw();
|
||||||
}
|
} catch (Throwable e) {
|
||||||
|
|
||||||
catch(Throwable e)
|
|
||||||
{
|
|
||||||
Iris.error("======================================");
|
Iris.error("======================================");
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
Iris.reportErrorChunk(x, z, e, "CHUNK");
|
Iris.reportErrorChunk(x, z, e, "CHUNK");
|
||||||
|
|||||||
@@ -27,7 +27,6 @@ import com.volmit.iris.engine.framework.EngineTarget;
|
|||||||
import com.volmit.iris.engine.object.common.IrisWorld;
|
import com.volmit.iris.engine.object.common.IrisWorld;
|
||||||
import com.volmit.iris.engine.object.dimensional.IrisDimension;
|
import com.volmit.iris.engine.object.dimensional.IrisDimension;
|
||||||
import com.volmit.iris.util.parallel.MultiBurst;
|
import com.volmit.iris.util.parallel.MultiBurst;
|
||||||
import org.bukkit.generator.BlockPopulator;
|
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.util.concurrent.CompletableFuture;
|
import java.util.concurrent.CompletableFuture;
|
||||||
@@ -51,13 +50,11 @@ public class EngineProvider {
|
|||||||
engine.get().whenComplete((e, x) -> Iris.callEvent(new IrisEngineHotloadEvent(e)));
|
engine.get().whenComplete((e, x) -> Iris.callEvent(new IrisEngineHotloadEvent(e)));
|
||||||
}
|
}
|
||||||
|
|
||||||
public Engine getEngine()
|
public Engine getEngine() {
|
||||||
{
|
|
||||||
try {
|
try {
|
||||||
Engine e = engine.get().get();
|
Engine e = engine.get().get();
|
||||||
|
|
||||||
if(e == null)
|
if (e == null) {
|
||||||
{
|
|
||||||
throw new RuntimeException("NULL");
|
throw new RuntimeException("NULL");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -72,12 +69,10 @@ public class EngineProvider {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void close() {
|
public void close() {
|
||||||
if(engine.get() != null && engine.get().isDone())
|
if (engine.get() != null && engine.get().isDone()) {
|
||||||
{
|
|
||||||
Engine e = getEngine();
|
Engine e = getEngine();
|
||||||
|
|
||||||
if(e != null)
|
if (e != null) {
|
||||||
{
|
|
||||||
e.close();
|
e.close();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,11 +23,9 @@ import com.volmit.iris.core.IrisSettings;
|
|||||||
import com.volmit.iris.core.nms.INMS;
|
import com.volmit.iris.core.nms.INMS;
|
||||||
import com.volmit.iris.core.pregenerator.PregenListener;
|
import com.volmit.iris.core.pregenerator.PregenListener;
|
||||||
import com.volmit.iris.core.pregenerator.PregenTask;
|
import com.volmit.iris.core.pregenerator.PregenTask;
|
||||||
import com.volmit.iris.engine.IrisEngine;
|
|
||||||
import com.volmit.iris.engine.data.chunk.MCATerrainChunk;
|
import com.volmit.iris.engine.data.chunk.MCATerrainChunk;
|
||||||
import com.volmit.iris.engine.data.chunk.TerrainChunk;
|
import com.volmit.iris.engine.data.chunk.TerrainChunk;
|
||||||
import com.volmit.iris.engine.framework.Engine;
|
import com.volmit.iris.engine.framework.Engine;
|
||||||
import com.volmit.iris.engine.framework.EngineTarget;
|
|
||||||
import com.volmit.iris.engine.object.common.HeadlessWorld;
|
import com.volmit.iris.engine.object.common.HeadlessWorld;
|
||||||
import com.volmit.iris.util.collection.KList;
|
import com.volmit.iris.util.collection.KList;
|
||||||
import com.volmit.iris.util.documentation.ChunkCoordinates;
|
import com.volmit.iris.util.documentation.ChunkCoordinates;
|
||||||
@@ -61,7 +59,8 @@ public class HeadlessGenerator implements PlatformChunkGenerator {
|
|||||||
burst = new MultiBurst("Iris Headless Generator", 9, IrisSettings.getThreadCount(IrisSettings.get().getConcurrency().getPregenThreadCount()));
|
burst = new MultiBurst("Iris Headless Generator", 9, IrisSettings.getThreadCount(IrisSettings.get().getConcurrency().getPregenThreadCount()));
|
||||||
writer = new NBTWorld(world.getWorld().worldFolder());
|
writer = new NBTWorld(world.getWorld().worldFolder());
|
||||||
provider = new EngineProvider();
|
provider = new EngineProvider();
|
||||||
provider.provideEngine(world.getWorld(), world.getDimension().getLoadKey(), world.getDimension().getLoader().getDataFolder(), isStudio(), (e) -> {});
|
provider.provideEngine(world.getWorld(), world.getDimension().getLoadKey(), world.getDimension().getLoader().getDataFolder(), isStudio(), (e) -> {
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@ChunkCoordinates
|
@ChunkCoordinates
|
||||||
|
|||||||
@@ -24,21 +24,17 @@ import com.volmit.iris.engine.framework.EngineTarget;
|
|||||||
import com.volmit.iris.engine.framework.Hotloadable;
|
import com.volmit.iris.engine.framework.Hotloadable;
|
||||||
import com.volmit.iris.util.data.DataProvider;
|
import com.volmit.iris.util.data.DataProvider;
|
||||||
|
|
||||||
import java.io.File;
|
|
||||||
|
|
||||||
public interface PlatformChunkGenerator extends Hotloadable, DataProvider {
|
public interface PlatformChunkGenerator extends Hotloadable, DataProvider {
|
||||||
Engine getEngine();
|
Engine getEngine();
|
||||||
|
|
||||||
boolean isHeadless();
|
boolean isHeadless();
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
default IrisData getData()
|
default IrisData getData() {
|
||||||
{
|
|
||||||
return getEngine().getData();
|
return getEngine().getData();
|
||||||
}
|
}
|
||||||
|
|
||||||
default EngineTarget getTarget()
|
default EngineTarget getTarget() {
|
||||||
{
|
|
||||||
return getEngine().getTarget();
|
return getEngine().getTarget();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -18,43 +18,34 @@
|
|||||||
|
|
||||||
package com.volmit.iris.util.collection;
|
package com.volmit.iris.util.collection;
|
||||||
|
|
||||||
public class StateList
|
public class StateList {
|
||||||
{
|
|
||||||
private final KList<String> states;
|
private final KList<String> states;
|
||||||
|
|
||||||
public StateList(String... states)
|
public StateList(String... states) {
|
||||||
{
|
|
||||||
this.states = new KList<String>(states);
|
this.states = new KList<String>(states);
|
||||||
|
|
||||||
if(getBits() > 64)
|
if (getBits() > 64) {
|
||||||
{
|
|
||||||
throw new RuntimeException("StateLists cannot exceed 64 bits! You are trying to use " + getBits() + " bits!");
|
throw new RuntimeException("StateLists cannot exceed 64 bits! You are trying to use " + getBits() + " bits!");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public StateList(Enum<?>... states)
|
public StateList(Enum<?>... states) {
|
||||||
{
|
|
||||||
this.states = new KList<Enum<?>>().convert(Enum::name);
|
this.states = new KList<Enum<?>>().convert(Enum::name);
|
||||||
|
|
||||||
if(getBits() > 64)
|
if (getBits() > 64) {
|
||||||
{
|
|
||||||
throw new RuntimeException("StateLists cannot exceed 64 bits! You are trying to use " + getBits() + " bits!");
|
throw new RuntimeException("StateLists cannot exceed 64 bits! You are trying to use " + getBits() + " bits!");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public long max()
|
public long max() {
|
||||||
{
|
|
||||||
return (long) (Math.pow(2, getBits()) - 1);
|
return (long) (Math.pow(2, getBits()) - 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
public KList<String> getEnabled(long list)
|
public KList<String> getEnabled(long list) {
|
||||||
{
|
|
||||||
KList<String> f = new KList<>();
|
KList<String> f = new KList<>();
|
||||||
|
|
||||||
for(String i : states)
|
for (String i : states) {
|
||||||
{
|
if (is(list, i)) {
|
||||||
if(is(list, i))
|
|
||||||
{
|
|
||||||
f.add(i);
|
f.add(i);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -62,65 +53,52 @@ public class StateList
|
|||||||
return f;
|
return f;
|
||||||
}
|
}
|
||||||
|
|
||||||
public long of(String... enabledStates)
|
public long of(String... enabledStates) {
|
||||||
{
|
|
||||||
long b = 0;
|
long b = 0;
|
||||||
|
|
||||||
for(String i : enabledStates)
|
for (String i : enabledStates) {
|
||||||
{
|
|
||||||
b |= getBit(i);
|
b |= getBit(i);
|
||||||
}
|
}
|
||||||
|
|
||||||
return b;
|
return b;
|
||||||
}
|
}
|
||||||
|
|
||||||
public long set(long list, String state, boolean enabled)
|
public long set(long list, String state, boolean enabled) {
|
||||||
{
|
|
||||||
long bit = getBit(state);
|
long bit = getBit(state);
|
||||||
boolean is = is(list, state);
|
boolean is = is(list, state);
|
||||||
|
|
||||||
if(enabled && !is)
|
if (enabled && !is) {
|
||||||
{
|
|
||||||
return list | bit;
|
return list | bit;
|
||||||
}
|
} else if (!enabled && is) {
|
||||||
|
|
||||||
else if(!enabled && is)
|
|
||||||
{
|
|
||||||
return list ^ bit;
|
return list ^ bit;
|
||||||
}
|
}
|
||||||
|
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean is(long list, String state)
|
public boolean is(long list, String state) {
|
||||||
{
|
|
||||||
long bit = getBit(state);
|
long bit = getBit(state);
|
||||||
|
|
||||||
return bit > 0 && (list & bit) == bit;
|
return bit > 0 && (list & bit) == bit;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean hasBit(String state)
|
public boolean hasBit(String state) {
|
||||||
{
|
|
||||||
return getBit(state) > 0;
|
return getBit(state) > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
public long getBit(String state)
|
public long getBit(String state) {
|
||||||
{
|
|
||||||
return getBit(states.indexOf(state));
|
return getBit(states.indexOf(state));
|
||||||
}
|
}
|
||||||
|
|
||||||
public long getBit(int index)
|
public long getBit(int index) {
|
||||||
{
|
|
||||||
return (long) (index < 0 ? -1 : Math.pow(2, index));
|
return (long) (index < 0 ? -1 : Math.pow(2, index));
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getBytes()
|
public int getBytes() {
|
||||||
{
|
|
||||||
return getBits() == 0 ? 0 : ((getBits() >> 2) + 1);
|
return getBits() == 0 ? 0 : ((getBits() >> 2) + 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getBits()
|
public int getBits() {
|
||||||
{
|
|
||||||
return states.size();
|
return states.size();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -384,13 +384,9 @@ public enum C {
|
|||||||
C o = C.getByChar(i);
|
C o = C.getByChar(i);
|
||||||
|
|
||||||
if (hrad != 0 || srad != 0 || vrad != 0) {
|
if (hrad != 0 || srad != 0 || vrad != 0) {
|
||||||
if(pulse > 0)
|
if (pulse > 0) {
|
||||||
{
|
|
||||||
b.append(VolmitSender.pulse(spinToHex(o, hrad, srad, vrad), spinToHex(o, -hrad, -srad, -vrad), pulse));
|
b.append(VolmitSender.pulse(spinToHex(o, hrad, srad, vrad), spinToHex(o, -hrad, -srad, -vrad), pulse));
|
||||||
}
|
} else {
|
||||||
|
|
||||||
else
|
|
||||||
{
|
|
||||||
b.append("<gradient:")
|
b.append("<gradient:")
|
||||||
.append(spinToHex(o, hrad, srad, vrad))
|
.append(spinToHex(o, hrad, srad, vrad))
|
||||||
.append(":")
|
.append(":")
|
||||||
|
|||||||
@@ -24,8 +24,7 @@ import java.io.File;
|
|||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
||||||
public class InstanceState {
|
public class InstanceState {
|
||||||
public static int getInstanceId()
|
public static int getInstanceId() {
|
||||||
{
|
|
||||||
try {
|
try {
|
||||||
return Integer.parseInt(IO.readAll(instanceFile()).trim());
|
return Integer.parseInt(IO.readAll(instanceFile()).trim());
|
||||||
} catch (Throwable e) {
|
} catch (Throwable e) {
|
||||||
@@ -35,8 +34,7 @@ public class InstanceState {
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void updateInstanceId()
|
public static void updateInstanceId() {
|
||||||
{
|
|
||||||
try {
|
try {
|
||||||
IO.writeAll(instanceFile(), RNG.r.imax() + "");
|
IO.writeAll(instanceFile(), RNG.r.imax() + "");
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
@@ -44,8 +42,7 @@ public class InstanceState {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static File instanceFile()
|
private static File instanceFile() {
|
||||||
{
|
|
||||||
File f = new File("plugins/Iris/cache/instance");
|
File f = new File("plugins/Iris/cache/instance");
|
||||||
f.getParentFile().mkdirs();
|
f.getParentFile().mkdirs();
|
||||||
return f;
|
return f;
|
||||||
|
|||||||
@@ -34,9 +34,7 @@ import com.volmit.iris.util.parallel.BurstExecutor;
|
|||||||
import com.volmit.iris.util.parallel.HyperLock;
|
import com.volmit.iris.util.parallel.HyperLock;
|
||||||
import com.volmit.iris.util.parallel.MultiBurst;
|
import com.volmit.iris.util.parallel.MultiBurst;
|
||||||
|
|
||||||
import java.io.DataInputStream;
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.FileInputStream;
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.nio.charset.StandardCharsets;
|
import java.nio.charset.StandardCharsets;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
@@ -44,7 +42,6 @@ import java.util.UUID;
|
|||||||
import java.util.concurrent.CompletableFuture;
|
import java.util.concurrent.CompletableFuture;
|
||||||
import java.util.concurrent.ExecutionException;
|
import java.util.concurrent.ExecutionException;
|
||||||
import java.util.concurrent.atomic.AtomicBoolean;
|
import java.util.concurrent.atomic.AtomicBoolean;
|
||||||
import java.util.zip.GZIPInputStream;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The mantle can store any type of data slice anywhere and manage regions & IO on it's own.
|
* The mantle can store any type of data slice anywhere and manage regions & IO on it's own.
|
||||||
@@ -81,28 +78,23 @@ public class Mantle {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@ChunkCoordinates
|
@ChunkCoordinates
|
||||||
public void raiseFlag(int x, int z, MantleFlag flag, Runnable r)
|
public void raiseFlag(int x, int z, MantleFlag flag, Runnable r) {
|
||||||
{
|
if (!hasFlag(x, z, flag)) {
|
||||||
if(!hasFlag(x, z, flag))
|
|
||||||
{
|
|
||||||
flag(x, z, flag, true);
|
flag(x, z, flag, true);
|
||||||
r.run();
|
r.run();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ChunkCoordinates
|
@ChunkCoordinates
|
||||||
public void lowerFlag(int x, int z, MantleFlag flag, Runnable r)
|
public void lowerFlag(int x, int z, MantleFlag flag, Runnable r) {
|
||||||
{
|
if (hasFlag(x, z, flag)) {
|
||||||
if(hasFlag(x, z, flag))
|
|
||||||
{
|
|
||||||
flag(x, z, flag, false);
|
flag(x, z, flag, false);
|
||||||
r.run();
|
r.run();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ChunkCoordinates
|
@ChunkCoordinates
|
||||||
public void flag(int x, int z, MantleFlag flag, boolean flagged)
|
public void flag(int x, int z, MantleFlag flag, boolean flagged) {
|
||||||
{
|
|
||||||
try {
|
try {
|
||||||
get(x >> 5, z >> 5).get().getOrCreate(x & 31, z & 31).flag(flag, flagged);
|
get(x >> 5, z >> 5).get().getOrCreate(x & 31, z & 31).flag(flag, flagged);
|
||||||
} catch (InterruptedException | ExecutionException e) {
|
} catch (InterruptedException | ExecutionException e) {
|
||||||
@@ -111,12 +103,9 @@ public class Mantle {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@ChunkCoordinates
|
@ChunkCoordinates
|
||||||
public <T> void iterateChunk(int x, int z, Class<T> type, Consumer4<Integer, Integer, Integer, T> iterator, MantleFlag... requiredFlags)
|
public <T> void iterateChunk(int x, int z, Class<T> type, Consumer4<Integer, Integer, Integer, T> iterator, MantleFlag... requiredFlags) {
|
||||||
{
|
for (MantleFlag i : requiredFlags) {
|
||||||
for(MantleFlag i : requiredFlags)
|
if (!hasFlag(x, z, i)) {
|
||||||
{
|
|
||||||
if(!hasFlag(x, z, i))
|
|
||||||
{
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -129,8 +118,7 @@ public class Mantle {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@ChunkCoordinates
|
@ChunkCoordinates
|
||||||
public boolean hasFlag(int x, int z, MantleFlag flag)
|
public boolean hasFlag(int x, int z, MantleFlag flag) {
|
||||||
{
|
|
||||||
try {
|
try {
|
||||||
return get(x >> 5, z >> 5).get().getOrCreate(x & 31, z & 31).isFlagged(flag);
|
return get(x >> 5, z >> 5).get().getOrCreate(x & 31, z & 31).isFlagged(flag);
|
||||||
} catch (InterruptedException | ExecutionException e) {
|
} catch (InterruptedException | ExecutionException e) {
|
||||||
@@ -302,8 +290,7 @@ public class Mantle {
|
|||||||
Long k = key(x, z);
|
Long k = key(x, z);
|
||||||
TectonicPlate p = loadedRegions.get(k);
|
TectonicPlate p = loadedRegions.get(k);
|
||||||
|
|
||||||
if(p != null)
|
if (p != null) {
|
||||||
{
|
|
||||||
lastUse.put(k, M.ms());
|
lastUse.put(k, M.ms());
|
||||||
return CompletableFuture.completedFuture(p);
|
return CompletableFuture.completedFuture(p);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,10 +18,6 @@
|
|||||||
|
|
||||||
package com.volmit.iris.util.mantle;
|
package com.volmit.iris.util.mantle;
|
||||||
|
|
||||||
import com.volmit.iris.Iris;
|
|
||||||
import com.volmit.iris.util.collection.KSet;
|
|
||||||
import com.volmit.iris.util.collection.StateList;
|
|
||||||
import com.volmit.iris.util.data.Varint;
|
|
||||||
import com.volmit.iris.util.documentation.ChunkCoordinates;
|
import com.volmit.iris.util.documentation.ChunkCoordinates;
|
||||||
import com.volmit.iris.util.function.Consumer4;
|
import com.volmit.iris.util.function.Consumer4;
|
||||||
import com.volmit.iris.util.matter.IrisMatter;
|
import com.volmit.iris.util.matter.IrisMatter;
|
||||||
@@ -52,8 +48,7 @@ public class MantleChunk {
|
|||||||
sections = new AtomicReferenceArray<>(sectionHeight);
|
sections = new AtomicReferenceArray<>(sectionHeight);
|
||||||
flags = new AtomicIntegerArray(MantleFlag.values().length);
|
flags = new AtomicIntegerArray(MantleFlag.values().length);
|
||||||
|
|
||||||
for (int i = 0; i < flags.length(); i++)
|
for (int i = 0; i < flags.length(); i++) {
|
||||||
{
|
|
||||||
flags.set(i, 0);
|
flags.set(i, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -70,8 +65,7 @@ public class MantleChunk {
|
|||||||
this(sectionHeight);
|
this(sectionHeight);
|
||||||
int s = din.readByte();
|
int s = din.readByte();
|
||||||
|
|
||||||
for(int i = 0; i < flags.length(); i++)
|
for (int i = 0; i < flags.length(); i++) {
|
||||||
{
|
|
||||||
flags.set(i, din.readBoolean() ? 1 : 0);
|
flags.set(i, din.readBoolean() ? 1 : 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -176,19 +170,14 @@ public class MantleChunk {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void trimSlice(int i) {
|
private void trimSlice(int i) {
|
||||||
if(exists(i))
|
if (exists(i)) {
|
||||||
{
|
|
||||||
Matter m = get(i);
|
Matter m = get(i);
|
||||||
|
|
||||||
if(m.getSliceMap().isEmpty())
|
if (m.getSliceMap().isEmpty()) {
|
||||||
{
|
|
||||||
sections.set(i, null);
|
sections.set(i, null);
|
||||||
}
|
} else {
|
||||||
|
|
||||||
else{
|
|
||||||
m.trimSlices();
|
m.trimSlices();
|
||||||
if(m.getSliceMap().isEmpty())
|
if (m.getSliceMap().isEmpty()) {
|
||||||
{
|
|
||||||
sections.set(i, null);
|
sections.set(i, null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -196,17 +185,14 @@ public class MantleChunk {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public <T> void iterate(Class<T> type, Consumer4<Integer, Integer, Integer, T> iterator) {
|
public <T> void iterate(Class<T> type, Consumer4<Integer, Integer, Integer, T> iterator) {
|
||||||
for(int i = 0; i < sections.length(); i++)
|
for (int i = 0; i < sections.length(); i++) {
|
||||||
{
|
|
||||||
int bs = (i << 4);
|
int bs = (i << 4);
|
||||||
Matter matter = get(i);
|
Matter matter = get(i);
|
||||||
|
|
||||||
if(matter != null)
|
if (matter != null) {
|
||||||
{
|
|
||||||
MatterSlice<T> t = matter.getSlice(type);
|
MatterSlice<T> t = matter.getSlice(type);
|
||||||
|
|
||||||
if(t != null)
|
if (t != null) {
|
||||||
{
|
|
||||||
t.iterateSync((a, b, c, f) -> iterator.accept(a, b + bs, c, f));
|
t.iterateSync((a, b, c, f) -> iterator.accept(a, b + bs, c, f));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,10 +24,9 @@ public enum MantleFlag {
|
|||||||
OBJECT,
|
OBJECT,
|
||||||
UPDATE,
|
UPDATE,
|
||||||
JIGSAW,
|
JIGSAW,
|
||||||
FEATURE
|
FEATURE;
|
||||||
;
|
|
||||||
static StateList getStateList()
|
static StateList getStateList() {
|
||||||
{
|
|
||||||
return new StateList(MantleFlag.values());
|
return new StateList(MantleFlag.values());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -172,10 +172,7 @@ public class TectonicPlate {
|
|||||||
if (chunk != null) {
|
if (chunk != null) {
|
||||||
dos.writeBoolean(true);
|
dos.writeBoolean(true);
|
||||||
chunk.write(dos);
|
chunk.write(dos);
|
||||||
}
|
} else {
|
||||||
|
|
||||||
else
|
|
||||||
{
|
|
||||||
dos.writeBoolean(false);
|
dos.writeBoolean(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -33,8 +33,6 @@ import java.io.*;
|
|||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import java.util.function.Function;
|
import java.util.function.Function;
|
||||||
import java.util.zip.GZIPInputStream;
|
|
||||||
import java.util.zip.GZIPOutputStream;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* When Red Matter isn't enough
|
* When Red Matter isn't enough
|
||||||
|
|||||||
@@ -18,9 +18,7 @@
|
|||||||
|
|
||||||
package com.volmit.iris.util.matter;
|
package com.volmit.iris.util.matter;
|
||||||
|
|
||||||
import com.volmit.iris.Iris;
|
|
||||||
import com.volmit.iris.engine.data.cache.Cache;
|
import com.volmit.iris.engine.data.cache.Cache;
|
||||||
import com.volmit.iris.util.data.NibbleDataPalette;
|
|
||||||
import com.volmit.iris.util.data.Varint;
|
import com.volmit.iris.util.data.Varint;
|
||||||
import com.volmit.iris.util.hunk.Hunk;
|
import com.volmit.iris.util.hunk.Hunk;
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
@@ -108,8 +106,7 @@ public interface MatterSlice<T> extends Hunk<T> {
|
|||||||
return readFrom(mediumType) != null;
|
return readFrom(mediumType) != null;
|
||||||
}
|
}
|
||||||
|
|
||||||
default int getBitsPer(int needed)
|
default int getBitsPer(int needed) {
|
||||||
{
|
|
||||||
int target = 1;
|
int target = 1;
|
||||||
for (int i = 1; i < 8; i++) {
|
for (int i = 1; i < 8; i++) {
|
||||||
if (Math.pow(2, i) > needed) {
|
if (Math.pow(2, i) > needed) {
|
||||||
|
|||||||
@@ -21,7 +21,6 @@ package com.volmit.iris.util.matter.slices;
|
|||||||
import com.volmit.iris.util.data.Varint;
|
import com.volmit.iris.util.data.Varint;
|
||||||
import com.volmit.iris.util.matter.Sliced;
|
import com.volmit.iris.util.matter.Sliced;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.OfflinePlayer;
|
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
import java.io.DataInputStream;
|
import java.io.DataInputStream;
|
||||||
|
|||||||
@@ -127,8 +127,7 @@ public class HyperLock {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void lock(int x, int z) {
|
public void lock(int x, int z) {
|
||||||
if(!enabled)
|
if (!enabled) {
|
||||||
{
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -136,8 +135,7 @@ public class HyperLock {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void unlock(int x, int z) {
|
public void unlock(int x, int z) {
|
||||||
if(!enabled)
|
if (!enabled) {
|
||||||
{
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -20,7 +20,6 @@ package com.volmit.iris.util.parallel;
|
|||||||
|
|
||||||
import com.volmit.iris.Iris;
|
import com.volmit.iris.Iris;
|
||||||
import com.volmit.iris.core.IrisSettings;
|
import com.volmit.iris.core.IrisSettings;
|
||||||
import com.volmit.iris.util.collection.KList;
|
|
||||||
import com.volmit.iris.util.io.InstanceState;
|
import com.volmit.iris.util.io.InstanceState;
|
||||||
import com.volmit.iris.util.math.M;
|
import com.volmit.iris.util.math.M;
|
||||||
import com.volmit.iris.util.scheduling.J;
|
import com.volmit.iris.util.scheduling.J;
|
||||||
@@ -55,8 +54,7 @@ public class MultiBurst {
|
|||||||
heartbeat = new Looper() {
|
heartbeat = new Looper() {
|
||||||
@Override
|
@Override
|
||||||
protected long loop() {
|
protected long loop() {
|
||||||
if(instance != InstanceState.getInstanceId())
|
if (instance != InstanceState.getInstanceId()) {
|
||||||
{
|
|
||||||
shutdownNow();
|
shutdownNow();
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,7 +18,6 @@
|
|||||||
|
|
||||||
package com.volmit.iris.util.plugin;
|
package com.volmit.iris.util.plugin;
|
||||||
|
|
||||||
import com.google.common.collect.Comparators;
|
|
||||||
import com.volmit.iris.Iris;
|
import com.volmit.iris.Iris;
|
||||||
import com.volmit.iris.core.IrisSettings;
|
import com.volmit.iris.core.IrisSettings;
|
||||||
import com.volmit.iris.util.collection.KList;
|
import com.volmit.iris.util.collection.KList;
|
||||||
@@ -27,8 +26,6 @@ import org.bukkit.Sound;
|
|||||||
|
|
||||||
import java.lang.reflect.Field;
|
import java.lang.reflect.Field;
|
||||||
import java.lang.reflect.InvocationTargetException;
|
import java.lang.reflect.InvocationTargetException;
|
||||||
import java.util.Collection;
|
|
||||||
import java.util.Collections;
|
|
||||||
import java.util.Comparator;
|
import java.util.Comparator;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -28,8 +28,6 @@ import lombok.Getter;
|
|||||||
import lombok.Setter;
|
import lombok.Setter;
|
||||||
import net.kyori.adventure.text.Component;
|
import net.kyori.adventure.text.Component;
|
||||||
import net.kyori.adventure.text.minimessage.MiniMessage;
|
import net.kyori.adventure.text.minimessage.MiniMessage;
|
||||||
import net.kyori.adventure.text.minimessage.transformation.inbuild.GradientTransformation;
|
|
||||||
import net.kyori.adventure.text.minimessage.transformation.inbuild.RainbowTransformation;
|
|
||||||
import net.kyori.adventure.title.Title;
|
import net.kyori.adventure.title.Title;
|
||||||
import org.bukkit.Server;
|
import org.bukkit.Server;
|
||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
@@ -45,7 +43,6 @@ import java.util.UUID;
|
|||||||
import java.util.concurrent.CompletableFuture;
|
import java.util.concurrent.CompletableFuture;
|
||||||
import java.util.concurrent.ExecutionException;
|
import java.util.concurrent.ExecutionException;
|
||||||
import java.util.concurrent.atomic.AtomicInteger;
|
import java.util.concurrent.atomic.AtomicInteger;
|
||||||
import java.util.concurrent.atomic.AtomicLong;
|
|
||||||
import java.util.concurrent.atomic.AtomicReference;
|
import java.util.concurrent.atomic.AtomicReference;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -193,31 +190,24 @@ public class VolmitSender implements CommandSender {
|
|||||||
s.sendMessage("========================================================");
|
s.sendMessage("========================================================");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void sendTitle(String title, String subtitle, int i, int s, int o)
|
public void sendTitle(String title, String subtitle, int i, int s, int o) {
|
||||||
{
|
|
||||||
Iris.audiences.player(player()).showTitle(Title.title(
|
Iris.audiences.player(player()).showTitle(Title.title(
|
||||||
createComponent(title),
|
createComponent(title),
|
||||||
createComponent(subtitle),
|
createComponent(subtitle),
|
||||||
Title.Times.of(Duration.ofMillis(i), Duration.ofMillis(s), Duration.ofMillis(o))));
|
Title.Times.of(Duration.ofMillis(i), Duration.ofMillis(s), Duration.ofMillis(o))));
|
||||||
}
|
}
|
||||||
|
|
||||||
public static long getTick()
|
public static long getTick() {
|
||||||
{
|
|
||||||
return M.ms() / 16;
|
return M.ms() / 16;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void sendProgress(double percent, String thing)
|
public void sendProgress(double percent, String thing) {
|
||||||
{
|
if (percent < 0) {
|
||||||
if(percent < 0)
|
|
||||||
{
|
|
||||||
int l = 44;
|
int l = 44;
|
||||||
int g = (int) (1D * l);
|
int g = (int) (1D * l);
|
||||||
sendTitle(C.IRIS + thing + " ", 0, 500, 250);
|
sendTitle(C.IRIS + thing + " ", 0, 500, 250);
|
||||||
sendActionNoProcessing("" + "" + pulse("#00ff80", "#00373d", 1D) + "<underlined> " + Form.repeat(" ", g) + "<reset>" + Form.repeat(" ", l - g));
|
sendActionNoProcessing("" + "" + pulse("#00ff80", "#00373d", 1D) + "<underlined> " + Form.repeat(" ", g) + "<reset>" + Form.repeat(" ", l - g));
|
||||||
}
|
} else {
|
||||||
|
|
||||||
else
|
|
||||||
{
|
|
||||||
int l = 44;
|
int l = 44;
|
||||||
int g = (int) (percent * l);
|
int g = (int) (percent * l);
|
||||||
sendTitle(C.IRIS + thing + " " + C.BLUE + "<font:minecraft:uniform>" + Form.pc(percent, 0), 0, 500, 250);
|
sendTitle(C.IRIS + thing + " " + C.BLUE + "<font:minecraft:uniform>" + Form.pc(percent, 0), 0, 500, 250);
|
||||||
@@ -225,8 +215,7 @@ public class VolmitSender implements CommandSender {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String pulse(String colorA, String colorB, double speed)
|
public static String pulse(String colorA, String colorB, double speed) {
|
||||||
{
|
|
||||||
return "<gradient:" + colorA + ":" + colorB + ":" + pulse(speed) + ">";
|
return "<gradient:" + colorA + ":" + colorB + ":" + pulse(speed) + ">";
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -238,50 +227,42 @@ public class VolmitSender implements CommandSender {
|
|||||||
return ((1D - v) * 2D) - 1D;
|
return ((1D - v) * 2D) - 1D;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void sendAction(String action)
|
public void sendAction(String action) {
|
||||||
{
|
|
||||||
Iris.audiences.player(player()).sendActionBar(createNoPrefixComponent(action));
|
Iris.audiences.player(player()).sendActionBar(createNoPrefixComponent(action));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void sendActionNoProcessing(String action)
|
public void sendActionNoProcessing(String action) {
|
||||||
{
|
|
||||||
Iris.audiences.player(player()).sendActionBar(createNoPrefixComponentNoProcessing(action));
|
Iris.audiences.player(player()).sendActionBar(createNoPrefixComponentNoProcessing(action));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void sendTitle(String subtitle, int i, int s, int o)
|
public void sendTitle(String subtitle, int i, int s, int o) {
|
||||||
{
|
|
||||||
Iris.audiences.player(player()).showTitle(Title.title(
|
Iris.audiences.player(player()).showTitle(Title.title(
|
||||||
createNoPrefixComponent(" "),
|
createNoPrefixComponent(" "),
|
||||||
createNoPrefixComponent(subtitle),
|
createNoPrefixComponent(subtitle),
|
||||||
Title.Times.of(Duration.ofMillis(i), Duration.ofMillis(s), Duration.ofMillis(o))));
|
Title.Times.of(Duration.ofMillis(i), Duration.ofMillis(s), Duration.ofMillis(o))));
|
||||||
}
|
}
|
||||||
|
|
||||||
private Component createNoPrefixComponent(String message)
|
private Component createNoPrefixComponent(String message) {
|
||||||
{
|
|
||||||
String t = C.translateAlternateColorCodes('&', message);
|
String t = C.translateAlternateColorCodes('&', message);
|
||||||
String a = C.aura(t, IrisSettings.get().getGeneral().getSpinh(), IrisSettings.get().getGeneral().getSpins(), IrisSettings.get().getGeneral().getSpinb(), 0.36);
|
String a = C.aura(t, IrisSettings.get().getGeneral().getSpinh(), IrisSettings.get().getGeneral().getSpins(), IrisSettings.get().getGeneral().getSpinb(), 0.36);
|
||||||
return MiniMessage.get().parse(a);
|
return MiniMessage.get().parse(a);
|
||||||
}
|
}
|
||||||
|
|
||||||
private Component createNoPrefixComponentNoProcessing(String message)
|
private Component createNoPrefixComponentNoProcessing(String message) {
|
||||||
{
|
|
||||||
return MiniMessage.get().parse(message);
|
return MiniMessage.get().parse(message);
|
||||||
}
|
}
|
||||||
|
|
||||||
private Component createComponent(String message)
|
private Component createComponent(String message) {
|
||||||
{
|
|
||||||
String t = C.translateAlternateColorCodes('&', getTag() + message);
|
String t = C.translateAlternateColorCodes('&', getTag() + message);
|
||||||
String a = C.aura(t, IrisSettings.get().getGeneral().getSpinh(), IrisSettings.get().getGeneral().getSpins(), IrisSettings.get().getGeneral().getSpinb());
|
String a = C.aura(t, IrisSettings.get().getGeneral().getSpinh(), IrisSettings.get().getGeneral().getSpins(), IrisSettings.get().getGeneral().getSpinb());
|
||||||
return MiniMessage.get().parse(a);
|
return MiniMessage.get().parse(a);
|
||||||
}
|
}
|
||||||
|
|
||||||
public <T> void showWaiting(String passive, CompletableFuture<T> f)
|
public <T> void showWaiting(String passive, CompletableFuture<T> f) {
|
||||||
{
|
|
||||||
AtomicInteger v = new AtomicInteger();
|
AtomicInteger v = new AtomicInteger();
|
||||||
AtomicReference<T> g = new AtomicReference<>();
|
AtomicReference<T> g = new AtomicReference<>();
|
||||||
v.set(J.ar(() -> {
|
v.set(J.ar(() -> {
|
||||||
if(f.isDone() && g.get() != null)
|
if (f.isDone() && g.get() != null) {
|
||||||
{
|
|
||||||
J.car(v.get());
|
J.car(v.get());
|
||||||
sendAction(" ");
|
sendAction(" ");
|
||||||
return;
|
return;
|
||||||
|
|||||||
Reference in New Issue
Block a user