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

@@ -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++)
{
@@ -159,8 +161,8 @@ 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

@@ -39,7 +39,7 @@ public class GenLayerBiome extends GenLayer
{
continue;
}
if(!regions.containsKey(i.getRegion()))
{
regions.put(i.getRegion(), new IrisRegion(i.getRegion()));
@@ -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();