This commit is contained in:
Daniel Mills 2020-09-07 23:00:29 -04:00
parent bdb86808a5
commit 3e92154e27
4 changed files with 18 additions and 9 deletions

View File

@ -314,9 +314,12 @@ public class Iris extends MortarPlugin
}
public static void verbose(String string)
{
if(IrisSettings.get().verbose)
{
msg(C.GRAY + string);
}
}
public static void success(String string)
{

View File

@ -25,6 +25,10 @@ public class IrisSettings
@Desc("Compress parallax data in memory to reduce memory usage in exchange for more cpu usage.")
public boolean parallaxCompression = true;
@DontObfuscate
@Desc("Useful information when creating iris worlds. Shows object loads & more.")
public boolean verbose = false;
@DontObfuscate
@Desc("Compression level (0-9) lower is faster, but is not as good compression. Best results around 3-5")
public int parallaxCompressionLevel = 2;

View File

@ -598,7 +598,7 @@ public class IrisDimension extends IrisRegistrant
{
return parallaxSize.aquire(() ->
{
Iris.info("Calculating the Parallax Size in Parallel");
Iris.verbose("Calculating the Parallax Size in Parallel");
O<Integer> xg = new O<>();
O<Integer> zg = new O<>();
xg.set(0);
@ -697,7 +697,7 @@ public class IrisDimension extends IrisRegistrant
z = z % 2 == 0 ? z + 1 : z;
x = Math.max(x, z);
z = x;
Iris.info("Done! Parallax Size: " + x + ", " + z);
Iris.verbose("Done! Parallax Size: " + x + ", " + z);
return new ChunkPosition(x, z);
});
}

View File

@ -35,7 +35,7 @@ public class PregenJob implements Listener
private Spiraler chunkSpiraler;
private boolean first;
private Consumer2<ChunkPosition, Color> consumer;
private int cubeSize = 7;
private int cubeSize = 5;
public PregenJob(World world, int size, MortarSender sender, Runnable onDone)
{
@ -138,7 +138,7 @@ public class PregenJob implements Listener
if(first)
{
sender.sendMessage("Pregen Started for " + Form.f((mcaWidth * mcaWidth)) + " Regions containing " + Form.f((mcaWidth * 16) * (mcaWidth * 16)) + " Chunks");
sender.sendMessage("Pregen Started for " + Form.f((size >> 4 >> 5 * size >> 4 >> 5)) + " Regions containing " + Form.f((size >> 4) * (size >> 4)) + " Chunks");
first = false;
spiraler.next();
@ -147,10 +147,13 @@ public class PregenJob implements Listener
chunkSpiraler.next();
if(isChunkWithin(chunkX, chunkZ))
{
if(consumer != null)
{
consumer.accept(new ChunkPosition(chunkX, chunkZ), Color.DARK_GRAY);
}
}
}
chunkSpiraler.retarget(cubeSize, cubeSize);
}
@ -163,7 +166,7 @@ public class PregenJob implements Listener
{
if(consumer != null)
{
consumer.accept(new ChunkPosition(chunkX, chunkZ), Color.YELLOW);
consumer.accept(new ChunkPosition(chunkX, chunkZ), Color.cyan.darker().darker());
}
world.loadChunk(chunkX, chunkZ);
@ -177,7 +180,6 @@ public class PregenJob implements Listener
else
{
total--;
if(consumer != null)
{
consumer.accept(new ChunkPosition(chunkX, chunkZ), Color.GREEN.darker());
@ -236,7 +238,7 @@ public class PregenJob implements Listener
@EventHandler
public void on(ChunkUnloadEvent e)
{
if(e.getWorld().equals(world) && isChunkWithin(e.getChunk().getX(), e.getChunk().getZ()))
if(e.getWorld().equals(world) && isChunkWithin(e.getChunk().getX(), e.getChunk().getZ()) && consumer != null)
{
consumer.accept(new ChunkPosition(e.getChunk().getX(), e.getChunk().getZ()), Color.GREEN);
}