mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2025-07-20 03:04:08 +00:00
Optimization
This commit is contained in:
parent
e6b59bc16d
commit
9aa6d1c0fc
@ -28,7 +28,6 @@ import com.volmit.iris.util.IrisLock;
|
|||||||
import com.volmit.iris.util.IrisStructureResult;
|
import com.volmit.iris.util.IrisStructureResult;
|
||||||
import com.volmit.iris.util.KList;
|
import com.volmit.iris.util.KList;
|
||||||
import com.volmit.iris.util.KMap;
|
import com.volmit.iris.util.KMap;
|
||||||
import com.volmit.iris.util.NastyRunnable;
|
|
||||||
import com.volmit.iris.util.PrecisionStopwatch;
|
import com.volmit.iris.util.PrecisionStopwatch;
|
||||||
import com.volmit.iris.util.RNG;
|
import com.volmit.iris.util.RNG;
|
||||||
|
|
||||||
@ -45,7 +44,6 @@ public abstract class ParallaxChunkGenerator extends TerrainChunkGenerator imple
|
|||||||
private MasterLock masterLock;
|
private MasterLock masterLock;
|
||||||
private IrisLock flock = new IrisLock("ParallaxLock");
|
private IrisLock flock = new IrisLock("ParallaxLock");
|
||||||
private IrisLock lock = new IrisLock("ParallaxLock");
|
private IrisLock lock = new IrisLock("ParallaxLock");
|
||||||
private IrisLock lockq = new IrisLock("ParallaxQueueLock");
|
|
||||||
private GenLayerUpdate glUpdate;
|
private GenLayerUpdate glUpdate;
|
||||||
private GenLayerText glText;
|
private GenLayerText glText;
|
||||||
private int sliverBuffer;
|
private int sliverBuffer;
|
||||||
@ -230,7 +228,6 @@ public abstract class ParallaxChunkGenerator extends TerrainChunkGenerator imple
|
|||||||
{
|
{
|
||||||
String key = "par." + x + "." + z;
|
String key = "par." + x + "." + z;
|
||||||
ChunkPosition rad = getDimension().getParallaxSize(this);
|
ChunkPosition rad = getDimension().getParallaxSize(this);
|
||||||
KList<NastyRunnable> q = new KList<>();
|
|
||||||
|
|
||||||
for(int ii = x - (rad.getX() / 2); ii <= x + (rad.getX() / 2); ii++)
|
for(int ii = x - (rad.getX() / 2); ii <= x + (rad.getX() / 2); ii++)
|
||||||
{
|
{
|
||||||
@ -275,12 +272,7 @@ public abstract class ParallaxChunkGenerator extends TerrainChunkGenerator imple
|
|||||||
for(IrisObjectPlacement m : k.getObjects())
|
for(IrisObjectPlacement m : k.getObjects())
|
||||||
{
|
{
|
||||||
int gg = g++;
|
int gg = g++;
|
||||||
lockq.lock();
|
placeObject(m, i, j, random.nextParallelRNG((34 * ((i * 30) + (j * 30) + gg) * i * j) + i - j + 1569962));
|
||||||
q.add(() ->
|
|
||||||
{
|
|
||||||
placeObject(m, i, j, random.nextParallelRNG((34 * ((i * 30) + (j * 30) + gg) * i * j) + i - j + 1569962));
|
|
||||||
});
|
|
||||||
lockq.unlock();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
continue searching;
|
continue searching;
|
||||||
@ -292,63 +284,33 @@ public abstract class ParallaxChunkGenerator extends TerrainChunkGenerator imple
|
|||||||
|
|
||||||
for(IrisTextPlacement k : getDimension().getText())
|
for(IrisTextPlacement k : getDimension().getText())
|
||||||
{
|
{
|
||||||
lockq.lock();
|
k.place(this, random.nextParallelRNG(-7228 + (34 * ((i * 30) + (j * 30)) * i * j) + i - j + 1569962), i, j);
|
||||||
q.add(() ->
|
|
||||||
{
|
|
||||||
k.place(this, random.nextParallelRNG(-7228 + (34 * ((i * 30) + (j * 30)) * i * j) + i - j + 1569962), i, j);
|
|
||||||
});
|
|
||||||
lockq.unlock();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
for(IrisTextPlacement k : r.getText())
|
for(IrisTextPlacement k : r.getText())
|
||||||
{
|
{
|
||||||
lockq.lock();
|
k.place(this, random.nextParallelRNG(-4228 + -7228 + (34 * ((i * 30) + (j * 30)) * i * j) + i - j + 1569962), i, j);
|
||||||
q.add(() ->
|
|
||||||
{
|
|
||||||
k.place(this, random.nextParallelRNG(-4228 + -7228 + (34 * ((i * 30) + (j * 30)) * i * j) + i - j + 1569962), i, j);
|
|
||||||
});
|
|
||||||
lockq.unlock();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
for(IrisTextPlacement k : b.getText())
|
for(IrisTextPlacement k : b.getText())
|
||||||
{
|
{
|
||||||
lockq.lock();
|
k.place(this, random.nextParallelRNG(-22228 + -4228 + -7228 + (34 * ((i * 30) + (j * 30)) * i * j) + i - j + 1569962), i, j);
|
||||||
q.add(() ->
|
|
||||||
{
|
|
||||||
k.place(this, random.nextParallelRNG(-22228 + -4228 + -7228 + (34 * ((i * 30) + (j * 30)) * i * j) + i - j + 1569962), i, j);
|
|
||||||
});
|
|
||||||
lockq.unlock();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
for(IrisStructurePlacement k : r.getStructures())
|
for(IrisStructurePlacement k : r.getStructures())
|
||||||
{
|
{
|
||||||
lockq.lock();
|
k.place(this, random.nextParallelRNG(2228), i, j);
|
||||||
q.add(() ->
|
|
||||||
{
|
|
||||||
k.place(this, random.nextParallelRNG(2228), i, j);
|
|
||||||
});
|
|
||||||
lockq.unlock();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
for(IrisStructurePlacement k : b.getStructures())
|
for(IrisStructurePlacement k : b.getStructures())
|
||||||
{
|
{
|
||||||
lockq.lock();
|
k.place(this, random.nextParallelRNG(-22228), i, j);
|
||||||
q.add(() ->
|
|
||||||
{
|
|
||||||
k.place(this, random.nextParallelRNG(-22228), i, j);
|
|
||||||
});
|
|
||||||
lockq.unlock();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
for(IrisObjectPlacement k : b.getObjects())
|
for(IrisObjectPlacement k : b.getObjects())
|
||||||
{
|
{
|
||||||
int gg = g++;
|
int gg = g++;
|
||||||
lockq.lock();
|
placeObject(k, i, j, random.nextParallelRNG((34 * ((i * 30) + (j * 30) + gg) * i * j) + i - j + 3569222));
|
||||||
q.add(() ->
|
|
||||||
{
|
|
||||||
placeObject(k, i, j, random.nextParallelRNG((34 * ((i * 30) + (j * 30) + gg) * i * j) + i - j + 3569222));
|
|
||||||
});
|
|
||||||
lockq.unlock();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if(getDimension().isCaves())
|
if(getDimension().isCaves())
|
||||||
@ -371,12 +333,7 @@ public abstract class ParallaxChunkGenerator extends TerrainChunkGenerator imple
|
|||||||
for(IrisObjectPlacement k : biome.getObjects())
|
for(IrisObjectPlacement k : biome.getObjects())
|
||||||
{
|
{
|
||||||
int gg = g++;
|
int gg = g++;
|
||||||
lockq.lock();
|
placeCaveObject(k, i, j, random.nextParallelRNG((34 * ((i * 30) + (j * 30) + gg) * i * j) + i - j + 1869322));
|
||||||
q.add(() ->
|
|
||||||
{
|
|
||||||
placeCaveObject(k, i, j, random.nextParallelRNG((34 * ((i * 30) + (j * 30) + gg) * i * j) + i - j + 1869322));
|
|
||||||
});
|
|
||||||
lockq.unlock();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -386,14 +343,6 @@ public abstract class ParallaxChunkGenerator extends TerrainChunkGenerator imple
|
|||||||
}
|
}
|
||||||
|
|
||||||
getAccelerant().waitFor(key);
|
getAccelerant().waitFor(key);
|
||||||
lockq.lock();
|
|
||||||
for(NastyRunnable i : q)
|
|
||||||
{
|
|
||||||
getAccelerant().queue(key + "-obj", i);
|
|
||||||
}
|
|
||||||
lockq.unlock();
|
|
||||||
|
|
||||||
getAccelerant().waitFor(key + "-obj");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void placeObject(IrisObjectPlacement o, int x, int z, RNG rng)
|
public void placeObject(IrisObjectPlacement o, int x, int z, RNG rng)
|
||||||
|
@ -37,7 +37,7 @@ public abstract class ParallelChunkGenerator extends DimensionChunkGenerator
|
|||||||
{
|
{
|
||||||
threads = tc;
|
threads = tc;
|
||||||
GroupedExecutor e = accelerant;
|
GroupedExecutor e = accelerant;
|
||||||
accelerant = new GroupedExecutor(threads, Thread.NORM_PRIORITY, "Iris Generator - " + world.getName());
|
accelerant = new GroupedExecutor(threads, Thread.MAX_PRIORITY, "Iris Generator - " + world.getName());
|
||||||
Iris.executors.add(accelerant);
|
Iris.executors.add(accelerant);
|
||||||
|
|
||||||
if(e != null)
|
if(e != null)
|
||||||
@ -90,8 +90,7 @@ public abstract class ParallelChunkGenerator extends DimensionChunkGenerator
|
|||||||
int j = jj;
|
int j = jj;
|
||||||
int wz = (z * 16) + j;
|
int wz = (z * 16) + j;
|
||||||
AtomicSliver sliver = map.getSliver(i, j);
|
AtomicSliver sliver = map.getSliver(i, j);
|
||||||
|
getAccelerant().queue(key, () ->
|
||||||
accelerant.queue(key, () ->
|
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
@ -200,10 +200,10 @@ public class GenLayerBiome extends GenLayer
|
|||||||
double x = bx / iris.getDimension().getBiomeZoom();
|
double x = bx / iris.getDimension().getBiomeZoom();
|
||||||
double z = bz / iris.getDimension().getBiomeZoom();
|
double z = bz / iris.getDimension().getBiomeZoom();
|
||||||
|
|
||||||
if(!parent.getRealChildren(iris).isEmpty())
|
if(parent.getRealChildren(iris).isNotEmpty())
|
||||||
{
|
{
|
||||||
CNG childCell = parent.getChildrenGenerator(rng, 123, parent.getChildShrinkFactor());
|
CNG childCell = parent.getChildrenGenerator(rng, 123, parent.getChildShrinkFactor());
|
||||||
KList<IrisBiome> chx = parent.getRealChildren(iris).copy(); // TODO Cache
|
KList<IrisBiome> chx = parent.getRealChildren(iris).copy();
|
||||||
chx.add(parent);
|
chx.add(parent);
|
||||||
IrisBiome biome = childCell.fitRarity(chx, x, z);
|
IrisBiome biome = childCell.fitRarity(chx, x, z);
|
||||||
biome.setInferredType(parent.getInferredType());
|
biome.setInferredType(parent.getInferredType());
|
||||||
|
@ -40,9 +40,9 @@ public class GenLayerCave extends GenLayer
|
|||||||
}
|
}
|
||||||
|
|
||||||
KList<CaveResult> result = new KList<>();
|
KList<CaveResult> result = new KList<>();
|
||||||
gg.SetNoiseType(NoiseType.Cellular);
|
gg.setNoiseType(NoiseType.Cellular);
|
||||||
gg.SetCellularReturnType(CellularReturnType.Distance2Sub);
|
gg.setCellularReturnType(CellularReturnType.Distance2Sub);
|
||||||
gg.SetCellularDistanceFunction(CellularDistanceFunction.Natural);
|
gg.setCellularDistanceFunction(CellularDistanceFunction.Natural);
|
||||||
|
|
||||||
for(int i = 0; i < iris.getDimension().getCaveLayers().size(); i++)
|
for(int i = 0; i < iris.getDimension().getCaveLayers().size(); i++)
|
||||||
{
|
{
|
||||||
|
@ -27,13 +27,13 @@ public class CellGenerator
|
|||||||
RNG rx = rng.nextParallelRNG(8735652);
|
RNG rx = rng.nextParallelRNG(8735652);
|
||||||
int s = rx.nextInt();
|
int s = rx.nextInt();
|
||||||
fn = new FastNoise(s);
|
fn = new FastNoise(s);
|
||||||
fn.SetNoiseType(FastNoise.NoiseType.Cellular);
|
fn.setNoiseType(FastNoise.NoiseType.Cellular);
|
||||||
fn.SetCellularReturnType(FastNoise.CellularReturnType.CellValue);
|
fn.setCellularReturnType(FastNoise.CellularReturnType.CellValue);
|
||||||
fn.SetCellularDistanceFunction(FastNoise.CellularDistanceFunction.Natural);
|
fn.setCellularDistanceFunction(FastNoise.CellularDistanceFunction.Natural);
|
||||||
fd = new FastNoise(s);
|
fd = new FastNoise(s);
|
||||||
fd.SetNoiseType(FastNoise.NoiseType.Cellular);
|
fd.setNoiseType(FastNoise.NoiseType.Cellular);
|
||||||
fd.SetCellularReturnType(FastNoise.CellularReturnType.Distance2Sub);
|
fd.setCellularReturnType(FastNoise.CellularReturnType.Distance2Sub);
|
||||||
fd.SetCellularDistanceFunction(FastNoise.CellularDistanceFunction.Natural);
|
fd.setCellularDistanceFunction(FastNoise.CellularDistanceFunction.Natural);
|
||||||
}
|
}
|
||||||
|
|
||||||
public float getDistance(double x, double z)
|
public float getDistance(double x, double z)
|
||||||
|
@ -7,9 +7,9 @@ public class CellHeightNoise implements NoiseGenerator {
|
|||||||
|
|
||||||
public CellHeightNoise(long seed) {
|
public CellHeightNoise(long seed) {
|
||||||
this.n = new FastNoise((int) seed);
|
this.n = new FastNoise((int) seed);
|
||||||
n.SetNoiseType(FastNoise.NoiseType.Cellular);
|
n.setNoiseType(FastNoise.NoiseType.Cellular);
|
||||||
n.SetCellularReturnType(FastNoise.CellularReturnType.Distance2Sub);
|
n.setCellularReturnType(FastNoise.CellularReturnType.Distance2Sub);
|
||||||
n.SetCellularDistanceFunction(FastNoise.CellularDistanceFunction.Natural);
|
n.setCellularDistanceFunction(FastNoise.CellularDistanceFunction.Natural);
|
||||||
}
|
}
|
||||||
|
|
||||||
private double filter(double noise) {
|
private double filter(double noise) {
|
||||||
|
@ -1,27 +1,32 @@
|
|||||||
package com.volmit.iris.noise;
|
package com.volmit.iris.noise;
|
||||||
|
|
||||||
public class CellularNoise implements NoiseGenerator {
|
public class CellularNoise implements NoiseGenerator
|
||||||
|
{
|
||||||
private final FastNoise n;
|
private final FastNoise n;
|
||||||
|
|
||||||
public CellularNoise(long seed) {
|
public CellularNoise(long seed)
|
||||||
|
{
|
||||||
this.n = new FastNoise((int) seed);
|
this.n = new FastNoise((int) seed);
|
||||||
n.SetNoiseType(FastNoise.NoiseType.Cellular);
|
n.setNoiseType(FastNoise.NoiseType.Cellular);
|
||||||
n.SetCellularReturnType(FastNoise.CellularReturnType.CellValue);
|
n.setCellularReturnType(FastNoise.CellularReturnType.CellValue);
|
||||||
n.SetCellularDistanceFunction(FastNoise.CellularDistanceFunction.Natural);
|
n.setCellularDistanceFunction(FastNoise.CellularDistanceFunction.Natural);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public double noise(double x) {
|
public double noise(double x)
|
||||||
|
{
|
||||||
return (n.GetCellular((float) x, 0) / 2D) + 0.5D;
|
return (n.GetCellular((float) x, 0) / 2D) + 0.5D;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public double noise(double x, double z) {
|
public double noise(double x, double z)
|
||||||
|
{
|
||||||
return (n.GetCellular((float) x, (float) z) / 2D) + 0.5D;
|
return (n.GetCellular((float) x, (float) z) / 2D) + 0.5D;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public double noise(double x, double y, double z) {
|
public double noise(double x, double y, double z)
|
||||||
|
{
|
||||||
return (n.GetCellular((float) x, (float) y, (float) z) / 2D) + 0.5D;
|
return (n.GetCellular((float) x, (float) y, (float) z) / 2D) + 0.5D;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
File diff suppressed because one or more lines are too long
@ -8,8 +8,8 @@ public class FractalBillowPerlinNoise implements NoiseGenerator, OctaveNoise {
|
|||||||
|
|
||||||
public FractalBillowPerlinNoise(long seed) {
|
public FractalBillowPerlinNoise(long seed) {
|
||||||
this.n = new FastNoise(new RNG(seed).imax());
|
this.n = new FastNoise(new RNG(seed).imax());
|
||||||
n.SetFractalOctaves(1);
|
n.setFractalOctaves(1);
|
||||||
n.SetFractalType(FractalType.Billow);
|
n.setFractalType(FractalType.Billow);
|
||||||
}
|
}
|
||||||
|
|
||||||
public double f(double v) {
|
public double f(double v) {
|
||||||
@ -33,6 +33,6 @@ public class FractalBillowPerlinNoise implements NoiseGenerator, OctaveNoise {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setOctaves(int o) {
|
public void setOctaves(int o) {
|
||||||
n.SetFractalOctaves(o);
|
n.setFractalOctaves(o);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -8,8 +8,8 @@ public class FractalBillowSimplexNoise implements NoiseGenerator, OctaveNoise {
|
|||||||
|
|
||||||
public FractalBillowSimplexNoise(long seed) {
|
public FractalBillowSimplexNoise(long seed) {
|
||||||
this.n = new FastNoise(new RNG(seed).imax());
|
this.n = new FastNoise(new RNG(seed).imax());
|
||||||
n.SetFractalOctaves(1);
|
n.setFractalOctaves(1);
|
||||||
n.SetFractalType(FractalType.Billow);
|
n.setFractalType(FractalType.Billow);
|
||||||
}
|
}
|
||||||
|
|
||||||
public double f(double v) {
|
public double f(double v) {
|
||||||
@ -33,6 +33,6 @@ public class FractalBillowSimplexNoise implements NoiseGenerator, OctaveNoise {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setOctaves(int o) {
|
public void setOctaves(int o) {
|
||||||
n.SetFractalOctaves(o);
|
n.setFractalOctaves(o);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -7,7 +7,7 @@ public class FractalCubicNoise implements NoiseGenerator {
|
|||||||
|
|
||||||
public FractalCubicNoise(long seed) {
|
public FractalCubicNoise(long seed) {
|
||||||
this.n = new FastNoise((int) seed);
|
this.n = new FastNoise((int) seed);
|
||||||
n.SetFractalType(FractalType.Billow);
|
n.setFractalType(FractalType.Billow);
|
||||||
}
|
}
|
||||||
|
|
||||||
private double f(double n) {
|
private double f(double n) {
|
||||||
|
@ -8,8 +8,8 @@ public class FractalFBMSimplexNoise implements NoiseGenerator, OctaveNoise {
|
|||||||
|
|
||||||
public FractalFBMSimplexNoise(long seed) {
|
public FractalFBMSimplexNoise(long seed) {
|
||||||
this.n = new FastNoise(new RNG(seed).imax());
|
this.n = new FastNoise(new RNG(seed).imax());
|
||||||
n.SetFractalOctaves(1);
|
n.setFractalOctaves(1);
|
||||||
n.SetFractalType(FractalType.FBM);
|
n.setFractalType(FractalType.FBM);
|
||||||
}
|
}
|
||||||
|
|
||||||
public double f(double v) {
|
public double f(double v) {
|
||||||
@ -33,6 +33,6 @@ public class FractalFBMSimplexNoise implements NoiseGenerator, OctaveNoise {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setOctaves(int o) {
|
public void setOctaves(int o) {
|
||||||
n.SetFractalOctaves(o);
|
n.setFractalOctaves(o);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -8,8 +8,8 @@ public class FractalRigidMultiSimplexNoise implements NoiseGenerator, OctaveNois
|
|||||||
|
|
||||||
public FractalRigidMultiSimplexNoise(long seed) {
|
public FractalRigidMultiSimplexNoise(long seed) {
|
||||||
this.n = new FastNoise(new RNG(seed).imax());
|
this.n = new FastNoise(new RNG(seed).imax());
|
||||||
n.SetFractalOctaves(1);
|
n.setFractalOctaves(1);
|
||||||
n.SetFractalType(FractalType.RigidMulti);
|
n.setFractalType(FractalType.RigidMulti);
|
||||||
}
|
}
|
||||||
|
|
||||||
public double f(double v) {
|
public double f(double v) {
|
||||||
@ -33,6 +33,6 @@ public class FractalRigidMultiSimplexNoise implements NoiseGenerator, OctaveNois
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setOctaves(int o) {
|
public void setOctaves(int o) {
|
||||||
n.SetFractalOctaves(o);
|
n.setFractalOctaves(o);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -5,9 +5,9 @@ public class GlobNoise implements NoiseGenerator {
|
|||||||
|
|
||||||
public GlobNoise(long seed) {
|
public GlobNoise(long seed) {
|
||||||
this.n = new FastNoise((int) seed);
|
this.n = new FastNoise((int) seed);
|
||||||
n.SetNoiseType(FastNoise.NoiseType.Cellular);
|
n.setNoiseType(FastNoise.NoiseType.Cellular);
|
||||||
n.SetCellularReturnType(FastNoise.CellularReturnType.Distance2Div);
|
n.setCellularReturnType(FastNoise.CellularReturnType.Distance2Div);
|
||||||
n.SetCellularDistanceFunction(FastNoise.CellularDistanceFunction.Natural);
|
n.setCellularDistanceFunction(FastNoise.CellularDistanceFunction.Natural);
|
||||||
}
|
}
|
||||||
|
|
||||||
private double f(double n)
|
private double f(double n)
|
||||||
|
@ -8,7 +8,7 @@ public class PerlinNoise implements NoiseGenerator, OctaveNoise {
|
|||||||
|
|
||||||
public PerlinNoise(long seed) {
|
public PerlinNoise(long seed) {
|
||||||
this.n = new FastNoise(new RNG(seed).imax());
|
this.n = new FastNoise(new RNG(seed).imax());
|
||||||
n.SetNoiseType(FastNoise.NoiseType.Perlin);
|
n.setNoiseType(FastNoise.NoiseType.Perlin);
|
||||||
octaves = 1;
|
octaves = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -8,7 +8,7 @@ public class SimplexNoise implements NoiseGenerator, OctaveNoise {
|
|||||||
|
|
||||||
public SimplexNoise(long seed) {
|
public SimplexNoise(long seed) {
|
||||||
this.n = new FastNoise(new RNG(seed).imax());
|
this.n = new FastNoise(new RNG(seed).imax());
|
||||||
n.SetNoiseType(FastNoise.NoiseType.Simplex);
|
n.setNoiseType(FastNoise.NoiseType.Simplex);
|
||||||
octaves = 1;
|
octaves = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -7,9 +7,9 @@ public class VascularNoise implements NoiseGenerator {
|
|||||||
|
|
||||||
public VascularNoise(long seed) {
|
public VascularNoise(long seed) {
|
||||||
this.n = new FastNoise((int) seed);
|
this.n = new FastNoise((int) seed);
|
||||||
n.SetNoiseType(FastNoise.NoiseType.Cellular);
|
n.setNoiseType(FastNoise.NoiseType.Cellular);
|
||||||
n.SetCellularReturnType(FastNoise.CellularReturnType.Distance2Sub);
|
n.setCellularReturnType(FastNoise.CellularReturnType.Distance2Sub);
|
||||||
n.SetCellularDistanceFunction(FastNoise.CellularDistanceFunction.Natural);
|
n.setCellularDistanceFunction(FastNoise.CellularDistanceFunction.Natural);
|
||||||
}
|
}
|
||||||
|
|
||||||
private double filter(double noise) {
|
private double filter(double noise) {
|
||||||
|
@ -31,7 +31,6 @@ import lombok.EqualsAndHashCode;
|
|||||||
@EqualsAndHashCode(callSuper = false)
|
@EqualsAndHashCode(callSuper = false)
|
||||||
public class IrisObject extends IrisRegistrant
|
public class IrisObject extends IrisRegistrant
|
||||||
{
|
{
|
||||||
private static final Material SNOW = Material.SNOW;
|
|
||||||
private static final BlockData AIR = B.getBlockData("CAVE_AIR");
|
private static final BlockData AIR = B.getBlockData("CAVE_AIR");
|
||||||
private static final BlockData[] SNOW_LAYERS = new BlockData[] {B.getBlockData("minecraft:snow[layers=1]"), B.getBlockData("minecraft:snow[layers=2]"), B.getBlockData("minecraft:snow[layers=3]"), B.getBlockData("minecraft:snow[layers=4]"), B.getBlockData("minecraft:snow[layers=5]"), B.getBlockData("minecraft:snow[layers=6]"), B.getBlockData("minecraft:snow[layers=7]"), B.getBlockData("minecraft:snow[layers=8]")};
|
private static final BlockData[] SNOW_LAYERS = new BlockData[] {B.getBlockData("minecraft:snow[layers=1]"), B.getBlockData("minecraft:snow[layers=2]"), B.getBlockData("minecraft:snow[layers=3]"), B.getBlockData("minecraft:snow[layers=4]"), B.getBlockData("minecraft:snow[layers=5]"), B.getBlockData("minecraft:snow[layers=6]"), B.getBlockData("minecraft:snow[layers=7]"), B.getBlockData("minecraft:snow[layers=8]")};
|
||||||
public static boolean shitty = false;
|
public static boolean shitty = false;
|
||||||
@ -469,12 +468,6 @@ public class IrisObject extends IrisRegistrant
|
|||||||
|
|
||||||
if(config.getSnow() > 0)
|
if(config.getSnow() > 0)
|
||||||
{
|
{
|
||||||
BlockData bd = placer.get(vx, vy, vz);
|
|
||||||
if(bd != null && bd.getMaterial().equals(SNOW))
|
|
||||||
{
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
int height = rngx.i(0, (int) (config.getSnow() * 7));
|
int height = rngx.i(0, (int) (config.getSnow() * 7));
|
||||||
placer.set(vx, vy + 1, vz, SNOW_LAYERS[Math.max(Math.min(height, 7), 0)]);
|
placer.set(vx, vy + 1, vz, SNOW_LAYERS[Math.max(Math.min(height, 7), 0)]);
|
||||||
}
|
}
|
||||||
|
@ -6,8 +6,6 @@ import java.util.concurrent.ForkJoinPool;
|
|||||||
import java.util.concurrent.ForkJoinPool.ForkJoinWorkerThreadFactory;
|
import java.util.concurrent.ForkJoinPool.ForkJoinWorkerThreadFactory;
|
||||||
import java.util.concurrent.ForkJoinWorkerThread;
|
import java.util.concurrent.ForkJoinWorkerThread;
|
||||||
|
|
||||||
import com.volmit.iris.Iris;
|
|
||||||
|
|
||||||
public class GroupedExecutor
|
public class GroupedExecutor
|
||||||
{
|
{
|
||||||
private int xc;
|
private int xc;
|
||||||
@ -73,21 +71,12 @@ public class GroupedExecutor
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
PrecisionStopwatch s = PrecisionStopwatch.start();
|
|
||||||
|
|
||||||
while(true)
|
while(true)
|
||||||
{
|
{
|
||||||
if(mirror.get(g) == 0)
|
if(mirror.get(g) == 0)
|
||||||
{
|
{
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(s.getMilliseconds() > 30000)
|
|
||||||
{
|
|
||||||
Iris.warn("Couldn't unlock grouped task: " + g + "! Clearing Task Group Forcibly and timing out!");
|
|
||||||
mirror.remove(g);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user