From ba9cb41d4789b16453893ec5237d39d7b5122924 Mon Sep 17 00:00:00 2001 From: Daniel Mills Date: Sun, 15 Mar 2020 19:35:07 -0400 Subject: [PATCH] Fixes --- .../java/ninja/bytecode/iris/Settings.java | 16 ++++---- .../iris/generator/IrisGenerator.java | 2 +- .../iris/generator/genobject/GenObject.java | 13 ++++++ .../generator/genobject/GenObjectGroup.java | 40 ++++++++++++++++++- .../iris/generator/layer/GenLayerBiome.java | 2 +- .../iris/generator/layer/GenLayerCaves.java | 15 ++++--- .../bytecode/iris/util/IrisWorldData.java | 1 - 7 files changed, 69 insertions(+), 20 deletions(-) diff --git a/src/main/java/ninja/bytecode/iris/Settings.java b/src/main/java/ninja/bytecode/iris/Settings.java index 57c86d649..893034845 100644 --- a/src/main/java/ninja/bytecode/iris/Settings.java +++ b/src/main/java/ninja/bytecode/iris/Settings.java @@ -15,7 +15,7 @@ public class Settings public PerformanceMode performanceMode = PerformanceMode.EXPLICIT; public ObjectMode objectMode = ObjectMode.PARALLAX; public int threadPriority = Thread.MAX_PRIORITY; - public int threadCount = 16; + public int threadCount = 32; public boolean debugMode = true; public int decorationAccuracy = 1; public boolean noObjectFail = false; @@ -26,24 +26,24 @@ public class Settings public static class GeneratorSettings { public InterpolationMode interpolationMode = InterpolationMode.BILINEAR; - public int interpolationRadius = 32; + public int interpolationRadius = 53; public int blockSmoothing = 1; public double objectDensity = 1D; public double horizontalZoom = 2; public double heightFracture = 155; - public double landScale = 0.5; + public double landScale = 0.44; public double landChance = 0.56; - public double roughness = 1.55; - public double biomeEdgeFuzzScale = 1; - public double biomeEdgeScrambleScale = 0.3; - public double biomeEdgeScrambleRange = 0.9; + public double roughness = 1.25; + public double biomeEdgeFuzzScale = 1.75; + public double biomeEdgeScrambleScale = 0.2; + public double biomeEdgeScrambleRange = 2.5; public double heightMultiplier = 0.806; public double heightExponentBase = 1; public double heightExponentMultiplier = 1.41; public double heightScale = 0.56; public double baseHeight = 0.065; public int seaLevel = 63; - public double biomeScale = 1; + public double biomeScale = 0.8; public boolean flatBedrock = false; } diff --git a/src/main/java/ninja/bytecode/iris/generator/IrisGenerator.java b/src/main/java/ninja/bytecode/iris/generator/IrisGenerator.java index 8b8417007..299f89101 100644 --- a/src/main/java/ninja/bytecode/iris/generator/IrisGenerator.java +++ b/src/main/java/ninja/bytecode/iris/generator/IrisGenerator.java @@ -308,7 +308,7 @@ public class IrisGenerator extends ParallaxWorldGenerator { int seaLevel = Iris.settings.gen.seaLevel; boolean land = y >= seaLevel; - int beachHeight = land ? 1 + (int) Math.round(seaLevel + beach.noise(x, z)) : seaLevel; + int beachHeight = land ? 1 + (int) Math.round(seaLevel + beach.noise(x, z) + 1) : seaLevel; boolean beach = y <= beachHeight && land; IrisBiome biome = glBiome.getBiome(x, z); IrisBiome realBiome = glBiome.getBiome(x, z, true); diff --git a/src/main/java/ninja/bytecode/iris/generator/genobject/GenObject.java b/src/main/java/ninja/bytecode/iris/generator/genobject/GenObject.java index 47cc48b85..a884a7658 100644 --- a/src/main/java/ninja/bytecode/iris/generator/genobject/GenObject.java +++ b/src/main/java/ninja/bytecode/iris/generator/genobject/GenObject.java @@ -49,6 +49,7 @@ public class GenObject private int failures; private int successes; private boolean gravity; + private boolean oversized; private String name = "?"; private KMap s; private KMap slopeCache; @@ -64,6 +65,7 @@ public class GenObject public GenObject(int w, int h, int d) { this.w = w; + oversized = false; this.h = h; this.d = d; shift = new BlockVector(); @@ -304,6 +306,7 @@ public class GenObject s.fill(this.s); s.centeredHeight = centeredHeight; s.name = name; + s.oversized = oversized; return s; } @@ -1094,4 +1097,14 @@ public class GenObject { this.shift = shift; } + + public boolean isOversized() + { + return oversized; + } + + public void setOversized(boolean oversized) + { + this.oversized = oversized; + } } diff --git a/src/main/java/ninja/bytecode/iris/generator/genobject/GenObjectGroup.java b/src/main/java/ninja/bytecode/iris/generator/genobject/GenObjectGroup.java index 3fa875202..f2b1dc40a 100644 --- a/src/main/java/ninja/bytecode/iris/generator/genobject/GenObjectGroup.java +++ b/src/main/java/ninja/bytecode/iris/generator/genobject/GenObjectGroup.java @@ -17,12 +17,14 @@ import ninja.bytecode.shuriken.logging.L; public class GenObjectGroup { private KList schematics; + private KList osSchematics; + private KList pxSchematics; private KList flags; private String name; private int priority; private double worldChance; private int worldRad; - + public GenObjectGroup(String name) { this.schematics = new KList<>(); @@ -147,6 +149,42 @@ public class GenObjectGroup return schematics; } + public KList getPXSchematics() + { + if(pxSchematics == null) + { + pxSchematics = new KList<>(); + + for(GenObject i : schematics) + { + if(!i.isOversized()) + { + pxSchematics.add(i); + } + } + } + + return pxSchematics; + } + + public KList getOSSchematics() + { + if(osSchematics == null) + { + osSchematics = new KList<>(); + + for(GenObject i : schematics) + { + if(i.isOversized()) + { + osSchematics.add(i); + } + } + } + + return pxSchematics; + } + public void setSchematics(KList schematics) { this.schematics = schematics; diff --git a/src/main/java/ninja/bytecode/iris/generator/layer/GenLayerBiome.java b/src/main/java/ninja/bytecode/iris/generator/layer/GenLayerBiome.java index 2a442682f..f2952cc0e 100644 --- a/src/main/java/ninja/bytecode/iris/generator/layer/GenLayerBiome.java +++ b/src/main/java/ninja/bytecode/iris/generator/layer/GenLayerBiome.java @@ -109,7 +109,7 @@ public class GenLayerBiome extends GenLayer return true; } - if(Borders.isBorderWithin(x, z, 7, 24D, (x + z) / 100D, (xx, zz) -> ocean.getIndex(xx, zz))) + if(Borders.isBorderWithin(x, z, 3, 24D, (x + z) / 100D, (xx, zz) -> ocean.getIndex(xx, zz))) { return true; } diff --git a/src/main/java/ninja/bytecode/iris/generator/layer/GenLayerCaves.java b/src/main/java/ninja/bytecode/iris/generator/layer/GenLayerCaves.java index 19922bab5..ca23f6d36 100644 --- a/src/main/java/ninja/bytecode/iris/generator/layer/GenLayerCaves.java +++ b/src/main/java/ninja/bytecode/iris/generator/layer/GenLayerCaves.java @@ -19,6 +19,7 @@ public class GenLayerCaves extends GenLayer { private PolygonGenerator g; private CNG gincline; + private CNG scram; public GenLayerCaves(IrisGenerator iris, World world, Random random, RNG rng) { @@ -26,6 +27,7 @@ public class GenLayerCaves extends GenLayer super(iris, world, random, rng); g = new PolygonGenerator(rng.nextParallelRNG(1111), 3, 0.024, 8, (c) -> c); gincline = new CNG(rng.nextParallelRNG(1112), 1D, 3).scale(0.00652); + scram = new CNG(rng.nextParallelRNG(2639634), 1D, 1).scale(0.15); //@done } @@ -35,19 +37,16 @@ public class GenLayerCaves extends GenLayer return gnoise; } - public void genCaves(double wxxf, double wzxf, int x, int z, AtomicChunkData data, ChunkPlan plan) + public void genCaves(double vwxxf, double vwzxf, int x, int z, AtomicChunkData data, ChunkPlan plan) { - if(true) - { - return; - } - PrecisionStopwatch s = PrecisionStopwatch.start(); double itr = 2; double level = 8; - double incline = 157; + double incline = 187; double baseWidth = 11; - double drop = 46; + double drop = 41; + double wxxf = (scram.noise(vwxxf, vwzxf) * 6) - vwzxf; + double wzxf = (scram.noise(vwzxf, vwxxf) * 6) + vwxxf; for(double m = 1; m <= itr; m += 0.45) { diff --git a/src/main/java/ninja/bytecode/iris/util/IrisWorldData.java b/src/main/java/ninja/bytecode/iris/util/IrisWorldData.java index 9b86cb213..45808e756 100644 --- a/src/main/java/ninja/bytecode/iris/util/IrisWorldData.java +++ b/src/main/java/ninja/bytecode/iris/util/IrisWorldData.java @@ -5,7 +5,6 @@ import java.io.IOException; import org.bukkit.Bukkit; import org.bukkit.World; -import mortar.logic.format.F; import mortar.util.text.C; import ninja.bytecode.iris.Iris; import ninja.bytecode.iris.generator.atomics.AtomicChunkData;