mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2026-04-05 15:26:28 +00:00
Fixes (for now)
This commit is contained in:
@@ -59,7 +59,6 @@ public class IrisGenerator extends ParallelChunkGenerator
|
||||
|
||||
private double[][][] scatterCache;
|
||||
private CNG scatter;
|
||||
private CNG fff;
|
||||
public GMap<String, IrisBiome> biomeCache = new GMap<>();
|
||||
private MB WATER = new MB(Material.STATIONARY_WATER);
|
||||
private MB ICE = new MB(Material.ICE);
|
||||
@@ -145,7 +144,6 @@ public class IrisGenerator extends ParallelChunkGenerator
|
||||
glCliffs = new GenLayerCliffs(this, world, random, rTerrain.nextParallelRNG(9));
|
||||
scatterCache = new double[16][][];
|
||||
scatter = new CNG(rTerrain.nextParallelRNG(52), 1, 1).scale(10);
|
||||
fff = new CNG(rTerrain.nextParallelRNG(53), 1, 1).scale(0.01);
|
||||
|
||||
for(int i = 0; i < 16; i++)
|
||||
{
|
||||
@@ -162,7 +160,12 @@ public class IrisGenerator extends ParallelChunkGenerator
|
||||
}
|
||||
}
|
||||
|
||||
L.i("Signature = " + world.getSeed() + " + " + glBiome.getBiome(0, 0).getRealBiome().ordinal() + " + " + computeHeight(0, 0, new ChunkPlan(), biome("Plains")));
|
||||
int m = 0;
|
||||
|
||||
for(IrisBiome i : biomeCache.values())
|
||||
{
|
||||
i.seal(getRTerrain().nextParallelRNG(1922 - m++));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -173,9 +176,7 @@ public class IrisGenerator extends ParallelChunkGenerator
|
||||
|
||||
public IrisBiome getBiome(int wxx, int wzx)
|
||||
{
|
||||
double wx = Math.round((double) wxx * (Iris.settings.gen.horizontalZoom / 1.90476190476));
|
||||
double wz = Math.round((double) wzx * (Iris.settings.gen.horizontalZoom / 1.90476190476));
|
||||
return glBiome.getBiome(wx * Iris.settings.gen.biomeScale, wz * Iris.settings.gen.biomeScale);
|
||||
return glBiome.getBiome(wxx, wzx);
|
||||
}
|
||||
|
||||
public IrisBiome biome(String name)
|
||||
@@ -240,8 +241,8 @@ public class IrisGenerator extends ParallelChunkGenerator
|
||||
|
||||
public double getANoise(int x, int z, ChunkPlan plan, IrisBiome biome)
|
||||
{
|
||||
double hv = IrisInterpolation.getNoise(x, z, Iris.settings.gen.hermiteSampleRadius, (xf, zf) -> getBiomedHeight((int) Math.round(xf), (int) Math.round(zf), plan));
|
||||
hv += glLNoise.generateLayer(hv * Iris.settings.gen.roughness * 215, (double) x * Iris.settings.gen.roughness * 0.82, (double) z * Iris.settings.gen.roughness * 0.82) * (1.6918 * (hv * 2.35));
|
||||
double hv = Iris.settings.performance.interpolation ? IrisInterpolation.getNoise(x, z, Iris.settings.gen.hermiteSampleRadius, (xf, zf) -> getBiomedHeight((int) Math.round(xf), (int) Math.round(zf), plan)) : getBiomedHeight((int) Math.round(x), (int) Math.round(z), plan);
|
||||
hv += Iris.settings.performance.surfaceNoise ? glLNoise.generateLayer(hv * Iris.settings.gen.roughness * 215, (double) x * Iris.settings.gen.roughness * 0.82, (double) z * Iris.settings.gen.roughness * 0.82) * (1.6918 * (hv * 2.35)) : 0;
|
||||
|
||||
if(biome.hasCliffs())
|
||||
{
|
||||
@@ -272,6 +273,7 @@ public class IrisGenerator extends ParallelChunkGenerator
|
||||
IrisBiome nbiome = height < 63 ? getOcean(biome, height) : biome;
|
||||
biome = nbiome;
|
||||
biome = height > 61 && height < 65 ? frozen ? biome : getBeach(biome) : biome;
|
||||
biome = height > 63 && biome.isCore() ? getBeach(biome) : biome;
|
||||
|
||||
for(int i = 0; i < max; i++)
|
||||
{
|
||||
@@ -378,11 +380,19 @@ public class IrisGenerator extends ParallelChunkGenerator
|
||||
|
||||
if(xh == -1)
|
||||
{
|
||||
int wx = (int) Math.round((double) x * (Iris.settings.gen.horizontalZoom / 1.90476190476));
|
||||
int wz = (int) Math.round((double) z * (Iris.settings.gen.horizontalZoom / 1.90476190476));
|
||||
IrisBiome biome = glBiome.getBiome(wx * Iris.settings.gen.biomeScale, wz * Iris.settings.gen.biomeScale);
|
||||
IrisBiome biome = glBiome.getBiome(x, z);
|
||||
double h = Iris.settings.gen.baseHeight + biome.getHeight();
|
||||
h += (glBase.getHeight(wx, wz) * 0.5) - (0.33 * 0.5);
|
||||
|
||||
if(Iris.settings.performance.baseNoise)
|
||||
{
|
||||
h += (glBase.getHeight(x, z) * 0.5) - (0.08);
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
h += 0.00001;
|
||||
}
|
||||
|
||||
plan.setHeight(x, z, h);
|
||||
return h;
|
||||
}
|
||||
|
||||
@@ -199,45 +199,31 @@ public class GenObjectGroup
|
||||
GList<GenObject> inject = new GList<>();
|
||||
String x = Thread.currentThread().getName();
|
||||
ReentrantLock rr = new ReentrantLock();
|
||||
TaskExecutor ex = new TaskExecutor(Iris.settings.performance.compilerThreads, Iris.settings.performance.compilerPriority, x + "/Subroutine ");
|
||||
TaskGroup gg = ex.startWork();
|
||||
for(GenObject i : getSchematics())
|
||||
{
|
||||
for(Direction j : new Direction[] {Direction.S, Direction.E, Direction.W})
|
||||
{
|
||||
GenObject cp = i.copy();
|
||||
|
||||
gg.queue(() ->
|
||||
{
|
||||
GenObject f = cp;
|
||||
f.rotate(Direction.N, j);
|
||||
rr.lock();
|
||||
inject.add(f);
|
||||
rr.unlock();
|
||||
});
|
||||
GenObject f = cp;
|
||||
f.rotate(Direction.N, j);
|
||||
rr.lock();
|
||||
inject.add(f);
|
||||
rr.unlock();
|
||||
}
|
||||
}
|
||||
|
||||
gg.execute();
|
||||
gg = ex.startWork();
|
||||
getSchematics().add(inject);
|
||||
|
||||
for(GenObject i : getSchematics())
|
||||
{
|
||||
gg.queue(() ->
|
||||
i.recalculateMountShift();
|
||||
|
||||
for(String j : flags)
|
||||
{
|
||||
i.recalculateMountShift();
|
||||
|
||||
for(String j : flags)
|
||||
{
|
||||
i.computeFlag(j);
|
||||
}
|
||||
});
|
||||
i.computeFlag(j);
|
||||
}
|
||||
}
|
||||
|
||||
gg.execute();
|
||||
ex.close();
|
||||
|
||||
L.i(ChatColor.LIGHT_PURPLE + "Processed " + ChatColor.WHITE + F.f(schematics.size()) + ChatColor.LIGHT_PURPLE + " Schematics in " + ChatColor.WHITE + name);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,16 +24,16 @@ public class GenLayerBase extends GenLayer
|
||||
//@builder
|
||||
super(iris, world, random, rng);
|
||||
hfracture = new CNG(rng.nextParallelRNG(6), 1, 2)
|
||||
.scale(0.0124);
|
||||
gen = new CNG(rng.nextParallelRNG(7), 0.19D, 7)
|
||||
.scale(0.012)
|
||||
.scale(0.0024);
|
||||
gen = new CNG(rng.nextParallelRNG(7), 0.24D, 7)
|
||||
.scale(0.0072)
|
||||
.amp(0.5)
|
||||
.freq(1.1)
|
||||
.fractureWith(new CNG(rng.nextParallelRNG(8), 1, 6)
|
||||
.scale(0.018)
|
||||
.scale(0.0007)
|
||||
.injectWith(CNG.MULTIPLY)
|
||||
.child(new CNG(rng.nextParallelRNG(9), 0.745, 2)
|
||||
.scale(0.1)), 44);
|
||||
.scale(0.001)), 44);
|
||||
height = new CNG(rng.nextParallelRNG(10), 1, 8)
|
||||
.scale(0.0017601 * Iris.settings.gen.heightScale)
|
||||
.fractureWith(new CNG(rng.nextParallelRNG(11), 1, 6)
|
||||
@@ -42,11 +42,11 @@ public class GenLayerBase extends GenLayer
|
||||
.scale(0.0034), 31)
|
||||
.scale(0.066), 58);
|
||||
superheight = new CNG(rng.nextParallelRNG(13), 1, 6)
|
||||
.scale(0.025 * Iris.settings.gen.superHeightScale)
|
||||
.scale(0.0125)
|
||||
.fractureWith(new CNG(rng.nextParallelRNG(14), 1, 1)
|
||||
.scale(0.13), 250);
|
||||
.scale(0.013), 250);
|
||||
fracture = new CNG(rng.nextParallelRNG(15), 0.6D, 4)
|
||||
.scale(0.118);
|
||||
.scale(0.01);
|
||||
//@done
|
||||
}
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@ public class GenLayerBiome extends GenLayer
|
||||
|
||||
for(IrisBiome i : biomes)
|
||||
{
|
||||
if(i.getName().equals("Beach"))
|
||||
if(i.getRegion().equals("default"))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
@@ -61,6 +61,18 @@ public class GenLayerBiome extends GenLayer
|
||||
v += 13 - i.getName().length();
|
||||
i.setGen(new EnumPolygonGenerator<IrisBiome>(rng.nextParallelRNG(33 + v), 0.000255 * i.getBiomes().size() * Iris.settings.gen.biomeScale, 1, i.getBiomes().toArray(new IrisBiome[i.getBiomes().size()]), factory));
|
||||
}
|
||||
|
||||
int m = 0;
|
||||
|
||||
for(IrisRegion i : regions.values())
|
||||
{
|
||||
for(IrisBiome j : i.getBiomes())
|
||||
{
|
||||
j.seal(iris.getRTerrain().nextParallelRNG(3922 - m++));
|
||||
}
|
||||
|
||||
i.getBeach().seal(iris.getRTerrain().nextParallelRNG(3922 - m++));
|
||||
}
|
||||
}
|
||||
|
||||
public boolean hasBorder(int checks, double distance, double... dims)
|
||||
@@ -115,24 +127,31 @@ public class GenLayerBiome extends GenLayer
|
||||
return regionGenerator.getChoice(xx, zz).getGen();
|
||||
}
|
||||
|
||||
public IrisBiome getBiome(double xx, double zz)
|
||||
public IrisBiome getBiome(double wxx, double wzx)
|
||||
{
|
||||
double x = xx + (Iris.settings.gen.biomeEdgeScramble == 0 ? 0 : (fracture.noise(zz, xx) * Iris.settings.gen.biomeEdgeScramble));
|
||||
double z = zz - (Iris.settings.gen.biomeEdgeScramble == 0 ? 0 : (fracture.noise(xx, zz) * Iris.settings.gen.biomeEdgeScramble));
|
||||
double wx = Math.round((double) wxx * (Iris.settings.gen.horizontalZoom / 1.90476190476)) * Iris.settings.gen.biomeScale;
|
||||
double wz = Math.round((double) wzx * (Iris.settings.gen.horizontalZoom / 1.90476190476)) * Iris.settings.gen.biomeScale;
|
||||
double x = wx + (Iris.settings.gen.biomeEdgeScramble == 0 ? 0 : (fracture.noise(wz, wx) * Iris.settings.gen.biomeEdgeScramble));
|
||||
double z = wz - (Iris.settings.gen.biomeEdgeScramble == 0 ? 0 : (fracture.noise(wx, wz) * Iris.settings.gen.biomeEdgeScramble));
|
||||
IrisBiome cbi = iris.biome("Ocean");
|
||||
double land = island.noise(x, z);
|
||||
double landChance = 1D - M.clip(Iris.settings.gen.landChance, 0D, 1D);
|
||||
|
||||
if(land > landChance + 0.0175)
|
||||
if(land > landChance)
|
||||
{
|
||||
cbi = getRegionGenerator(x, z).getChoice(x, z);
|
||||
}
|
||||
|
||||
else if(land < 0.3)
|
||||
else if(land < 0.4)
|
||||
{
|
||||
cbi = iris.biome("Deep Ocean");
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
cbi = iris.biome("Ocean");
|
||||
}
|
||||
|
||||
return cbi;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user