mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2025-07-18 18:23:06 +00:00
Fixes (for now)
This commit is contained in:
parent
05eb0b20be
commit
165517608d
@ -12,34 +12,33 @@ public class Settings
|
||||
public PerformanceMode performanceMode = PerformanceMode.UNLIMITED;
|
||||
public boolean fastDecoration = true;
|
||||
public int threadPriority = Thread.MAX_PRIORITY;
|
||||
public int compilerPriority = Thread.MAX_PRIORITY;
|
||||
public int threadCount = 4;
|
||||
public boolean debugMode = false;
|
||||
public int compilerThreads = 12;
|
||||
public boolean debugMode = true;
|
||||
public int decorationAccuracy = 1;
|
||||
public int cascadeLimit = 14;
|
||||
public boolean interpolation = true;
|
||||
public boolean surfaceNoise = true;
|
||||
public boolean baseNoise = true;
|
||||
}
|
||||
|
||||
public static class GeneratorSettings
|
||||
{
|
||||
public int hermiteSampleRadius = 6;
|
||||
public double horizontalZoom = 1;
|
||||
public double horizontalZoom = 2;
|
||||
public double heightFracture = 155;
|
||||
public double beachScale = 76;
|
||||
public double landScale = 0.325;
|
||||
public double landChance = 0.62;
|
||||
public double landScale = 0.5;
|
||||
public double landChance = 0.5;
|
||||
public double biomeEdgeScramble = 1550D; // 1550D
|
||||
public double roughness = 1.55;
|
||||
public double heightMultiplier = 0.806;
|
||||
public double heightExponentBase = 1;
|
||||
public double heightExponentMultiplier = 1.41;
|
||||
public double heightScale = 0.56;
|
||||
public double superHeightScale = 0.95;
|
||||
public double baseHeight = 0.165;
|
||||
public int seaLevel = 63;
|
||||
public double caveDensity = 4;
|
||||
public double caveScale = 1.45;
|
||||
public double biomeScale = 2.5;
|
||||
public double biomeScale = 1.65;
|
||||
public boolean flatBedrock = true;
|
||||
public boolean genObjects = false;
|
||||
public boolean genCarving = false;
|
||||
|
@ -18,8 +18,6 @@ import ninja.bytecode.shuriken.bench.PrecisionStopwatch;
|
||||
import ninja.bytecode.shuriken.collections.GList;
|
||||
import ninja.bytecode.shuriken.collections.GMap;
|
||||
import ninja.bytecode.shuriken.execution.J;
|
||||
import ninja.bytecode.shuriken.execution.TaskExecutor;
|
||||
import ninja.bytecode.shuriken.execution.TaskExecutor.TaskGroup;
|
||||
import ninja.bytecode.shuriken.format.F;
|
||||
import ninja.bytecode.shuriken.io.IO;
|
||||
import ninja.bytecode.shuriken.json.JSONException;
|
||||
@ -106,16 +104,11 @@ public class PackController implements IrisController
|
||||
|
||||
L.v(ChatColor.LIGHT_PURPLE + "Processing Content");
|
||||
|
||||
TaskExecutor exf = new TaskExecutor(Iris.settings.performance.compilerThreads, Iris.settings.performance.compilerPriority, "Iris Compiler");
|
||||
TaskGroup gg = exf.startWork();
|
||||
for(GenObjectGroup i : genObjectGroups.v())
|
||||
{
|
||||
gg.queue(i::processVariants);
|
||||
i.processVariants();
|
||||
}
|
||||
|
||||
gg.execute();
|
||||
exf.close();
|
||||
|
||||
for(String i : dimensions.k())
|
||||
{
|
||||
IrisDimension id = dimensions.get(i);
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
@ -14,6 +14,7 @@ import ninja.bytecode.shuriken.collections.GMap;
|
||||
import ninja.bytecode.shuriken.execution.J;
|
||||
import ninja.bytecode.shuriken.json.JSONArray;
|
||||
import ninja.bytecode.shuriken.json.JSONObject;
|
||||
import ninja.bytecode.shuriken.logging.L;
|
||||
import ninja.bytecode.shuriken.math.CNG;
|
||||
import ninja.bytecode.shuriken.math.M;
|
||||
import ninja.bytecode.shuriken.math.RNG;
|
||||
@ -26,17 +27,17 @@ public class IrisBiome
|
||||
|
||||
//@builder
|
||||
private static final IrisBiome OCEAN = new IrisBiome("Ocean", Biome.OCEAN)
|
||||
.height(-0.2)
|
||||
.height(-0.4)
|
||||
.coreBiome()
|
||||
.surface(MB.of(Material.SAND), MB.of(Material.SAND), MB.of(Material.SAND), MB.of(Material.CLAY), MB.of(Material.GRAVEL))
|
||||
.simplexSurface();
|
||||
private static final IrisBiome FROZEN_OCEAN = new IrisBiome("Frozen Ocean", Biome.FROZEN_OCEAN)
|
||||
.height(-0.16)
|
||||
.height(-0.4)
|
||||
.coreBiome()
|
||||
.surface(MB.of(Material.SAND), MB.of(Material.SAND), MB.of(Material.SAND), MB.of(Material.CLAY), MB.of(Material.GRAVEL))
|
||||
.simplexSurface();
|
||||
private static final IrisBiome DEEP_OCEAN = new IrisBiome("Deep Ocean", Biome.DEEP_OCEAN)
|
||||
.height(-0.4)
|
||||
.height(-0.6)
|
||||
.coreBiome()
|
||||
.surface(MB.of(Material.SAND), MB.of(Material.CLAY), MB.of(Material.GRAVEL))
|
||||
.simplexSurface();
|
||||
@ -176,6 +177,57 @@ public class IrisBiome
|
||||
fromJSON(o, true);
|
||||
}
|
||||
|
||||
public void seal(RNG rng)
|
||||
{
|
||||
if(simplexScatter)
|
||||
{
|
||||
poly = new PolygonGenerator.EnumPolygonGenerator<MB>(rng, 0.125, 2, getSurface().toArray(new MB[getSurface().size()]), (g) ->
|
||||
{
|
||||
return g.scale(0.09 * surfaceScale).fractureWith(new CNG(rng.nextParallelRNG(56), 1D, 2).scale(0.0955), 55);
|
||||
});
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
poly = new PolygonGenerator.EnumPolygonGenerator<MB>(rng, 15.05, 2, getSurface().toArray(new MB[getSurface().size()]), (g) ->
|
||||
{
|
||||
return g.scale(surfaceScale).fractureWith(new CNG(rng.nextParallelRNG(55), 1D, 2).scale(0.0155), 224);
|
||||
});
|
||||
}
|
||||
|
||||
if(simplexScatterSub)
|
||||
{
|
||||
polySub = new PolygonGenerator.EnumPolygonGenerator<MB>(rng, 0.125, 2, getDirt().toArray(new MB[getDirt().size()]), (g) ->
|
||||
{
|
||||
return g.scale(0.06 * subSurfaceScale).fractureWith(new CNG(rng.nextParallelRNG(526), 1D, 2).scale(0.0955), 55);
|
||||
});
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
polySub = new PolygonGenerator.EnumPolygonGenerator<MB>(rng, 15.05, 2, getDirt().toArray(new MB[getDirt().size()]), (g) ->
|
||||
{
|
||||
return g.scale(subSurfaceScale).fractureWith(new CNG(rng.nextParallelRNG(515), 1D, 2).scale(0.0155), 224);
|
||||
});
|
||||
}
|
||||
|
||||
if(simplexScatterRock)
|
||||
{
|
||||
polyRock = new PolygonGenerator.EnumPolygonGenerator<MB>(rng, 0.125, 2, getRock().toArray(new MB[getRock().size()]), (g) ->
|
||||
{
|
||||
return g.scale(0.08 * rockScale).fractureWith(new CNG(rng.nextParallelRNG(562), 1D, 2).scale(0.0955), 55);
|
||||
});
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
polyRock = new PolygonGenerator.EnumPolygonGenerator<MB>(rng, 15.05, 2, getRock().toArray(new MB[getRock().size()]), (g) ->
|
||||
{
|
||||
return g.scale(rockScale).fractureWith(new CNG(rng.nextParallelRNG(551), 1D, 2).scale(0.0155), 224);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
public void fromJSON(JSONObject o, boolean chain)
|
||||
{
|
||||
name = o.getString("name");
|
||||
@ -462,29 +514,19 @@ public class IrisBiome
|
||||
{
|
||||
double wx = x + 1000D;
|
||||
double wz = z + 1000D;
|
||||
|
||||
if(polySub == null)
|
||||
{
|
||||
L.w(getName() + " is not sealed!");
|
||||
}
|
||||
|
||||
if(simplexScatter)
|
||||
{
|
||||
if(poly == null)
|
||||
{
|
||||
poly = new PolygonGenerator.EnumPolygonGenerator<MB>(rng, 0.125, 2, getSurface().toArray(new MB[getSurface().size()]), (g) ->
|
||||
{
|
||||
return g.scale(0.09 * surfaceScale).fractureWith(new CNG(rng.nextParallelRNG(56), 1D, 2).scale(0.0955), 55);
|
||||
});
|
||||
}
|
||||
|
||||
return poly.getChoice(wx / 3, wz / 3);
|
||||
}
|
||||
|
||||
if(scatterSurface)
|
||||
{
|
||||
if(poly == null)
|
||||
{
|
||||
poly = new PolygonGenerator.EnumPolygonGenerator<MB>(rng, 15.05, 2, getSurface().toArray(new MB[getSurface().size()]), (g) ->
|
||||
{
|
||||
return g.scale(surfaceScale).fractureWith(new CNG(rng.nextParallelRNG(55), 1D, 2).scale(0.0155), 224);
|
||||
});
|
||||
}
|
||||
|
||||
return poly.getChoice(wx * 0.2D, wz * 0.2D);
|
||||
}
|
||||
|
||||
@ -495,29 +537,19 @@ public class IrisBiome
|
||||
{
|
||||
double wx = x + 1000D;
|
||||
double wz = z + 1000D;
|
||||
|
||||
if(polySub == null)
|
||||
{
|
||||
L.w(getName() + " is not sealed!");
|
||||
}
|
||||
|
||||
if(simplexScatterSub)
|
||||
{
|
||||
if(polySub == null)
|
||||
{
|
||||
polySub = new PolygonGenerator.EnumPolygonGenerator<MB>(rng, 0.125, 2, getDirt().toArray(new MB[getDirt().size()]), (g) ->
|
||||
{
|
||||
return g.scale(0.06 * subSurfaceScale).fractureWith(new CNG(rng.nextParallelRNG(526), 1D, 2).scale(0.0955), 55);
|
||||
});
|
||||
}
|
||||
|
||||
return polySub.getChoice(wx / 3, i / 3, wz / 3);
|
||||
}
|
||||
|
||||
if(scatterSurfaceSub)
|
||||
{
|
||||
if(polySub == null)
|
||||
{
|
||||
polySub = new PolygonGenerator.EnumPolygonGenerator<MB>(rng, 15.05, 2, getDirt().toArray(new MB[getDirt().size()]), (g) ->
|
||||
{
|
||||
return g.scale(subSurfaceScale).fractureWith(new CNG(rng.nextParallelRNG(515), 1D, 2).scale(0.0155), 224);
|
||||
});
|
||||
}
|
||||
|
||||
return polySub.getChoice(wx * 0.2D, i / 3, wz * 0.2D);
|
||||
}
|
||||
|
||||
@ -528,29 +560,19 @@ public class IrisBiome
|
||||
{
|
||||
double wx = x + 1000D;
|
||||
double wz = z + 1000D;
|
||||
|
||||
if(polySub == null)
|
||||
{
|
||||
L.w(getName() + " is not sealed!");
|
||||
}
|
||||
|
||||
if(simplexScatterRock)
|
||||
{
|
||||
if(polyRock == null)
|
||||
{
|
||||
polyRock = new PolygonGenerator.EnumPolygonGenerator<MB>(rng, 0.125, 2, getRock().toArray(new MB[getRock().size()]), (g) ->
|
||||
{
|
||||
return g.scale(0.08 * rockScale).fractureWith(new CNG(rng.nextParallelRNG(562), 1D, 2).scale(0.0955), 55);
|
||||
});
|
||||
}
|
||||
|
||||
return polyRock.getChoice(wx / 3, i / 3, wz / 3);
|
||||
}
|
||||
|
||||
if(scatterSurfaceRock)
|
||||
{
|
||||
if(polyRock == null)
|
||||
{
|
||||
polyRock = new PolygonGenerator.EnumPolygonGenerator<MB>(rng, 15.05, 2, getRock().toArray(new MB[getRock().size()]), (g) ->
|
||||
{
|
||||
return g.scale(rockScale).fractureWith(new CNG(rng.nextParallelRNG(551), 1D, 2).scale(0.0155), 224);
|
||||
});
|
||||
}
|
||||
|
||||
return polyRock.getChoice(wx * 0.2D, i * 0.2D, wz * 0.2D);
|
||||
}
|
||||
|
||||
@ -824,5 +846,4 @@ public class IrisBiome
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -68,26 +68,14 @@ public class IrisDimension
|
||||
private GList<IrisBiome> biomesFromArray(JSONArray a) throws JSONException, IOException
|
||||
{
|
||||
GList<IrisBiome> b = new GList<>();
|
||||
TaskExecutor ex = new TaskExecutor(Iris.settings.performance.compilerThreads, Iris.settings.performance.compilerPriority, "Iris Loader");
|
||||
TaskGroup g = ex.startWork();
|
||||
ReentrantLock lock = new ReentrantLock();
|
||||
|
||||
for(int i = 0; i < a.length(); i++)
|
||||
{
|
||||
int ii = i;
|
||||
g.queue(() ->
|
||||
{
|
||||
IrisBiome bb = Iris.getController(PackController.class).loadBiome(a.getString(ii));
|
||||
lock.lock();
|
||||
Iris.getController(PackController.class).registerBiome(a.getString(ii), bb);
|
||||
b.add(bb);
|
||||
lock.unlock();
|
||||
});
|
||||
IrisBiome bb = Iris.getController(PackController.class).loadBiome(a.getString(ii));
|
||||
Iris.getController(PackController.class).registerBiome(a.getString(ii), bb);
|
||||
b.add(bb);
|
||||
}
|
||||
|
||||
g.execute();
|
||||
ex.close();
|
||||
|
||||
return b;
|
||||
}
|
||||
|
||||
|
@ -40,7 +40,6 @@ public final class AtomicChunkData implements ChunkGenerator.ChunkData
|
||||
{
|
||||
this.maxHeight = world.getMaxHeight();
|
||||
this.w = world;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -1,6 +1,5 @@
|
||||
package ninja.bytecode.iris.util;
|
||||
|
||||
import ninja.bytecode.iris.Iris;
|
||||
import ninja.bytecode.shuriken.math.M;
|
||||
|
||||
public class IrisInterpolation
|
||||
@ -115,17 +114,16 @@ public class IrisInterpolation
|
||||
|
||||
public static double getHermiteNoise(int x, int z, int rad, NoiseProvider n)
|
||||
{
|
||||
int h = rad;
|
||||
int fx = x >> h;
|
||||
int fz = z >> h;
|
||||
int x0 = ((fx - 1) << h);
|
||||
int z0 = ((fz - 1) << h);
|
||||
int x1 = (fx << h);
|
||||
int z1 = (fz << h);
|
||||
int x2 = ((fx + 1) << h);
|
||||
int z2 = ((fz + 1) << h);
|
||||
int x3 = ((fx + 2) << h);
|
||||
int z3 = ((fz + 2) << h);
|
||||
int fx = x >> rad;
|
||||
int fz = z >> rad;
|
||||
int x0 = ((fx - 1) << rad);
|
||||
int z0 = ((fz - 1) << rad);
|
||||
int x1 = (fx << rad);
|
||||
int z1 = (fz << rad);
|
||||
int x2 = ((fx + 1) << rad);
|
||||
int z2 = ((fz + 1) << rad);
|
||||
int x3 = ((fx + 2) << rad);
|
||||
int z3 = ((fz + 2) << rad);
|
||||
double px = M.rangeScale(0, 1, x1, x2, x);
|
||||
double pz = M.rangeScale(0, 1, z1, z2, z);
|
||||
//@builder
|
||||
@ -146,7 +144,7 @@ public class IrisInterpolation
|
||||
n.noise(x3, z1),
|
||||
n.noise(x3, z2),
|
||||
n.noise(x3, z3),
|
||||
px, pz, 0.01, 0);
|
||||
px, pz, 0.00001, 0.5);
|
||||
//@done
|
||||
}
|
||||
|
||||
|
@ -1,15 +0,0 @@
|
||||
package ninja.bytecode.iris.util;
|
||||
|
||||
import org.bukkit.generator.ChunkGenerator;
|
||||
|
||||
import ninja.bytecode.shuriken.collections.GList;
|
||||
|
||||
public class MulticoreChunkGenerator extends ChunkGenerator
|
||||
{
|
||||
private GList<ParallelChunkGenerator> generators;
|
||||
|
||||
public MulticoreChunkGenerator(int tc)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
@ -1,6 +1,7 @@
|
||||
package ninja.bytecode.iris.util;
|
||||
|
||||
import java.util.Random;
|
||||
import java.util.concurrent.locks.ReentrantLock;
|
||||
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.World;
|
||||
@ -24,6 +25,7 @@ public abstract class ParallelChunkGenerator extends ChunkGenerator
|
||||
private int wx;
|
||||
private int wz;
|
||||
private AtomicChunkData data;
|
||||
private ReentrantLock biomeLock;
|
||||
private TaskGroup tg;
|
||||
private boolean ready = false;
|
||||
int cg = 0;
|
||||
@ -52,20 +54,11 @@ public abstract class ParallelChunkGenerator extends ChunkGenerator
|
||||
genPool = Iris.getController(ExecutionController.class).getExecutor(world);
|
||||
}
|
||||
|
||||
if(this.world == null)
|
||||
{
|
||||
ready = false;
|
||||
}
|
||||
|
||||
if(this.world != null && world.getSeed() != this.world.getSeed())
|
||||
{
|
||||
ready = false;
|
||||
}
|
||||
|
||||
this.world = world;
|
||||
data = new AtomicChunkData(world);
|
||||
if(!ready)
|
||||
{
|
||||
biomeLock = new ReentrantLock();
|
||||
onInit(world, random);
|
||||
ready = true;
|
||||
}
|
||||
@ -75,19 +68,25 @@ public abstract class ParallelChunkGenerator extends ChunkGenerator
|
||||
|
||||
for(i = 0; i < 16; i++)
|
||||
{
|
||||
wx = (x * 16) + i;
|
||||
wx = (x << 4) + i;
|
||||
|
||||
for(j = 0; j < 16; j++)
|
||||
{
|
||||
wz = (z * 16) + j;
|
||||
wz = (z << 4) + j;
|
||||
int a = wx;
|
||||
int b = wz;
|
||||
int c = i;
|
||||
int d = j;
|
||||
tg.queue(() -> biome.setBiome(c, d, generateFullColumn(a, b, c, d, plan.get())));
|
||||
tg.queue(() ->
|
||||
{
|
||||
Biome f = generateFullColumn(a, b, c, d, plan.get());
|
||||
biomeLock.lock();
|
||||
biome.setBiome(c, d, f);
|
||||
biomeLock.unlock();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
plan.set(onInitChunk(world, x, z, random));
|
||||
TaskResult r = tg.execute();
|
||||
onPostChunk(world, x, z, random, data, plan.get());
|
||||
|
Loading…
x
Reference in New Issue
Block a user