mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2025-07-18 18:23:06 +00:00
Locky overrides
This commit is contained in:
parent
5bf6687f1f
commit
4a6d58c36e
@ -39,6 +39,7 @@ 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.collection.KMap;
|
import com.volmit.iris.util.collection.KMap;
|
||||||
import com.volmit.iris.util.collection.KSet;
|
import com.volmit.iris.util.collection.KSet;
|
||||||
|
import com.volmit.iris.util.data.B;
|
||||||
import com.volmit.iris.util.exceptions.IrisException;
|
import com.volmit.iris.util.exceptions.IrisException;
|
||||||
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;
|
||||||
@ -514,26 +515,6 @@ public class IrisProject {
|
|||||||
files(getPath(), files);
|
files(getPath(), files);
|
||||||
filesObjects(getPath(), objects);
|
filesObjects(getPath(), objects);
|
||||||
|
|
||||||
jobs.add(new ParallelQueueJob<File>() {
|
|
||||||
@Override
|
|
||||||
public void execute(File f) {
|
|
||||||
try {
|
|
||||||
JSONObject p = new JSONObject(IO.readAll(f));
|
|
||||||
fixBlocks(p);
|
|
||||||
scanForErrors(data, f, p, sender);
|
|
||||||
IO.writeAll(f, p.toString(4));
|
|
||||||
|
|
||||||
} catch (Throwable e) {
|
|
||||||
sender.sendMessage(C.RED + "JSON Error "+ f.getPath() + ": " + e.getMessage());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getName() {
|
|
||||||
return "JSON";
|
|
||||||
}
|
|
||||||
}.queue(files));
|
|
||||||
|
|
||||||
jobs.add(new ParallelQueueJob<File>() {
|
jobs.add(new ParallelQueueJob<File>() {
|
||||||
@Override
|
@Override
|
||||||
public void execute(File f) {
|
public void execute(File f) {
|
||||||
@ -543,12 +524,16 @@ public class IrisProject {
|
|||||||
|
|
||||||
if(o.getBlocks().isEmpty())
|
if(o.getBlocks().isEmpty())
|
||||||
{
|
{
|
||||||
sender.sendMessage(C.RED + "IOB " + f.getPath() + " has 0 blocks!");
|
sender.sendMessageRaw("<hover:show_text:'Error:\n" +
|
||||||
|
"<yellow>" + f.getPath() +
|
||||||
|
"'><red>- IOB " + f.getName() + " has 0 blocks!");
|
||||||
}
|
}
|
||||||
|
|
||||||
if(o.getW() == 0 || o.getH() == 0 || o.getD() == 0)
|
if(o.getW() == 0 || o.getH() == 0 || o.getD() == 0)
|
||||||
{
|
{
|
||||||
sender.sendMessage(C.RED + "IOB " + f.getPath() + " is not 3D!");
|
sender.sendMessageRaw("<hover:show_text:'Error:\n" +
|
||||||
|
"<yellow>" + f.getPath() + "\n<red>The width height or depth has a zero in it (bad format)" +
|
||||||
|
"'><red>- IOB " + f.getName() + " is not 3D!");
|
||||||
}
|
}
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
@ -560,6 +545,30 @@ public class IrisProject {
|
|||||||
return "IOB";
|
return "IOB";
|
||||||
}
|
}
|
||||||
}.queue(objects));
|
}.queue(objects));
|
||||||
|
|
||||||
|
jobs.add(new ParallelQueueJob<File>() {
|
||||||
|
@Override
|
||||||
|
public void execute(File f) {
|
||||||
|
try {
|
||||||
|
JSONObject p = new JSONObject(IO.readAll(f));
|
||||||
|
fixBlocks(p);
|
||||||
|
scanForErrors(data, f, p, sender);
|
||||||
|
IO.writeAll(f, p.toString(4));
|
||||||
|
|
||||||
|
} catch (Throwable e) {
|
||||||
|
sender.sendMessageRaw("<hover:show_text:'Error:\n" +
|
||||||
|
"<yellow>" + f.getPath() +
|
||||||
|
"\n<red>" +e.getMessage() +
|
||||||
|
"'><red>- JSON Error " + f.getName());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getName() {
|
||||||
|
return "JSON";
|
||||||
|
}
|
||||||
|
}.queue(files));
|
||||||
|
|
||||||
new JobCollection("Compile", jobs).execute(sender);
|
new JobCollection("Compile", jobs).execute(sender);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -569,14 +578,28 @@ public class IrisProject {
|
|||||||
|
|
||||||
if(loader == null)
|
if(loader == null)
|
||||||
{
|
{
|
||||||
sender.sendMessage("Can't find loader for " + f.getPath());
|
sender.sendMessageBasic("Can't find loader for " + f.getPath());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
IrisRegistrant load = loader.load(key);
|
IrisRegistrant load = loader.load(key);
|
||||||
|
compare(load.getClass(), p, sender, new KList<>());
|
||||||
load.scanForErrors(p, sender);
|
load.scanForErrors(p, sender);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void compare(Class<?> c, JSONObject j, VolmitSender sender, KList<String> path)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
Object o = c.getClass().getConstructor().newInstance();
|
||||||
|
}
|
||||||
|
|
||||||
|
catch(Throwable e)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public void files(File clean, KList<File> files) {
|
public void files(File clean, KList<File> files) {
|
||||||
if (clean.isDirectory()) {
|
if (clean.isDirectory()) {
|
||||||
for (File i : clean.listFiles()) {
|
for (File i : clean.listFiles()) {
|
||||||
|
@ -114,9 +114,9 @@ public class PlannedStructure {
|
|||||||
int xx = i.getPosition().getX() + sx;
|
int xx = i.getPosition().getX() + sx;
|
||||||
int zz = i.getPosition().getZ() + sz;
|
int zz = i.getPosition().getZ() + sz;
|
||||||
int offset = i.getPosition().getY() - startHeight;
|
int offset = i.getPosition().getY() - startHeight;
|
||||||
int height = (i.getStructure().getStructure().getLockY() != -1
|
int height = (i.getStructure().getStructure().getLockY() == -1 ? i.getStructure().getStructure().getOverrideYRange() != null
|
||||||
? i.getStructure().getStructure().getLockY()
|
? (int)i.getStructure().getStructure().getOverrideYRange().get(rng, xx, zz, getData())
|
||||||
: placer.getHighest(xx, zz, getData())) + offset + (v.getH() / 2);
|
: i.getStructure().getStructure().getLockY() : placer.getHighest(xx, zz, getData())) + offset + (v.getH() / 2);
|
||||||
|
|
||||||
if (options.getMode().equals(ObjectPlaceMode.PAINT) || options.isVacuum()) {
|
if (options.getMode().equals(ObjectPlaceMode.PAINT) || options.isVacuum()) {
|
||||||
height = -1;
|
height = -1;
|
||||||
|
@ -23,6 +23,7 @@ import com.volmit.iris.core.project.loader.IrisRegistrant;
|
|||||||
import com.volmit.iris.engine.data.cache.AtomicCache;
|
import com.volmit.iris.engine.data.cache.AtomicCache;
|
||||||
import com.volmit.iris.engine.object.annotations.*;
|
import com.volmit.iris.engine.object.annotations.*;
|
||||||
import com.volmit.iris.engine.object.feature.IrisFeature;
|
import com.volmit.iris.engine.object.feature.IrisFeature;
|
||||||
|
import com.volmit.iris.engine.object.noise.IrisStyledRange;
|
||||||
import com.volmit.iris.util.collection.KList;
|
import com.volmit.iris.util.collection.KList;
|
||||||
import com.volmit.iris.util.json.JSONObject;
|
import com.volmit.iris.util.json.JSONObject;
|
||||||
import com.volmit.iris.util.plugin.VolmitSender;
|
import com.volmit.iris.util.plugin.VolmitSender;
|
||||||
@ -61,7 +62,10 @@ public class IrisJigsawStructure extends IrisRegistrant {
|
|||||||
@Desc("If set to true, iris will look for any pieces with only one connector in valid pools for edge connectors and attach them to 'terminate' the paths/piece connectors. Essentially it caps off ends. For example in a village, Iris would add houses to the ends of roads where possible. For terminators to be selected, they can only have one connector or they wont be chosen.")
|
@Desc("If set to true, iris will look for any pieces with only one connector in valid pools for edge connectors and attach them to 'terminate' the paths/piece connectors. Essentially it caps off ends. For example in a village, Iris would add houses to the ends of roads where possible. For terminators to be selected, they can only have one connector or they wont be chosen.")
|
||||||
private boolean terminate = true;
|
private boolean terminate = true;
|
||||||
|
|
||||||
@Desc("Set to lock the starting peice to a y coordinate, otherwise the surface will be used.")
|
@Desc("Override the y range instead of placing on the height map")
|
||||||
|
private IrisStyledRange overrideYRange = null;
|
||||||
|
|
||||||
|
@Desc("Force Y to a specific value")
|
||||||
private int lockY = -1;
|
private int lockY = -1;
|
||||||
|
|
||||||
private transient AtomicCache<Integer> maxDimension = new AtomicCache<>();
|
private transient AtomicCache<Integer> maxDimension = new AtomicCache<>();
|
||||||
|
@ -26,8 +26,6 @@ import com.volmit.iris.util.scheduling.ChronoLatch;
|
|||||||
import it.unimi.dsi.fastutil.ints.IntOpenHashSet;
|
import it.unimi.dsi.fastutil.ints.IntOpenHashSet;
|
||||||
import it.unimi.dsi.fastutil.ints.IntSet;
|
import it.unimi.dsi.fastutil.ints.IntSet;
|
||||||
import it.unimi.dsi.fastutil.ints.IntSets;
|
import it.unimi.dsi.fastutil.ints.IntSets;
|
||||||
import it.unimi.dsi.fastutil.objects.ReferenceLinkedOpenHashSet;
|
|
||||||
import it.unimi.dsi.fastutil.objects.ReferenceSet;
|
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.block.data.BlockData;
|
import org.bukkit.block.data.BlockData;
|
||||||
@ -64,8 +62,6 @@ public class B {
|
|||||||
ALLIUM,
|
ALLIUM,
|
||||||
AZURE_BLUET,
|
AZURE_BLUET,
|
||||||
BLUE_ORCHID,
|
BLUE_ORCHID,
|
||||||
POPPY,
|
|
||||||
DANDELION,
|
|
||||||
OXEYE_DAISY,
|
OXEYE_DAISY,
|
||||||
LILY_OF_THE_VALLEY,
|
LILY_OF_THE_VALLEY,
|
||||||
WITHER_ROSE,
|
WITHER_ROSE,
|
||||||
@ -91,7 +87,6 @@ public class B {
|
|||||||
private static IntSet buildDecorantCache() {
|
private static IntSet buildDecorantCache() {
|
||||||
IntSet b = new IntOpenHashSet();
|
IntSet b = new IntOpenHashSet();
|
||||||
Arrays.stream(new Material[]{
|
Arrays.stream(new Material[]{
|
||||||
|
|
||||||
GRASS,
|
GRASS,
|
||||||
TALL_GRASS,
|
TALL_GRASS,
|
||||||
FERN,
|
FERN,
|
||||||
@ -147,6 +142,7 @@ public class B {
|
|||||||
TORCH,
|
TORCH,
|
||||||
SOUL_TORCH
|
SOUL_TORCH
|
||||||
}).forEach((i) -> b.add(i.ordinal()));
|
}).forEach((i) -> b.add(i.ordinal()));
|
||||||
|
b.addAll(foliageCache);
|
||||||
|
|
||||||
return IntSets.unmodifiable(b);
|
return IntSets.unmodifiable(b);
|
||||||
}
|
}
|
||||||
@ -168,6 +164,7 @@ public class B {
|
|||||||
JACK_O_LANTERN,
|
JACK_O_LANTERN,
|
||||||
REDSTONE_LAMP,
|
REDSTONE_LAMP,
|
||||||
MAGMA_BLOCK,
|
MAGMA_BLOCK,
|
||||||
|
LIGHT,
|
||||||
SHROOMLIGHT,
|
SHROOMLIGHT,
|
||||||
SEA_LANTERN,
|
SEA_LANTERN,
|
||||||
SOUL_LANTERN,
|
SOUL_LANTERN,
|
||||||
@ -184,7 +181,8 @@ public class B {
|
|||||||
private static IntSet buildStorageCache() {
|
private static IntSet buildStorageCache() {
|
||||||
IntSet b = new IntOpenHashSet();
|
IntSet b = new IntOpenHashSet();
|
||||||
Arrays.stream(new Material[]{
|
Arrays.stream(new Material[]{
|
||||||
CHEST, SMOKER,
|
CHEST,
|
||||||
|
SMOKER,
|
||||||
TRAPPED_CHEST,
|
TRAPPED_CHEST,
|
||||||
SHULKER_BOX,
|
SHULKER_BOX,
|
||||||
WHITE_SHULKER_BOX,
|
WHITE_SHULKER_BOX,
|
||||||
@ -230,7 +228,9 @@ public class B {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (onto.equals(Material.AIR) || onto.equals(B.getMaterial("CAVE_AIR")) || onto.equals(B.getMaterial("VOID_AIR"))) {
|
if (onto.equals(Material.AIR) ||
|
||||||
|
onto.equals(B.getMaterial("CAVE_AIR"))
|
||||||
|
|| onto.equals(B.getMaterial("VOID_AIR"))) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -309,6 +309,9 @@ public class VolmitSender implements CommandSender {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void sendMessageBasic(String message) {
|
||||||
|
s.sendMessage(C.translateAlternateColorCodes('&', getTag() + message));
|
||||||
|
}
|
||||||
|
|
||||||
public void sendMessageRaw(String message) {
|
public void sendMessageRaw(String message) {
|
||||||
if (message.contains("<NOMINI>")) {
|
if (message.contains("<NOMINI>")) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user