diff --git a/build.gradle.kts b/build.gradle.kts index b46de5aae..be590b5be 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -33,7 +33,7 @@ dependencies { compileOnly("org.spigotmc:spigot-api:1.16.2-R0.1-SNAPSHOT") compileOnly("org.jetbrains:annotations:20.1.0") // more recent. implementation("commons-io:commons-io:2.4") - compileOnly(name = "Gaea-1.14.1", group = "") + compileOnly(name = "Gaea-1.14.2", group = "") implementation("org.apache.commons:commons-imaging:1.0-alpha2") compileOnly("com.sk89q.worldedit:worldedit-bukkit:7.2.0-SNAPSHOT") implementation("org.bstats:bstats-bukkit:1.7") @@ -45,7 +45,8 @@ dependencies { testImplementation("org.junit.jupiter:junit-jupiter-api:5.7.0") testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:5.7.0") - testImplementation(name = "Gaea-1.14.0", group = "") + testImplementation(name = "Gaea-1.14.2", group = "") + testImplementation("org.spigotmc:spigot-api:1.16.2-R0.1-SNAPSHOT") } val compileJava: JavaCompile by tasks @@ -120,7 +121,7 @@ val testWithPaper = task(name = "testWithPaper") { "-XX:InitiatingHeapOccupancyPercent=15", "-XX:G1MixedGCLiveThresholdPercent=90", "-XX:G1RSetUpdatingPauseTimePercent=5", "-XX:SurvivorRatio=32", "-XX:+PerfDisableSharedMem", "-XX:MaxTenuringThreshold=1", "-Dusing.aikars.flags=https://mcflags.emc.gs", - "-Daikars.new.flags=true") + "-Daikars.new.flags=true", "-DIReallyKnowWhatIAmDoingISwear") maxHeapSize = "2G" args = listOf("nogui") workingDir = file("${testDir}/") @@ -131,10 +132,10 @@ tasks.named("shadowJar") { archiveClassifier.set("") archiveBaseName.set("Terra") setVersion(project.version) - relocate("org.apache.commons", "lib.commons") - relocate("org.bstats.bukkit", "lib.bstats") - relocate("parsii", "lib.parsii") - relocate("io.papermc.lib", "lib.paperlib") + relocate("org.apache.commons", "com.dfsek.terra.lib.commons") + relocate("org.bstats.bukkit", "com.dfsek.terra.lib.bstats") + relocate("parsii", "com.dfsek.terra.lib.parsii") + relocate("io.papermc.lib", "com.dfsek.terra.lib.paperlib") } tasks.build { diff --git a/lib/Gaea-1.14.1-javadoc.jar b/lib/Gaea-1.14.1-javadoc.jar deleted file mode 100644 index c90b5a24e..000000000 Binary files a/lib/Gaea-1.14.1-javadoc.jar and /dev/null differ diff --git a/lib/Gaea-1.14.1-sources.jar b/lib/Gaea-1.14.1-sources.jar deleted file mode 100644 index c3b48710b..000000000 Binary files a/lib/Gaea-1.14.1-sources.jar and /dev/null differ diff --git a/lib/Gaea-1.14.1.jar b/lib/Gaea-1.14.1.jar deleted file mode 100644 index 67d9df0d2..000000000 Binary files a/lib/Gaea-1.14.1.jar and /dev/null differ diff --git a/lib/Gaea-1.14.2.jar b/lib/Gaea-1.14.2.jar new file mode 100644 index 000000000..966ebed95 Binary files /dev/null and b/lib/Gaea-1.14.2.jar differ diff --git a/src/main/java/com/dfsek/terra/TerraProfiler.java b/src/main/java/com/dfsek/terra/TerraProfiler.java index 374aaa8db..428e318b8 100644 --- a/src/main/java/com/dfsek/terra/TerraProfiler.java +++ b/src/main/java/com/dfsek/terra/TerraProfiler.java @@ -19,7 +19,7 @@ public class TerraProfiler extends WorldProfiler { .addMeasurement(new Measurement(1500000, DataType.PERIOD_MILLISECONDS), "OreTime") .addMeasurement(new Measurement(1500000, DataType.PERIOD_MILLISECONDS), "CaveTime") .addMeasurement(new Measurement(1500000, DataType.PERIOD_MILLISECONDS), "StructureTime") - .addMeasurement(new Measurement(1500000, DataType.PERIOD_MILLISECONDS), "StructurePasteTime") + .addMeasurement(new Measurement(1500000, DataType.PERIOD_MILLISECONDS), "ElevationTime") .addMeasurement(new Measurement(1500000, DataType.PERIOD_MILLISECONDS), "SnowTime") .addMeasurement(new Measurement(1500000, DataType.PERIOD_MILLISECONDS), "CaveBlockUpdate"); } diff --git a/src/main/java/com/dfsek/terra/biome/failsafe/FailType.java b/src/main/java/com/dfsek/terra/biome/failsafe/FailType.java index 8c2e25f75..bc5c7f959 100644 --- a/src/main/java/com/dfsek/terra/biome/failsafe/FailType.java +++ b/src/main/java/com/dfsek/terra/biome/failsafe/FailType.java @@ -27,7 +27,7 @@ public enum FailType { }, /** * Returns null, hard crashing the server, but not generating any corrupted terrain.
- * This option is
NOT
stable, but it has the least risk of blank chunks being generated. + * This option is NOT stable, but it has the least risk of blank chunks being generated. * However, it has the highest risk of corruption! */ CRASH { diff --git a/src/main/java/com/dfsek/terra/biome/failsafe/FailoverGenerator.java b/src/main/java/com/dfsek/terra/biome/failsafe/FailoverGenerator.java index d4b35d4db..100668163 100644 --- a/src/main/java/com/dfsek/terra/biome/failsafe/FailoverGenerator.java +++ b/src/main/java/com/dfsek/terra/biome/failsafe/FailoverGenerator.java @@ -19,6 +19,6 @@ public final class FailoverGenerator extends UserDefinedGenerator { } public FailoverGenerator() throws ParseException { - super("0", Collections.emptyList(), palette, false); + super("0", null, Collections.emptyList(), palette, new TreeMap<>(), false); } } diff --git a/src/main/java/com/dfsek/terra/carving/UserDefinedCarver.java b/src/main/java/com/dfsek/terra/carving/UserDefinedCarver.java index 208e9f1ca..ab50ba1a3 100644 --- a/src/main/java/com/dfsek/terra/carving/UserDefinedCarver.java +++ b/src/main/java/com/dfsek/terra/carving/UserDefinedCarver.java @@ -21,6 +21,9 @@ public class UserDefinedCarver extends Carver { private final int hash; private final int topCut; private final int bottomCut; + private double step = 2; + private Range recalc = new Range(8, 10); + private double recalcMagnitude = 3; public UserDefinedCarver(Range height, Range radius, Range length, double[] start, double[] mutate, double[] radiusMultiplier, int hash, int topCut, int bottomCut) { super(height.getMin(), height.getMax()); @@ -40,6 +43,18 @@ public class UserDefinedCarver extends Carver { return new UserDefinedWorm(length.get(r) / 2, r, vector, radius.getMax(), topCut, bottomCut); } + public void setStep(double step) { + this.step = step; + } + + public void setRecalc(Range recalc) { + this.recalc = recalc; + } + + public void setRecalcMagnitude(double recalcMagnitude) { + this.recalcMagnitude = recalcMagnitude; + } + @Override public boolean isChunkCarved(World w, int chunkX, int chunkZ, Random random) { ConfigPack c = TerraWorld.getWorld(w).getConfig(); @@ -50,6 +65,9 @@ public class UserDefinedCarver extends Carver { private final Vector direction; private final int maxRad; private double runningRadius; + private int steps; + private int nextDirection = 0; + private double[] currentRotation = new double[3]; public UserDefinedWorm(int length, Random r, Vector origin, int maxRad, int topCut, int bottomCut) { super(length, r, origin); @@ -57,17 +75,27 @@ public class UserDefinedCarver extends Carver { super.setBottomCut(bottomCut); runningRadius = radius.get(r); this.maxRad = maxRad; - direction = new Vector((r.nextDouble() - 0.5D) * start[0], (r.nextDouble() - 0.5D) * start[1], (r.nextDouble() - 0.5D) * start[2]).normalize().multiply(2); + direction = new Vector((r.nextDouble() - 0.5D) * start[0], (r.nextDouble() - 0.5D) * start[1], (r.nextDouble() - 0.5D) * start[2]).normalize().multiply(step); } @Override public void step() { + if(steps == nextDirection) { + direction.rotateAroundX(Math.toRadians((getRandom().nextGaussian()) * mutate[0] * recalcMagnitude)); + direction.rotateAroundY(Math.toRadians((getRandom().nextGaussian()) * mutate[1] * recalcMagnitude)); + direction.rotateAroundZ(Math.toRadians((getRandom().nextGaussian()) * mutate[2] * recalcMagnitude)); + currentRotation = new double[] {(getRandom().nextGaussian()) * mutate[0], + (getRandom().nextGaussian()) * mutate[1], + (getRandom().nextGaussian()) * mutate[2]}; + nextDirection += recalc.get(getRandom()); + } + steps++; setRadius(new int[] {(int) (runningRadius * radiusMultiplier[0]), (int) (runningRadius * radiusMultiplier[1]), (int) (runningRadius * radiusMultiplier[2])}); runningRadius += (getRandom().nextDouble() - 0.5) * mutate[3]; runningRadius = Math.max(Math.min(runningRadius, maxRad), 1); - direction.rotateAroundX(Math.toRadians(getRandom().nextDouble() * mutate[0] * 2)); - direction.rotateAroundY(Math.toRadians(getRandom().nextDouble() * mutate[1] * 2)); - direction.rotateAroundZ(Math.toRadians(getRandom().nextDouble() * mutate[2] * 2)); + direction.rotateAroundX(Math.toRadians(currentRotation[0] * mutate[0])); + direction.rotateAroundY(Math.toRadians(currentRotation[1] * mutate[1])); + direction.rotateAroundZ(Math.toRadians(currentRotation[2] * mutate[2])); getRunning().add(direction); } } diff --git a/src/main/java/com/dfsek/terra/config/base/ConfigUtil.java b/src/main/java/com/dfsek/terra/config/base/ConfigUtil.java index 6e66110c8..98d502d6a 100644 --- a/src/main/java/com/dfsek/terra/config/base/ConfigUtil.java +++ b/src/main/java/com/dfsek/terra/config/base/ConfigUtil.java @@ -6,6 +6,7 @@ import com.dfsek.terra.TerraWorld; import com.dfsek.terra.biome.failsafe.FailType; import com.dfsek.terra.config.exception.ConfigException; import com.dfsek.terra.config.lang.LangUtil; +import com.dfsek.terra.util.TagUtil; import org.bukkit.Bukkit; import org.bukkit.Material; import org.bukkit.configuration.InvalidConfigurationException; @@ -72,9 +73,20 @@ public final class ConfigUtil { Set bl = new HashSet<>(); for(String s : list) { try { - if(bl.contains(Bukkit.createBlockData(s).getMaterial())) - Bukkit.getLogger().warning("Duplicate material in " + phase + " list: " + s); - bl.add(Bukkit.createBlockData(s).getMaterial()); + if(s.startsWith("#")) { + Debug.info("Loading Tag " + s); + Set tag = TagUtil.getTag(s.substring(1)); + for(Material m : tag) { + if(bl.contains(m)) { + Bukkit.getLogger().warning("Duplicate material in " + phase + " list: " + m); // Check for duplicates in this tag + } + } + bl.addAll(tag); + } else { + if(bl.contains(Bukkit.createBlockData(s).getMaterial())) + Bukkit.getLogger().warning("Duplicate material in " + phase + " list: " + s); + bl.add(Bukkit.createBlockData(s).getMaterial()); + } } catch(NullPointerException | IllegalArgumentException e) { throw new ConfigException("Could not load BlockData data for \"" + s + "\"", id); } diff --git a/src/main/java/com/dfsek/terra/config/genconfig/CarverConfig.java b/src/main/java/com/dfsek/terra/config/genconfig/CarverConfig.java index da8103ff7..be3b48df4 100644 --- a/src/main/java/com/dfsek/terra/config/genconfig/CarverConfig.java +++ b/src/main/java/com/dfsek/terra/config/genconfig/CarverConfig.java @@ -41,6 +41,7 @@ public class CarverConfig extends TerraConfig { private final boolean replaceIsBlacklistTop; private final boolean replaceIsBlacklistBottom; private final boolean updateOcean; + private final Range recalc; @SuppressWarnings("unchecked") public CarverConfig(File file, ConfigPack config) throws IOException, InvalidConfigurationException { @@ -69,6 +70,9 @@ public class CarverConfig extends TerraConfig { updateOcean = getBoolean("update-liquids", false); + double step = getDouble("step", 2); + recalc = new Range(getInt("recalculate-direction.min", 8), getInt("recalculate-direction.max", 12)); + double rm = getDouble("recalculate-magnitude", 4); shift = new HashMap<>(); for(Map.Entry e : Objects.requireNonNull(getConfigurationSection("shift")).getValues(false).entrySet()) { Set l = new HashSet<>(); @@ -93,6 +97,9 @@ public class CarverConfig extends TerraConfig { Range height = new Range(getInt("start.height.min"), getInt("start.height.max")); carver = new UserDefinedCarver(height, radius, length, start, mutate, radiusMultiplier, id.hashCode(), getInt("cut.top", 0), getInt("cut.bottom", 0)); + carver.setStep(step); + carver.setRecalc(recalc); + carver.setRecalcMagnitude(rm); } @SuppressWarnings("unchecked") diff --git a/src/main/java/com/dfsek/terra/config/genconfig/biome/AbstractBiomeConfig.java b/src/main/java/com/dfsek/terra/config/genconfig/biome/AbstractBiomeConfig.java index 365309b81..9398bf39c 100644 --- a/src/main/java/com/dfsek/terra/config/genconfig/biome/AbstractBiomeConfig.java +++ b/src/main/java/com/dfsek/terra/config/genconfig/biome/AbstractBiomeConfig.java @@ -34,7 +34,7 @@ public class AbstractBiomeConfig extends TerraConfig { if(contains("carving")) carving = new BiomeCarverConfig(this); - if(contains("palette")) palette = new BiomePaletteConfig(this); + if(contains("palette")) palette = new BiomePaletteConfig(this, "palette"); if(contains("flora")) flora = new BiomeFloraConfig(this); diff --git a/src/main/java/com/dfsek/terra/config/genconfig/biome/BiomeConfig.java b/src/main/java/com/dfsek/terra/config/genconfig/biome/BiomeConfig.java index 050e92c19..cc98c67ba 100644 --- a/src/main/java/com/dfsek/terra/config/genconfig/biome/BiomeConfig.java +++ b/src/main/java/com/dfsek/terra/config/genconfig/biome/BiomeConfig.java @@ -10,10 +10,12 @@ import com.dfsek.terra.config.exception.NotFoundException; import com.dfsek.terra.config.genconfig.structure.StructureConfig; import com.dfsek.terra.generation.UserDefinedDecorator; import com.dfsek.terra.generation.UserDefinedGenerator; +import org.bukkit.block.data.BlockData; import org.bukkit.configuration.InvalidConfigurationException; import org.polydev.gaea.math.Range; import org.polydev.gaea.tree.Tree; import org.polydev.gaea.world.Flora; +import org.polydev.gaea.world.palette.Palette; import parsii.tokenizer.ParseException; import java.io.File; @@ -22,6 +24,7 @@ import java.util.ArrayList; import java.util.Collections; import java.util.List; import java.util.Objects; +import java.util.TreeMap; public class BiomeConfig extends TerraConfig { @@ -36,6 +39,9 @@ public class BiomeConfig extends TerraConfig { private final BiomeSnowConfig snow; private final List structures; private final ConfigPack config; + private final double ySlantOffsetTop; + private final double ySlantOffsetBottom; + private String eq; public BiomeConfig(File file, ConfigPack config) throws InvalidConfigurationException, IOException { @@ -72,7 +78,7 @@ public class BiomeConfig extends TerraConfig { if(extending && abstractBiome.getPaletteData() != null && !contains("palette")) { palette = abstractBiome.getPaletteData(); Debug.info("Using super palette"); - } else palette = new BiomePaletteConfig(this); + } else palette = new BiomePaletteConfig(this, "palette"); // Palette must not be null if(palette.getPaletteMap() == null) @@ -120,6 +126,17 @@ public class BiomeConfig extends TerraConfig { Debug.info("Using super snow"); } else snow = new BiomeSnowConfig(this); + // Get slant stuff + TreeMap> slant = new TreeMap<>(); + if(contains("slant")) { + String slantS = getString("slant.palette"); + slant = new BiomePaletteConfig(this, "slant.palette").getPaletteMap(); + Debug.info("Using slant palette: " + slantS); + if(slant == null) throw new NotFoundException("Slant Palette", slantS, getID()); + } + ySlantOffsetTop = getDouble("slant.y-offset.top", 0.25); + ySlantOffsetBottom = getDouble("slant.y-offset.bottom", 0.25); + //Make sure equation is non-null if(eq == null || eq.equals("")) throw new ConfigException("Could not find noise equation! Biomes must include a noise equation, or extend an abstract biome with one.", getID()); @@ -150,9 +167,14 @@ public class BiomeConfig extends TerraConfig { } } + String elevation = getString("elevation.equation", null); + boolean doElevationInterpolation = getBoolean("elevation.interpolation", true); + try { // Get UserDefinedBiome instance representing this config. - this.biome = new UserDefinedBiome(vanillaBiome, dec, new UserDefinedGenerator(eq, Collections.emptyList(), palette.getPaletteMap(), getBoolean("prevent-smooth", false)), getBoolean("erodible", false), biomeID); + UserDefinedGenerator gen = new UserDefinedGenerator(eq, elevation, Collections.emptyList(), palette.getPaletteMap(), slant, getBoolean("prevent-smooth", false)); + gen.setElevationInterpolation(doElevationInterpolation); + this.biome = new UserDefinedBiome(vanillaBiome, dec, gen, getBoolean("erodible", false), biomeID); } catch(ParseException e) { e.printStackTrace(); throw new ConfigException("Unable to parse noise equation!", getID()); @@ -175,6 +197,14 @@ public class BiomeConfig extends TerraConfig { return flora.getFloraHeights().computeIfAbsent(f, input -> new Range(-1, -1)); } + public double getYSlantOffsetTop() { + return ySlantOffsetTop; + } + + public double getYSlantOffsetBottom() { + return ySlantOffsetBottom; + } + @Override public String toString() { return "Biome with ID " + getID() + " and noise equation " + eq; diff --git a/src/main/java/com/dfsek/terra/config/genconfig/biome/BiomePaletteConfig.java b/src/main/java/com/dfsek/terra/config/genconfig/biome/BiomePaletteConfig.java index b586222e0..ff70cca9b 100644 --- a/src/main/java/com/dfsek/terra/config/genconfig/biome/BiomePaletteConfig.java +++ b/src/main/java/com/dfsek/terra/config/genconfig/biome/BiomePaletteConfig.java @@ -19,10 +19,9 @@ import java.util.TreeMap; public class BiomePaletteConfig extends TerraConfigSection { private TreeMap> paletteMap; - @SuppressWarnings("unchecked") - public BiomePaletteConfig(TerraConfig parent) throws InvalidConfigurationException { + public BiomePaletteConfig(TerraConfig parent, String key) throws InvalidConfigurationException { super(parent); - List> cfg = parent.getMapList("palette"); + List> cfg = parent.getMapList(key); if(cfg.size() == 0) return; paletteMap = new TreeMap<>(); for(Map e : cfg) { diff --git a/src/main/java/com/dfsek/terra/generation/ElevationEquation.java b/src/main/java/com/dfsek/terra/generation/ElevationEquation.java new file mode 100644 index 000000000..8cff5e1fb --- /dev/null +++ b/src/main/java/com/dfsek/terra/generation/ElevationEquation.java @@ -0,0 +1,35 @@ +package com.dfsek.terra.generation; + +import com.dfsek.terra.math.NoiseFunction2; +import org.polydev.gaea.math.FastNoiseLite; +import parsii.eval.Expression; +import parsii.eval.Parser; +import parsii.eval.Scope; +import parsii.eval.Variable; +import parsii.tokenizer.ParseException; + +public class ElevationEquation { + private static final Object noiseLock = new Object(); + private final Expression delegate; + private final Scope s = new Scope(); + private final NoiseFunction2 n2 = new NoiseFunction2(); + + private final Variable xVar = s.getVariable("x"); + private final Variable zVar = s.getVariable("z"); + + public ElevationEquation(String equation) throws ParseException { + Parser p = new Parser(); + p.registerFunction("noise2", n2); + delegate = p.parse(equation, s); + } + + public double getNoise(double x, double z, FastNoiseLite noiseLite) { + synchronized(noiseLock) { + xVar.setValue(x); + zVar.setValue(z); + + n2.setNoise(noiseLite); + return delegate.evaluate(); + } + } +} diff --git a/src/main/java/com/dfsek/terra/generation/ElevationInterpolator.java b/src/main/java/com/dfsek/terra/generation/ElevationInterpolator.java new file mode 100644 index 000000000..92634b2bc --- /dev/null +++ b/src/main/java/com/dfsek/terra/generation/ElevationInterpolator.java @@ -0,0 +1,83 @@ +package com.dfsek.terra.generation; + +import com.dfsek.terra.biome.TerraBiomeGrid; +import org.bukkit.World; +import org.polydev.gaea.generation.GenerationPhase; +import org.polydev.gaea.math.FastNoiseLite; +import org.polydev.gaea.math.Interpolator; + +public class ElevationInterpolator { + private final UserDefinedGenerator[][] gens = new UserDefinedGenerator[10][10]; + private final double[][] values = new double[18][18]; + private final FastNoiseLite noise; + private final int xOrigin; + private final int zOrigin; + private final TerraBiomeGrid grid; + + public ElevationInterpolator(World w, int chunkX, int chunkZ, TerraBiomeGrid grid, FastNoiseLite noise) { + this.xOrigin = chunkX << 4; + this.zOrigin = chunkZ << 4; + this.noise = noise; + this.grid = grid; + + for(int x = -2; x < 8; x++) { + for(int z = -2; z < 8; z++) { + gens[x + 2][z + 2] = (UserDefinedGenerator) grid.getBiome(xOrigin + x * 4, zOrigin + z * 4, GenerationPhase.BASE).getGenerator(); + } + } + + for(byte x = -1; x <= 16; x++) { + for(byte z = -1; z <= 16; z++) { + UserDefinedGenerator generator = getGenerator(x, z); + if(compareGens((x / 4), (z / 4)) && generator.interpolateElevation()) { + Interpolator interpolator = new Interpolator(biomeAvg(x / 4, z / 4), + biomeAvg((x / 4) + 1, z / 4), + biomeAvg(x / 4, (z / 4) + 1), + biomeAvg((x / 4) + 1, (z / 4) + 1), + Interpolator.Type.LINEAR); + values[x + 1][z + 1] = interpolator.bilerp((double) (x % 4) / 4, (double) (z % 4) / 4); + } else values[x + 1][z + 1] = elevate(generator, xOrigin + x, zOrigin + z); + } + } + } + + private UserDefinedGenerator getGenerator(int x, int z) { + return (UserDefinedGenerator) grid.getBiome(xOrigin + x, zOrigin + z, GenerationPhase.BASE).getGenerator(); + } + + private UserDefinedGenerator getStoredGen(int x, int z) { + return gens[x + 2][z + 2]; + } + + private boolean compareGens(int x, int z) { + UserDefinedGenerator comp = getStoredGen(x, z); + + for(int xi = x - 2; xi <= x + 2; xi++) { + for(int zi = z - 2; zi <= z + 2; zi++) { + if(!comp.equals(getStoredGen(xi, zi))) return true; + } + } + return false; + } + + private double biomeAvg(int x, int z) { + return (elevate(getStoredGen(x + 1, z), x * 4 + 4 + xOrigin, z * 4 + zOrigin) + + elevate(getStoredGen(x - 1, z), x * 4 - 4 + xOrigin, z * 4 + zOrigin) + + elevate(getStoredGen(x, z + 1), x * 4 + xOrigin, z * 4 + 4 + zOrigin) + + elevate(getStoredGen(x, z - 1), x * 4 + xOrigin, z * 4 - 4 + zOrigin) + + elevate(getStoredGen(x, z), x * 4 + xOrigin, z * 4 + zOrigin) + + elevate(getStoredGen(x - 1, z - 1), x * 4 + xOrigin, z * 4 + zOrigin) + + elevate(getStoredGen(x - 1, z + 1), x * 4 + xOrigin, z * 4 + zOrigin) + + elevate(getStoredGen(x + 1, z - 1), x * 4 + xOrigin, z * 4 + zOrigin) + + elevate(getStoredGen(x + 1, z + 1), x * 4 + xOrigin, z * 4 + zOrigin)) / 9D; + } + + private double elevate(UserDefinedGenerator g, int x, int z) { + if(g.getElevationEquation() != null) return g.getElevationEquation().getNoise(x, z, noise); + return 0; + } + + public double getElevation(int x, int z) { + return values[x + 1][z + 1]; + } +} diff --git a/src/main/java/com/dfsek/terra/generation/TerraChunkGenerator.java b/src/main/java/com/dfsek/terra/generation/TerraChunkGenerator.java index a27f5b11c..551cf67bd 100644 --- a/src/main/java/com/dfsek/terra/generation/TerraChunkGenerator.java +++ b/src/main/java/com/dfsek/terra/generation/TerraChunkGenerator.java @@ -2,6 +2,7 @@ package com.dfsek.terra.generation; import com.dfsek.terra.Debug; import com.dfsek.terra.Terra; +import com.dfsek.terra.TerraProfiler; import com.dfsek.terra.TerraWorld; import com.dfsek.terra.biome.UserDefinedBiome; import com.dfsek.terra.config.base.ConfigPack; @@ -30,6 +31,7 @@ import org.polydev.gaea.generation.GenerationPhase; import org.polydev.gaea.generation.GenerationPopulator; import org.polydev.gaea.math.ChunkInterpolator; import org.polydev.gaea.population.PopulationManager; +import org.polydev.gaea.profiler.ProfileFuture; import org.polydev.gaea.profiler.WorldProfiler; import org.polydev.gaea.world.palette.Palette; @@ -80,60 +82,44 @@ public class TerraChunkGenerator extends GaeaChunkGenerator { popMan.attachProfiler(p); } - @Override - public ChunkData generateBase(@NotNull World world, @NotNull Random random, int chunkX, int chunkZ, ChunkInterpolator interpolator) { - if(needsLoad) load(world); // Load population data for world. - ChunkData chunk = createChunkData(world); - TerraWorld tw = TerraWorld.getWorld(world); - if(!tw.isSafe()) return chunk; - ConfigPack config = tw.getConfig(); - int xOrig = (chunkX << 4); - int zOrig = (chunkZ << 4); - org.polydev.gaea.biome.BiomeGrid grid = getBiomeGrid(world); - for(byte x = 0; x < 16; x++) { - for(byte z = 0; z < 16; z++) { - int paletteLevel = 0; - int cx = xOrig + x; - int cz = zOrig + z; - Biome b = grid.getBiome(xOrig + x, zOrig + z, GenerationPhase.PALETTE_APPLY); - BiomeConfig c = config.getBiome((UserDefinedBiome) b); - BiomeSlabConfig slab = c.getSlabs(); - int sea = c.getOcean().getSeaLevel(); - Palette seaPalette = c.getOcean().getOcean(); - for(int y = world.getMaxHeight() - 1; y >= 0; y--) { - if(interpolator.getNoise(x, y, z) > 0) { - BlockData data = b.getGenerator().getPalette(y).get(paletteLevel, cx, cz); - chunk.setBlock(x, y, z, data); - if(paletteLevel == 0 && slab != null && y < 255) { - prepareBlockPart(data, chunk.getBlockData(x, y + 1, z), chunk, new Vector(x, y + 1, z), slab.getSlabs(), - slab.getStairs(), slab.getSlabThreshold(), interpolator); - } - paletteLevel++; - } else if(y <= sea) { - chunk.setBlock(x, y, z, seaPalette.get(sea - y, x + xOrig, z + zOrig)); - paletteLevel = 0; - } else paletteLevel = 0; - } - } + private static Palette getPalette(int x, int y, int z, BiomeConfig c, ChunkInterpolator interpolator, ElevationInterpolator elevationInterpolator) { + Palette slant = ((UserDefinedGenerator) c.getBiome().getGenerator()).getSlantPalette(y); + if(slant != null) { + boolean north = interpolator.getNoise(x, y - elevationInterpolator.getElevation(x, z + 1), z + 1) > 0; + boolean south = interpolator.getNoise(x, y - elevationInterpolator.getElevation(x, z - 1), z - 1) > 0; + boolean east = interpolator.getNoise(x + 1, y - elevationInterpolator.getElevation(x + 1, z), z) > 0; + boolean west = interpolator.getNoise(x - 1, y - elevationInterpolator.getElevation(x - 1, z), z) > 0; + + double ySlantOffsetTop = c.getYSlantOffsetTop(); + double ySlantOffsetBottom = c.getYSlantOffsetBottom(); + boolean top = interpolator.getNoise(x, y + ySlantOffsetTop - elevationInterpolator.getElevation(x, z), z) > 0; + boolean bottom = interpolator.getNoise(x, y - ySlantOffsetBottom - elevationInterpolator.getElevation(x, z), z) > 0; + + if((top && bottom) && (north || south || east || west) && (!(north && south && east && west))) return slant; } - return chunk; + return c.getBiome().getGenerator().getPalette(y); } - private void prepareBlockPart(BlockData down, BlockData orig, ChunkData chunk, Vector block, Map> slabs, - Map> stairs, double thresh, ChunkInterpolator interpolator) { - if(interpolator.getNoise(block.getBlockX(), block.getBlockY() - 0.4, block.getBlockZ()) > thresh) { + private static void prepareBlockPart(BlockData down, BlockData orig, ChunkData chunk, Vector block, Map> slabs, + Map> stairs, double thresh, ChunkInterpolator interpolator, ElevationInterpolator elevationInterpolator) { + double elevation = elevationInterpolator.getElevation(block.getBlockX(), block.getBlockZ()); + if(interpolator.getNoise(block.getBlockX(), block.getBlockY() - 0.4 - elevation, block.getBlockZ()) > thresh) { if(stairs != null) { Palette stairPalette = stairs.get(down.getMaterial()); if(stairPalette != null) { BlockData stair = stairPalette.get(0, block.getBlockX(), block.getBlockZ()); Stairs stairNew = (Stairs) stair.clone(); - if(interpolator.getNoise(block.getBlockX() - 0.5, block.getBlockY(), block.getBlockZ()) > thresh) { + double elevationN = elevationInterpolator.getElevation(block.getBlockX(), block.getBlockZ() - 1); // Northern elevation + double elevationS = elevationInterpolator.getElevation(block.getBlockX(), block.getBlockZ() + 1); // Southern elevation + double elevationE = elevationInterpolator.getElevation(block.getBlockX() + 1, block.getBlockZ()); // Eastern elevation + double elevationW = elevationInterpolator.getElevation(block.getBlockX() - 1, block.getBlockZ()); // Western elevation + if(interpolator.getNoise(block.getBlockX() - 0.5, block.getBlockY() - elevationW, block.getBlockZ()) > thresh) { stairNew.setFacing(BlockFace.WEST); - } else if(interpolator.getNoise(block.getBlockX(), block.getBlockY(), block.getBlockZ() - 0.5) > thresh) { + } else if(interpolator.getNoise(block.getBlockX(), block.getBlockY() - elevationN, block.getBlockZ() - 0.5) > thresh) { stairNew.setFacing(BlockFace.NORTH); - } else if(interpolator.getNoise(block.getBlockX(), block.getBlockY(), block.getBlockZ() + 0.5) > thresh) { + } else if(interpolator.getNoise(block.getBlockX(), block.getBlockY() - elevationS, block.getBlockZ() + 0.5) > thresh) { stairNew.setFacing(BlockFace.SOUTH); - } else if(interpolator.getNoise(block.getBlockX() + 0.5, block.getBlockY(), block.getBlockZ()) > thresh) { + } else if(interpolator.getNoise(block.getBlockX() + 0.5, block.getBlockY() - elevationE, block.getBlockZ()) > thresh) { stairNew.setFacing(BlockFace.EAST); } else stairNew = null; if(stairNew != null) { @@ -151,6 +137,58 @@ public class TerraChunkGenerator extends GaeaChunkGenerator { } } + @Override + @SuppressWarnings("try") + public ChunkData generateBase(@NotNull World world, @NotNull Random random, int chunkX, int chunkZ, ChunkInterpolator interpolator) { + if(needsLoad) load(world); // Load population data for world. + ChunkData chunk = createChunkData(world); + TerraWorld tw = TerraWorld.getWorld(world); + if(!tw.isSafe()) return chunk; + ConfigPack config = tw.getConfig(); + int xOrig = (chunkX << 4); + int zOrig = (chunkZ << 4); + org.polydev.gaea.biome.BiomeGrid grid = getBiomeGrid(world); + + ElevationInterpolator elevationInterpolator; + try(ProfileFuture ignore = TerraProfiler.fromWorld(world).measure("ElevationTime")) { + elevationInterpolator = new ElevationInterpolator(world, chunkX, chunkZ, tw.getGrid(), getNoiseGenerator()); + } + + for(byte x = 0; x < 16; x++) { + for(byte z = 0; z < 16; z++) { + int paletteLevel = 0; + + int cx = xOrig + x; + int cz = zOrig + z; + + Biome b = grid.getBiome(xOrig + x, zOrig + z, GenerationPhase.PALETTE_APPLY); + BiomeConfig c = config.getBiome((UserDefinedBiome) b); + + double elevate = elevationInterpolator.getElevation(x, z); + + BiomeSlabConfig slab = c.getSlabs(); + int sea = c.getOcean().getSeaLevel(); + Palette seaPalette = c.getOcean().getOcean(); + for(int y = world.getMaxHeight() - 1; y >= 0; y--) { + if(interpolator.getNoise(x, y - elevate, z) > 0) { + BlockData data = getPalette(x, y, z, c, interpolator, elevationInterpolator).get(paletteLevel, cx, cz); + chunk.setBlock(x, y, z, data); + if(paletteLevel == 0 && slab != null && y < 255) { + prepareBlockPart(data, chunk.getBlockData(x, y + 1, z), chunk, new Vector(x, y + 1, z), slab.getSlabs(), + slab.getStairs(), slab.getSlabThreshold(), interpolator, elevationInterpolator); + } + paletteLevel++; + } else if(y <= sea) { + chunk.setBlock(x, y, z, seaPalette.get(sea - y, x + xOrig, z + zOrig)); + paletteLevel = 0; + } else paletteLevel = 0; + } + } + } + return chunk; + } + + private void load(World w) { try { popMan.loadBlocks(w); diff --git a/src/main/java/com/dfsek/terra/generation/UserDefinedGenerator.java b/src/main/java/com/dfsek/terra/generation/UserDefinedGenerator.java index 2db007307..eadc45f58 100644 --- a/src/main/java/com/dfsek/terra/generation/UserDefinedGenerator.java +++ b/src/main/java/com/dfsek/terra/generation/UserDefinedGenerator.java @@ -1,12 +1,15 @@ package com.dfsek.terra.generation; +import com.dfsek.terra.Debug; import com.dfsek.terra.math.NoiseFunction2; import com.dfsek.terra.math.NoiseFunction3; import com.dfsek.terra.util.DataUtil; import org.bukkit.World; import org.bukkit.block.data.BlockData; +import org.jetbrains.annotations.Nullable; import org.polydev.gaea.biome.Generator; import org.polydev.gaea.math.FastNoiseLite; +import org.polydev.gaea.math.Interpolator; import org.polydev.gaea.world.palette.Palette; import parsii.eval.Expression; import parsii.eval.Parser; @@ -27,12 +30,16 @@ public class UserDefinedGenerator extends Generator { private final Variable zVar = s.getVariable("z"); @SuppressWarnings({"unchecked", "rawtypes", "RedundantSuppression"}) private final Palette[] palettes = new Palette[256]; + @SuppressWarnings({"unchecked", "rawtypes", "RedundantSuppression"}) + private final Palette[] slantPalettes = new Palette[256]; private final NoiseFunction2 n2 = new NoiseFunction2(); private final NoiseFunction3 n3 = new NoiseFunction3(); + private final ElevationEquation elevationEquation; private final boolean preventSmooth; + private boolean elevationInterpolation; - public UserDefinedGenerator(String equation, List userVariables, Map> paletteMap, boolean preventSmooth) + public UserDefinedGenerator(String equation, @Nullable String elevateEquation, List userVariables, Map> paletteMap, Map> slantPaletteMap, boolean preventSmooth) throws ParseException { Parser p = new Parser(); p.registerFunction("noise2", n2); @@ -46,7 +53,19 @@ public class UserDefinedGenerator extends Generator { } } palettes[y] = d; + Palette slantPalette = null; + for(Map.Entry> e : slantPaletteMap.entrySet()) { + if(e.getKey() >= y) { + slantPalette = e.getValue(); + break; + } + } + slantPalettes[y] = slantPalette; } + if(elevateEquation != null) { + Debug.info("Using elevation equation"); + this.elevationEquation = new ElevationEquation(elevateEquation); + } else this.elevationEquation = null; this.noiseExp = p.parse(equation, s); this.preventSmooth = preventSmooth; } @@ -102,8 +121,30 @@ public class UserDefinedGenerator extends Generator { return palettes[y]; } + public Palette getSlantPalette(int y) { + return slantPalettes[y]; + } + + @Override public boolean useMinimalInterpolation() { return preventSmooth; } + + @Override + public Interpolator.Type getInterpolationType() { + return Interpolator.Type.LINEAR; + } + + public ElevationEquation getElevationEquation() { + return elevationEquation; + } + + public boolean interpolateElevation() { + return elevationInterpolation; + } + + public void setElevationInterpolation(boolean elevationInterpolation) { + this.elevationInterpolation = elevationInterpolation; + } } diff --git a/src/main/java/com/dfsek/terra/population/StructurePopulator.java b/src/main/java/com/dfsek/terra/population/StructurePopulator.java index 844941596..2539a9635 100644 --- a/src/main/java/com/dfsek/terra/population/StructurePopulator.java +++ b/src/main/java/com/dfsek/terra/population/StructurePopulator.java @@ -49,30 +49,28 @@ public class StructurePopulator extends BlockPopulator { if(!struc.checkSpawns(spawn, rotation)) continue; double horizontal = struc.getStructureInfo().getMaxHorizontal(); if(Math.abs((cx + 8) - spawn.getBlockX()) <= horizontal && Math.abs((cz + 8) - spawn.getBlockZ()) <= horizontal) { - try(ProfileFuture ignore = TerraProfiler.fromWorld(world).measure("StructurePasteTime")) { - struc.paste(spawn, chunk, rotation); - for(StructureContainedInventory i : struc.getInventories()) { - try { - Debug.info("Attempting to populate loot: " + i.getUid()); - Vector2 lootCoords = RotationUtil.getRotatedCoords(new Vector2(i.getX() - struc.getStructureInfo().getCenterX(), i.getZ() - struc.getStructureInfo().getCenterZ()), rotation.inverse()); - Location inv = spawn.clone().add(lootCoords.getX(), i.getY(), lootCoords.getZ()); - Debug.info(Math.floorDiv(inv.getBlockX(), 16) + ":" + chunk.getX() + ", " + Math.floorDiv(inv.getBlockZ(), 16) + ":" + chunk.getZ()); - if(Math.floorDiv(inv.getBlockX(), 16) != chunk.getX() || Math.floorDiv(inv.getBlockZ(), 16) != chunk.getZ()) - continue; - Debug.info("Target is in chunk."); - Debug.info(spawn.toString() + " became: " + inv.toString() + " (" + rotation + ", " + inv.getBlock().getType() + ")"); - LootTable table = conf.getLoot(i.getUid()); - if(table == null) continue; - Debug.info("Target has table assigned."); - table.fillInventory(((BlockInventoryHolder) inv.getBlock().getState()).getInventory(), random); - } catch(ClassCastException e) { - Debug.error("Could not populate structure loot!"); - Debug.stack(e); - } + struc.paste(spawn, chunk, rotation); + for(StructureContainedInventory i : struc.getInventories()) { + try { + Debug.info("Attempting to populate loot: " + i.getUid()); + Vector2 lootCoords = RotationUtil.getRotatedCoords(new Vector2(i.getX() - struc.getStructureInfo().getCenterX(), i.getZ() - struc.getStructureInfo().getCenterZ()), rotation.inverse()); + Location inv = spawn.clone().add(lootCoords.getX(), i.getY(), lootCoords.getZ()); + Debug.info(Math.floorDiv(inv.getBlockX(), 16) + ":" + chunk.getX() + ", " + Math.floorDiv(inv.getBlockZ(), 16) + ":" + chunk.getZ()); + if(Math.floorDiv(inv.getBlockX(), 16) != chunk.getX() || Math.floorDiv(inv.getBlockZ(), 16) != chunk.getZ()) + continue; + Debug.info("Target is in chunk."); + Debug.info(spawn.toString() + " became: " + inv.toString() + " (" + rotation + ", " + inv.getBlock().getType() + ")"); + LootTable table = conf.getLoot(i.getUid()); + if(table == null) continue; + Debug.info("Target has table assigned."); + table.fillInventory(((BlockInventoryHolder) inv.getBlock().getState()).getInventory(), random); + } catch(ClassCastException e) { + Debug.error("Could not populate structure loot!"); + Debug.stack(e); } - for(Feature f : conf.getFeatures()) f.apply(struc, spawn, chunk); // Apply features. - break; } + for(Feature f : conf.getFeatures()) f.apply(struc, spawn, chunk); // Apply features. + break; } } } diff --git a/src/main/java/com/dfsek/terra/util/TagUtil.java b/src/main/java/com/dfsek/terra/util/TagUtil.java new file mode 100644 index 000000000..41298ec88 --- /dev/null +++ b/src/main/java/com/dfsek/terra/util/TagUtil.java @@ -0,0 +1,55 @@ +package com.dfsek.terra.util; + +import com.dfsek.terra.Debug; +import org.bukkit.Material; +import org.bukkit.Tag; +import org.jetbrains.annotations.NotNull; + +import java.lang.reflect.Field; +import java.lang.reflect.Modifier; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import java.util.stream.Collectors; +import java.util.stream.Stream; + +@SuppressWarnings("unchecked") +public class TagUtil { + private static final Map> tagMap; + + static { + Debug.info("Loading tags..."); + tagMap = new HashMap<>(); + + Field[] tags = Tag.class.getFields(); // Add Bukkit tags + for(Field field : tags) { + if(Modifier.isStatic(field.getModifiers())) { + try { + Tag tag = (Tag) field.get(new Object()); + tagMap.put(tag.getKey().toString(), tag.getValues()); + Debug.info("Loaded tag: #" + tag.getKey().toString()); + } catch(IllegalAccessException e) { + e.printStackTrace(); + } catch(ClassCastException ignore) { + } + } + } + putCustomSet("minecraft:base_stone_nether", Material.NETHERRACK, Material.BASALT, Material.BLACKSTONE); + putCustomSet("minecraft:base_stone_overworld", Material.STONE, Material.GRANITE, Material.DIORITE, Material.ANDESITE); + } + + private static Set getSet(Material... materials) { + return Stream.of(materials).collect(Collectors.toSet()); + } + + private static void putCustomSet(String key, Material... materials) { + tagMap.put(key, getSet(materials)); + Debug.info("Loaded tag: #" + key); + } + + @NotNull + public static Set getTag(String tag) { + return Objects.requireNonNull(tagMap.get(tag)); + } +} diff --git a/src/main/resources/default-config/abstract/biomes/basic_ores.yml b/src/main/resources/default-config/abstract/biomes/basic_ores.yml index a881a1d64..4da757e12 100644 --- a/src/main/resources/default-config/abstract/biomes/basic_ores.yml +++ b/src/main/resources/default-config/abstract/biomes/basic_ores.yml @@ -4,7 +4,7 @@ structures: - STRONGHOLD carving: - CAVE: 30 + CAVE: 40 RAVINE: 5 CAVERN: 5 ores: diff --git a/src/main/resources/default-config/abstract/biomes/deep_ocean_abstract.yml b/src/main/resources/default-config/abstract/biomes/deep_ocean_abstract.yml index 19178b724..d3494ef35 100644 --- a/src/main/resources/default-config/abstract/biomes/deep_ocean_abstract.yml +++ b/src/main/resources/default-config/abstract/biomes/deep_ocean_abstract.yml @@ -26,7 +26,7 @@ flora: max: 64 carving: - CAVE_OCEAN: 35 + CAVE_OCEAN: 45 structures: - STRONGHOLD diff --git a/src/main/resources/default-config/abstract/biomes/mountain/mountains_pretty.yml b/src/main/resources/default-config/abstract/biomes/mountain/mountains_pretty.yml index 7804b2f8b..11338dd17 100644 --- a/src/main/resources/default-config/abstract/biomes/mountain/mountains_pretty.yml +++ b/src/main/resources/default-config/abstract/biomes/mountain/mountains_pretty.yml @@ -2,7 +2,7 @@ noise-equation: "((-((y / 76)^2)) + 1) + ((noise2(x, z)+0.5) / 3) + abs(noise2(x id: "MOUNTAINS_PRETTY" carving: - CAVE: 30 + CAVE: 40 RAVINE: 5 CAVERN: 5 diff --git a/src/main/resources/default-config/abstract/biomes/mountain/mountains_pretty_border_0.yml b/src/main/resources/default-config/abstract/biomes/mountain/mountains_pretty_border_0.yml index f1d67c27a..717fb53c1 100644 --- a/src/main/resources/default-config/abstract/biomes/mountain/mountains_pretty_border_0.yml +++ b/src/main/resources/default-config/abstract/biomes/mountain/mountains_pretty_border_0.yml @@ -2,7 +2,7 @@ noise-equation: "((-((y / 64)^2)) + 1) + ((noise2(x, z)+0.5) / 3) + abs(noise2(x id: "MOUNTAINS_PRETTY_0" carving: - CAVE: 30 + CAVE: 40 RAVINE: 5 CAVERN: 5 diff --git a/src/main/resources/default-config/abstract/biomes/mountain/mountains_pretty_border_1.yml b/src/main/resources/default-config/abstract/biomes/mountain/mountains_pretty_border_1.yml index 0ad6d73ee..4cd7e192a 100644 --- a/src/main/resources/default-config/abstract/biomes/mountain/mountains_pretty_border_1.yml +++ b/src/main/resources/default-config/abstract/biomes/mountain/mountains_pretty_border_1.yml @@ -2,7 +2,7 @@ noise-equation: "((-((y / 70)^2)) + 1) + ((noise2(x, z)+0.5) / 3) + abs(noise2(x id: "MOUNTAINS_PRETTY_1" carving: - CAVE: 30 + CAVE: 40 RAVINE: 5 CAVERN: 5 diff --git a/src/main/resources/default-config/abstract/biomes/ocean_abstract.yml b/src/main/resources/default-config/abstract/biomes/ocean_abstract.yml index 08c9951b9..40076c94d 100644 --- a/src/main/resources/default-config/abstract/biomes/ocean_abstract.yml +++ b/src/main/resources/default-config/abstract/biomes/ocean_abstract.yml @@ -26,7 +26,7 @@ flora: max: 64 carving: - CAVE_OCEAN: 35 + CAVE_OCEAN: 45 structures: - STRONGHOLD diff --git a/src/main/resources/default-config/abstract/biomes/plains_abstract.yml b/src/main/resources/default-config/abstract/biomes/plains_abstract.yml index 065fbd3d2..251cf0f2f 100644 --- a/src/main/resources/default-config/abstract/biomes/plains_abstract.yml +++ b/src/main/resources/default-config/abstract/biomes/plains_abstract.yml @@ -2,7 +2,7 @@ noise-equation: "((-((y / 63)^2)) + 1) + |(noise2(x, z) / 3) + 0.1|" id: "PLAINS_ABSTRACT" carving: - CAVE: 30 + CAVE: 40 RAVINE: 5 CAVERN: 5 diff --git a/src/main/resources/default-config/abstract/biomes/shelf_ocean_abstract.yml b/src/main/resources/default-config/abstract/biomes/shelf_ocean_abstract.yml index ccf221321..1ec3c36a4 100644 --- a/src/main/resources/default-config/abstract/biomes/shelf_ocean_abstract.yml +++ b/src/main/resources/default-config/abstract/biomes/shelf_ocean_abstract.yml @@ -28,7 +28,7 @@ flora: max: 64 carving: - CAVE_OCEAN: 35 + CAVE_OCEAN: 45 ores: DIRT: diff --git a/src/main/resources/default-config/biomes/crag.yml b/src/main/resources/default-config/biomes/crag.yml new file mode 100644 index 000000000..6dbbe5563 --- /dev/null +++ b/src/main/resources/default-config/biomes/crag.yml @@ -0,0 +1,73 @@ +noise-equation: "((-((y / 63)^2)) + 1) + |(noise2(x/1.5, z/1.5)+0.25)|/2.5" +elevation: + equation: "min(floor(((max(noise2(x, z)+0.5, 0)))*8), 7)*6 + noise2(x*2,z*2)*12" + interpolation: true +extends: "BASIC_ORES" +id: "CRAG" + +slant: + palette: + - "BLOCK:minecraft:bedrock": 0 + - BEDROCK_MOST: 1 + - BEDROCK_HALF: 2 + - BEDROCK_LITTLE: 3 + - "BLOCK:minecraft:stone": 255 + y-offset: + top: 0.3 + bottom: 0.25 + +palette: + - "BLOCK:minecraft:bedrock": 0 + - BEDROCK_MOST: 1 + - BEDROCK_HALF: 2 + - BEDROCK_LITTLE: 3 + - GRASSY: 255 +vanilla: PLAINS + +flora: + chance: 60 + attempts: 2 + simplex: + enable: true + frequency: 0.1 + seed: 4 + items: + SMALL_ROCK: + weight: 1 + y: + min: 62 + max: 180 + TALL_GRASS: + weight: 1 + y: + min: 62 + max: 180 + GRASS: + weight: 5 + y: + min: 62 + max: 180 + LEAVES: + weight: 3 + y: + min: 62 + max: 180 +slabs: + enable: true + threshold: 0.0075 + palettes: + - "minecraft:stone": "MOUNTAIN_SLABS" + - "minecraft:gravel": "MOUNTAIN_SLABS" + use-stairs-if-available: true + stair-palettes: + - "minecraft:stone": "MOUNTAIN_STAIRS" + - "minecraft:gravel": "MOUNTAIN_STAIRS" + +trees: + density: 7 + items: + CACTUS: + weight: 1 + y: + min: 58 + max: 72 \ No newline at end of file diff --git a/src/main/resources/default-config/biomes/desert.yml b/src/main/resources/default-config/biomes/desert.yml index 8418c9d21..7b66c880a 100644 --- a/src/main/resources/default-config/biomes/desert.yml +++ b/src/main/resources/default-config/biomes/desert.yml @@ -26,8 +26,7 @@ flora: erodible: true trees: - chance: 100 - density: 1 + density: 7 items: CACTUS: weight: 1 diff --git a/src/main/resources/default-config/biomes/forest/dark_forest.yml b/src/main/resources/default-config/biomes/forest/dark_forest.yml index eaf40f8a3..24fac3578 100644 --- a/src/main/resources/default-config/biomes/forest/dark_forest.yml +++ b/src/main/resources/default-config/biomes/forest/dark_forest.yml @@ -39,6 +39,11 @@ trees: density: 400 items: DARK_OAK: + weight: 19 + y: + min: 58 + max: 84 + RED_MUSHROOM: weight: 1 y: min: 58 diff --git a/src/main/resources/default-config/biomes/mesa.yml b/src/main/resources/default-config/biomes/mesa.yml index 1832099f1..985028277 100644 --- a/src/main/resources/default-config/biomes/mesa.yml +++ b/src/main/resources/default-config/biomes/mesa.yml @@ -1,27 +1,62 @@ -noise-equation: "((-((y / 64)^2)) + 1) + min(floor(((max(noise2(x/1.5, z/1.5)+0.1, 0)) + 0.1)*5), 3)/2.5 + |(noise2(x, z)+0.1)/3|" +noise-equation: "((-((y / 63)^2)) + 1) + |(noise2(x/1.5, z/1.5)+0.25)|/2.5" +elevation: + equation: "min(floor(((max(noise2(x/1.5, z/1.5)+0.25, 0)))*5), 3)*9 + if(max(noise2(x/1.5, z/1.5)+0.05, 0), (noise2(x*2,z*2))*10, 0)" + interpolation: true extends: "BASIC_ORES" id: "MESA" +slant: + palette: + - "BLOCK:minecraft:bedrock": 0 + - BEDROCK_MOST: 1 + - BEDROCK_HALF: 2 + - BEDROCK_LITTLE: 3 + - "BLOCK:minecraft:terracotta": 255 + - "BLOCK:minecraft:gray_terracotta": 124 + - "BLOCK:minecraft:cyan_terracotta": 121 + - "BLOCK:minecraft:white_terracotta": 120 + - "BLOCK:minecraft:gray_terracotta": 119 + - "BLOCK:minecraft:orange_terracotta": 117 + - "BLOCK:minecraft:terracotta": 116 + - "BLOCK:minecraft:orange_terracotta": 115 + - "BLOCK:minecraft:terracotta": 111 + - "BLOCK:minecraft:red_terracotta": 109 + - "BLOCK:minecraft:terracotta": 108 + - "BLOCK:minecraft:white_terracotta": 107 + - "BLOCK:minecraft:red_terracotta": 106 + - "BLOCK:minecraft:yellow_terracotta": 103 + - "BLOCK:minecraft:terracotta": 102 + - "BLOCK:minecraft:yellow_terracotta": 101 + - "BLOCK:minecraft:terracotta": 98 + - "BLOCK:minecraft:gray_terracotta": 95 + - "BLOCK:minecraft:cyan_terracotta": 94 + - "BLOCK:minecraft:white_terracotta": 93 + - "BLOCK:minecraft:terracotta": 92 + - "BLOCK:minecraft:orange_terracotta": 88 + - "BLOCK:minecraft:terracotta": 87 + - "BLOCK:minecraft:orange_terracotta": 86 + - "BLOCK:minecraft:terracotta": 85 + - "BLOCK:minecraft:red_terracotta": 82 + - "BLOCK:minecraft:terracotta": 80 + - "BLOCK:minecraft:orange_terracotta": 77 + - "BLOCK:minecraft:yellow_terracotta": 76 + - "BLOCK:minecraft:red_terracotta": 75 + - "BLOCK:minecraft:terracotta": 73 + - "BLOCK:minecraft:white_terracotta": 72 + - "BLOCK:minecraft:terracotta": 71 + - "BLOCK:minecraft:terracotta": 70 + - "BLOCK:minecraft:orange_terracotta": 66 + - "BLOCK:minecraft:terracotta": 65 + y-offset: + top: 0.5 + bottom: 0.25 + palette: - "BLOCK:minecraft:bedrock": 0 - BEDROCK_MOST: 1 - BEDROCK_HALF: 2 - BEDROCK_LITTLE: 3 - RED_DESERT: 255 - - "BLOCK:minecraft:red_terracotta": 128 - - "BLOCK:minecraft:orange_terracotta": 124 - - "BLOCK:minecraft:terracotta": 120 - - "BLOCK:minecraft:yellow_terracotta": 116 - - "BLOCK:minecraft:red_terracotta": 112 - - "BLOCK:minecraft:orange_terracotta": 108 - - "BLOCK:minecraft:terracotta": 104 - - "BLOCK:minecraft:red_terracotta": 100 - - "BLOCK:minecraft:orange_terracotta": 96 - - "BLOCK:minecraft:terracotta": 92 - - "BLOCK:minecraft:yellow_terracotta": 88 - - "BLOCK:minecraft:red_terracotta": 84 - - "BLOCK:minecraft:orange_terracotta": 80 - - RED_DESERT: 72 vanilla: BADLANDS flora-chance: 2 @@ -49,8 +84,7 @@ slabs: - "minecraft:red_sand": "BLOCK:minecraft:red_sandstone_stairs" trees: - chance: 100 - density: 1 + density: 7 items: CACTUS: weight: 1 diff --git a/src/main/resources/default-config/biomes/mountain/arid_mountains.yml b/src/main/resources/default-config/biomes/mountain/arid_mountains.yml index 0e941cb15..9c9f9bb8d 100644 --- a/src/main/resources/default-config/biomes/mountain/arid_mountains.yml +++ b/src/main/resources/default-config/biomes/mountain/arid_mountains.yml @@ -1,4 +1,7 @@ -noise-equation: "((-((y / 64)^2)) + 1) + min(floor(((|noise2(x/2.5, z/2.5)|) + 0.1)*4), 3)/2.5 + |noise2(x/2.5, z/2.5)|" +noise-equation: "((-((y / 64)^2)) + 1) + |noise2(x/2.5, z/2.5)|" +elevation: + equation: "min(floor(((|noise2(x/2.5, z/2.5)|) + 0.1)*4)*4, 12)" + interpolation: true id: "ARID_MOUNTAINS" extends: "BASIC_ORES" @@ -13,6 +16,14 @@ palette: vanilla: SAVANNA erodible: false +prevent-smooth: true + +slant: + palette: + - ARID_SIDE: 255 + y-offset: + top: 0.4 + bottom: 0.25 flora: chance: 40 diff --git a/src/main/resources/default-config/biomes/mountain/arid_mountains_border_0.yml b/src/main/resources/default-config/biomes/mountain/arid_mountains_border_0.yml deleted file mode 100644 index 647ceeffa..000000000 --- a/src/main/resources/default-config/biomes/mountain/arid_mountains_border_0.yml +++ /dev/null @@ -1,47 +0,0 @@ -noise-equation: "((-((y / 64)^2)) + 1) + min(floor(((|noise2(x/2.5, z/2.5)|) + 0.1)), 3)/5 + |noise2(x/2.5, z/2.5)|" - -id: "ARID_MOUNTAINS_0" -extends: "BASIC_ORES" - - -palette: - - "BLOCK:minecraft:bedrock": 0 - - BEDROCK_MOST: 1 - - BEDROCK_HALF: 2 - - BEDROCK_LITTLE: 3 - - ARID: 255 -vanilla: SAVANNA - -erodible: false - -flora: - chance: 40 - attempts: 1 - items: - TALL_GRASS: - weight: 15 - y: - min: 62 - max: 128 - GRASS: - weight: 70 - y: - min: 62 - max: 128 - -trees: - density: 50 - items: - ACACIA: - weight: 1 - y: - min: 58 - max: 128 -slabs: - enable: true - threshold: 0.015 - palettes: - - "minecraft:red_sand": "BLOCK:minecraft:red_sandstone_slab" - use-stairs-if-available: true - stair-palettes: - - "minecraft:red_sand": "BLOCK:minecraft:red_sandstone_stairs" \ No newline at end of file diff --git a/src/main/resources/default-config/biomes/mountain/arid_mountains_border_1.yml b/src/main/resources/default-config/biomes/mountain/arid_mountains_border_1.yml deleted file mode 100644 index 78e95c034..000000000 --- a/src/main/resources/default-config/biomes/mountain/arid_mountains_border_1.yml +++ /dev/null @@ -1,47 +0,0 @@ -noise-equation: "((-((y / 64)^2)) + 1) + min(floor(((|noise2(x/2.5, z/2.5)|) + 0.1)*3), 3)/3 + |noise2(x/2.5, z/2.5)|" - -id: "ARID_MOUNTAINS_1" -extends: "BASIC_ORES" - - -palette: - - "BLOCK:minecraft:bedrock": 0 - - BEDROCK_MOST: 1 - - BEDROCK_HALF: 2 - - BEDROCK_LITTLE: 3 - - ARID: 255 -vanilla: SAVANNA - -erodible: false - -flora: - chance: 40 - attempts: 1 - items: - TALL_GRASS: - weight: 15 - y: - min: 62 - max: 128 - GRASS: - weight: 70 - y: - min: 62 - max: 128 - -trees: - density: 50 - items: - ACACIA: - weight: 1 - y: - min: 58 - max: 128 -slabs: - enable: true - threshold: 0.015 - palettes: - - "minecraft:red_sand": "BLOCK:minecraft:red_sandstone_slab" - use-stairs-if-available: true - stair-palettes: - - "minecraft:red_sand": "BLOCK:minecraft:red_sandstone_stairs" \ No newline at end of file diff --git a/src/main/resources/default-config/biomes/mushroom_island.yml b/src/main/resources/default-config/biomes/mushroom_island.yml new file mode 100644 index 000000000..53e81dffe --- /dev/null +++ b/src/main/resources/default-config/biomes/mushroom_island.yml @@ -0,0 +1,49 @@ +noise-equation: "((-((y / 63)^2)) + 1) + ((noise2(x, z)+0.5) / 2)" +extends: "BASIC_ORES" +id: "MUSHROOM_ISLANDS" + +palette: + - "BLOCK:minecraft:bedrock": 0 + - BEDROCK_MOST: 1 + - BEDROCK_HALF: 2 + - BEDROCK_LITTLE: 3 + - RIVER_BOTTOM: 61 + - RIVER_SHORE: 62 + - MYCELIUM: 255 +vanilla: MUSHROOM_FIELDS + +flora: + chance: 15 + attempts: 1 + items: + RED_MUSHROOM: + weight: 100 + y: + min: 62 + max: 84 + BROWN_MUSHROOM: + weight: 100 + y: + min: 62 + max: 84 + SMALL_ROCK: + weight: 10 + y: + min: 62 + max: 84 + +erodible: true + +trees: + density: 250 + items: + BROWN_MUSHROOM: + weight: 8 + y: + min: 58 + max: 84 + RED_MUSHROOM: + weight: 2 + y: + min: 58 + max: 84 diff --git a/src/main/resources/default-config/carving/cave.yml b/src/main/resources/default-config/carving/cave.yml index 60b95bb5d..6af35f30c 100644 --- a/src/main/resources/default-config/carving/cave.yml +++ b/src/main/resources/default-config/carving/cave.yml @@ -1,7 +1,8 @@ id: CAVE +step: 2 length: - min: 20 - max: 100 + min: 40 + max: 80 start: x: 1 y: 0.25 @@ -11,7 +12,7 @@ start: x: 1 y: 1 z: 1 - min: 2 + min: 3 max: 4 height: min: 4 @@ -20,9 +21,9 @@ cut: top: 0 bottom: 1 mutate: - x: 2 - y: 6 - z: 2 + x: 1 + y: 3 + z: 1 radius: 0.125 palette: inner: @@ -58,6 +59,7 @@ palette: y: 255 shift: "minecraft:grass_block": [ "minecraft:dirt" ] + "minecraft:mycelium": [ "minecraft:dirt" ] "minecraft:podzol": [ "minecraft:dirt" ] "minecraft:gravel": [ "minecraft:dirt" ] "minecraft:sand": [ "minecraft:dirt" ] diff --git a/src/main/resources/default-config/carving/cave_ocean.yml b/src/main/resources/default-config/carving/cave_ocean.yml index e384226f9..9f46c88f2 100644 --- a/src/main/resources/default-config/carving/cave_ocean.yml +++ b/src/main/resources/default-config/carving/cave_ocean.yml @@ -1,7 +1,8 @@ id: "CAVE_OCEAN" +step: 2 length: - min: 20 - max: 100 + min: 40 + max: 80 start: x: 1 y: 0.25 @@ -11,18 +12,18 @@ start: x: 1 y: 1 z: 1 - min: 2 + min: 3 max: 4 height: min: 4 max: 72 cut: top: 0 - bottom: 0 + bottom: 1 mutate: - x: 2 - y: 6 - z: 2 + x: 1 + y: 3 + z: 1 radius: 0.125 palette: inner: diff --git a/src/main/resources/default-config/carving/cave_swamp.yml b/src/main/resources/default-config/carving/cave_swamp.yml index a29a65c89..045fa0fab 100644 --- a/src/main/resources/default-config/carving/cave_swamp.yml +++ b/src/main/resources/default-config/carving/cave_swamp.yml @@ -1,7 +1,8 @@ id: "CAVE_SWAMP" +step: 2 length: - min: 20 - max: 100 + min: 40 + max: 80 start: x: 1 y: 0.25 @@ -11,18 +12,18 @@ start: x: 1 y: 1 z: 1 - min: 2 + min: 3 max: 4 height: min: 4 max: 72 cut: top: 0 - bottom: 0 + bottom: 1 mutate: - x: 2 - y: 6 - z: 2 + x: 1 + y: 3 + z: 1 radius: 0.125 palette: inner: diff --git a/src/main/resources/default-config/carving/cave_tundra.yml b/src/main/resources/default-config/carving/cave_tundra.yml index 865985df8..30deefe74 100644 --- a/src/main/resources/default-config/carving/cave_tundra.yml +++ b/src/main/resources/default-config/carving/cave_tundra.yml @@ -1,7 +1,8 @@ id: "CAVE_TUNDRA" +step: 2 length: - min: 20 - max: 100 + min: 40 + max: 80 start: x: 1 y: 0.25 @@ -11,18 +12,18 @@ start: x: 1 y: 1 z: 1 - min: 2 + min: 3 max: 4 height: min: 4 max: 72 cut: top: 0 - bottom: 0 + bottom: 1 mutate: - x: 2 - y: 6 - z: 2 + x: 1 + y: 3 + z: 1 radius: 0.125 palette: inner: diff --git a/src/main/resources/default-config/carving/ravine.yml b/src/main/resources/default-config/carving/ravine.yml index 56c73bec7..5c91a18a1 100644 --- a/src/main/resources/default-config/carving/ravine.yml +++ b/src/main/resources/default-config/carving/ravine.yml @@ -9,7 +9,7 @@ start: radius: multiply: x: 1 - y: 4 + y: 6 z: 1 min: 3 max: 4 @@ -17,11 +17,11 @@ start: min: 12 max: 56 cut: - top: 1 - bottom: 2 + top: 6 + bottom: 4 mutate: x: 1 - y: 4 + y: 2 z: 1 radius: 0.125 palette: diff --git a/src/main/resources/default-config/flora/button.yml b/src/main/resources/default-config/flora/button.yml index a1746a0db..c1e37a8ae 100644 --- a/src/main/resources/default-config/flora/button.yml +++ b/src/main/resources/default-config/flora/button.yml @@ -11,5 +11,6 @@ spawnable: - "minecraft:gravel" - "minecraft:dirt" - "minecraft:coarse_dirt" + - "minecraft:mycelium" replaceable: - "minecraft:air" \ No newline at end of file diff --git a/src/main/resources/default-config/grids/mountain_border_flat.yml b/src/main/resources/default-config/grids/mountain_border_flat.yml index 90608f133..89a86da24 100644 --- a/src/main/resources/default-config/grids/mountain_border_flat.yml +++ b/src/main/resources/default-config/grids/mountain_border_flat.yml @@ -1,10 +1,10 @@ grid: - - [ "MOUNTAINS_STONE_0", "MOUNTAINS_STONE_0", "MOUNTAINS_PRETTY_0", "MOUNTAINS_PRETTY_0", "MOUNTAINS_PRETTY_0", "ARID_MOUNTAINS_0", "ARID_MOUNTAINS_0", "ARID_MOUNTAINS_0", "MESA", "MESA", "MESA" ] - - [ "MOUNTAINS_STONE_0", "MOUNTAINS_STONE_0", "MOUNTAINS_PRETTY_0", "MOUNTAINS_PRETTY_0", "MOUNTAINS_PRETTY_0", "ARID_MOUNTAINS_0", "ARID_MOUNTAINS_0", "ARID_MOUNTAINS_0", "MESA", "MESA", "MESA" ] - - [ "MOUNTAINS_STONE_0", "MOUNTAINS_STONE_0", "MOUNTAINS_PRETTY_0", "MOUNTAINS_PRETTY_0", "MOUNTAINS_PRETTY_0", "ARID_MOUNTAINS_0", "ARID_MOUNTAINS_0", "ARID_MOUNTAINS_0", "MESA", "MESA", "MESA" ] - - [ "MOUNTAINS_STONE_0", "MOUNTAINS_STONE_0", "MOUNTAINS_PRETTY_0", "MOUNTAINS_PRETTY_0", "MOUNTAINS_PRETTY_0", "ARID_MOUNTAINS_0", "ARID_MOUNTAINS_0", "ARID_MOUNTAINS_0", "MESA", "MESA", "MESA" ] - - [ "MOUNTAINS_STONE_0", "MOUNTAINS_STONE_0", "MOUNTAINS_PRETTY_0", "MOUNTAINS_PRETTY_0", "MOUNTAINS_PRETTY_0", "ARID_MOUNTAINS_0", "ARID_MOUNTAINS_0", "ARID_MOUNTAINS_0", "ARID_MOUNTAINS_0", "ARID_MOUNTAINS_0", "ARID_MOUNTAINS_0" ] - - [ "MOUNTAINS_STONE_0", "MOUNTAINS_STONE_0", "MOUNTAINS_PRETTY_0", "MOUNTAINS_PRETTY_0", "MOUNTAINS_PRETTY_0", "MOUNTAINS_PRETTY_0", "ARID_MOUNTAINS_0", "ARID_MOUNTAINS_0", "ARID_MOUNTAINS_0", "ARID_MOUNTAINS_0", "ARID_MOUNTAINS_0" ] + - [ "MOUNTAINS_STONE_0", "MOUNTAINS_STONE_0", "MOUNTAINS_PRETTY_0", "MOUNTAINS_PRETTY_0", "MOUNTAINS_PRETTY_0", "ARID_MOUNTAINS", "ARID_MOUNTAINS", "ARID_MOUNTAINS", "MESA", "MESA", "MESA" ] + - [ "MOUNTAINS_STONE_0", "MOUNTAINS_STONE_0", "MOUNTAINS_PRETTY_0", "MOUNTAINS_PRETTY_0", "MOUNTAINS_PRETTY_0", "ARID_MOUNTAINS", "ARID_MOUNTAINS", "ARID_MOUNTAINS", "MESA", "MESA", "MESA" ] + - [ "MOUNTAINS_STONE_0", "MOUNTAINS_STONE_0", "MOUNTAINS_PRETTY_0", "MOUNTAINS_PRETTY_0", "MOUNTAINS_PRETTY_0", "ARID_MOUNTAINS", "ARID_MOUNTAINS", "ARID_MOUNTAINS", "MESA", "MESA", "MESA" ] + - [ "MOUNTAINS_STONE_0", "MOUNTAINS_STONE_0", "MOUNTAINS_PRETTY_0", "MOUNTAINS_PRETTY_0", "MOUNTAINS_PRETTY_0", "ARID_MOUNTAINS", "ARID_MOUNTAINS", "ARID_MOUNTAINS", "MESA", "MESA", "MESA" ] + - [ "MOUNTAINS_STONE_0", "MOUNTAINS_STONE_0", "MOUNTAINS_PRETTY_0", "MOUNTAINS_PRETTY_0", "MOUNTAINS_PRETTY_0", "ARID_MOUNTAINS", "ARID_MOUNTAINS", "ARID_MOUNTAINS", "ARID_MOUNTAINS", "ARID_MOUNTAINS", "ARID_MOUNTAINS" ] + - [ "MOUNTAINS_STONE_0", "MOUNTAINS_STONE_0", "MOUNTAINS_PRETTY_0", "MOUNTAINS_PRETTY_0", "MOUNTAINS_PRETTY_0", "MOUNTAINS_PRETTY_0", "ARID_MOUNTAINS", "ARID_MOUNTAINS", "ARID_MOUNTAINS", "ARID_MOUNTAINS", "ARID_MOUNTAINS" ] - [ "MOUNTAINS_STONE_0", "MOUNTAINS_STONE_0", "MOUNTAINS_PRETTY_0", "MOUNTAINS_PRETTY_0", "MOUNTAINS_PRETTY_0", "MOUNTAINS_PRETTY_0", "MOUNTAINS_PRETTY_0", "MOUNTAINS_PRETTY_0", "MOUNTAINS_PRETTY_0", "MOUNTAINS_PRETTY_0", "MOUNTAINS_PRETTY_0" ] - [ "MOUNTAINS_STONE_0", "MOUNTAINS_STONE_0", "MOUNTAINS_PRETTY_0", "MOUNTAINS_PRETTY_0", "MOUNTAINS_PRETTY_0", "MOUNTAINS_PRETTY_0", "MOUNTAINS_PRETTY_0", "MOUNTAINS_JUNGLE_0", "MOUNTAINS_JUNGLE_0", "MOUNTAINS_JUNGLE_0", "MOUNTAINS_JUNGLE_0" ] - [ "MOUNTAINS_STONE_0", "MOUNTAINS_STONE_0", "MOUNTAINS_PRETTY_0", "MOUNTAINS_PRETTY_0", "MOUNTAINS_PRETTY_0", "MOUNTAINS_PRETTY_0", "MOUNTAINS_PRETTY_0", "MOUNTAINS_PRETTY_0", "MOUNTAINS_JUNGLE_0", "MOUNTAINS_JUNGLE_0", "MOUNTAINS_JUNGLE_0" ] diff --git a/src/main/resources/default-config/grids/mountain_border_mid.yml b/src/main/resources/default-config/grids/mountain_border_mid.yml index d3c197e49..e267ad139 100644 --- a/src/main/resources/default-config/grids/mountain_border_mid.yml +++ b/src/main/resources/default-config/grids/mountain_border_mid.yml @@ -1,10 +1,10 @@ grid: - - [ "MOUNTAINS_STONE_1", "MOUNTAINS_STONE_1", "MOUNTAINS_PRETTY_0", "MOUNTAINS_PRETTY_1", "MOUNTAINS_PRETTY_0", "ARID_MOUNTAINS_1", "ARID_MOUNTAINS_1", "ARID_MOUNTAINS_1", "MESA", "MESA", "MESA" ] - - [ "MOUNTAINS_STONE_1", "MOUNTAINS_STONE_1", "MOUNTAINS_PRETTY_0", "MOUNTAINS_PRETTY_1", "MOUNTAINS_PRETTY_0", "ARID_MOUNTAINS_1", "ARID_MOUNTAINS_1", "ARID_MOUNTAINS_1", "MESA", "MESA", "MESA" ] - - [ "MOUNTAINS_STONE_1", "MOUNTAINS_STONE_1", "MOUNTAINS_PRETTY_0", "MOUNTAINS_PRETTY_1", "MOUNTAINS_PRETTY_0", "ARID_MOUNTAINS_1", "ARID_MOUNTAINS_1", "ARID_MOUNTAINS_1", "MESA", "MESA", "MESA" ] - - [ "MOUNTAINS_STONE_1", "MOUNTAINS_STONE_1", "MOUNTAINS_PRETTY_0", "MOUNTAINS_PRETTY_1", "MOUNTAINS_PRETTY_0", "ARID_MOUNTAINS_1", "ARID_MOUNTAINS_1", "ARID_MOUNTAINS_1", "MESA", "MESA", "MESA" ] - - [ "MOUNTAINS_STONE_1", "MOUNTAINS_STONE_1", "MOUNTAINS_PRETTY_0", "MOUNTAINS_PRETTY_1", "MOUNTAINS_PRETTY_0", "ARID_MOUNTAINS_1", "ARID_MOUNTAINS_1", "ARID_MOUNTAINS_1", "ARID_MOUNTAINS_1", "ARID_MOUNTAINS_1", "ARID_MOUNTAINS_1" ] - - [ "MOUNTAINS_STONE_1", "MOUNTAINS_STONE_1", "MOUNTAINS_PRETTY_0", "MOUNTAINS_PRETTY_1", "MOUNTAINS_PRETTY_1", "MOUNTAINS_PRETTY_0", "ARID_MOUNTAINS_1", "ARID_MOUNTAINS_1", "ARID_MOUNTAINS_1", "ARID_MOUNTAINS_1", "ARID_MOUNTAINS_1" ] + - [ "MOUNTAINS_STONE_1", "MOUNTAINS_STONE_1", "MOUNTAINS_PRETTY_0", "MOUNTAINS_PRETTY_1", "MOUNTAINS_PRETTY_0", "ARID_MOUNTAINS", "ARID_MOUNTAINS", "ARID_MOUNTAINS", "MESA", "MESA", "MESA" ] + - [ "MOUNTAINS_STONE_1", "MOUNTAINS_STONE_1", "MOUNTAINS_PRETTY_0", "MOUNTAINS_PRETTY_1", "MOUNTAINS_PRETTY_0", "ARID_MOUNTAINS", "ARID_MOUNTAINS", "ARID_MOUNTAINS", "MESA", "MESA", "MESA" ] + - [ "MOUNTAINS_STONE_1", "MOUNTAINS_STONE_1", "MOUNTAINS_PRETTY_0", "MOUNTAINS_PRETTY_1", "MOUNTAINS_PRETTY_0", "ARID_MOUNTAINS", "ARID_MOUNTAINS", "ARID_MOUNTAINS", "MESA", "MESA", "MESA" ] + - [ "MOUNTAINS_STONE_1", "MOUNTAINS_STONE_1", "MOUNTAINS_PRETTY_0", "MOUNTAINS_PRETTY_1", "MOUNTAINS_PRETTY_0", "ARID_MOUNTAINS", "ARID_MOUNTAINS", "ARID_MOUNTAINS", "MESA", "MESA", "MESA" ] + - [ "MOUNTAINS_STONE_1", "MOUNTAINS_STONE_1", "MOUNTAINS_PRETTY_0", "MOUNTAINS_PRETTY_1", "MOUNTAINS_PRETTY_0", "ARID_MOUNTAINS", "ARID_MOUNTAINS", "ARID_MOUNTAINS", "ARID_MOUNTAINS", "ARID_MOUNTAINS", "ARID_MOUNTAINS" ] + - [ "MOUNTAINS_STONE_1", "MOUNTAINS_STONE_1", "MOUNTAINS_PRETTY_0", "MOUNTAINS_PRETTY_1", "MOUNTAINS_PRETTY_1", "MOUNTAINS_PRETTY_0", "ARID_MOUNTAINS", "ARID_MOUNTAINS", "ARID_MOUNTAINS", "ARID_MOUNTAINS", "ARID_MOUNTAINS" ] - [ "MOUNTAINS_STONE_1", "MOUNTAINS_STONE_1", "MOUNTAINS_PRETTY_0", "MOUNTAINS_PRETTY_1", "MOUNTAINS_PRETTY_1", "MOUNTAINS_PRETTY_1", "MOUNTAINS_PRETTY_0", "MOUNTAINS_PRETTY_0", "MOUNTAINS_PRETTY_0", "MOUNTAINS_PRETTY_0", "MOUNTAINS_PRETTY_0" ] - [ "MOUNTAINS_STONE_1", "MOUNTAINS_STONE_1", "MOUNTAINS_PRETTY_0", "MOUNTAINS_PRETTY_1", "MOUNTAINS_PRETTY_1", "MOUNTAINS_PRETTY_1", "MOUNTAINS_PRETTY_1", "MOUNTAINS_JUNGLE_1", "MOUNTAINS_JUNGLE_1", "MOUNTAINS_JUNGLE_1", "MOUNTAINS_JUNGLE_1" ] - [ "MOUNTAINS_STONE_1", "MOUNTAINS_STONE_1", "MOUNTAINS_PRETTY_0", "MOUNTAINS_PRETTY_1", "MOUNTAINS_PRETTY_1", "MOUNTAINS_PRETTY_1", "MOUNTAINS_PRETTY_1", "MOUNTAINS_PRETTY_1", "MOUNTAINS_JUNGLE_1", "MOUNTAINS_JUNGLE_1", "MOUNTAINS_JUNGLE_1" ] diff --git a/src/main/resources/default-config/grids/ocean_deep.yml b/src/main/resources/default-config/grids/ocean_deep.yml index 9c06d6afc..ea682958b 100644 --- a/src/main/resources/default-config/grids/ocean_deep.yml +++ b/src/main/resources/default-config/grids/ocean_deep.yml @@ -1,8 +1,8 @@ grid: - - [ "FROZEN_OCEAN_DEEP", "COLD_OCEAN_DEEP", "COLD_OCEAN_DEEP", "OCEAN_DEEP", "OCEAN_DEEP", "OCEAN_DEEP", "OCEAN_DEEP", "LUKEWARM_OCEAN_DEEP", "WARM_OCEAN_DEEP", "WARM_OCEAN_DEEP", "WARM_OCEAN_DEEP" ] - - [ "FROZEN_OCEAN_DEEP", "COLD_OCEAN_DEEP", "COLD_OCEAN_DEEP", "OCEAN_DEEP", "OCEAN_DEEP", "OCEAN_DEEP", "OCEAN_DEEP", "LUKEWARM_OCEAN_DEEP", "WARM_OCEAN_DEEP", "WARM_OCEAN_DEEP", "WARM_OCEAN_DEEP" ] - - [ "FROZEN_OCEAN_DEEP", "COLD_OCEAN_DEEP", "COLD_OCEAN_DEEP", "OCEAN_DEEP", "OCEAN_DEEP", "OCEAN_DEEP", "OCEAN_DEEP", "LUKEWARM_OCEAN_DEEP", "WARM_OCEAN_DEEP", "WARM_OCEAN_DEEP", "WARM_OCEAN_DEEP" ] - - [ "FROZEN_OCEAN_DEEP", "COLD_OCEAN_DEEP", "COLD_OCEAN_DEEP", "OCEAN_DEEP", "OCEAN_DEEP", "OCEAN_DEEP", "OCEAN_DEEP", "LUKEWARM_OCEAN_DEEP", "WARM_OCEAN_DEEP", "WARM_OCEAN_DEEP", "WARM_OCEAN_DEEP" ] + - [ "FROZEN_OCEAN_DEEP", "COLD_OCEAN_DEEP", "COLD_OCEAN_DEEP", "OCEAN_DEEP", "OCEAN_DEEP", "OCEAN_DEEP", "OCEAN_DEEP", "LUKEWARM_OCEAN_SHELF", "WARM_OCEAN", "MUSHROOM_ISLANDS", "MUSHROOM_ISLANDS" ] + - [ "FROZEN_OCEAN_DEEP", "COLD_OCEAN_DEEP", "COLD_OCEAN_DEEP", "OCEAN_DEEP", "OCEAN_DEEP", "OCEAN_DEEP", "OCEAN_DEEP", "LUKEWARM_OCEAN_DEEP", "WARM_OCEAN_SHELF", "WARM_OCEAN", "MUSHROOM_ISLANDS" ] + - [ "FROZEN_OCEAN_DEEP", "COLD_OCEAN_DEEP", "COLD_OCEAN_DEEP", "OCEAN_DEEP", "OCEAN_DEEP", "OCEAN_DEEP", "OCEAN_DEEP", "LUKEWARM_OCEAN_DEEP", "WARM_OCEAN_DEEP", "WARM_OCEAN_SHELF", "WARM_OCEAN" ] + - [ "FROZEN_OCEAN_DEEP", "COLD_OCEAN_DEEP", "COLD_OCEAN_DEEP", "OCEAN_DEEP", "OCEAN_DEEP", "OCEAN_DEEP", "OCEAN_DEEP", "LUKEWARM_OCEAN_DEEP", "WARM_OCEAN_DEEP", "WARM_OCEAN_DEEP", "WARM_OCEAN_SHELF" ] - [ "FROZEN_OCEAN_DEEP", "COLD_OCEAN_DEEP", "COLD_OCEAN_DEEP", "OCEAN_DEEP", "OCEAN_DEEP", "OCEAN_DEEP", "OCEAN_DEEP", "LUKEWARM_OCEAN_DEEP", "WARM_OCEAN_DEEP", "WARM_OCEAN_DEEP", "WARM_OCEAN_DEEP" ] - [ "FROZEN_OCEAN_DEEP", "COLD_OCEAN_DEEP", "COLD_OCEAN_DEEP", "OCEAN_DEEP", "OCEAN_DEEP", "OCEAN_DEEP", "OCEAN_DEEP", "LUKEWARM_OCEAN_DEEP", "WARM_OCEAN_DEEP", "WARM_OCEAN_DEEP", "WARM_OCEAN_DEEP" ] - [ "FROZEN_OCEAN_DEEP", "COLD_OCEAN_DEEP", "COLD_OCEAN_DEEP", "OCEAN_DEEP", "OCEAN_DEEP", "OCEAN_DEEP", "OCEAN_DEEP", "LUKEWARM_OCEAN_DEEP", "WARM_OCEAN_DEEP", "WARM_OCEAN_DEEP", "WARM_OCEAN_DEEP" ] diff --git a/src/main/resources/default-config/ores/deposits/andesite_pocket.yml b/src/main/resources/default-config/ores/deposits/andesite_pocket.yml index 612b7b2fe..2883cf899 100644 --- a/src/main/resources/default-config/ores/deposits/andesite_pocket.yml +++ b/src/main/resources/default-config/ores/deposits/andesite_pocket.yml @@ -6,4 +6,4 @@ deform: 0.75 deform-frequency: 0.1 id: "ANDESITE" replace: - - "minecraft:stone" \ No newline at end of file + - "#minecraft:base_stone_overworld" \ No newline at end of file diff --git a/src/main/resources/default-config/ores/deposits/diorite_pocket.yml b/src/main/resources/default-config/ores/deposits/diorite_pocket.yml index 65e15d323..f7c8ed7f5 100644 --- a/src/main/resources/default-config/ores/deposits/diorite_pocket.yml +++ b/src/main/resources/default-config/ores/deposits/diorite_pocket.yml @@ -6,4 +6,4 @@ deform: 0.75 deform-frequency: 0.1 id: "DIORITE" replace: - - "minecraft:stone" \ No newline at end of file + - "#minecraft:base_stone_overworld" \ No newline at end of file diff --git a/src/main/resources/default-config/ores/deposits/dirt_pocket.yml b/src/main/resources/default-config/ores/deposits/dirt_pocket.yml index 76312b589..d16b87088 100644 --- a/src/main/resources/default-config/ores/deposits/dirt_pocket.yml +++ b/src/main/resources/default-config/ores/deposits/dirt_pocket.yml @@ -6,4 +6,4 @@ deform: 0.75 deform-frequency: 0.1 id: "DIRT" replace: - - "minecraft:stone" \ No newline at end of file + - "#minecraft:base_stone_overworld" \ No newline at end of file diff --git a/src/main/resources/default-config/ores/deposits/granite_pocket.yml b/src/main/resources/default-config/ores/deposits/granite_pocket.yml index d50fe47af..e03e635d4 100644 --- a/src/main/resources/default-config/ores/deposits/granite_pocket.yml +++ b/src/main/resources/default-config/ores/deposits/granite_pocket.yml @@ -6,4 +6,4 @@ deform: 0.75 deform-frequency: 0.1 id: "GRANITE" replace: - - "minecraft:stone" \ No newline at end of file + - "#minecraft:base_stone_overworld" \ No newline at end of file diff --git a/src/main/resources/default-config/ores/deposits/gravel_pocket.yml b/src/main/resources/default-config/ores/deposits/gravel_pocket.yml index dd74170bd..05f1cd595 100644 --- a/src/main/resources/default-config/ores/deposits/gravel_pocket.yml +++ b/src/main/resources/default-config/ores/deposits/gravel_pocket.yml @@ -6,4 +6,4 @@ deform: 0.75 deform-frequency: 0.1 id: "GRAVEL" replace: - - "minecraft:stone" \ No newline at end of file + - "#minecraft:base_stone_overworld" \ No newline at end of file diff --git a/src/main/resources/default-config/ores/minerals/coal.yml b/src/main/resources/default-config/ores/minerals/coal.yml index 8a3e7a63c..0254a37a4 100644 --- a/src/main/resources/default-config/ores/minerals/coal.yml +++ b/src/main/resources/default-config/ores/minerals/coal.yml @@ -6,4 +6,4 @@ deform: 0.75 deform-frequency: 0.2 id: "COAL_ORE" replace: - - "minecraft:stone" \ No newline at end of file + - "#minecraft:base_stone_overworld" \ No newline at end of file diff --git a/src/main/resources/default-config/ores/minerals/diamond.yml b/src/main/resources/default-config/ores/minerals/diamond.yml index 2b1f32a56..ed7b3a78c 100644 --- a/src/main/resources/default-config/ores/minerals/diamond.yml +++ b/src/main/resources/default-config/ores/minerals/diamond.yml @@ -6,4 +6,4 @@ deform: 0.75 deform-frequency: 0.2 id: "DIAMOND_ORE" replace: - - "minecraft:stone" \ No newline at end of file + - "#minecraft:base_stone_overworld" \ No newline at end of file diff --git a/src/main/resources/default-config/ores/minerals/gold.yml b/src/main/resources/default-config/ores/minerals/gold.yml index fc5954eb7..ade0f682a 100644 --- a/src/main/resources/default-config/ores/minerals/gold.yml +++ b/src/main/resources/default-config/ores/minerals/gold.yml @@ -6,4 +6,4 @@ deform: 0.75 deform-frequency: 0.2 id: "GOLD_ORE" replace: - - "minecraft:stone" \ No newline at end of file + - "#minecraft:base_stone_overworld" \ No newline at end of file diff --git a/src/main/resources/default-config/ores/minerals/iron.yml b/src/main/resources/default-config/ores/minerals/iron.yml index 0b2cf36a3..78ed86db9 100644 --- a/src/main/resources/default-config/ores/minerals/iron.yml +++ b/src/main/resources/default-config/ores/minerals/iron.yml @@ -6,4 +6,4 @@ deform: 0.75 deform-frequency: 0.2 id: "IRON_ORE" replace: - - "minecraft:stone" \ No newline at end of file + - "#minecraft:base_stone_overworld" \ No newline at end of file diff --git a/src/main/resources/default-config/ores/minerals/lapis.yml b/src/main/resources/default-config/ores/minerals/lapis.yml index 4c626b72a..ba36d2d0a 100644 --- a/src/main/resources/default-config/ores/minerals/lapis.yml +++ b/src/main/resources/default-config/ores/minerals/lapis.yml @@ -6,4 +6,4 @@ deform: 0.75 deform-frequency: 0.2 id: "LAPIS_ORE" replace: - - "minecraft:stone" \ No newline at end of file + - "#minecraft:base_stone_overworld" \ No newline at end of file diff --git a/src/main/resources/default-config/ores/minerals/redstone.yml b/src/main/resources/default-config/ores/minerals/redstone.yml index dcf76b6a6..2f23e595f 100644 --- a/src/main/resources/default-config/ores/minerals/redstone.yml +++ b/src/main/resources/default-config/ores/minerals/redstone.yml @@ -6,4 +6,4 @@ deform: 0.75 deform-frequency: 0.2 id: "REDSTONE_ORE" replace: - - "minecraft:stone" \ No newline at end of file + - "#minecraft:base_stone_overworld" \ No newline at end of file diff --git a/src/main/resources/default-config/pack.yml b/src/main/resources/default-config/pack.yml index a47cae3ef..c9a9c316e 100644 --- a/src/main/resources/default-config/pack.yml +++ b/src/main/resources/default-config/pack.yml @@ -43,8 +43,8 @@ frequencies: zone: 2048 blend: enable: true - frequency: 0.125 - amplitude: 10 + frequency: 0.12 + amplitude: 5 erode: enable: true frequency: 0.001 diff --git a/src/main/resources/default-config/palettes/mountains/arid_side.yml b/src/main/resources/default-config/palettes/mountains/arid_side.yml new file mode 100644 index 000000000..22b4defe1 --- /dev/null +++ b/src/main/resources/default-config/palettes/mountains/arid_side.yml @@ -0,0 +1,26 @@ +layers: + - materials: + - "minecraft:grass_block": 1 + - "minecraft:grass_block": 1 + - "minecraft:grass_path": 1 + - "minecraft:grass_block": 1 + - "minecraft:grass_block": 1 + - "minecraft:grass_block": 1 + - "minecraft:grass_block": 1 + - "minecraft:grass_block": 1 + - "minecraft:grass_path": 1 + - "minecraft:grass_block": 1 + - "minecraft:grass_block": 1 + - "minecraft:grass_block": 1 + - "minecraft:grass_block": 1 + - "minecraft:grass_block": 1 + - "minecraft:white_terracotta": 2 + layers: 1 + - materials: + - "minecraft:dirt": 7 + - "minecraft:white_terracotta": 1 + layers: 1 +id: "ARID_SIDE" +simplex: true +frequency: 0.05 +seed: 3 \ No newline at end of file diff --git a/src/main/resources/default-config/palettes/mycelium.yml b/src/main/resources/default-config/palettes/mycelium.yml new file mode 100644 index 000000000..7ce4ba808 --- /dev/null +++ b/src/main/resources/default-config/palettes/mycelium.yml @@ -0,0 +1,11 @@ +layers: + - materials: + - "minecraft:mycelium": 1 + layers: 1 + - materials: + - "minecraft:dirt": 1 + layers: 2 + - materials: + - "minecraft:stone": 1 + layers: 1 +id: "MYCELIUM" \ No newline at end of file diff --git a/src/main/resources/plugin.yml b/src/main/resources/plugin.yml index bd6168ce1..df1d49c57 100644 --- a/src/main/resources/plugin.yml +++ b/src/main/resources/plugin.yml @@ -1,9 +1,10 @@ name: "Terra" depend: [ "Gaea" ] main: "com.dfsek.terra.Terra" -version: "1.2.0-BETA" +version: "1.2.1-BETA" load: "STARTUP" api-version: "1.16" +description: "An insanely powerful free & open-source data-driven world generator." softdepend: [ "WorldEdit" ] commands: terra: diff --git a/src/test/java/NoiseInstancePerformanceTest.java b/src/test/java/NoiseInstancePerformanceTest.java new file mode 100644 index 000000000..ac3ecc72c --- /dev/null +++ b/src/test/java/NoiseInstancePerformanceTest.java @@ -0,0 +1,17 @@ +import org.junit.jupiter.api.Test; +import org.polydev.gaea.math.FastNoiseLite; + +public class NoiseInstancePerformanceTest { + @Test + public void performance() { + FastNoiseLite noiseLite = new FastNoiseLite(2403); + long l = System.nanoTime(); + for(int i = 0; i < 10000000; i++) noiseLite.getNoise(i, i); + System.out.println("No instantiation: " + (System.nanoTime() - l) / 1000000 + "ms"); + for(int i = 0; i < 10000000; i++) { + FastNoiseLite noiseLite1 = new FastNoiseLite(2403); + noiseLite1.getNoise(i, i); + } + System.out.println("Instantiation: " + (System.nanoTime() - l) / 1000000 + "ms"); + } +}