This commit is contained in:
Daniel Mills 2020-01-16 20:36:17 -05:00
parent c47526ce8e
commit 05eb0b20be
5 changed files with 230 additions and 14 deletions

View File

@ -14,7 +14,7 @@ public class Settings
public int threadPriority = Thread.MAX_PRIORITY;
public int compilerPriority = Thread.MAX_PRIORITY;
public int threadCount = 4;
public boolean debugMode = true;
public boolean debugMode = false;
public int compilerThreads = 12;
public int decorationAccuracy = 1;
public int cascadeLimit = 14;
@ -41,10 +41,10 @@ public class Settings
public double caveScale = 1.45;
public double biomeScale = 2.5;
public boolean flatBedrock = true;
public boolean genObjects = true;
public boolean genCarving = true;
public boolean genCaverns = true;
public boolean genCaves = true;
public boolean genObjects = false;
public boolean genCarving = false;
public boolean genCaverns = false;
public boolean genCaves = false;
public double carvingChance = 0.352;
public double cavernChance = 0.321;
public int minCarvingHeight = 75;

View File

@ -59,6 +59,7 @@ 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);
@ -144,6 +145,7 @@ 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++)
{
@ -160,7 +162,7 @@ public class IrisGenerator extends ParallelChunkGenerator
}
}
L.i("Signature = " + world.getSeed() + " + " + glBiome.getBiome(0, 0).getRealBiome().ordinal() +" + "+ computeHeight(0, 0, new ChunkPlan(), biome("Plains")));
L.i("Signature = " + world.getSeed() + " + " + glBiome.getBiome(0, 0).getRealBiome().ordinal() + " + " + computeHeight(0, 0, new ChunkPlan(), biome("Plains")));
}
@Override
@ -255,12 +257,14 @@ public class IrisGenerator extends ParallelChunkGenerator
}
@Override
public Biome genColumn(int wxx, int wzx, int x, int z, ChunkPlan plan)
public Biome genColumn(int wxxf, int wzxf, int x, int z, ChunkPlan plan)
{
double wx = getOffsetX(wxxf);
double wz = getOffsetZ(wzxf);
int wxx = (int) wx;
int wzx = (int) wz;
int highest = 0;
int seaLevel = Iris.settings.gen.seaLevel;
double wx = getOffsetX(wxx);
double wz = getOffsetZ(wzx);
IrisBiome biome = getBiome(wxx, wzx);
boolean frozen = getRegion(biome) != null ? getRegion(biome).isFrozen() : false;
int height = computeHeight(wxx, wzx, plan, biome);

View File

@ -63,6 +63,53 @@ public class GenLayerBiome extends GenLayer
}
}
public boolean hasBorder(int checks, double distance, double... dims)
{
IrisBiome current = getBiome(dims[0], dims[1]);
double ajump = 360D / (double) checks;
if(dims.length == 2)
{
for(int i = 0; i < checks; i++)
{
double dx = M.sin((float) Math.toRadians(ajump * i));
double dz = M.cos((float) Math.toRadians(ajump * i));
if(!current.equals(getBiome((dx * distance) + dims[0], (dz * distance) + dims[1])))
{
return true;
}
}
}
return false;
}
public boolean hasHeightBorder(int checks, double distance, double... dims)
{
IrisBiome current = getBiome(dims[0], dims[1]);
double ajump = 360D / (double) checks;
if(dims.length == 2)
{
for(int i = 0; i < checks; i++)
{
double dx = M.sin((float) Math.toRadians(ajump * i));
double dz = M.cos((float) Math.toRadians(ajump * i));
if(current.getHeight() != getBiome((dx * distance) + dims[0], (dz * distance) + dims[1]).getHeight())
{
return true;
}
}
}
return false;
}
public boolean isBorder(int wx, int wz, double range)
{
return hasHeightBorder(6, range, wx, wz);
}
public EnumPolygonGenerator<IrisBiome> getRegionGenerator(double xx, double zz)
{
return regionGenerator.getChoice(xx, zz).getGen();

View File

@ -657,4 +657,172 @@ public class IrisBiome
{
return cliffChance;
}
@Override
public int hashCode()
{
final int prime = 31;
int result = 1;
long temp;
temp = Double.doubleToLongBits(amp);
result = prime * result + (int) (temp ^ (temp >>> 32));
temp = Double.doubleToLongBits(cliffChance);
result = prime * result + (int) (temp ^ (temp >>> 32));
temp = Double.doubleToLongBits(cliffScale);
result = prime * result + (int) (temp ^ (temp >>> 32));
result = prime * result + (cliffs ? 1231 : 1237);
result = prime * result + (core ? 1231 : 1237);
result = prime * result + ((dirt == null) ? 0 : dirt.hashCode());
result = prime * result + dirtDepth;
temp = Double.doubleToLongBits(height);
result = prime * result + (int) (temp ^ (temp >>> 32));
result = prime * result + ((name == null) ? 0 : name.hashCode());
result = prime * result + ((poly == null) ? 0 : poly.hashCode());
result = prime * result + ((polyRock == null) ? 0 : polyRock.hashCode());
result = prime * result + ((polySub == null) ? 0 : polySub.hashCode());
result = prime * result + ((realBiome == null) ? 0 : realBiome.hashCode());
result = prime * result + ((region == null) ? 0 : region.hashCode());
result = prime * result + ((rock == null) ? 0 : rock.hashCode());
result = prime * result + rockDepth;
temp = Double.doubleToLongBits(rockScale);
result = prime * result + (int) (temp ^ (temp >>> 32));
result = prime * result + ((scatterChance == null) ? 0 : scatterChance.hashCode());
result = prime * result + (scatterSurface ? 1231 : 1237);
result = prime * result + (scatterSurfaceRock ? 1231 : 1237);
result = prime * result + (scatterSurfaceSub ? 1231 : 1237);
result = prime * result + ((schematicGroups == null) ? 0 : schematicGroups.hashCode());
result = prime * result + (simplexScatter ? 1231 : 1237);
result = prime * result + (simplexScatterRock ? 1231 : 1237);
result = prime * result + (simplexScatterSub ? 1231 : 1237);
temp = Double.doubleToLongBits(snow);
result = prime * result + (int) (temp ^ (temp >>> 32));
temp = Double.doubleToLongBits(subSurfaceScale);
result = prime * result + (int) (temp ^ (temp >>> 32));
result = prime * result + ((surface == null) ? 0 : surface.hashCode());
temp = Double.doubleToLongBits(surfaceScale);
result = prime * result + (int) (temp ^ (temp >>> 32));
return result;
}
@Override
public boolean equals(Object obj)
{
if(this == obj)
return true;
if(obj == null)
return false;
if(getClass() != obj.getClass())
return false;
IrisBiome other = (IrisBiome) obj;
if(Double.doubleToLongBits(amp) != Double.doubleToLongBits(other.amp))
return false;
if(Double.doubleToLongBits(cliffChance) != Double.doubleToLongBits(other.cliffChance))
return false;
if(Double.doubleToLongBits(cliffScale) != Double.doubleToLongBits(other.cliffScale))
return false;
if(cliffs != other.cliffs)
return false;
if(core != other.core)
return false;
if(dirt == null)
{
if(other.dirt != null)
return false;
}
else if(!dirt.equals(other.dirt))
return false;
if(dirtDepth != other.dirtDepth)
return false;
if(Double.doubleToLongBits(height) != Double.doubleToLongBits(other.height))
return false;
if(name == null)
{
if(other.name != null)
return false;
}
else if(!name.equals(other.name))
return false;
if(poly == null)
{
if(other.poly != null)
return false;
}
else if(!poly.equals(other.poly))
return false;
if(polyRock == null)
{
if(other.polyRock != null)
return false;
}
else if(!polyRock.equals(other.polyRock))
return false;
if(polySub == null)
{
if(other.polySub != null)
return false;
}
else if(!polySub.equals(other.polySub))
return false;
if(realBiome != other.realBiome)
return false;
if(region == null)
{
if(other.region != null)
return false;
}
else if(!region.equals(other.region))
return false;
if(rock == null)
{
if(other.rock != null)
return false;
}
else if(!rock.equals(other.rock))
return false;
if(rockDepth != other.rockDepth)
return false;
if(Double.doubleToLongBits(rockScale) != Double.doubleToLongBits(other.rockScale))
return false;
if(scatterChance == null)
{
if(other.scatterChance != null)
return false;
}
else if(!scatterChance.equals(other.scatterChance))
return false;
if(scatterSurface != other.scatterSurface)
return false;
if(scatterSurfaceRock != other.scatterSurfaceRock)
return false;
if(scatterSurfaceSub != other.scatterSurfaceSub)
return false;
if(schematicGroups == null)
{
if(other.schematicGroups != null)
return false;
}
else if(!schematicGroups.equals(other.schematicGroups))
return false;
if(simplexScatter != other.simplexScatter)
return false;
if(simplexScatterRock != other.simplexScatterRock)
return false;
if(simplexScatterSub != other.simplexScatterSub)
return false;
if(Double.doubleToLongBits(snow) != Double.doubleToLongBits(other.snow))
return false;
if(Double.doubleToLongBits(subSurfaceScale) != Double.doubleToLongBits(other.subSurfaceScale))
return false;
if(surface == null)
{
if(other.surface != null)
return false;
}
else if(!surface.equals(other.surface))
return false;
if(Double.doubleToLongBits(surfaceScale) != Double.doubleToLongBits(other.surfaceScale))
return false;
return true;
}
}

View File

@ -14,7 +14,6 @@ import ninja.bytecode.shuriken.execution.ChronoLatch;
import ninja.bytecode.shuriken.execution.TaskExecutor;
import ninja.bytecode.shuriken.execution.TaskExecutor.TaskGroup;
import ninja.bytecode.shuriken.execution.TaskExecutor.TaskResult;
import ninja.bytecode.shuriken.logging.L;
import ninja.bytecode.shuriken.math.RollingSequence;
import ninja.bytecode.shuriken.reaction.O;
@ -99,8 +98,6 @@ public abstract class ParallelChunkGenerator extends ChunkGenerator
catch(Throwable e)
{
e.printStackTrace();
for(int i = 0; i < 16; i++)
{
for(int j = 0; j < 16; j++)