mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2026-04-09 09:16:12 +00:00
Fixes
This commit is contained in:
@@ -13,6 +13,7 @@ import ninja.bytecode.iris.Iris;
|
||||
import ninja.bytecode.iris.controller.PackController;
|
||||
import ninja.bytecode.iris.generator.genobject.GenObjectDecorator;
|
||||
import ninja.bytecode.iris.generator.genobject.GenObjectGroup;
|
||||
import ninja.bytecode.iris.generator.layer.GenLayerBase;
|
||||
import ninja.bytecode.iris.generator.layer.GenLayerBiome;
|
||||
import ninja.bytecode.iris.generator.layer.GenLayerCarving;
|
||||
import ninja.bytecode.iris.generator.layer.GenLayerCaverns;
|
||||
@@ -21,6 +22,7 @@ import ninja.bytecode.iris.generator.layer.GenLayerLayeredNoise;
|
||||
import ninja.bytecode.iris.generator.layer.GenLayerSnow;
|
||||
import ninja.bytecode.iris.pack.CompiledDimension;
|
||||
import ninja.bytecode.iris.pack.IrisBiome;
|
||||
import ninja.bytecode.iris.pack.IrisRegion;
|
||||
import ninja.bytecode.iris.util.AtomicChunkData;
|
||||
import ninja.bytecode.iris.util.ChunkPlan;
|
||||
import ninja.bytecode.iris.util.IrisInterpolation;
|
||||
@@ -66,8 +68,8 @@ public class IrisGenerator extends ParallelChunkGenerator
|
||||
private GenLayerCarving glCarving;
|
||||
private GenLayerCaverns glCaverns;
|
||||
private GenLayerSnow glSnow;
|
||||
private GenLayerBase glBase;
|
||||
private RNG rTerrain;
|
||||
private CNG lerpf;
|
||||
private CompiledDimension dim;
|
||||
private World world;
|
||||
private GMap<String, GenObjectGroup> schematicCache = new GMap<>();
|
||||
@@ -128,6 +130,7 @@ public class IrisGenerator extends ParallelChunkGenerator
|
||||
{
|
||||
this.world = world;
|
||||
rTerrain = new RNG(world.getSeed() + 1024);
|
||||
glBase = new GenLayerBase(this, world, random, rTerrain.nextParallelRNG(1));
|
||||
glLNoise = new GenLayerLayeredNoise(this, world, random, rTerrain.nextParallelRNG(2));
|
||||
glBiome = new GenLayerBiome(this, world, random, rTerrain.nextParallelRNG(4), dim.getBiomes());
|
||||
glCaves = new GenLayerCaves(this, world, random, rTerrain.nextParallelRNG(-1));
|
||||
@@ -183,8 +186,7 @@ public class IrisGenerator extends ParallelChunkGenerator
|
||||
double hv = IrisInterpolation.getNoise(wxx, wzx,
|
||||
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, wxx * Iris.settings.gen.roughness * 0.82, wzx * Iris.settings.gen.roughness * 0.82) * (1.6918 * (hv * 2.35)) * 0.725;
|
||||
|
||||
hv += glLNoise.generateLayer(hv * Iris.settings.gen.roughness * 215, wxx * Iris.settings.gen.roughness * 0.82, wzx * Iris.settings.gen.roughness * 0.82) * (1.6918 * (hv * 2.35));
|
||||
int height = (int) Math.round(M.clip(hv, 0D, 1D) * 253);
|
||||
int max = Math.max(height, seaLevel);
|
||||
IrisBiome override = null;
|
||||
@@ -192,7 +194,20 @@ public class IrisGenerator extends ParallelChunkGenerator
|
||||
|
||||
if(height > 61 && height < 65 + (glLNoise.getHeight(wz, wx) * Iris.settings.gen.beachScale))
|
||||
{
|
||||
override = biome("Beach");
|
||||
IrisBiome beach = null;
|
||||
IrisRegion region = glBiome.getRegion(biome.getRegion());
|
||||
|
||||
if(region != null)
|
||||
{
|
||||
beach = region.getBeach();
|
||||
}
|
||||
|
||||
if(beach == null)
|
||||
{
|
||||
beach = biome("Beach");
|
||||
}
|
||||
|
||||
override = beach;
|
||||
}
|
||||
|
||||
else if(height < 63)
|
||||
@@ -323,6 +338,7 @@ public class IrisGenerator extends ParallelChunkGenerator
|
||||
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);
|
||||
double h = Iris.settings.gen.baseHeight + biome.getHeight();
|
||||
h += (glBase.getHeight(wx, wz) * 0.5) - (0.33 * 0.5);
|
||||
plan.setHeight(x, z, h);
|
||||
return h;
|
||||
}
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
package ninja.bytecode.iris.generator;
|
||||
|
||||
public class Snippet
|
||||
{
|
||||
public double horizontalZoom = 0.525; // 0.525
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,67 @@
|
||||
package ninja.bytecode.iris.generator.layer;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import org.bukkit.World;
|
||||
|
||||
import ninja.bytecode.iris.Iris;
|
||||
import ninja.bytecode.iris.generator.IrisGenerator;
|
||||
import ninja.bytecode.iris.util.GenLayer;
|
||||
import ninja.bytecode.shuriken.math.CNG;
|
||||
import ninja.bytecode.shuriken.math.M;
|
||||
import ninja.bytecode.shuriken.math.RNG;
|
||||
|
||||
public class GenLayerBase extends GenLayer
|
||||
{
|
||||
private CNG gen;
|
||||
private CNG fracture;
|
||||
private CNG hfracture;
|
||||
private CNG height;
|
||||
private CNG superheight;
|
||||
|
||||
public GenLayerBase(IrisGenerator iris, World world, Random random, RNG rng)
|
||||
{
|
||||
//@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)
|
||||
.amp(0.5)
|
||||
.freq(1.1)
|
||||
.fractureWith(new CNG(rng.nextParallelRNG(8), 1, 6)
|
||||
.scale(0.018)
|
||||
.injectWith(CNG.MULTIPLY)
|
||||
.child(new CNG(rng.nextParallelRNG(9), 0.745, 2)
|
||||
.scale(0.1)), 44);
|
||||
height = new CNG(rng.nextParallelRNG(10), 1, 8)
|
||||
.scale(0.0017601 * Iris.settings.gen.heightScale)
|
||||
.fractureWith(new CNG(rng.nextParallelRNG(11), 1, 6)
|
||||
.scale(0.0174)
|
||||
.fractureWith(new CNG(rng.nextParallelRNG(12), 1, 1)
|
||||
.scale(0.0034), 31)
|
||||
.scale(0.066), 58);
|
||||
superheight = new CNG(rng.nextParallelRNG(13), 1, 6)
|
||||
.scale(0.025 * Iris.settings.gen.superHeightScale)
|
||||
.fractureWith(new CNG(rng.nextParallelRNG(14), 1, 1)
|
||||
.scale(0.13), 250);
|
||||
fracture = new CNG(rng.nextParallelRNG(15), 0.6D, 4)
|
||||
.scale(0.118);
|
||||
//@done
|
||||
}
|
||||
|
||||
public double getHeight(double x, double z)
|
||||
{
|
||||
return M.clip(Math.pow(height.noise(x + (hfracture.noise(x, z) * Iris.settings.gen.heightFracture), z + (hfracture.noise(z, x) * Iris.settings.gen.heightFracture)), Iris.settings.gen.heightExponentBase + (superheight.noise(x, z) * Iris.settings.gen.heightExponentMultiplier)) * Iris.settings.gen.heightMultiplier, 0D, 1D);
|
||||
}
|
||||
|
||||
@Override
|
||||
public double generateLayer(double gnoise, double dx, double dz)
|
||||
{
|
||||
double noise = gnoise + getHeight(dx, dz);
|
||||
double fnoise = fracture.noise(dx, dz);
|
||||
dx += (fnoise * 44);
|
||||
dz -= (fnoise * 44);
|
||||
return ((noise * 0.185) + (gen.noise(dx, dz) * (0.15 + (noise * 0.65))));
|
||||
}
|
||||
}
|
||||
@@ -3,7 +3,6 @@ package ninja.bytecode.iris.generator.layer;
|
||||
import java.util.Random;
|
||||
import java.util.function.Function;
|
||||
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.World;
|
||||
|
||||
import ninja.bytecode.iris.Iris;
|
||||
@@ -11,7 +10,6 @@ import ninja.bytecode.iris.generator.IrisGenerator;
|
||||
import ninja.bytecode.iris.pack.IrisBiome;
|
||||
import ninja.bytecode.iris.pack.IrisRegion;
|
||||
import ninja.bytecode.iris.util.GenLayer;
|
||||
import ninja.bytecode.iris.util.MaxingGenerator;
|
||||
import ninja.bytecode.iris.util.MaxingGenerator.EnumMaxingGenerator;
|
||||
import ninja.bytecode.shuriken.collections.GList;
|
||||
import ninja.bytecode.shuriken.collections.GMap;
|
||||
@@ -22,27 +20,26 @@ import ninja.bytecode.shuriken.math.RNG;
|
||||
public class GenLayerBiome extends GenLayer
|
||||
{
|
||||
private EnumMaxingGenerator<IrisRegion> regionGenerator;
|
||||
private MaxingGenerator roads;
|
||||
private GMap<String, IrisRegion> regions;
|
||||
private Function<CNG, CNG> factory;
|
||||
private CNG pathCheck;
|
||||
private CNG fracture;
|
||||
private CNG island;
|
||||
|
||||
public GenLayerBiome(IrisGenerator iris, World world, Random random, RNG rng, GList<IrisBiome> biomes)
|
||||
{
|
||||
//@builder
|
||||
super(iris, world, random, rng);
|
||||
island = new CNG(rng.nextParallelRNG(10334), 1D, 3).scale(0.003 * Iris.settings.gen.landScale).fractureWith(new CNG(rng.nextParallelRNG(34), 1D, 12).scale(0.6), 180);
|
||||
fracture = new CNG(rng.nextParallelRNG(28), 1D, 24).scale(0.0021).fractureWith(new CNG(rng.nextParallelRNG(34), 1D, 12).scale(0.01), 12250);
|
||||
factory = (g) -> g.fractureWith(new CNG(rng.nextParallelRNG(29), 1D, 4).scale(0.02), 56);
|
||||
pathCheck = new CNG(rng.nextParallelRNG(31), 1D, 1).scale(0.00096);
|
||||
roads = new MaxingGenerator(rng.nextParallelRNG(32), 5, 0.00055, 8, factory);
|
||||
//@done
|
||||
|
||||
GMap<String, IrisRegion> regions = new GMap<>();
|
||||
regions = new GMap<>();
|
||||
|
||||
for(IrisBiome i : biomes)
|
||||
{
|
||||
if(i.getName().equals("Beach"))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if(!regions.containsKey(i.getRegion()))
|
||||
{
|
||||
regions.put(i.getRegion(), new IrisRegion(i.getRegion()));
|
||||
@@ -51,6 +48,11 @@ public class GenLayerBiome extends GenLayer
|
||||
regions.get(i.getRegion()).getBiomes().add(i);
|
||||
}
|
||||
|
||||
for(IrisRegion i : regions.values())
|
||||
{
|
||||
i.load();
|
||||
}
|
||||
|
||||
int v = 85034;
|
||||
regionGenerator = new EnumMaxingGenerator<IrisRegion>(rng.nextParallelRNG(v), 0.00522 * Iris.settings.gen.biomeScale * 0.189, 1, regions.v().toArray(new IrisRegion[regions.v().size()]), factory);
|
||||
|
||||
@@ -74,29 +76,9 @@ public class GenLayerBiome extends GenLayer
|
||||
double land = island.noise(x, z);
|
||||
double landChance = 1D - M.clip(Iris.settings.gen.landChance, 0D, 1D);
|
||||
|
||||
if(land > landChance && land < landChance + 0.0175)
|
||||
{
|
||||
cbi = iris.biome("Beach");
|
||||
}
|
||||
|
||||
else if(land > landChance + 0.0175)
|
||||
if(land > landChance + 0.0175)
|
||||
{
|
||||
cbi = getRegionGenerator(x, z).getChoice(x, z);
|
||||
|
||||
if(pathCheck.noise(x, z) > 0.33)
|
||||
{
|
||||
IrisBiome road = iris.biome("Beach");
|
||||
|
||||
if(cbi.getSurface().get(0).material.equals(Material.GRASS))
|
||||
{
|
||||
road = IrisBiome.ROAD_GRASSY;
|
||||
}
|
||||
|
||||
if(Math.abs(road.getHeight() - cbi.getHeight()) < 0.0001 && roads.hasBorder(4, 3, xx, zz))
|
||||
{
|
||||
return road;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
else if(land < 0.3)
|
||||
@@ -112,4 +94,9 @@ public class GenLayerBiome extends GenLayer
|
||||
{
|
||||
return noise;
|
||||
}
|
||||
|
||||
public IrisRegion getRegion(String name)
|
||||
{
|
||||
return regions.get(name);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user