mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2025-07-18 18:23:06 +00:00
Performance Improvements
This commit is contained in:
parent
cd07f29038
commit
f1e3210c7a
2
pom.xml
2
pom.xml
@ -120,12 +120,14 @@
|
||||
</repository>
|
||||
</repositories>
|
||||
<dependencies>
|
||||
<!-- Spigot API -->
|
||||
<dependency>
|
||||
<groupId>org.spigotmc</groupId>
|
||||
<artifactId>spigot-api</artifactId>
|
||||
<version>1.16.1-R0.1-SNAPSHOT</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<!-- Utilities -->
|
||||
<dependency>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok</artifactId>
|
||||
|
@ -74,6 +74,7 @@ public abstract class TerrainChunkGenerator extends ParallelChunkGenerator
|
||||
|
||||
try
|
||||
{
|
||||
KList<Runnable> surfaces = new KList<>();
|
||||
int highestPlaced = 0;
|
||||
BlockData block;
|
||||
int fluidHeight = getDimension().getFluidHeight();
|
||||
@ -82,11 +83,11 @@ public abstract class TerrainChunkGenerator extends ParallelChunkGenerator
|
||||
double wx = getZoomed(ox);
|
||||
double wz = getZoomed(oz);
|
||||
int depth = 0;
|
||||
double noise = getNoiseHeight(rx, rz);
|
||||
int height = (int) Math.round(noise) + fluidHeight;
|
||||
double noise = getNoiseHeight(rx, rz) + fluidHeight;
|
||||
int height = (int) Math.round(noise);
|
||||
boolean carvable = getDimension().isCarving() && height > getDimension().getCarvingMin();
|
||||
IrisRegion region = sampleRegion(rx, rz);
|
||||
BiomeResult biomeResult = sampleTrueBiome(rx, rz);
|
||||
BiomeResult biomeResult = sampleTrueBiome(rx, rz, noise);
|
||||
IrisBiome biome = biomeResult.getBiome();
|
||||
double airReversal = biomeResult.getHeightOffset();
|
||||
|
||||
@ -206,13 +207,12 @@ public abstract class TerrainChunkGenerator extends ParallelChunkGenerator
|
||||
|
||||
sliver.set(k, block);
|
||||
highestPlaced = Math.max(highestPlaced, k);
|
||||
|
||||
if(!cavernSurface && (k == height && block.getMaterial().isSolid() && k < fluidHeight))
|
||||
{
|
||||
decorateUnderwater(biome, sliver, wx, k, wz, rx, rz, block);
|
||||
}
|
||||
|
||||
if((carvable && cavernSurface) || (k == Math.max(height, fluidHeight) && block.getMaterial().isSolid() && k < 255 && k >= fluidHeight))
|
||||
if((carvable && cavernSurface) && !(k == Math.max(height, fluidHeight) && block.getMaterial().isSolid() && k < 255 && k >= fluidHeight))
|
||||
{
|
||||
decorateLand(biome, sliver, wx, k, wz, rx, rz, block);
|
||||
}
|
||||
@ -256,10 +256,22 @@ public abstract class TerrainChunkGenerator extends ParallelChunkGenerator
|
||||
}
|
||||
}
|
||||
|
||||
block = sliver.get(Math.max(height, fluidHeight));
|
||||
|
||||
if(block.getMaterial().isSolid())
|
||||
{
|
||||
decorateLand(biome, sliver, wx, Math.max(height, fluidHeight), wz, rx, rz, block);
|
||||
}
|
||||
|
||||
if(!sampled && cachingAllowed && highestPlaced < height)
|
||||
{
|
||||
cacheHeightMap[(z << 4) | x] = highestPlaced;
|
||||
}
|
||||
|
||||
for(Runnable i : surfaces)
|
||||
{
|
||||
i.run();
|
||||
}
|
||||
}
|
||||
|
||||
catch(Throwable e)
|
||||
@ -502,7 +514,7 @@ public abstract class TerrainChunkGenerator extends ParallelChunkGenerator
|
||||
return getBiomeHeight(wx, wz, rx, rz);
|
||||
}
|
||||
|
||||
public BiomeResult sampleTrueBiomeBase(int x, int z)
|
||||
public BiomeResult sampleTrueBiomeBase(int x, int z, int height)
|
||||
{
|
||||
if(!getDimension().getFocus().equals(""))
|
||||
{
|
||||
@ -512,7 +524,6 @@ public abstract class TerrainChunkGenerator extends ParallelChunkGenerator
|
||||
double wx = getModifiedX(x, z);
|
||||
double wz = getModifiedZ(x, z);
|
||||
IrisRegion region = sampleRegion(x, z);
|
||||
int height = (int) Math.round(getTerrainHeight(x, z));
|
||||
double sh = region.getShoreHeight(wx, wz);
|
||||
IrisBiome current = sampleBiome(x, z).getBiome();
|
||||
|
||||
@ -569,6 +580,11 @@ public abstract class TerrainChunkGenerator extends ParallelChunkGenerator
|
||||
}
|
||||
|
||||
public BiomeResult sampleTrueBiome(int x, int z)
|
||||
{
|
||||
return sampleTrueBiome(x, z, getTerrainHeight(x, z));
|
||||
}
|
||||
|
||||
public BiomeResult sampleTrueBiome(int x, int z, double noise)
|
||||
{
|
||||
if(!getDimension().getFocus().equals(""))
|
||||
{
|
||||
@ -583,9 +599,9 @@ public abstract class TerrainChunkGenerator extends ParallelChunkGenerator
|
||||
double wx = getModifiedX(x, z);
|
||||
double wz = getModifiedZ(x, z);
|
||||
IrisRegion region = sampleRegion(x, z);
|
||||
int height = sampleHeight(x, z);
|
||||
int height = (int) Math.round(noise);
|
||||
double sh = region.getShoreHeight(wx, wz);
|
||||
BiomeResult res = sampleTrueBiomeBase(x, z);
|
||||
BiomeResult res = sampleTrueBiomeBase(x, z, height);
|
||||
IrisBiome current = res.getBiome();
|
||||
|
||||
if(current.isSea() && height > getDimension().getFluidHeight() - sh)
|
||||
|
@ -119,11 +119,11 @@ public class GenLayerBiome extends GenLayer
|
||||
|
||||
public InferredType getType(double bx, double bz, IrisRegion regionData)
|
||||
{
|
||||
bridgeGenerator.setShuffle(0);
|
||||
bridgeGenerator.setShuffle(47);
|
||||
bridgeGenerator.setCellScale(0.33 / iris.getDimension().getContinentZoom());
|
||||
double x = bx / iris.getDimension().getBiomeZoom();
|
||||
double z = bz / iris.getDimension().getBiomeZoom();
|
||||
return bridgeGenerator.getIndex(x, z, 2) == 1 ? InferredType.SEA : InferredType.LAND;
|
||||
return bridgeGenerator.getIndex(x, z, 2) == 1 ? InferredType.LAND : InferredType.SEA;
|
||||
}
|
||||
|
||||
public BiomeResult generateBiomeData(double bx, double bz, IrisRegion regionData, RarityCellGenerator cell, KList<IrisBiome> biomes, InferredType inferredType)
|
||||
|
Loading…
x
Reference in New Issue
Block a user