jackson stuff + lots of other shit

Signed-off-by: solonovamax <solonovamax@12oclockpoint.com>
This commit is contained in:
solonovamax 2020-11-14 22:21:32 -05:00
commit cb3bab2293
No known key found for this signature in database
GPG Key ID: ED0FC2D44CD76482
194 changed files with 652 additions and 5896 deletions

View File

@ -5,13 +5,16 @@ import java.nio.channels.Channels
import java.nio.file.Files
import java.nio.file.Paths
import java.nio.file.StandardCopyOption
import java.util.zip.ZipInputStream
plugins {
java
maven
id("com.github.johnrengelman.shadow").version("6.1.0")
}
repositories {
mavenCentral()
flatDir {
dirs("lib")
}
@ -26,46 +29,102 @@ java {
targetCompatibility = JavaVersion.VERSION_1_8
}
val versionObj = Version("0", "0", "1", "dev.2")
val versionObj = Version("1", "3", "1", true)
version = versionObj
dependencies {
compileOnly("org.spigotmc:spigot-api:1.16.2-R0.1-SNAPSHOT")
compileOnly("org.jetbrains:annotations:20.1.0") // more recent.
// Commons. Used for stuff.
implementation("commons-io:commons-io:2.4")
compileOnly(name = "Gaea-1.14.2", group = "")
// Commons-imagine. Used for loading images from disk for the biome images.
implementation("org.apache.commons:commons-imaging:1.0-alpha2")
compileOnly("com.sk89q.worldedit:worldedit-bukkit:7.2.0-SNAPSHOT")
// Bstats. For tracking stats.
implementation("org.bstats:bstats-bukkit:1.7")
compileOnly("com.googlecode.json-simple:json-simple:1.1")
// Parsii. Does parsing of the equations.
implementation(name = "parsii-1.2", group = "")
// Papermc API. for Paper spigot
implementation("io.papermc:paperlib:1.0.5")
// JUnit.
// Jackson
implementation("com.fasterxml.jackson.core:jackson-core:2.12+")
implementation("com.fasterxml.jackson.core:jackson-annotations:2.12+")
implementation("com.fasterxml.jackson.core:jackson-databind:2.12+")
implementation("com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:2.12+")
// Spigot mc API. Provided by spigot.
compileOnly("org.spigotmc:spigot-api:1.16.2-R0.1-SNAPSHOT")
// Annotations. Provided by mc.
compileOnly("org.jetbrains:annotations:20.1.0")
// Gaea. Provided as a plugin.
val gaeaVersion = "1.14.2"
compileOnly(name = "Gaea-${gaeaVersion}", group = "")
testImplementation(name = "Gaea-${gaeaVersion}", group = "")
// Worldedit. For saving structures. Provided as a plugin.
compileOnly("com.sk89q.worldedit:worldedit-bukkit:7.2.0-SNAPSHOT")
// GSON. idk how it's used.
compileOnly("com.googlecode.json-simple:json-simple:1.1")
// JUnit. Used for testing.
testImplementation("org.junit.jupiter:junit-jupiter-api:5.7.0")
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:5.7.0")
// Included here becaues tests rely on it.
testImplementation(name = "Gaea-1.14.2", group = "")
testImplementation("org.spigotmc:spigot-api:1.16.2-R0.1-SNAPSHOT")
}
val compileJava: JavaCompile by tasks
val mainSourceSet: SourceSet = sourceSets["main"]
val tokenizeJavaSources = task<Copy>(name = "tokenizeJavaSources") {
from(mainSourceSet.allSource) {
include("**/plugin.yml")
val tokens = mapOf("VERSION" to versionObj.toString())
filter(org.apache.tools.ant.filters.ReplaceTokens::class, "tokens" to tokens)
}
into("build/tokenizedSources")
includeEmptyDirs = false
}
compileJava.apply {
dependsOn(tokenizeJavaSources)
options.encoding = "UTF-8"
doFirst {
options.compilerArgs = mutableListOf("-Xlint:all", "-Xlint:-processing")
options.compilerArgs = mutableListOf("-Xlint:all")
}
}
tasks.test {
useJUnitPlatform()
maxHeapSize = "1G"
maxHeapSize = "4G"
ignoreFailures = false
failFast = true
maxParallelForks = 12
}
tasks.named<ShadowJar>("shadowJar") {
from(tokenizeJavaSources.destinationDir)
archiveClassifier.set("")
archiveBaseName.set("Terra")
setVersion(project.version)
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 {
dependsOn(tasks.shadowJar)
// dependsOn(testWithPaper)
// testWithPaper.mustRunAfter(tasks.shadowJar)
}
val testDir = "target/server/"
val setupServer = tasks.create("setupServer") {
@ -74,7 +133,7 @@ val setupServer = tasks.create("setupServer") {
// clean
file("${testDir}/").deleteRecursively()
file("${testDir}/plugins").mkdirs()
// Downloading latest paper jar.
val paperUrl = URL("https://papermc.io/api/v1/paper/1.16.4/latest/download")
val paperReadableByteChannel = Channels.newChannel(paperUrl.openStream())
@ -82,26 +141,42 @@ val setupServer = tasks.create("setupServer") {
val paperFileOutputStream = paperFile.outputStream()
val paperFileChannel = paperFileOutputStream.channel
paperFileChannel.transferFrom(paperReadableByteChannel, 0, Long.MAX_VALUE)
// Cloning test setup.
gitClone("https://github.com/PolyhedralDev/WorldGenTestServer")
// Copying plugins
Files.move(Paths.get("WorldGenTestServer/plugins"),
Paths.get("$testDir/plugins"),
StandardCopyOption.REPLACE_EXISTING)
Paths.get("$testDir/plugins"),
StandardCopyOption.REPLACE_EXISTING)
// Copying config
val serverText = URL("https://raw.githubusercontent.com/PolyhedralDev/WorldGenTestServer/master/server.properties").readText()
file("${testDir}/server.properties").writeText(serverText)
val bukkitText = URL("https://raw.githubusercontent.com/PolyhedralDev/WorldGenTestServer/master/bukkit.yml").readText()
file("${testDir}/bukkit.yml").writeText(bukkitText.replace("\${world}", "world").replace("\${gen}", "Terra:DEFAULT"))
File("${testDir}/eula.txt").writeText("eula=true")
// clean up
file("WorldGenTestServer").deleteRecursively()
}
}
val downloadDefaultPacks = tasks.create("downloadDefaultPacks") {
doFirst {
// Downloading latest paper jar.
// if (file("${buildDir}/resources/main/packs/default").exists() && file("${buildDir}/resources/main/packs/nether").exists())
// return@doFirst
// else
file("${buildDir}/resources/main/packs/").deleteRecursively()
val defaultPackUrl = URL("https://github.com/PolyhedralDev/TerraDefaultConfig/releases/download/latest/default.zip")
downloadAndUnzipPack(defaultPackUrl)
val netherPackUrl = URL("https://github.com/PolyhedralDev/TerraDefaultConfig/releases/download/latest/nether.zip")
downloadAndUnzipPack(netherPackUrl)
}
}
tasks.processResources.get().dependsOn(downloadDefaultPacks)
val testWithPaper = task<JavaExec>(name = "testWithPaper") {
standardInput = System.`in`
dependsOn(tasks.shadowJar)
@ -136,6 +211,7 @@ tasks.named<ShadowJar>("shadowJar") {
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")
relocate("com.fasterxml.jackson", "com.dfsek.terra.lib.jackson")
}
tasks.build {
@ -151,29 +227,48 @@ tasks.build {
* Version class that does version stuff.
*/
@Suppress("MemberVisibilityCanBePrivate")
class Version(val major: String, val minor: String, val revision: String, val preReleaseData: String? = null) {
class Version(val major: String, val minor: String, val revision: String, val preRelease: Boolean = false) {
override fun toString(): String {
return if (preReleaseData.isNullOrBlank())
return if (!preRelease)
"$major.$minor.$revision"
else //Only use git hash if it's a prerelease.
"$major.$minor.$revision-$preReleaseData+${getGitHash()}"
"$major.$minor.$revision-BETA+${getGitHash()}"
}
}
fun getGitHash(): String {
val stdout = ByteArrayOutputStream()
exec {
val exitCode = exec {
commandLine = mutableListOf("git", "rev-parse", "--short", "HEAD")
standardOutput = stdout
}
}.exitValue
if (exitCode == 128) // https://canary.discord.com/channels/715448651786485780/765260067812540416/777236094768381954
System.err.println("You can only use this in a git repo. Please run \"git clone https://github.com/PolyhedralDev/Terra.git\", then cd into there.")
if (exitCode == 127 || exitCode == 9009) // https://canary.discord.com/channels/715448651786485780/715448652411437099/777304618853335082
System.err.println("You must install git for this to work. https://git-scm.com/downloads")
return stdout.toString().trim()
}
fun gitClone(name: String) {
val stdout = ByteArrayOutputStream()
exec {
val result = exec {
commandLine = mutableListOf("git", "clone", name)
standardOutput = stdout
}
}.exitValue
if (result == 127 || result == 9009) // https://canary.discord.com/channels/715448651786485780/715448652411437099/777304618853335082
System.err.println("You must install git for this to work.")
}
fun downloadAndUnzipPack(packUrl: URL) {
ZipInputStream(packUrl.openStream()).use { zip ->
while (true) {
val entry = zip.nextEntry ?: break
if (entry.isDirectory)
file("${buildDir}/resources/main/packs/${entry.name}").mkdirs()
else
file("${buildDir}/resources/main/packs/${entry.name}").outputStream().use { output ->
output.write(zip.readBytes())
}
}
}
}

BIN
gradle/wrapper/gradle-wrapper.jar vendored Normal file

Binary file not shown.

View File

@ -3,7 +3,7 @@ package com.dfsek.terra;
import com.dfsek.terra.async.AsyncStructureFinder;
import com.dfsek.terra.config.base.ConfigPack;
import com.dfsek.terra.config.genconfig.structure.StructureConfig;
import com.dfsek.terra.tree.TreeRegistry;
import com.dfsek.terra.registry.TreeRegistry;
import com.dfsek.terra.util.StructureTypeEnum;
import org.bukkit.Material;
import org.bukkit.block.Block;

View File

@ -1,9 +1,9 @@
package com.dfsek.terra;
import com.dfsek.terra.biome.BiomeZone;
import com.dfsek.terra.biome.TerraBiomeGrid;
import com.dfsek.terra.biome.UserDefinedBiome;
import com.dfsek.terra.biome.UserDefinedGrid;
import com.dfsek.terra.biome.grid.TerraBiomeGrid;
import com.dfsek.terra.biome.grid.UserDefinedGrid;
import com.dfsek.terra.config.base.ConfigPack;
import com.dfsek.terra.config.base.WorldConfig;
import com.dfsek.terra.config.genconfig.BiomeGridConfig;

View File

@ -1,6 +1,6 @@
package com.dfsek.terra.async;
import com.dfsek.terra.biome.TerraBiomeGrid;
import com.dfsek.terra.biome.grid.TerraBiomeGrid;
import org.bukkit.Location;
import org.bukkit.util.Vector;
import org.jetbrains.annotations.NotNull;

View File

@ -1,7 +1,7 @@
package com.dfsek.terra.async;
import com.dfsek.terra.Terra;
import com.dfsek.terra.biome.TerraBiomeGrid;
import com.dfsek.terra.biome.grid.TerraBiomeGrid;
import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.World;

View File

@ -1,8 +1,8 @@
package com.dfsek.terra.async;
import com.dfsek.terra.TerraWorld;
import com.dfsek.terra.biome.TerraBiomeGrid;
import com.dfsek.terra.biome.UserDefinedBiome;
import com.dfsek.terra.biome.grid.TerraBiomeGrid;
import com.dfsek.terra.config.genconfig.structure.StructureConfig;
import com.dfsek.terra.structure.Rotation;
import com.dfsek.terra.structure.Structure;

View File

@ -40,7 +40,7 @@ public class BiomeZone {
* @param z Z coordinate
* @return BiomeGrid at coordinates.
*/
protected BiomeGrid getGrid(int x, int z) {
public BiomeGrid getGrid(int x, int z) {
return grids[NormalizationUtil.normalize(useImage ? Objects.requireNonNull(imageLoader).getNoiseVal(x, z, channel) : noise.getNoise(x, z), grids.length, 4)];
}

View File

@ -7,7 +7,7 @@ import org.polydev.gaea.world.palette.Palette;
import org.polydev.gaea.world.palette.RandomPalette;
import parsii.tokenizer.ParseException;
import java.util.Collections;
import java.util.HashMap;
import java.util.Random;
import java.util.TreeMap;
@ -19,6 +19,6 @@ public final class FailoverGenerator extends UserDefinedGenerator {
}
public FailoverGenerator() throws ParseException {
super("0", null, Collections.emptyList(), palette, new TreeMap<>(), false);
super("0", null, new HashMap<>(), palette, new TreeMap<>(), false);
}
}

View File

@ -1,5 +1,9 @@
package com.dfsek.terra.biome;
package com.dfsek.terra.biome.grid;
import com.dfsek.terra.biome.BiomeZone;
import com.dfsek.terra.biome.UserDefinedBiome;
import com.dfsek.terra.biome.postprocessing.CoordinatePerturb;
import com.dfsek.terra.biome.postprocessing.ErosionNoise;
import com.dfsek.terra.config.base.ConfigPack;
import com.dfsek.terra.config.base.ConfigUtil;
import com.dfsek.terra.config.lang.LangUtil;

View File

@ -1,5 +1,6 @@
package com.dfsek.terra.biome;
package com.dfsek.terra.biome.grid;
import com.dfsek.terra.biome.UserDefinedBiome;
import com.dfsek.terra.config.base.WorldConfig;
import com.dfsek.terra.image.ImageLoader;
import org.bukkit.Location;

View File

@ -1,4 +1,4 @@
package com.dfsek.terra.biome;
package com.dfsek.terra.biome.postprocessing;
import com.dfsek.terra.procgen.math.Vector2;
import org.polydev.gaea.math.FastNoiseLite;

View File

@ -1,4 +1,4 @@
package com.dfsek.terra.biome;
package com.dfsek.terra.biome.postprocessing;
import org.polydev.gaea.math.FastNoiseLite;
@ -26,7 +26,7 @@ public class ErosionNoise {
* @param z Z coordinate
* @return Whether location is eroded
*/
boolean isEroded(int x, int z) {
public boolean isEroded(int x, int z) {
double abs = Math.pow(noise.getNoise(x, z), 2);
return abs < thresh;
}

View File

@ -1,8 +1,8 @@
package com.dfsek.terra.command.biome;
import com.dfsek.terra.TerraWorld;
import com.dfsek.terra.biome.TerraBiomeGrid;
import com.dfsek.terra.biome.UserDefinedBiome;
import com.dfsek.terra.biome.grid.TerraBiomeGrid;
import com.dfsek.terra.config.lang.LangUtil;
import org.bukkit.World;
import org.bukkit.command.Command;

View File

@ -24,9 +24,9 @@ public class SpawnCommand extends WorldCommand implements DebugCommand {
int x = p.getBlockX();
int y = p.getBlockY();
int z = p.getBlockZ();
boolean air = StructureSpawnRequirement.AIR.matches(world, x, y, z);
boolean ground = StructureSpawnRequirement.LAND.matches(world, x, y, z);
boolean sea = StructureSpawnRequirement.OCEAN.matches(world, x, y, z);
boolean air = StructureSpawnRequirement.AIR.getInstance(world).matches(x, y, z);
boolean ground = StructureSpawnRequirement.LAND.getInstance(world).matches(x, y, z);
boolean sea = StructureSpawnRequirement.OCEAN.getInstance(world).matches(x, y, z);
sender.sendMessage("AIR: " + air + "\nLAND: " + ground + "\nOCEAN: " + sea);
return true;

View File

@ -1,283 +1,57 @@
package com.dfsek.terra.config;
import com.dfsek.terra.config.base.ConfigPack;
import org.bukkit.Color;
import org.bukkit.Location;
import org.bukkit.configuration.InvalidConfigurationException;
import org.bukkit.configuration.file.YamlConfiguration;
import org.bukkit.configuration.serialization.ConfigurationSerializable;
import org.bukkit.inventory.ItemStack;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.List;
import java.util.Map;
import java.util.Set;
@SuppressWarnings("unused")
public abstract class TerraConfig {
protected final String id;
private final ConfigPack config;
private final YamlConfiguration yaml;
public TerraConfig(File file, ConfigPack config) throws IOException, InvalidConfigurationException {
yaml = new YamlConfiguration();
yaml.load(file);
this.config = config;
/**
* Constructs a new Terra config with a file, config pack and Id.
*
* @param file The file to use when constructing the config.
* @param config The config reference.
* @param id The id of the object.
* @throws IOException
* @throws InvalidConfigurationException
* @deprecated Deprecated because you should use {@link #TerraConfig(InputStream, ConfigPack, String)}
*/
@Deprecated
public TerraConfig(File file, ConfigPack config, String id) throws IOException, InvalidConfigurationException {
this(new FileInputStream(file), config, id);
}
public TerraConfig(InputStream stream, ConfigPack config) throws IOException, InvalidConfigurationException {
/**
* Constructs a new Terra config with an input stream, config pack and Id.
*
* @param stream The input stream to use when constructing the config.
* @param config The config reference.
* @param id The id of the object.
* @throws IOException
* @throws InvalidConfigurationException
*/
public TerraConfig(InputStream stream, ConfigPack config, String id) throws IOException, InvalidConfigurationException {
yaml = new YamlConfiguration();
yaml.load(new InputStreamReader(stream));
this.config = config;
this.id = id;
}
public ConfigPack getConfig() {
return config;
}
public abstract String getID();
public @NotNull Set<String> getKeys(boolean deep) {
return yaml.getKeys(deep);
}
public @NotNull Map<String, Object> getValues(boolean deep) {
return yaml.getValues(deep);
}
public boolean contains(@NotNull String path) {
return yaml.contains(path);
}
public boolean contains(@NotNull String path, boolean ignoreDefault) {
return yaml.contains(path, ignoreDefault);
}
public boolean isSet(@NotNull String path) {
return yaml.isSet(path);
}
public @Nullable Object get(@NotNull String path) {
return yaml.get(path);
}
public @Nullable Object get(@NotNull String path, @Nullable Object def) {
return yaml.get(path, def);
}
public @Nullable String getString(@NotNull String path) {
return yaml.getString(path);
}
public @Nullable String getString(@NotNull String path, @Nullable String def) {
return yaml.getString(path, def);
}
public boolean isString(@NotNull String path) {
return yaml.isString(path);
}
public int getInt(@NotNull String path) {
return yaml.getInt(path);
}
public int getInt(@NotNull String path, int def) {
return yaml.getInt(path, def);
}
public boolean isInt(@NotNull String path) {
return yaml.isInt(path);
}
public boolean getBoolean(@NotNull String path) {
return yaml.getBoolean(path);
}
public boolean getBoolean(@NotNull String path, boolean def) {
return yaml.getBoolean(path, def);
}
public boolean isBoolean(@NotNull String path) {
return yaml.isBoolean(path);
}
public double getDouble(@NotNull String path) {
return yaml.getDouble(path);
}
public double getDouble(@NotNull String path, double def) {
return yaml.getDouble(path, def);
}
public boolean isDouble(@NotNull String path) {
return yaml.isDouble(path);
}
public long getLong(@NotNull String path) {
return yaml.getLong(path);
}
public long getLong(@NotNull String path, long def) {
return yaml.getLong(path, def);
}
public boolean isLong(@NotNull String path) {
return yaml.isLong(path);
}
public @Nullable List<?> getList(@NotNull String path) {
return yaml.getList(path);
}
public @Nullable List<?> getList(@NotNull String path, @Nullable List<?> def) {
return yaml.getList(path, def);
}
public boolean isList(@NotNull String path) {
return yaml.isList(path);
}
public @NotNull List<String> getStringList(@NotNull String path) {
return yaml.getStringList(path);
}
public @NotNull List<Integer> getIntegerList(@NotNull String path) {
return yaml.getIntegerList(path);
}
public @NotNull List<Boolean> getBooleanList(@NotNull String path) {
return yaml.getBooleanList(path);
}
public @NotNull List<Double> getDoubleList(@NotNull String path) {
return yaml.getDoubleList(path);
}
public @NotNull List<Float> getFloatList(@NotNull String path) {
return yaml.getFloatList(path);
}
public @NotNull List<Long> getLongList(@NotNull String path) {
return yaml.getLongList(path);
}
public @NotNull List<Byte> getByteList(@NotNull String path) {
return yaml.getByteList(path);
}
public @NotNull List<Character> getCharacterList(@NotNull String path) {
return yaml.getCharacterList(path);
}
public @NotNull List<Short> getShortList(@NotNull String path) {
return yaml.getShortList(path);
}
public @NotNull List<Map<?, ?>> getMapList(@NotNull String path) {
return yaml.getMapList(path);
}
public <T> @Nullable T getObject(@NotNull String path, @NotNull Class<T> clazz) {
return yaml.getObject(path, clazz);
}
public <T> @Nullable T getObject(@NotNull String path, @NotNull Class<T> clazz, @Nullable T def) {
return yaml.getObject(path, clazz, def);
}
public <T extends ConfigurationSerializable> @Nullable T getSerializable(@NotNull String path, @NotNull Class<T> clazz) {
return yaml.getSerializable(path, clazz);
}
public <T extends ConfigurationSerializable> @Nullable T getSerializable(@NotNull String path, @NotNull Class<T> clazz, @Nullable T def) {
return yaml.getSerializable(path, clazz, def);
}
public @Nullable ItemStack getItemStack(@NotNull String path) {
return yaml.getItemStack(path);
}
public @Nullable ItemStack getItemStack(@NotNull String path, @Nullable ItemStack def) {
return yaml.getItemStack(path, def);
}
public boolean isItemStack(@NotNull String path) {
return yaml.isItemStack(path);
}
public @Nullable Color getColor(@NotNull String path) {
return yaml.getColor(path);
}
public @Nullable Color getColor(@NotNull String path, @Nullable Color def) {
return yaml.getColor(path, def);
}
public boolean isColor(@NotNull String path) {
return yaml.isColor(path);
}
public @Nullable Location getLocation(@NotNull String path) {
return yaml.getLocation(path);
}
public @Nullable Location getLocation(@NotNull String path, @Nullable Location def) {
return yaml.getLocation(path, def);
}
public boolean isLocation(@NotNull String path) {
return yaml.isLocation(path);
public String getID() {
return id;
}
}

View File

@ -17,7 +17,8 @@ import com.dfsek.terra.config.genconfig.biome.AbstractBiomeConfig;
import com.dfsek.terra.config.genconfig.biome.BiomeConfig;
import com.dfsek.terra.config.genconfig.structure.StructureConfig;
import com.dfsek.terra.config.lang.LangUtil;
import com.dfsek.terra.tree.TreeRegistry;
import com.dfsek.terra.registry.FloraRegistry;
import com.dfsek.terra.registry.TreeRegistry;
import com.dfsek.terra.util.StructureTypeEnum;
import org.bukkit.configuration.ConfigurationSection;
import org.bukkit.configuration.InvalidConfigurationException;
@ -33,6 +34,7 @@ import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Set;
import java.util.logging.Level;
import java.util.stream.Collectors;
@ -40,7 +42,7 @@ import java.util.stream.Collectors;
/**
* Represents a Terra configuration pack.
*/
public class ConfigPack {
public class ConfigPack extends YamlConfiguration {
private static final Map<String, ConfigPack> configs = new HashMap<>();
public final List<String> biomeList;
public final double zoneFreq;
@ -61,30 +63,29 @@ public class ConfigPack {
public final boolean vanillaDecoration;
public final boolean vanillaMobs;
public final boolean preventSaplingOverride;
public final Map<StructureTypeEnum, StructureConfig> locatable = new HashMap<>();
private final YamlConfiguration yaml;
private final Map<StructureTypeEnum, StructureConfig> locatable = new HashMap<>();
private final Map<String, OreConfig> ores;
private final Map<String, PaletteConfig> palettes;
private final Map<String, CarverConfig> carvers;
private final Map<String, FloraConfig> flora;
private final Map<String, StructureConfig> structures;
private final Map<String, AbstractBiomeConfig> abstractBiomes;
private final Map<String, BiomeConfig> biomes;
private final Map<String, BiomeGridConfig> grids;
private final TreeRegistry treeRegistry = new TreeRegistry();
private final FloraRegistry floraRegistry = new FloraRegistry();
private final Set<StructureConfig> allStructures = new HashSet<>();
private final Map<String, Double> definedVariables = new HashMap<>();
private final File dataFolder;
private final String id;
public ConfigPack(File file) throws IOException, InvalidConfigurationException {
yaml = new YamlConfiguration();
yaml.load(new File(file, "pack.yml"));
long l = System.nanoTime();
load(new File(file, "pack.yml"));
dataFolder = file;
if(!yaml.contains("id")) throw new ConfigException("No ID specified!", "null");
this.id = yaml.getString("id");
if(!contains("id")) throw new ConfigException("No ID specified!", "null");
this.id = getString("id");
ores = ConfigLoader.load(new File(file, "ores").toPath(), this, OreConfig.class);
@ -92,7 +93,11 @@ public class ConfigPack {
carvers = ConfigLoader.load(new File(file, "carving").toPath(), this, CarverConfig.class);
flora = ConfigLoader.load(new File(file, "flora").toPath(), this, FloraConfig.class);
Map<String, FloraConfig> flora = ConfigLoader.load(new File(file, "flora").toPath(), this, FloraConfig.class);
for(Map.Entry<String, FloraConfig> entry : flora.entrySet()) {
if(floraRegistry.add(entry.getKey(), entry.getValue()))
Debug.info("Overriding Gaea flora: " + entry.getKey());
}
structures = ConfigLoader.load(new File(file, "structures").toPath(), this, StructureConfig.class);
@ -103,43 +108,57 @@ public class ConfigPack {
Debug.info("Overriding Vanilla tree: " + entry.getKey());
}
if(contains("variables")) {
Map<String, Object> vars = Objects.requireNonNull(getConfigurationSection("variables")).getValues(false);
for(Map.Entry<String, Object> entry : vars.entrySet()) {
try {
definedVariables.put(entry.getKey(), Double.valueOf(entry.getValue().toString()));
Debug.info("Registered variable " + entry.getKey() + " with value " + entry.getValue());
} catch(ClassCastException | NumberFormatException e) {
Debug.stack(e);
throw new ConfigException("Variable value " + entry.getValue().toString() + " could not be parsed to a double.", getID());
}
}
}
abstractBiomes = ConfigLoader.load(new File(file, "abstract" + File.separator + "biomes").toPath(), this, AbstractBiomeConfig.class);
biomes = ConfigLoader.load(new File(file, "biomes").toPath(), this, BiomeConfig.class);
grids = ConfigLoader.load(new File(file, "grids").toPath(), this, BiomeGridConfig.class);
zoneFreq = 1f / yaml.getInt("frequencies.zone", 1536);
freq1 = 1f / yaml.getInt("frequencies.grid-x", 256);
freq2 = 1f / yaml.getInt("frequencies.grid-z", 512);
zoneFreq = 1f / getInt("frequencies.zone", 1536);
freq1 = 1f / getInt("frequencies.grid-x", 256);
freq2 = 1f / getInt("frequencies.grid-z", 512);
biomeBlend = yaml.getBoolean("blend.enable", false);
blendAmp = yaml.getInt("blend.amplitude", 8);
blendFreq = yaml.getDouble("blend.frequency", 0.01);
biomeBlend = getBoolean("blend.enable", false);
blendAmp = getInt("blend.amplitude", 8);
blendFreq = getDouble("blend.frequency", 0.01);
erosionEnable = yaml.getBoolean("erode.enable", false);
erosionFreq = yaml.getDouble("erode.frequency", 0.01);
erosionThresh = yaml.getDouble("erode.threshold", 0.04);
erosionOctaves = yaml.getInt("erode.octaves", 3);
erosionEnable = getBoolean("erode.enable", false);
erosionFreq = getDouble("erode.frequency", 0.01);
erosionThresh = getDouble("erode.threshold", 0.04);
erosionOctaves = getInt("erode.octaves", 3);
octaves = yaml.getInt("noise.octaves", 4);
frequency = yaml.getDouble("noise.frequency", 1f / 96);
octaves = getInt("noise.octaves", 4);
frequency = getDouble("noise.frequency", 1f / 96);
erosionName = yaml.getString("erode.grid");
erosionName = getString("erode.grid");
vanillaCaves = yaml.getBoolean("vanilla.caves", false);
vanillaStructures = yaml.getBoolean("vanilla.structures", false);
vanillaDecoration = yaml.getBoolean("vanilla.decorations", false);
vanillaMobs = yaml.getBoolean("vanilla.mobs", false);
vanillaCaves = getBoolean("vanilla.caves", false);
vanillaStructures = getBoolean("vanilla.structures", false);
vanillaDecoration = getBoolean("vanilla.decorations", false);
vanillaMobs = getBoolean("vanilla.mobs", false);
preventSaplingOverride = yaml.getBoolean("prevent-sapling-override", false);
preventSaplingOverride = getBoolean("prevent-sapling-override", false);
if(vanillaMobs || vanillaDecoration || vanillaStructures || vanillaCaves) {
Terra.getInstance().getLogger().warning("WARNING: Vanilla features have been enabled! These features may not work properly, and are not officially supported! Use at your own risk!");
}
// Load BiomeGrids from BiomeZone
biomeList = yaml.getStringList("grids");
biomeList = getStringList("grids");
for(String biome : biomeList) {
if(getBiomeGrid(biome) == null) {
@ -154,7 +173,7 @@ public class ConfigPack {
allStructures.addAll(b.getStructures());
}
ConfigurationSection st = yaml.getConfigurationSection("locatable");
ConfigurationSection st = getConfigurationSection("locatable");
if(st != null) {
Map<String, Object> strucLocatable = st.getValues(false);
for(Map.Entry<String, Object> e : strucLocatable.entrySet()) {
@ -171,14 +190,14 @@ public class ConfigPack {
LangUtil.log("config-pack.loaded", Level.INFO, getID(), String.valueOf((System.nanoTime() - l) / 1000000D));
}
public BiomeGridConfig getBiomeGrid(String id) {
return grids.get(id);
}
public String getID() {
return id;
}
public Map<String, Double> getDefinedVariables() {
return definedVariables;
}
public Map<String, BiomeConfig> getBiomes() {
return biomes;
}
@ -187,6 +206,10 @@ public class ConfigPack {
return structures.get(id);
}
public BiomeGridConfig getBiomeGrid(String id) {
return grids.get(id);
}
public static synchronized void loadAll(JavaPlugin main) {
configs.clear();
File file = new File(main.getDataFolder(), "packs");
@ -287,8 +310,8 @@ public class ConfigPack {
return fill;
}
public FloraConfig getFlora(String id) {
return flora.get(id);
public FloraRegistry getFloraRegistry() {
return floraRegistry;
}
public TreeRegistry getTreeRegistry() {

View File

@ -1,7 +1,7 @@
package com.dfsek.terra.config.genconfig;
import com.dfsek.terra.biome.UserDefinedBiome;
import com.dfsek.terra.biome.UserDefinedGrid;
import com.dfsek.terra.biome.grid.UserDefinedGrid;
import com.dfsek.terra.config.TerraConfig;
import com.dfsek.terra.config.base.ConfigPack;
import com.dfsek.terra.config.base.WorldConfig;

View File

@ -41,12 +41,10 @@ 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 {
super(file, config);
load(file);
if(!contains("id")) throw new ConfigException("No ID specified for Carver!", "null");
id = Objects.requireNonNull(getString("id"));
@ -71,7 +69,7 @@ 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));
Range 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<String, Object> e : Objects.requireNonNull(getConfigurationSection("shift")).getValues(false).entrySet()) {

View File

@ -21,7 +21,6 @@ import parsii.tokenizer.ParseException;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
import java.util.TreeMap;
@ -172,7 +171,7 @@ public class BiomeConfig extends TerraConfig {
try {
// Get UserDefinedBiome instance representing this config.
UserDefinedGenerator gen = new UserDefinedGenerator(eq, elevation, Collections.emptyList(), palette.getPaletteMap(), slant, getBoolean("prevent-smooth", false));
UserDefinedGenerator gen = new UserDefinedGenerator(eq, elevation, config.getDefinedVariables(), palette.getPaletteMap(), slant, getBoolean("prevent-smooth", false));
gen.setElevationInterpolation(doElevationInterpolation);
this.biome = new UserDefinedBiome(vanillaBiome, dec, gen, getBoolean("erodible", false), biomeID);
} catch(ParseException e) {

View File

@ -3,7 +3,6 @@ package com.dfsek.terra.config.genconfig.biome;
import com.dfsek.terra.Debug;
import com.dfsek.terra.config.TerraConfig;
import com.dfsek.terra.config.TerraConfigSection;
import com.dfsek.terra.config.base.ConfigUtil;
import com.dfsek.terra.config.exception.ConfigException;
import com.dfsek.terra.config.exception.NotFoundException;
import org.bukkit.configuration.ConfigurationSection;
@ -12,13 +11,13 @@ import org.polydev.gaea.math.FastNoiseLite;
import org.polydev.gaea.math.ProbabilityCollection;
import org.polydev.gaea.math.Range;
import org.polydev.gaea.world.Flora;
import org.polydev.gaea.world.FloraType;
import java.util.HashMap;
import java.util.Map;
import java.util.Objects;
public class BiomeFloraConfig extends TerraConfigSection {
private final ProbabilityCollection<Flora> flora = new ProbabilityCollection<>();
private final ProbabilityCollection<Flora> floras = new ProbabilityCollection<>();
private final Map<Flora, Range> floraHeights = new HashMap<>();
private int floraAttempts;
private int floraChance;
@ -40,35 +39,28 @@ public class BiomeFloraConfig extends TerraConfigSection {
floraNoise.setFrequency(floraFreq);
}
try {
for(Map.Entry<String, Object> e : cfg.getValues(false).entrySet()) {
for(Map.Entry<String, Object> e : cfg.getValues(false).entrySet()) {
try {
Map<?, ?> val = ((ConfigurationSection) e.getValue()).getValues(false);
Map<?, ?> y = ((ConfigurationSection) val.get("y")).getValues(false);
Flora flora;
try {
Debug.info("Adding " + e.getKey() + " to biome's flora list with weight " + e.getValue());
Flora floraObj = FloraType.valueOf(e.getKey());
flora.add(floraObj, (Integer) val.get("weight"));
floraHeights.put(floraObj, new Range((Integer) y.get("min"), (Integer) y.get("max")));
} catch(IllegalArgumentException ex) {
try {
Debug.info("[Terra] Is custom flora: true");
Flora floraCustom = parent.getConfig().getFlora(e.getKey());
if(floraCustom == null) throw new NotFoundException("Flora", e.getKey(), parent.getID());
flora.add(floraCustom, (Integer) val.get("weight"));
floraHeights.put(floraCustom, new Range((Integer) y.get("min"), (Integer) y.get("max")));
} catch(NullPointerException ex2) {
throw new NotFoundException("Flora", e.getKey(), parent.getID());
}
flora = Objects.requireNonNull(parent.getConfig().getFloraRegistry().get(e.getKey()));
} catch(NullPointerException ex) {
throw new NotFoundException("Flora", e.getKey(), parent.getID());
}
floras.add(flora, (Integer) val.get("weight"));
floraHeights.put(flora, new Range((Integer) y.get("min"), (Integer) y.get("max")));
} catch(ClassCastException ex) {
Debug.stack(ex);
throw new ConfigException("Unable to parse Flora configuration! Check YAML syntax.", parent.getID());
}
} catch(ClassCastException e) {
if(ConfigUtil.debug) e.printStackTrace();
throw new ConfigException("Unable to parse Flora configuration! Check YAML syntax.", parent.getID());
}
}
public ProbabilityCollection<Flora> getFlora() {
return flora;
return floras;
}
public Map<Flora, Range> getFloraHeights() {

View File

@ -3,6 +3,7 @@ package com.dfsek.terra.config.genconfig.biome;
import com.dfsek.terra.config.TerraConfig;
import com.dfsek.terra.config.TerraConfigSection;
import com.dfsek.terra.config.exception.ConfigException;
import com.dfsek.terra.config.exception.NotFoundException;
import org.bukkit.configuration.ConfigurationSection;
import org.bukkit.configuration.InvalidConfigurationException;
import org.polydev.gaea.math.ProbabilityCollection;
@ -25,6 +26,7 @@ public class BiomeTreeConfig extends TerraConfigSection {
Map<String, Object> cfg = c.getValues(false);
if(cfg.size() == 0) return;
treeDensity = parent.getInt("trees.density", 0);
for(Map.Entry<String, Object> e : cfg.entrySet()) {
try {
Map<?, ?> val = ((ConfigurationSection) e.getValue()).getValues(false);
@ -33,7 +35,7 @@ public class BiomeTreeConfig extends TerraConfigSection {
try {
tree = Objects.requireNonNull(parent.getConfig().getTreeRegistry().get(e.getKey()));
} catch(NullPointerException ex2) {
throw new ConfigException("Invalid tree type: \"" + e.getKey() + "\"", parent.getID());
throw new NotFoundException("Tree", e.getKey(), parent.getID());
}
trees.add(tree, (Integer) val.get("weight"));
treeHeights.put(tree, new Range((Integer) y.get("min"), (Integer) y.get("max")));

View File

@ -0,0 +1,28 @@
package com.dfsek.terra.config.jackson;
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.databind.DeserializationContext;
import com.fasterxml.jackson.databind.JavaType;
import com.fasterxml.jackson.databind.deser.std.StdDeserializer;
import org.bukkit.block.data.BlockData;
import java.io.IOException;
public class BlockDataDeserializer extends StdDeserializer<BlockData> {
protected BlockDataDeserializer(Class<BlockData> vc) {
super(vc);
}
protected BlockDataDeserializer(JavaType valueType) {
super(valueType);
}
protected BlockDataDeserializer(StdDeserializer<BlockData> src) {
super(src);
}
@Override
public BlockData deserialize(JsonParser p, DeserializationContext ctxt) throws IOException {
return null;
}
}

View File

@ -0,0 +1,35 @@
package com.dfsek.terra.config.jackson;
import com.fasterxml.jackson.core.JsonParseException;
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.databind.DeserializationContext;
import com.fasterxml.jackson.databind.JavaType;
import com.fasterxml.jackson.databind.deser.std.StdDeserializer;
import org.bukkit.Bukkit;
import org.bukkit.Material;
import java.io.IOException;
import java.util.Objects;
public class MaterialDeserializer extends StdDeserializer<Material> {
protected MaterialDeserializer(Class<Material> vc) {
super(vc);
}
protected MaterialDeserializer(JavaType valueType) {
super(valueType);
}
protected MaterialDeserializer(StdDeserializer<Material> src) {
super(src);
}
@Override
public Material deserialize(JsonParser p, DeserializationContext ctxt) throws IOException {
try {
return Bukkit.createBlockData(Objects.requireNonNull(p.getValueAsString())).getMaterial();
} catch(IllegalArgumentException e) {
throw new JsonParseException(p, "This is not a valid block.", e);
}
}
}

View File

@ -0,0 +1,47 @@
package com.dfsek.terra.config.jackson;
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.DeserializationContext;
import com.fasterxml.jackson.databind.JavaType;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.deser.std.StdDeserializer;
import org.polydev.gaea.math.ProbabilityCollection;
import java.io.IOException;
import java.util.Iterator;
import java.util.Map;
public class ProbabilityCollectionDeserializer<T> extends StdDeserializer<ProbabilityCollection<T>> {
private static final ObjectMapper mapper = new ObjectMapper();
protected ProbabilityCollectionDeserializer(Class<ProbabilityCollection<java.lang.String>> vc) {
super(vc);
}
protected ProbabilityCollectionDeserializer(JavaType valueType) {
super(valueType);
}
protected ProbabilityCollectionDeserializer(StdDeserializer<ProbabilityCollection<java.lang.String>> src) {
super(src);
}
@Override
public ProbabilityCollection<T> deserialize(JsonParser p, DeserializationContext ctxt) throws IOException {
JsonNode rootNode = p.getCodec().readTree(p);
ProbabilityCollection<T> collection = new ProbabilityCollection<>();
Iterator<Map.Entry<String, JsonNode>> it = rootNode.fields();
while(it.hasNext()) {
Map.Entry<String, JsonNode> currentNode = it.next();
collection.add(mapper.readValue(currentNode.getKey(), new TypeReference<T>() {
}), currentNode.getValue().numberValue().intValue());
}
return collection;
}
}

View File

@ -0,0 +1,11 @@
package com.dfsek.terra.config.jackson;
import com.fasterxml.jackson.core.util.VersionUtil;
import com.fasterxml.jackson.databind.module.SimpleModule;
public class TerraModule extends SimpleModule {
public TerraModule() {
super("TerraModule", VersionUtil.parseVersion("@projectVersion@", "@projectGroupId@", "@projectArtifactId@"));
}
}

View File

@ -1,6 +1,6 @@
package com.dfsek.terra.generation;
import com.dfsek.terra.biome.TerraBiomeGrid;
import com.dfsek.terra.biome.grid.TerraBiomeGrid;
import org.bukkit.World;
import org.polydev.gaea.generation.GenerationPhase;
import org.polydev.gaea.math.FastNoiseLite;

View File

@ -17,7 +17,6 @@ import parsii.eval.Scope;
import parsii.eval.Variable;
import parsii.tokenizer.ParseException;
import java.util.List;
import java.util.Map;
@ -39,8 +38,11 @@ public class UserDefinedGenerator extends Generator {
private boolean elevationInterpolation;
public UserDefinedGenerator(String equation, @Nullable String elevateEquation, List<Variable> userVariables, Map<Integer, Palette<BlockData>> paletteMap, Map<Integer, Palette<BlockData>> slantPaletteMap, boolean preventSmooth)
public UserDefinedGenerator(String equation, @Nullable String elevateEquation, Map<String, Double> userVariables, Map<Integer, Palette<BlockData>> paletteMap, Map<Integer, Palette<BlockData>> slantPaletteMap, boolean preventSmooth)
throws ParseException {
for(Map.Entry<String, Double> entry : userVariables.entrySet()) {
s.getVariable(entry.getKey()).setValue(entry.getValue()); // Define all user variables.
}
Parser p = new Parser();
p.registerFunction("noise2", n2);
p.registerFunction("noise3", n3);

View File

@ -1,4 +1,4 @@
package com.dfsek.terra.generation.entities;
package com.dfsek.terra.generation.deserelized;
import org.bukkit.Location;
import org.bukkit.plugin.java.JavaPlugin;

View File

@ -1,10 +1,10 @@
package com.dfsek.terra.generation.entities;
package com.dfsek.terra.generation.deserelized;
import com.fasterxml.jackson.databind.JsonDeserializer;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import org.bukkit.Chunk;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.block.Block;
import org.bukkit.block.data.BlockData;
import org.bukkit.plugin.java.JavaPlugin;
import org.bukkit.util.Vector;
import org.polydev.gaea.math.FastNoiseLite;
@ -13,18 +13,12 @@ import org.polydev.gaea.population.ChunkCoordinate;
import java.util.HashMap;
import java.util.Map;
import java.util.Random;
import java.util.Set;
@SuppressWarnings("DefaultAnnotationParam")
@JsonDeserialize(using = JsonDeserializer.None.class)
public class MultiChunkOre extends Ore {
protected final int min;
protected final int max;
public MultiChunkOre(BlockData oreData, int min, int max, double deform, double deformFrequency, String id,
boolean update, int chunkEdgeOffset, Set<Material> replaceable) {
super(oreData, deform, deformFrequency, id, update, chunkEdgeOffset, replaceable);
this.min = min;
this.max = max;
}
protected int min;
protected int max;
@Override
public void generate(Location location, Random random, JavaPlugin plugin) {
@ -54,7 +48,7 @@ public class MultiChunkOre extends Ore {
Block block = chunks.computeIfAbsent(coord, k -> chunk.getWorld().getChunkAt(oreLocation.toLocation(chunk.getWorld())))
.getBlock(Math.floorMod(source.getBlockX(), 16), source.getBlockY(), Math.floorMod(source.getBlockZ(), 16)); // Chunk caching conditional computation
if(replaceable.contains(block.getType()) && block.getLocation().getY() >= 0)
block.setBlockData(oreData, update);
block.setBlockData(material, update);
}
}
}

View File

@ -0,0 +1,64 @@
package com.dfsek.terra.generation.deserelized;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonSubTypes;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.block.Block;
import org.bukkit.block.data.BlockData;
import org.bukkit.plugin.java.JavaPlugin;
import java.util.Random;
import java.util.Set;
/**
* This selects which value based on whether the key {@code type} is
* {@code multi}, {@code single}, or {@code vanilla}.
*/
@SuppressWarnings("DefaultAnnotationParam")
@JsonTypeInfo(
use = JsonTypeInfo.Id.CLASS,
include = JsonTypeInfo.As.PROPERTY,
property = "type"
)
@JsonSubTypes({
@JsonSubTypes.Type(value = MultiChunkOre.class, name = "multi"),
@JsonSubTypes.Type(value = SingleChunkOre.class, name = "single"),
@JsonSubTypes.Type(value = VanillaOre.class, name = "vanilla")
})
public abstract class Ore implements GenerationEntity {
protected BlockData material;
protected double deform = 0.75;
@JsonProperty("deform-frequency")
protected double deformFrequency = 0.1;
protected String id;
protected boolean update = false;
@JsonProperty("chunk-edge-offset")
protected int chunkEdgeOffset = 0;
@JsonProperty("replace")
protected Set<Material> replaceable;
public int getChunkEdgeOffset() {
return chunkEdgeOffset;
}
/**
* Generate an ore.
*
* @param location Location to generate the ore at.
* @param random Random used for generation.
* @param plugin Plugin reference.
*/
@Override
public abstract void generate(Location location, Random random, JavaPlugin plugin);
public boolean isValidLocation(Location location, JavaPlugin plugin) {
Block block = location.getBlock();
return (replaceable.contains(block.getType()) && (block.getLocation().getY() >= 0));
}
protected int randomInRange(Random r, int min, int max) {
return r.nextInt(max - min + 1) + min;
}
}

View File

@ -1,27 +1,17 @@
package com.dfsek.terra.generation.entities;
package com.dfsek.terra.generation.deserelized;
import org.bukkit.Chunk;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.block.Block;
import org.bukkit.block.data.BlockData;
import org.bukkit.plugin.java.JavaPlugin;
import org.bukkit.util.Vector;
import org.polydev.gaea.math.FastNoiseLite;
import java.util.Random;
import java.util.Set;
public class SingleChunkOre extends Ore {
protected final int min;
protected final int max;
public SingleChunkOre(BlockData oreData, int min, int max, double deform, double deformFrequency, String id,
boolean update, int chunkEdgeOffset, Set<Material> replaceable) {
super(oreData, deform, deformFrequency, id, update, chunkEdgeOffset, replaceable);
this.min = min;
this.max = max;
}
protected int min = 0;
protected int max = 255;
@Override
public void generate(Location location, Random random, JavaPlugin plugin) {
@ -41,7 +31,7 @@ public class SingleChunkOre extends Ore {
if(oreLoc.distance(location.toVector()) < (rad + 0.5) * ((noise.getNoise(x, y, z) + 1) * deform)) {
Block b = chunk.getBlock(oreLoc.getBlockX(), oreLoc.getBlockY(), oreLoc.getBlockZ());
if(replaceable.contains(b.getType()) && b.getLocation().getY() >= 0)
b.setBlockData(oreData, update);
b.setBlockData(material, update);
}
}
}

View File

@ -1,7 +1,8 @@
package com.dfsek.terra.generation.entities;
package com.dfsek.terra.generation.deserelized;
import com.dfsek.terra.structure.Rotation;
import com.dfsek.terra.structure.Structure;
import com.fasterxml.jackson.annotation.JsonProperty;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.plugin.java.JavaPlugin;
@ -10,18 +11,14 @@ import org.polydev.gaea.math.ProbabilityCollection;
import java.util.Random;
import java.util.Set;
@SuppressWarnings({"unused", "SpellCheckingInspection", "MismatchedQueryAndUpdateOfCollection"})
public class Tree implements GenerationEntity {
private final Set<Material> spawnable;
private final String id;
private final int yOffset;
private final ProbabilityCollection<Structure> structure;
public Tree(Set<Material> spawnable, String id, int yOffset, ProbabilityCollection<Structure> structure) {
this.spawnable = spawnable;
this.id = id;
this.yOffset = yOffset;
this.structure = structure;
}
private Set<Material> spawnable;
private String id;
@JsonProperty("y-offset")
private int yOffset;
@JsonProperty("files")
private ProbabilityCollection<Structure> structure;
@Override
public void generate(Location location, Random random, JavaPlugin plugin) {

View File

@ -1,25 +1,16 @@
package com.dfsek.terra.generation.entities;
package com.dfsek.terra.generation.deserelized;
import net.royawesome.jlibnoise.MathHelper;
import org.bukkit.Chunk;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.block.Block;
import org.bukkit.block.data.BlockData;
import org.bukkit.plugin.java.JavaPlugin;
import java.util.Random;
import java.util.Set;
@SuppressWarnings("unused")
public class VanillaOre extends Ore {
private final int size;
public VanillaOre(BlockData oreData, int size, double deform, double deformFrequency, String id,
boolean update,
int chunkEdgeOffset, Set<Material> replaceable) {
super(oreData, deform, deformFrequency, id, update, chunkEdgeOffset, replaceable);
this.size = size;
}
private int size;
/**
* TODO: what the fuck does half of this do?
@ -73,7 +64,7 @@ public class VanillaOre extends Ore {
double d15 = (z + 0.5D - (d3 + (d4 - d3) * iFactor)) / (d11 / 2.0D);
Block block = chunk.getBlock(x, y, z);
if((d13 * d13 + d14 * d14 + d15 * d15 < 1.0D) && replaceable.contains(block.getType())) {
block.setBlockData(oreData, update);
block.setBlockData(material, update);
}
}
}

View File

@ -1,6 +1,7 @@
package com.dfsek.terra.generation.entities;
import com.dfsek.terra.carving.UserDefinedCarver;
import com.dfsek.terra.generation.deserelized.GenerationEntity;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.block.data.BlockData;

View File

@ -1,5 +1,6 @@
package com.dfsek.terra.generation.entities;
import com.dfsek.terra.generation.deserelized.GenerationEntity;
import org.bukkit.Chunk;
import org.bukkit.Location;
import org.bukkit.Material;

View File

@ -1,44 +0,0 @@
package com.dfsek.terra.generation.entities;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.block.Block;
import org.bukkit.block.data.BlockData;
import org.bukkit.plugin.java.JavaPlugin;
import java.util.Random;
import java.util.Set;
public abstract class Ore implements GenerationEntity {
protected final BlockData oreData;
protected final double deform;
protected final double deformFrequency;
protected final String id;
protected final boolean update;
protected final int chunkEdgeOffset;
protected final Set<Material> replaceable;
public Ore(BlockData oreData, double deform, double deformFrequency, String id, boolean update,
int chunkEdgeOffset, Set<Material> replaceable) {
this.oreData = oreData;
this.deform = deform;
this.deformFrequency = deformFrequency;
this.id = id;
this.update = update;
this.chunkEdgeOffset = chunkEdgeOffset;
this.replaceable = replaceable;
}
// @Override
// public abstract void generate(Location location, Random random, JavaPlugin plugin);
@Override
public boolean isValidLocation(Location location, JavaPlugin plugin) {
Block block = location.getBlock();
return (replaceable.contains(block.getType()) && (block.getLocation().getY() >= 0));
}
protected int randomInRange(Random r, int min, int max) {
return r.nextInt(max - min + 1) + min;
}
}

View File

@ -2,7 +2,7 @@ package com.dfsek.terra.image;
import com.dfsek.terra.TerraWorld;
import com.dfsek.terra.biome.BiomeZone;
import com.dfsek.terra.biome.TerraBiomeGrid;
import com.dfsek.terra.biome.grid.TerraBiomeGrid;
import com.dfsek.terra.config.base.ConfigUtil;
import com.dfsek.terra.debug.gui.DebugGUI;
import org.bukkit.World;

View File

@ -1,7 +1,7 @@
package com.dfsek.terra.image;
import com.dfsek.terra.TerraWorld;
import com.dfsek.terra.biome.TerraBiomeGrid;
import com.dfsek.terra.biome.grid.TerraBiomeGrid;
import org.bukkit.World;
import org.polydev.gaea.biome.NormalizationUtil;

View File

@ -3,8 +3,8 @@ package com.dfsek.terra.population;
import com.dfsek.terra.Terra;
import com.dfsek.terra.TerraProfiler;
import com.dfsek.terra.TerraWorld;
import com.dfsek.terra.biome.TerraBiomeGrid;
import com.dfsek.terra.biome.UserDefinedBiome;
import com.dfsek.terra.biome.grid.TerraBiomeGrid;
import com.dfsek.terra.config.base.ConfigPack;
import com.dfsek.terra.config.genconfig.biome.BiomeConfig;
import com.dfsek.terra.config.genconfig.biome.BiomeFloraConfig;

View File

@ -2,8 +2,8 @@ package com.dfsek.terra.population;
import com.dfsek.terra.TerraProfiler;
import com.dfsek.terra.TerraWorld;
import com.dfsek.terra.biome.TerraBiomeGrid;
import com.dfsek.terra.biome.UserDefinedBiome;
import com.dfsek.terra.biome.grid.TerraBiomeGrid;
import com.dfsek.terra.config.base.ConfigUtil;
import com.dfsek.terra.config.genconfig.biome.BiomeConfig;
import com.dfsek.terra.util.DataUtil;

View File

@ -3,8 +3,8 @@ package com.dfsek.terra.population;
import com.dfsek.terra.Debug;
import com.dfsek.terra.TerraProfiler;
import com.dfsek.terra.TerraWorld;
import com.dfsek.terra.biome.TerraBiomeGrid;
import com.dfsek.terra.biome.UserDefinedBiome;
import com.dfsek.terra.biome.grid.TerraBiomeGrid;
import com.dfsek.terra.config.base.ConfigPack;
import com.dfsek.terra.config.genconfig.structure.StructureConfig;
import com.dfsek.terra.procgen.math.Vector2;

View File

@ -0,0 +1,10 @@
package com.dfsek.terra.registry;
import org.polydev.gaea.world.Flora;
import org.polydev.gaea.world.FloraType;
public class FloraRegistry extends TerraRegistry<Flora> {
public FloraRegistry() {
for(FloraType f : FloraType.values()) add(f.toString(), f);
}
}

View File

@ -0,0 +1,41 @@
package com.dfsek.terra.registry;
import java.util.HashMap;
import java.util.Map;
public abstract class TerraRegistry<T> {
private final Map<String, T> objects = new HashMap<>();
/**
* Add an object to the registry with a name.
*
* @param name Name of the tree.
* @param value Object to add
* @return True if tree was overwritten.
*/
public boolean add(String name, T value) {
boolean exists = objects.containsKey(name);
objects.put(name, value);
return exists;
}
/**
* Check if the registry contains an object.
*
* @param name Name of the object.
* @return Whether the registry contains the object.
*/
public boolean contains(String name) {
return objects.containsKey(name);
}
/**
* Get an object from the registry,
*
* @param id ID of object to get
* @return Object
*/
public T get(String id) {
return objects.get(id);
}
}

View File

@ -0,0 +1,10 @@
package com.dfsek.terra.registry;
import org.polydev.gaea.tree.Tree;
import org.polydev.gaea.tree.TreeType;
public class TreeRegistry extends TerraRegistry<Tree> {
public TreeRegistry() {
for(TreeType t : TreeType.values()) add(t.toString(), t); // Populate registry with default trees.
}
}

View File

@ -277,7 +277,7 @@ public class Structure implements Serializable {
public boolean checkSpawns(Location origin, Rotation r) {
for(StructureContainedBlock b : spawns) {
Vector2 rot = getRotatedCoords(new Vector2(b.getX() - structureInfo.getCenterX(), b.getZ() - structureInfo.getCenterZ()), r);
if(!b.getRequirement().matches(origin.getWorld(), (int) rot.getX() + origin.getBlockX(), origin.getBlockY() + b.getY(), (int) rot.getZ() + origin.getBlockZ()))
if(!b.getRequirement().getInstance(origin.getWorld()).matches((int) rot.getX() + origin.getBlockX(), origin.getBlockY() + b.getY(), (int) rot.getZ() + origin.getBlockZ()))
return false;
}
return true;

View File

@ -1,74 +1,37 @@
package com.dfsek.terra.structure;
import com.dfsek.terra.TerraWorld;
import com.dfsek.terra.biome.UserDefinedBiome;
import com.dfsek.terra.config.base.ConfigPack;
import com.dfsek.terra.config.genconfig.biome.BiomeConfig;
import com.dfsek.terra.structure.spawn.AirSpawn;
import com.dfsek.terra.structure.spawn.BlankSpawn;
import com.dfsek.terra.structure.spawn.LandSpawn;
import com.dfsek.terra.structure.spawn.OceanSpawn;
import com.dfsek.terra.structure.spawn.Requirement;
import org.bukkit.World;
import org.polydev.gaea.generation.GenerationPhase;
import org.polydev.gaea.math.FastNoiseLite;
import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;
public enum StructureSpawnRequirement implements Serializable {
AIR {
@Override
public boolean matches(World w, int x, int y, int z) {
setNoise(w, x, y, z);
TerraWorld tw = TerraWorld.getWorld(w);
ConfigPack wc = tw.getConfig();
UserDefinedBiome b = (UserDefinedBiome) tw.getGrid().getBiome(x, z, GenerationPhase.POPULATE);
BiomeConfig c = wc.getBiome(b);
if(y <= c.getOcean().getSeaLevel()) return false;
return b.getGenerator().getNoise(getNoise(w), w, x, y, z) <= 0;
public Requirement getInstance(World world) {
return new AirSpawn(world);
}
}, OCEAN {
@Override
public boolean matches(World w, int x, int y, int z) {
setNoise(w, x, y, z);
UserDefinedBiome b = (UserDefinedBiome) TerraWorld.getWorld(w).getGrid().getBiome(x, z, GenerationPhase.POPULATE);
BiomeConfig c = TerraWorld.getWorld(w).getConfig().getBiome(b);
if(y > c.getOcean().getSeaLevel()) return false;
return b.getGenerator().getNoise(getNoise(w), w, x, y, z) <= 0;
public Requirement getInstance(World world) {
return new OceanSpawn(world);
}
}, LAND {
@Override
public boolean matches(World w, int x, int y, int z) {
setNoise(w, x, y, z);
UserDefinedBiome b = (UserDefinedBiome) TerraWorld.getWorld(w).getGrid().getBiome(x, z, GenerationPhase.POPULATE);
return b.getGenerator().getNoise(getNoise(w), w, x, y, z) > 0;
public Requirement getInstance(World world) {
return new LandSpawn(world);
}
}, BLANK {
@Override
public boolean matches(World w, int x, int y, int z) {
return true;
public Requirement getInstance(World world) {
return new BlankSpawn();
}
};
private static final long serialVersionUID = -175639605885943679L;
private static final transient Map<World, FastNoiseLite> noiseMap = new HashMap<>();
private static void setNoise(World w, int x, int y, int z) {
TerraWorld tw = TerraWorld.getWorld(w);
ConfigPack wc = tw.getConfig();
if(getNoise(w) == null) {
FastNoiseLite gen = new FastNoiseLite((int) w.getSeed());
gen.setNoiseType(FastNoiseLite.NoiseType.OpenSimplex2);
gen.setFractalType(FastNoiseLite.FractalType.FBm);
gen.setFractalOctaves(wc.octaves);
gen.setFrequency(wc.frequency);
putNoise(w, gen);
}
}
public static void putNoise(World w, FastNoiseLite noise) {
noiseMap.putIfAbsent(w, noise);
}
private static FastNoiseLite getNoise(World w) {
return noiseMap.get(w);
}
public abstract boolean matches(World w, int x, int y, int z);
public abstract Requirement getInstance(World world);
}

View File

@ -0,0 +1,24 @@
package com.dfsek.terra.structure.spawn;
import com.dfsek.terra.TerraWorld;
import com.dfsek.terra.biome.UserDefinedBiome;
import com.dfsek.terra.config.base.ConfigPack;
import com.dfsek.terra.config.genconfig.biome.BiomeConfig;
import org.bukkit.World;
import org.polydev.gaea.generation.GenerationPhase;
public class AirSpawn extends Requirement {
public AirSpawn(World world) {
super(world);
}
@Override
public boolean matches(int x, int y, int z) {
TerraWorld tw = TerraWorld.getWorld(getWorld());
ConfigPack wc = tw.getConfig();
UserDefinedBiome b = (UserDefinedBiome) tw.getGrid().getBiome(x, z, GenerationPhase.POPULATE);
BiomeConfig c = wc.getBiome(b);
if(y <= c.getOcean().getSeaLevel()) return false;
return b.getGenerator().getNoise(getNoise(), getWorld(), x, y, z) <= 0;
}
}

View File

@ -0,0 +1,12 @@
package com.dfsek.terra.structure.spawn;
public class BlankSpawn extends Requirement {
public BlankSpawn() {
super(null);
}
@Override
public boolean matches(int x, int y, int z) {
return true;
}
}

View File

@ -0,0 +1,19 @@
package com.dfsek.terra.structure.spawn;
import com.dfsek.terra.TerraWorld;
import com.dfsek.terra.biome.UserDefinedBiome;
import org.bukkit.World;
import org.polydev.gaea.generation.GenerationPhase;
public class LandSpawn extends Requirement {
public LandSpawn(World world) {
super(world);
}
@Override
public boolean matches(int x, int y, int z) {
TerraWorld tw = TerraWorld.getWorld(getWorld());
UserDefinedBiome b = (UserDefinedBiome) tw.getGrid().getBiome(x, z, GenerationPhase.POPULATE);
return b.getGenerator().getNoise(getNoise(), getWorld(), x, y, z) > 0;
}
}

View File

@ -0,0 +1,22 @@
package com.dfsek.terra.structure.spawn;
import com.dfsek.terra.TerraWorld;
import com.dfsek.terra.biome.UserDefinedBiome;
import com.dfsek.terra.config.genconfig.biome.BiomeConfig;
import org.bukkit.World;
import org.polydev.gaea.generation.GenerationPhase;
public class OceanSpawn extends Requirement {
public OceanSpawn(World world) {
super(world);
}
@Override
public boolean matches(int x, int y, int z) {
TerraWorld tw = TerraWorld.getWorld(getWorld());
UserDefinedBiome b = (UserDefinedBiome) tw.getGrid().getBiome(x, z, GenerationPhase.POPULATE);
BiomeConfig c = tw.getConfig().getBiome(b);
if(y > c.getOcean().getSeaLevel()) return false;
return b.getGenerator().getNoise(getNoise(), getWorld(), x, y, z) <= 0;
}
}

View File

@ -0,0 +1,25 @@
package com.dfsek.terra.structure.spawn;
import com.dfsek.terra.generation.TerraChunkGenerator;
import org.bukkit.World;
import org.polydev.gaea.math.FastNoiseLite;
import java.util.Objects;
public abstract class Requirement {
private final World world;
public Requirement(World world) {
this.world = world;
}
public abstract boolean matches(int x, int y, int z);
protected FastNoiseLite getNoise() {
return ((TerraChunkGenerator) Objects.requireNonNull(world.getGenerator())).getNoiseGenerator();
}
public World getWorld() {
return world;
}
}

View File

@ -1,36 +0,0 @@
package com.dfsek.terra.tree;
import org.polydev.gaea.tree.Tree;
import org.polydev.gaea.tree.TreeType;
import java.util.HashMap;
import java.util.Map;
public class TreeRegistry {
private final Map<String, Tree> trees = new HashMap<>();
public TreeRegistry() {
for(TreeType t : TreeType.values()) trees.put(t.toString(), t); // Populate registry with default trees.
}
/**
* Add a tree to the registry with a name.
*
* @param name Name of the tree.
* @param value Tree to add
* @return True if tree was overwritten.
*/
public boolean add(String name, Tree value) {
boolean exists = trees.containsKey(name);
trees.put(name, value);
return exists;
}
public boolean contains(String name) {
return trees.containsKey(name);
}
public Tree get(String id) {
return trees.get(id);
}
}

View File

@ -1,65 +0,0 @@
id: "BASIC_ORES"
structures:
- STRONGHOLD
carving:
CAVE: 40
RAVINE: 5
CAVERN: 5
ores:
DIRT:
min: 0
max: 1
min-height: 0
max-height: 84
GRAVEL:
min: 0
max: 1
min-height: 0
max-height: 84
DIORITE:
min: 0
max: 1
min-height: 0
max-height: 84
ANDESITE:
min: 0
max: 1
min-height: 0
max-height: 84
GRANITE:
min: 0
max: 1
min-height: 0
max-height: 84
COAL_ORE:
min: 4
max: 8
min-height: 0
max-height: 84
IRON_ORE:
min: 2
max: 6
min-height: 0
max-height: 64
GOLD_ORE:
min: 1
max: 3
min-height: 0
max-height: 32
LAPIS_ORE:
min: 1
max: 2
min-height: 0
max-height: 32
REDSTONE_ORE:
min: 1
max: 2
min-height: 0
max-height: 16
DIAMOND_ORE:
min: 1
max: 1
min-height: 0
max-height: 16

View File

@ -1,96 +0,0 @@
noise-equation: "((-((y / 58)^2)) + 1) + (noise2(x, z)/5)"
id: "BEACH_ABSTRACT"
palette:
- "BLOCK:minecraft:bedrock": 0
- BEDROCK_MOST: 1
- BEDROCK_HALF: 2
- BEDROCK_LITTLE: 3
- SANDY: 64
- GRASSY: 255
structures:
- STRONGHOLD
flora:
chance: 60
attempts: 1
items:
TALL_GRASS:
weight: 15
y:
min: 62
max: 84
LILY_PAD:
weight: 1
y:
min: 62
max: 84
GRASS:
weight: 70
y:
min: 62
max: 84
POPPY:
weight: 5
y:
min: 62
max: 84
ores:
DIRT:
min: 0
max: 2
min-height: 0
max-height: 128
GRAVEL:
min: 0
max: 2
min-height: 0
max-height: 128
DIORITE:
min: 0
max: 2
min-height: 0
max-height: 128
ANDESITE:
min: 0
max: 2
min-height: 0
max-height: 128
GRANITE:
min: 0
max: 2
min-height: 0
max-height: 128
COAL_ORE:
min: 5
max: 15
min-height: 0
max-height: 128
IRON_ORE:
min: 2
max: 6
min-height: 0
max-height: 64
GOLD_ORE:
min: 1
max: 3
min-height: 0
max-height: 32
LAPIS_ORE:
min: 1
max: 4
min-height: 0
max-height: 32
REDSTONE_ORE:
min: 1
max: 4
min-height: 0
max-height: 16
DIAMOND_ORE:
min: 1
max: 2
min-height: 0
max-height: 16

View File

@ -1,89 +0,0 @@
noise-equation: "((-((y / 36)^2)) + 1) + ((noise2(x, z)/3))"
id: "DEEP_OCEAN_ABSTRACT"
palette:
- "BLOCK:minecraft:bedrock": 0
- BEDROCK_MOST: 1
- BEDROCK_HALF: 2
- BEDROCK_LITTLE: 3
- SANDY: 255
- OCEANFLOOR: 60
flora:
chance: 50
attempts: 1
items:
TALL_SEAGRASS:
weight: 1
y:
min: 32
max: 64
SEAGRASS:
weight: 3
y:
min: 32
max: 64
carving:
CAVE_OCEAN: 45
structures:
- STRONGHOLD
ores:
DIRT:
min: 0
max: 2
min-height: 0
max-height: 128
GRAVEL:
min: 0
max: 2
min-height: 0
max-height: 128
DIORITE:
min: 0
max: 2
min-height: 0
max-height: 128
ANDESITE:
min: 0
max: 2
min-height: 0
max-height: 128
GRANITE:
min: 0
max: 2
min-height: 0
max-height: 128
COAL_ORE:
min: 5
max: 15
min-height: 0
max-height: 128
IRON_ORE:
min: 2
max: 6
min-height: 0
max-height: 64
GOLD_ORE:
min: 1
max: 3
min-height: 0
max-height: 32
LAPIS_ORE:
min: 1
max: 4
min-height: 0
max-height: 32
REDSTONE_ORE:
min: 1
max: 4
min-height: 0
max-height: 16
DIAMOND_ORE:
min: 1
max: 2
min-height: 0
max-height: 16

View File

@ -1,107 +0,0 @@
noise-equation: "((-((y / 76)^2)) + 1) + ((noise2(x, z)+0.5) / 3) + abs(noise2(x/2, z/2)*4)"
id: "MOUNTAINS_PRETTY"
carving:
CAVE: 40
RAVINE: 5
CAVERN: 5
structures:
- STRONGHOLD
ores:
DIRT:
min: 0
max: 1
min-height: 0
max-height: 84
GRAVEL:
min: 0
max: 1
min-height: 0
max-height: 84
DIORITE:
min: 0
max: 1
min-height: 0
max-height: 84
ANDESITE:
min: 0
max: 1
min-height: 0
max-height: 84
GRANITE:
min: 0
max: 1
min-height: 0
max-height: 84
COAL_ORE:
min: 4
max: 8
min-height: 0
max-height: 84
IRON_ORE:
min: 2
max: 6
min-height: 0
max-height: 64
GOLD_ORE:
min: 1
max: 3
min-height: 0
max-height: 32
LAPIS_ORE:
min: 1
max: 2
min-height: 0
max-height: 32
REDSTONE_ORE:
min: 1
max: 2
min-height: 0
max-height: 16
DIAMOND_ORE:
min: 1
max: 1
min-height: 0
max-height: 16
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"

View File

@ -1,107 +0,0 @@
noise-equation: "((-((y / 64)^2)) + 1) + ((noise2(x, z)+0.5) / 3) + abs(noise2(x/2, z/2))"
id: "MOUNTAINS_PRETTY_0"
carving:
CAVE: 40
RAVINE: 5
CAVERN: 5
structures:
- STRONGHOLD
ores:
DIRT:
min: 0
max: 1
min-height: 0
max-height: 84
GRAVEL:
min: 0
max: 1
min-height: 0
max-height: 84
DIORITE:
min: 0
max: 1
min-height: 0
max-height: 84
ANDESITE:
min: 0
max: 1
min-height: 0
max-height: 84
GRANITE:
min: 0
max: 1
min-height: 0
max-height: 84
COAL_ORE:
min: 4
max: 8
min-height: 0
max-height: 84
IRON_ORE:
min: 2
max: 6
min-height: 0
max-height: 64
GOLD_ORE:
min: 1
max: 3
min-height: 0
max-height: 32
LAPIS_ORE:
min: 1
max: 2
min-height: 0
max-height: 32
REDSTONE_ORE:
min: 1
max: 2
min-height: 0
max-height: 16
DIAMOND_ORE:
min: 1
max: 1
min-height: 0
max-height: 16
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"

View File

@ -1,107 +0,0 @@
noise-equation: "((-((y / 70)^2)) + 1) + ((noise2(x, z)+0.5) / 3) + abs(noise2(x/2, z/2)*3)"
id: "MOUNTAINS_PRETTY_1"
carving:
CAVE: 40
RAVINE: 5
CAVERN: 5
structures:
- STRONGHOLD
ores:
DIRT:
min: 0
max: 1
min-height: 0
max-height: 84
GRAVEL:
min: 0
max: 1
min-height: 0
max-height: 84
DIORITE:
min: 0
max: 1
min-height: 0
max-height: 84
ANDESITE:
min: 0
max: 1
min-height: 0
max-height: 84
GRANITE:
min: 0
max: 1
min-height: 0
max-height: 84
COAL_ORE:
min: 4
max: 8
min-height: 0
max-height: 84
IRON_ORE:
min: 2
max: 6
min-height: 0
max-height: 64
GOLD_ORE:
min: 1
max: 3
min-height: 0
max-height: 32
LAPIS_ORE:
min: 1
max: 2
min-height: 0
max-height: 32
REDSTONE_ORE:
min: 1
max: 2
min-height: 0
max-height: 16
DIAMOND_ORE:
min: 1
max: 1
min-height: 0
max-height: 16
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"

View File

@ -1,89 +0,0 @@
noise-equation: "((-((y / 48)^2)) + 1) + ((noise2(x, z)/3))"
id: "OCEAN_ABSTRACT"
palette:
- "BLOCK:minecraft:bedrock": 0
- BEDROCK_MOST: 1
- BEDROCK_HALF: 2
- BEDROCK_LITTLE: 3
- SANDY: 255
- OCEANFLOOR: 60
flora:
chance: 50
attempts: 1
items:
TALL_SEAGRASS:
weight: 1
y:
min: 32
max: 64
SEAGRASS:
weight: 3
y:
min: 32
max: 64
carving:
CAVE_OCEAN: 45
structures:
- STRONGHOLD
ores:
DIRT:
min: 0
max: 2
min-height: 0
max-height: 128
GRAVEL:
min: 0
max: 2
min-height: 0
max-height: 128
DIORITE:
min: 0
max: 2
min-height: 0
max-height: 128
ANDESITE:
min: 0
max: 2
min-height: 0
max-height: 128
GRANITE:
min: 0
max: 2
min-height: 0
max-height: 128
COAL_ORE:
min: 5
max: 15
min-height: 0
max-height: 128
IRON_ORE:
min: 2
max: 6
min-height: 0
max-height: 64
GOLD_ORE:
min: 1
max: 3
min-height: 0
max-height: 32
LAPIS_ORE:
min: 1
max: 4
min-height: 0
max-height: 32
REDSTONE_ORE:
min: 1
max: 4
min-height: 0
max-height: 16
DIAMOND_ORE:
min: 1
max: 2
min-height: 0
max-height: 16

View File

@ -1,68 +0,0 @@
noise-equation: "((-((y / 63)^2)) + 1) + |(noise2(x, z) / 3) + 0.1|"
id: "PLAINS_ABSTRACT"
carving:
CAVE: 40
RAVINE: 5
CAVERN: 5
structures:
- STRONGHOLD
erodible: true
ores:
DIRT:
min: 0
max: 2
min-height: 0
max-height: 72
GRAVEL:
min: 0
max: 2
min-height: 0
max-height: 72
DIORITE:
min: 0
max: 2
min-height: 0
max-height: 72
ANDESITE:
min: 0
max: 2
min-height: 0
max-height: 72
GRANITE:
min: 0
max: 2
min-height: 0
max-height: 72
COAL_ORE:
min: 3
max: 7
min-height: 0
max-height: 72
IRON_ORE:
min: 2
max: 7
min-height: 0
max-height: 64
GOLD_ORE:
min: 1
max: 3
min-height: 0
max-height: 32
LAPIS_ORE:
min: 1
max: 4
min-height: 0
max-height: 32
REDSTONE_ORE:
min: 1
max: 4
min-height: 0
max-height: 16
DIAMOND_ORE:
min: 1
max: 2
min-height: 0
max-height: 16

View File

@ -1,88 +0,0 @@
noise-equation: "((-((y / 40)^2)) + 1) + ((noise2(x, z)/3))"
id: "SHELF_OCEAN_ABSTRACT"
structures:
- STRONGHOLD
palette:
- "BLOCK:minecraft:bedrock": 0
- BEDROCK_MOST: 1
- BEDROCK_HALF: 2
- BEDROCK_LITTLE: 3
- SANDY: 255
- OCEANFLOOR: 60
flora:
chance: 50
attempts: 1
items:
TALL_SEAGRASS:
weight: 1
y:
min: 32
max: 64
SEAGRASS:
weight: 3
y:
min: 32
max: 64
carving:
CAVE_OCEAN: 45
ores:
DIRT:
min: 0
max: 2
min-height: 0
max-height: 128
GRAVEL:
min: 0
max: 2
min-height: 0
max-height: 128
DIORITE:
min: 0
max: 2
min-height: 0
max-height: 128
ANDESITE:
min: 0
max: 2
min-height: 0
max-height: 128
GRANITE:
min: 0
max: 2
min-height: 0
max-height: 128
COAL_ORE:
min: 5
max: 15
min-height: 0
max-height: 128
IRON_ORE:
min: 2
max: 6
min-height: 0
max-height: 64
GOLD_ORE:
min: 1
max: 3
min-height: 0
max-height: 32
LAPIS_ORE:
min: 1
max: 4
min-height: 0
max-height: 32
REDSTONE_ORE:
min: 1
max: 4
min-height: 0
max-height: 16
DIAMOND_ORE:
min: 1
max: 2
min-height: 0
max-height: 16

View File

@ -1,4 +0,0 @@
extends: "BEACH_ABSTRACT"
id: "BEACH"
vanilla: BEACH
erodible: true

View File

@ -1,11 +0,0 @@
extends: "BEACH_ABSTRACT"
id: "COLD_BEACH"
palette:
- "BLOCK:minecraft:bedrock": 0
- BEDROCK_MOST: 1
- BEDROCK_HALF: 2
- BEDROCK_LITTLE: 3
- GRAVEL: 64
- TUNDRA: 255
erodible: true
vanilla: SNOWY_BEACH

View File

@ -1,14 +0,0 @@
extends: "BEACH_ABSTRACT"
id: "FROZEN_BEACH"
palette:
- "BLOCK:minecraft:bedrock": 0
- BEDROCK_MOST: 1
- BEDROCK_HALF: 2
- BEDROCK_LITTLE: 3
- GRAVEL: 64
- TUNDRA: 255
erodible: true
vanilla: SNOWY_BEACH
ocean:
palette: "COLD_OCEAN"
level: 62

View File

@ -1,11 +0,0 @@
extends: "BEACH_ABSTRACT"
id: "WARM_BEACH"
vanilla: BEACH
erodible: true
palette:
- "BLOCK:minecraft:bedrock": 0
- BEDROCK_MOST: 1
- BEDROCK_HALF: 2
- BEDROCK_LITTLE: 3
- SAND_ALL: 255

View File

@ -1,73 +0,0 @@
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

View File

@ -1,48 +0,0 @@
extends: "PLAINS_ABSTRACT"
id: "DESERT"
palette:
- "BLOCK:minecraft:bedrock": 0
- BEDROCK_MOST: 1
- BEDROCK_HALF: 2
- BEDROCK_LITTLE: 3
- DESERT: 255
vanilla: DESERT
flora:
chance: 2
items:
DEAD_BUSH:
weight: 1
y:
min: 62
max: 84
SMALL_ROCK:
weight: 1
y:
min: 62
max: 84
erodible: true
trees:
density: 7
items:
CACTUS:
weight: 1
y:
min: 58
max: 72
slabs:
enable: true
threshold: 0.0075
palettes:
- "minecraft:sand": "BLOCK:minecraft:sandstone_slab"
use-stairs-if-available: true
stair-palettes:
- "minecraft:sand": "BLOCK:minecraft:sandstone_stairs"
# Carving and ores covered by super biome

View File

@ -1,42 +0,0 @@
noise-equation: "((-((y / 63)^2)) + 1) + ((noise2(x, z)+0.5) / 3)"
extends: "BASIC_ORES"
id: "BIRCH_FOREST"
palette:
- "BLOCK:minecraft:bedrock": 0
- BEDROCK_MOST: 1
- BEDROCK_HALF: 2
- BEDROCK_LITTLE: 3
- SANDY: 62
- GRASSY: 255
vanilla: BIRCH_FOREST
flora:
chance: 40
attempts: 1
items:
TALL_GRASS:
weight: 15
y:
min: 62
max: 84
GRASS:
weight: 70
y:
min: 62
max: 84
POPPY:
weight: 5
y:
min: 62
max: 84
erodible: true
trees:
density: 200
items:
BIRCH:
weight: 1
y:
min: 58
max: 84

View File

@ -1,50 +0,0 @@
noise-equation: "((-((y / 63)^2)) + 1) + ((noise2(x, z)+0.5) / 3)"
extends: "BASIC_ORES"
id: "DARK_FOREST"
structures:
- MANSION
- STRONGHOLD
palette:
- "BLOCK:minecraft:bedrock": 0
- BEDROCK_MOST: 1
- BEDROCK_HALF: 2
- BEDROCK_LITTLE: 3
- SANDY: 62
- GRASSY: 255
vanilla: DARK_FOREST
erodible: true
flora-chance: 40
flora:
chance: 40
attempts: 1
items:
TALL_GRASS:
weight: 15
y:
min: 62
max: 255
GRASS:
weight: 70
y:
min: 62
max: 255
POPPY:
weight: 5
y:
min: 62
max: 255
trees:
density: 400
items:
DARK_OAK:
weight: 19
y:
min: 58
max: 84
RED_MUSHROOM:
weight: 1
y:
min: 58
max: 84

View File

@ -1,76 +0,0 @@
noise-equation: "((-((y / 63)^2)) + 1) + ((noise2(x, z)+0.25) / 3)"
extends: "BASIC_ORES"
id: "JUNGLE"
palette:
- "BLOCK:minecraft:bedrock": 0
- BEDROCK_MOST: 1
- BEDROCK_HALF: 2
- BEDROCK_LITTLE: 3
- RIVER_BOTTOM: 61
- RIVER_SHORE: 62
- GRASSY: 255
vanilla: JUNGLE
erodible: true
structures:
- JUNGLE
- STRONGHOLD
flora:
chance: 80
attempts: 2
items:
TALL_GRASS:
weight: 150
y:
min: 62
max: 84
GRASS:
weight: 750
y:
min: 62
max: 84
POPPY:
weight: 50
y:
min: 62
max: 84
ROSE_BUSH:
weight: 4
y:
min: 62
max: 84
LILAC:
weight: 4
y:
min: 62
max: 84
STALAGMITE:
weight: 10
y:
min: 4
max: 50
STALACTITE:
weight: 10
y:
min: 4
max: 50
trees:
density: 500
items:
JUNGLE_BUSH:
weight: 4
y:
min: 58
max: 84
SMALL_JUNGLE:
weight: 2
y:
min: 58
max: 84
JUNGLE:
weight: 4
y:
min: 58
max: 84

View File

@ -1,58 +0,0 @@
noise-equation: "((-((y / 63)^2)) + 1) + ((noise2(x, z)+0.5) / 2)"
extends: "BASIC_ORES"
id: "FOREST"
palette:
- "BLOCK:minecraft:bedrock": 0
- BEDROCK_MOST: 1
- BEDROCK_HALF: 2
- BEDROCK_LITTLE: 3
- RIVER_BOTTOM: 61
- RIVER_SHORE: 62
- GRASSY: 255
vanilla: FOREST
flora:
chance: 40
attempts: 1
items:
TALL_GRASS:
weight: 150
y:
min: 62
max: 84
GRASS:
weight: 750
y:
min: 62
max: 84
POPPY:
weight: 50
y:
min: 62
max: 84
ROSE_BUSH:
weight: 4
y:
min: 62
max: 84
LILAC:
weight: 4
y:
min: 62
max: 84
erodible: true
trees:
density: 250
items:
OAK:
weight: 8
y:
min: 58
max: 84
LARGE_OAK:
weight: 2
y:
min: 58
max: 84

View File

@ -1,38 +0,0 @@
noise-equation: "((-((y / 63)^2)) + 1) + ((noise2(x, z)+0.5) / 3)"
extends: "BASIC_ORES"
id: "SAVANNA"
palette:
- "BLOCK:minecraft:bedrock": 0
- BEDROCK_MOST: 1
- BEDROCK_HALF: 2
- BEDROCK_LITTLE: 3
- RIVER_BOTTOM: 61
- RIVER_SHORE: 62
- GRASSY: 255
vanilla: SAVANNA
flora:
chance: 40
attempts: 1
items:
TALL_GRASS:
weight: 15
y:
min: 62
max: 84
GRASS:
weight: 70
y:
min: 62
max: 84
erodible: true
trees:
density: 20
items:
ACACIA:
weight: 1
y:
min: 58
max: 84

View File

@ -1,50 +0,0 @@
noise-equation: "((-((y / 63)^2)) + 1) + ((noise2(x, z)+0.5) / 2)"
extends: "BASIC_ORES"
id: "SNOWY_TAIGA"
erodible: true
palette:
- "BLOCK:minecraft:bedrock": 0
- BEDROCK_MOST: 1
- BEDROCK_HALF: 2
- BEDROCK_LITTLE: 3
- RIVER_BOTTOM: 61
- RIVER_SHORE: 62
- TAIGA: 255
vanilla: TAIGA
snow:
- min: 0
max: 255
chance: 100
flora:
chance: 40
attempts: 1
items:
TALL_GRASS:
weight: 15
y:
min: 62
max: 84
GRASS:
weight: 75
y:
min: 62
max: 84
POPPY:
weight: 5
y:
min: 62
max: 84
trees:
density: 75
items:
SPRUCE:
weight: 1
y:
min: 58
max: 84

View File

@ -1,43 +0,0 @@
noise-equation: "((-((y / 63)^2)) + 1) + ((noise2(x, z)+0.5) / 2)"
extends: "BASIC_ORES"
id: "TAIGA"
palette:
- "BLOCK:minecraft:bedrock": 0
- BEDROCK_MOST: 1
- BEDROCK_HALF: 2
- BEDROCK_LITTLE: 3
- RIVER_BOTTOM: 61
- RIVER_SHORE: 62
- TAIGA: 255
vanilla: TAIGA
erodible: true
flora:
chance: 40
attempts: 1
items:
TALL_GRASS:
weight: 15
y:
min: 62
max: 84
GRASS:
weight: 75
y:
min: 62
max: 84
POPPY:
weight: 5
y:
min: 62
max: 84
trees:
density: 75
items:
SPRUCE:
weight: 1
y:
min: 58
max: 84

View File

@ -1,93 +0,0 @@
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
vanilla: BADLANDS
flora-chance: 2
flora:
chance: 2
attempts: 1
items:
DEAD_BUSH:
weight: 1
y:
min: 62
max: 84
SMALL_ROCK:
weight: 1
y:
min: 62
max: 84
slabs:
enable: true
threshold: 0.0075
palettes:
- "minecraft:red_sand": "BLOCK:minecraft:red_sandstone_slab"
use-stairs-if-available: true
stair-palettes:
- "minecraft:red_sand": "BLOCK:minecraft:red_sandstone_stairs"
trees:
density: 7
items:
CACTUS:
weight: 1
y:
min: 58
max: 72

View File

@ -1,58 +0,0 @@
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"
palette:
- "BLOCK:minecraft:bedrock": 0
- BEDROCK_MOST: 1
- BEDROCK_HALF: 2
- BEDROCK_LITTLE: 3
- ARID: 255
vanilla: SAVANNA
erodible: false
prevent-smooth: true
slant:
palette:
- ARID_SIDE: 255
y-offset:
top: 0.4
bottom: 0.25
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"

View File

@ -1,28 +0,0 @@
extends: "MOUNTAINS_PRETTY"
id: "MOUNTAINS_JUNGLE"
palette:
- "BLOCK:minecraft:bedrock": 0
- BEDROCK_MOST: 1
- BEDROCK_HALF: 2
- BEDROCK_LITTLE: 3
- MOUNTAIN_JUNGLE: 255
vanilla: JUNGLE
trees:
density: 500
items:
JUNGLE_BUSH:
weight: 4
y:
min: 58
max: 92
SMALL_JUNGLE:
weight: 2
y:
min: 58
max: 92
JUNGLE:
weight: 4
y:
min: 58
max: 92

View File

@ -1,28 +0,0 @@
extends: "MOUNTAINS_PRETTY_0"
id: "MOUNTAINS_JUNGLE_0"
palette:
- "BLOCK:minecraft:bedrock": 0
- BEDROCK_MOST: 1
- BEDROCK_HALF: 2
- BEDROCK_LITTLE: 3
- MOUNTAIN_JUNGLE: 255
vanilla: JUNGLE
trees:
density: 500
items:
JUNGLE_BUSH:
weight: 4
y:
min: 58
max: 92
SMALL_JUNGLE:
weight: 2
y:
min: 58
max: 92
JUNGLE:
weight: 4
y:
min: 58
max: 92

View File

@ -1,28 +0,0 @@
extends: "MOUNTAINS_PRETTY_1"
id: "MOUNTAINS_JUNGLE_1"
palette:
- "BLOCK:minecraft:bedrock": 0
- BEDROCK_MOST: 1
- BEDROCK_HALF: 2
- BEDROCK_LITTLE: 3
- MOUNTAIN_JUNGLE: 255
vanilla: JUNGLE
trees:
density: 120
items:
JUNGLE_BUSH:
weight: 4
y:
min: 58
max: 92
SMALL_JUNGLE:
weight: 2
y:
min: 58
max: 92
JUNGLE:
weight: 4
y:
min: 58
max: 92

View File

@ -1,10 +0,0 @@
extends: "MOUNTAINS_PRETTY"
id: "MOUNTAINS_PRETTY"
palette:
- "BLOCK:minecraft:bedrock": 0
- BEDROCK_MOST: 1
- BEDROCK_HALF: 2
- BEDROCK_LITTLE: 3
- MOUNTAIN_PRETTY: 255
vanilla: PLAINS

View File

@ -1,10 +0,0 @@
extends: "MOUNTAINS_PRETTY_0"
id: "MOUNTAINS_PRETTY_0"
palette:
- "BLOCK:minecraft:bedrock": 0
- BEDROCK_MOST: 1
- BEDROCK_HALF: 2
- BEDROCK_LITTLE: 3
- MOUNTAIN_PRETTY: 255
vanilla: PLAINS

View File

@ -1,10 +0,0 @@
extends: "MOUNTAINS_PRETTY_1"
id: "MOUNTAINS_PRETTY_1"
palette:
- "BLOCK:minecraft:bedrock": 0
- BEDROCK_MOST: 1
- BEDROCK_HALF: 2
- BEDROCK_LITTLE: 3
- MOUNTAIN_PRETTY: 255
vanilla: PLAINS

View File

@ -1,36 +0,0 @@
extends: "MOUNTAINS_PRETTY"
id: "MOUNTAINS_STONE"
noise-equation: "((-((y / 76)^2)) + 1) + ((noise2(x, z)+0.5) / 3) + max(noise2(x/2, z/2)*4 + noise2(x*8, z*8)*0.25, 0)"
prevent-smooth: true
palette:
- "BLOCK:minecraft:bedrock": 0
- BEDROCK_MOST: 1
- BEDROCK_HALF: 2
- BEDROCK_LITTLE: 3
- MOUNTAIN_STONE: 255
- MOUNTAIN_STONE_GRASS: 108
- MOUNTAIN_GRASS: 84
vanilla: MOUNTAINS
snow:
- min: 0
max: 120
chance: 50
- min: 120
max: 140
chance: 75
- min: 140
max: 255
chance: 100
trees:
density: 60
items:
SPRUCE:
weight: 1
y:
min: 58
max: 92
flora:
chance: 0
attempts: 0
items: { }

View File

@ -1,36 +0,0 @@
extends: "MOUNTAINS_PRETTY_0"
id: "MOUNTAINS_STONE_0"
noise-equation: "((-((y / 64)^2)) + 1) + ((noise2(x, z)+0.5) / 3) + max(noise2(x/2, z/2), 0)"
prevent-smooth: true
palette:
- "BLOCK:minecraft:bedrock": 0
- BEDROCK_MOST: 1
- BEDROCK_HALF: 2
- BEDROCK_LITTLE: 3
- MOUNTAIN_STONE: 255
- MOUNTAIN_STONE_GRASS: 108
- MOUNTAIN_GRASS: 84
vanilla: MOUNTAINS
snow:
- min: 0
max: 120
chance: 50
- min: 120
max: 140
chance: 75
- min: 140
max: 255
chance: 100
trees:
density: 60
items:
SPRUCE:
weight: 1
y:
min: 58
max: 92
flora:
chance: 0
attempts: 0
items: { }

View File

@ -1,36 +0,0 @@
extends: "MOUNTAINS_PRETTY_1"
id: "MOUNTAINS_STONE_1"
noise-equation: "((-((y / 70)^2)) + 1) + ((noise2(x, z)+0.5) / 3) + max(noise2(x/2, z/2)*3 + noise2(x*8, z*8)*0.125, 0)"
prevent-smooth: true
palette:
- "BLOCK:minecraft:bedrock": 0
- BEDROCK_MOST: 1
- BEDROCK_HALF: 2
- BEDROCK_LITTLE: 3
- MOUNTAIN_STONE: 255
- MOUNTAIN_STONE_GRASS: 108
- MOUNTAIN_GRASS: 84
vanilla: MOUNTAINS
snow:
- min: 0
max: 120
chance: 50
- min: 120
max: 140
chance: 75
- min: 140
max: 255
chance: 100
trees:
density: 60
items:
SPRUCE:
weight: 1
y:
min: 58
max: 92
flora:
chance: 0
attempts: 0
items: { }

View File

@ -1,33 +0,0 @@
noise-equation: "((-((y / 62)^2)) + 1) + ((noise2(x, z)+0.5) / 3) + max(floor(noise3(x/2, y, z/2)*10 + noise2(x/2, z/2)*55)/8, 0)"
extends: "BASIC_ORES"
id: "MOUNTAINS"
palette:
- "BLOCK:minecraft:bedrock": 0
- BEDROCK_MOST: 1
- BEDROCK_HALF: 2
- BEDROCK_LITTLE: 3
- TUNDRA: 100
- SNOW: 255
vanilla: MOUNTAINS
flora:
chance: 2
attempts: 1
items:
SMALL_ROCK:
weight: 1
y:
min: 60
max: 72
slabs:
enable: true
threshold: 0.015
palettes:
- "minecraft:stone": "MOUNTAIN_SLABS"
- "minecraft:snow_block": "SNOW_LAYERS"
- "minecraft:gravel": "MOUNTAIN_SLABS"
use-stairs-if-available: true
stair-palettes:
- "minecraft:stone": "MOUNTAIN_STAIRS"
- "minecraft:gravel": "MOUNTAIN_STAIRS"

View File

@ -1,49 +0,0 @@
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

View File

@ -1,4 +0,0 @@
extends: "OCEAN_ABSTRACT"
id: "OCEAN"
vanilla: OCEAN

View File

@ -1,12 +0,0 @@
extends: "OCEAN_ABSTRACT"
id: "COLD_OCEAN"
vanilla: COLD_OCEAN
palette:
- "BLOCK:minecraft:bedrock": 0
- BEDROCK_MOST: 1
- BEDROCK_HALF: 2
- BEDROCK_LITTLE: 3
- TUNDRA: 255
- OCEANFLOOR: 60
ocean:
level: 62

View File

@ -1,13 +0,0 @@
extends: "OCEAN_ABSTRACT"
id: "FROZEN_OCEAN"
vanilla: COLD_OCEAN
palette:
- "BLOCK:minecraft:bedrock": 0
- BEDROCK_MOST: 1
- BEDROCK_HALF: 2
- BEDROCK_LITTLE: 3
- TUNDRA: 255
- OCEANFLOOR: 60
ocean:
palette: "COLD_OCEAN"
level: 62

View File

@ -1,39 +0,0 @@
extends: "OCEAN_ABSTRACT"
id: "LUKEWARM_OCEAN"
vanilla: LUKEWARM_OCEAN
palette:
- "BLOCK:minecraft:bedrock": 0
- BEDROCK_MOST: 1
- BEDROCK_HALF: 2
- BEDROCK_LITTLE: 3
- SANDY: 255
- OCEANFLOOR: 60
flora:
chance: 50
attempts: 1
items:
TALL_SEAGRASS:
weight: 1
y:
min: 32
max: 64
SEAGRASS:
weight: 3
y:
min: 32
max: 64
KELP_SHORT:
weight: 5
y:
min: 32
max: 64
KELP_MEDIUM:
weight: 5
y:
min: 32
max: 64
KELP_TALL:
weight: 5
y:
min: 32
max: 64

View File

@ -1,43 +0,0 @@
extends: "OCEAN_ABSTRACT"
id: "WARM_OCEAN"
vanilla: WARM_OCEAN
palette:
- "BLOCK:minecraft:bedrock": 0
- BEDROCK_MOST: 1
- BEDROCK_HALF: 2
- BEDROCK_LITTLE: 3
- SANDY: 255
- OCEANFLOOR: 60
flora:
chance: 50
attempts: 1
simplex:
enable: true
frequency: 0.05
seed: 4
items:
TALL_SEAGRASS:
weight: 1
y:
min: 32
max: 64
SEAGRASS:
weight: 3
y:
min: 32
max: 64
KELP_SHORT:
weight: 1
y:
min: 32
max: 64
KELP_MEDIUM:
weight: 1
y:
min: 32
max: 64
KELP_TALL:
weight: 1
y:
min: 32
max: 64

View File

@ -1,4 +0,0 @@
extends: "DEEP_OCEAN_ABSTRACT"
id: "OCEAN_DEEP"
vanilla: OCEAN

View File

@ -1,12 +0,0 @@
extends: "DEEP_OCEAN_ABSTRACT"
id: "COLD_OCEAN_DEEP"
vanilla: COLD_OCEAN
palette:
- "BLOCK:minecraft:bedrock": 0
- BEDROCK_MOST: 1
- BEDROCK_HALF: 2
- BEDROCK_LITTLE: 3
- TUNDRA: 255
- OCEANFLOOR: 60
ocean:
level: 62

View File

@ -1,13 +0,0 @@
extends: "DEEP_OCEAN_ABSTRACT"
id: "FROZEN_OCEAN_DEEP"
vanilla: COLD_OCEAN
palette:
- "BLOCK:minecraft:bedrock": 0
- BEDROCK_MOST: 1
- BEDROCK_HALF: 2
- BEDROCK_LITTLE: 3
- TUNDRA: 255
- OCEANFLOOR: 60
ocean:
palette: "COLD_OCEAN"
level: 62

View File

@ -1,39 +0,0 @@
extends: "DEEP_OCEAN_ABSTRACT"
id: "LUKEWARM_OCEAN_DEEP"
vanilla: LUKEWARM_OCEAN
palette:
- "BLOCK:minecraft:bedrock": 0
- BEDROCK_MOST: 1
- BEDROCK_HALF: 2
- BEDROCK_LITTLE: 3
- SANDY: 255
- OCEANFLOOR: 60
flora:
chance: 50
attempts: 1
items:
TALL_SEAGRASS:
weight: 1
y:
min: 32
max: 64
SEAGRASS:
weight: 3
y:
min: 32
max: 64
KELP_SHORT:
weight: 5
y:
min: 32
max: 64
KELP_MEDIUM:
weight: 5
y:
min: 32
max: 64
KELP_TALL:
weight: 5
y:
min: 32
max: 64

View File

@ -1,43 +0,0 @@
extends: "DEEP_OCEAN_ABSTRACT"
id: "WARM_OCEAN_DEEP"
vanilla: WARM_OCEAN
palette:
- "BLOCK:minecraft:bedrock": 0
- BEDROCK_MOST: 1
- BEDROCK_HALF: 2
- BEDROCK_LITTLE: 3
- SANDY: 255
- OCEANFLOOR: 60
flora:
chance: 50
attempts: 1
simplex:
enable: true
frequency: 0.05
seed: 4
items:
TALL_SEAGRASS:
weight: 1
y:
min: 32
max: 64
SEAGRASS:
weight: 3
y:
min: 32
max: 64
KELP_SHORT:
weight: 1
y:
min: 32
max: 64
KELP_MEDIUM:
weight: 1
y:
min: 32
max: 64
KELP_TALL:
weight: 1
y:
min: 32
max: 64

View File

@ -1,4 +0,0 @@
extends: "SHELF_OCEAN_ABSTRACT"
id: "OCEAN_SHELF"
vanilla: OCEAN

View File

@ -1,12 +0,0 @@
extends: "SHELF_OCEAN_ABSTRACT"
id: "COLD_OCEAN_SHELF"
vanilla: COLD_OCEAN
palette:
- "BLOCK:minecraft:bedrock": 0
- BEDROCK_MOST: 1
- BEDROCK_HALF: 2
- BEDROCK_LITTLE: 3
- TUNDRA: 255
- OCEANFLOOR: 60
ocean:
level: 62

Some files were not shown because too many files have changed in this diff Show More