mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2025-12-27 02:59:06 +00:00
Tweaks and fixes
This commit is contained in:
@@ -60,20 +60,6 @@ public class PregenTask {
|
||||
iterateRegion(xr, zr, s, new Position2(0,0));
|
||||
}
|
||||
|
||||
private static Position2 avg(Position2... c)
|
||||
{
|
||||
double x = 0;
|
||||
double z = 0;
|
||||
|
||||
for(Position2 i : c)
|
||||
{
|
||||
x += i.getX() * 15;
|
||||
z += i.getZ() * 15;
|
||||
}
|
||||
|
||||
return new Position2((int)(x / c.length), (int)(z / c.length));
|
||||
}
|
||||
|
||||
private static KList<Position2> computeOrder(Position2 pull) {
|
||||
KList<Position2> p = new KList<>();
|
||||
new Spiraler(33, 33, (x, z) -> {
|
||||
|
||||
@@ -61,6 +61,7 @@ import com.volmit.iris.util.format.C;
|
||||
import com.volmit.iris.util.format.Form;
|
||||
import com.volmit.iris.util.hunk.Hunk;
|
||||
import com.volmit.iris.util.io.IO;
|
||||
import com.volmit.iris.util.mantle.MantleFlag;
|
||||
import com.volmit.iris.util.math.M;
|
||||
import com.volmit.iris.util.math.RNG;
|
||||
import com.volmit.iris.util.matter.MatterCavern;
|
||||
@@ -460,6 +461,7 @@ public class IrisEngine implements Engine {
|
||||
mode.generate(x, z, blocks, vbiomes, multicore);
|
||||
}
|
||||
|
||||
getMantle().getMantle().flag(x>>4, z>>4, MantleFlag.REAL, true);
|
||||
getMetrics().getTotal().put(p.getMilliseconds());
|
||||
generated.incrementAndGet();
|
||||
recycle();
|
||||
|
||||
@@ -224,7 +224,6 @@ public interface EngineMantle extends IObjectPlacer {
|
||||
}
|
||||
|
||||
burst.complete();
|
||||
getMantle().flag(x, z, MantleFlag.REAL, true);
|
||||
}
|
||||
|
||||
default void generateMantleComponent(MantleWriter writer, int x, int z, MantleComponent c, MantleChunk mc) {
|
||||
@@ -278,7 +277,7 @@ public interface EngineMantle extends IObjectPlacer {
|
||||
for (int j = -s; j <= s; j++) {
|
||||
int xx = i + x;
|
||||
int zz = j + z;
|
||||
if(!getMantle().hasFlag(xx, zz, MantleFlag.PLANNED))
|
||||
if(!getMantle().hasFlag(xx, zz, MantleFlag.REAL))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -88,9 +88,9 @@ public class HeadlessGenerator implements PlatformChunkGenerator {
|
||||
.injector((xx, yy, zz, biomeBase) -> chunk.setBiomeAt(ox + xx, yy, oz + zz,
|
||||
INMS.get().getTrueBiomeBaseId(biomeBase)))
|
||||
.build();
|
||||
getEngine().generate(x * 16, z * 16,
|
||||
getEngine().generate(x << 4, z << 4,
|
||||
Hunk.view((ChunkGenerator.ChunkData) tc), Hunk.view((ChunkGenerator.BiomeGrid) tc),
|
||||
false);
|
||||
true);
|
||||
chunk.cleanupPalettesAndBlockStates();
|
||||
} catch (Throwable e) {
|
||||
Iris.error("======================================");
|
||||
@@ -131,15 +131,7 @@ public class HeadlessGenerator implements PlatformChunkGenerator {
|
||||
}
|
||||
}), avgLast(x, z));
|
||||
last.add(new Position2(x, z));
|
||||
|
||||
e.complete();
|
||||
|
||||
J.a(() -> PregenTask.iterateRegion(x, z, (ii, jj) -> {
|
||||
getEngine().cleanupMantleChunk(ii, jj);
|
||||
if (listener != null) {
|
||||
listener.onChunkCleaned(ii, jj);
|
||||
}
|
||||
}));
|
||||
}
|
||||
|
||||
private Position2 avgLast(int x, int z) {
|
||||
@@ -153,8 +145,8 @@ public class HeadlessGenerator implements PlatformChunkGenerator {
|
||||
|
||||
for(Position2 i : last)
|
||||
{
|
||||
xx += 7 * (i.getX() - x);
|
||||
zz += 7 * (i.getZ() - z);
|
||||
xx += 27 * (i.getX() - x);
|
||||
zz += 27 * (i.getZ() - z);
|
||||
}
|
||||
|
||||
return new Position2((int)xx, (int)zz);
|
||||
|
||||
@@ -123,7 +123,7 @@ public class MCAFile {
|
||||
if (raf.readByte() == 0) {
|
||||
continue;
|
||||
}
|
||||
p2.add(new Position2(x & 31, (z / 32) & 31));
|
||||
p2.add(new Position2(x & 31, (z / 31) & 31));
|
||||
}
|
||||
return p2;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user