Adding Terracore to your project
Terracore and its modules
Section titled “Terracore and its modules”Terracore is a modular library, split into multiple modules so you can choose which one you want to depend on, depending on your use case.
It currently has 4 main modules:
terracore-geooffers geography and geometry processing primitives. For example, it is in this module that the code for the BTE projection lives.terracore-httpoffers an HTTP client tailored for efficientGETrequests and caching, that can be used to download geographic datasets.terracore-minecraftoffers object-oriented abstractions over Minecraft concepts like Biomes, Blocks or Identifiers. The implementations in Terracore are rather simple and usually have one to one mappings with implementations from modding or plugin APIs, but Terracore has its own so it doesn’t need Minecraft to do its work.terracore-worldgenuses all of the above modules to implement the actual dataset processing and world generation engine. If you are here to build a world generation plugin or mod, this is what you want.
Terracore also has compatibility modules that help integrate it with other APIs:
terracore-bukkitoffers functions to efficiently convert objects fromterracore-minecraftto objects from the Bukkit API.
Configuring your build system
Section titled “Configuring your build system”Considering you already have a working Java project, you need to do two things to add Terracore to your classpath.
-
Add the
maven.smyler.netMaven repository. It is where the Terracore artifacts are published.build.gradle.kts repositories {maven {// This repository will provide Terracorename = "Smyler snaphots"url = uri("https://maven.smyler.net/snapshots/")}mavenCentral() // And this will provide its transitive dependencies (Guava, Jackon, etc..)}build.gradle repositories {maven {// This repository will provide Terracorename = 'Smyler snapshots'url = uri('https://maven.smyler.net/snapshots/')}mavenCentral() // And this will provide its transitive dependencies (Guava, Jackson, etc..)}pom.xml <repositories><repository><id>smyler-snapshots</id><name>Smyler snapshots</name><url>https://maven.smyler.net/snapshots/</url></repository></repositories> -
Then, declare the Terracore modules you need as dependencies.
build.gradle.kts dependencies {/*Add your dependencies on Terracore here in the following format:implementation("net.buildtheearth.terracore:<module name>:<version>")For example:*/implementation("net.buildtheearth.terracore:terracore-worldgen:master-SNAPSHOT")implementation("net.buildtheearth.terracore:terracore-bukkit:master-SNAPSHOT")}build.gradle dependencies {/*Add your dependencies on Terracore here in the following format:implementation 'net.buildtheearth.terracore:<module name>:<version>'For example:*/implementation 'net.buildtheearth.terracore:terracore-worldgen:master-SNAPSHOT'implementation 'net.buildtheearth.terracore:terracore-bukkit:master-SNAPSHOT'}pom.xml <dependencies><!--Add your dependencies on Terracore here in the following format:<dependency><groupId>net.buildtheearth.terracore</groupId><artifactId>module name</artifactId><version>version</version></dependency>For example:--><dependency><groupId>net.buildtheearth.terracore</groupId><artifactId>terracore-worldgen</artifactId><version>master-SNAPSHOT</version></dependency><dependency><groupId>net.buildtheearth.terracore</groupId><artifactId>terracore-bukkit</artifactId><version>master-SNAPSHOT</version></dependency></dependencies>
Available versions
Section titled “Available versions”Terracore will eventually follow semantic versioning:
- all version numbers are of the form
X.Y.Z, whereXis the major version number,Yis the minor version number,Zis the patch or bugfix version number;
- two versions with the same major and minor version numbers have fully compatible APIs, you can change from one to another without changing your code, but the one with the higher patch number is likely to have bug fixes the other do not;
- two versions with the same major version numbers but different minor numbers are backward compatible, meaning it is safe to upgrade from the lower version number to the higher, but not the opposite, as the newer version may have new features or APIs;
- two version with different major version numbers are not compatible, you are likely to need to change some code to go from one to another.