mirror of
https://github.com/PolyhedralDev/Terra.git
synced 2026-05-20 16:50:28 +00:00
Compare commits
321 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| e0a26046a0 | |||
| 8bad33ef22 | |||
| f278ae7ab5 | |||
| a61c6b8a97 | |||
| 830ede9272 | |||
| 8e544a68d4 | |||
| e8e9f69fac | |||
| 3a7d1a69d0 | |||
| 7b29d25847 | |||
| 810d10ac0a | |||
| aecc003f23 | |||
| d0bc006faa | |||
| 98aadc816b | |||
| 992ae592fd | |||
| 7711e67999 | |||
| 35bdc99873 | |||
| 5ba5d6efdd | |||
| c848c33bc0 | |||
| ff153ddc21 | |||
| cb2841ed4f | |||
| 4f668adb67 | |||
| 1d8a208d10 | |||
| 6279638363 | |||
| 23b846eca9 | |||
| d1f881ca2c | |||
| b4ab3769b0 | |||
| d5ab3e23f5 | |||
| 3a28551e97 | |||
| ac66fc7d69 | |||
| bfc1c32d46 | |||
| fa6e0e0ae4 | |||
| f953c5085d | |||
| 7288373dbc | |||
| 983cb1f012 | |||
| 944c04b9b8 | |||
| 73a2c70794 | |||
| 088523222d | |||
| 6badce6bc7 | |||
| 92a5134458 | |||
| 4222eef531 | |||
| 9b6a503f31 | |||
| 82a9ecf736 | |||
| eec4db43b2 | |||
| 1d3c380784 | |||
| 65e4c9a149 | |||
| d4549643fc | |||
| a87ad8c966 | |||
| 153f6e5a87 | |||
| a385a43250 | |||
| 3cd6aead64 | |||
| 4f33b11828 | |||
| f5bbaa3c3a | |||
| 4fd84a3f2d | |||
| bed67c211d | |||
| 2c8d3416ab | |||
| 5e43f0afef | |||
| 02fdcee705 | |||
| 4165224c51 | |||
| 710bbc33c9 | |||
| 1929239015 | |||
| 3ca90808f0 | |||
| 9d91440997 | |||
| f98062d417 | |||
| 8df3a4dd02 | |||
| afd2c81b19 | |||
| 4432ae4867 | |||
| 16c951838b | |||
| 8de4f1198a | |||
| 144c932703 | |||
| e56b8856fa | |||
| 04f6d18198 | |||
| 640645b96b | |||
| a70738eda5 | |||
| 62756d2784 | |||
| 32f8907cb1 | |||
| b75e9c152e | |||
| c190485dbe | |||
| e756953828 | |||
| 071f9d39af | |||
| d2107fd258 | |||
| df3e623530 | |||
| f0d03d4538 | |||
| 84fe8792d6 | |||
| 67fc2ba4dc | |||
| 8d63c40e2f | |||
| b0bc37c34d | |||
| f2c5c15650 | |||
| f5de88215c | |||
| 8a6ad95947 | |||
| cc14c716bf | |||
| ece5213a87 | |||
| a01f700653 | |||
| 0ca7171bae | |||
| 6261f0849c | |||
| 4fc24f022f | |||
| 61ed302137 | |||
| 053ec39b7b | |||
| 0a952cff4c | |||
| 12faae8fd5 | |||
| 1496f2c929 | |||
| 40a938be19 | |||
| 4be2390294 | |||
| da16f65ea2 | |||
| 65d026a130 | |||
| d45256b2f7 | |||
| 16d8e8f29d | |||
| a58b2a5193 | |||
| 1e5a1e20c2 | |||
| 592788450c | |||
| 060cbfd0c4 | |||
| b9c2f4e63b | |||
| 87674aa0ba | |||
| 40ccf80c7f | |||
| 6946755e31 | |||
| 3b9962662e | |||
| 7ca61f82b2 | |||
| 6851999926 | |||
| 585967157d | |||
| 305255511d | |||
| 819be16d83 | |||
| 8a028b193a | |||
| d31679e6be | |||
| 9d328b12b3 | |||
| a743e9c015 | |||
| 43d52e4bc1 | |||
| accc07fa07 | |||
| c1d3155ddd | |||
| 9a01a6c6a0 | |||
| 3033fbbf29 | |||
| c78a984a11 | |||
| 1ae0d1f867 | |||
| be7e10c30c | |||
| 2ccf8a8805 | |||
| 197cb12be2 | |||
| adb43dcaa8 | |||
| b03d128913 | |||
| 725fa88466 | |||
| 370b2e0122 | |||
| 331075e54d | |||
| 973590f5fd | |||
| 1a5ab6b505 | |||
| 14732328cd | |||
| 6c7974c302 | |||
| 1204b7a8c1 | |||
| fbe1c76e26 | |||
| add7803e65 | |||
| 4393a16b2f | |||
| b4fa635455 | |||
| 9f425c6159 | |||
| 158ffba2a5 | |||
| b7326c0ff6 | |||
| f70a83aec3 | |||
| 589cf83c38 | |||
| c374c2d5ef | |||
| 13782bb51e | |||
| 1aa3ef813c | |||
| 6cc53beecb | |||
| 2c45ba91aa | |||
| 6244ffca63 | |||
| 59d943b3ea | |||
| f605ee1937 | |||
| f87b7c07d9 | |||
| f1124aae6b | |||
| 9c8298fe53 | |||
| d69b0dba90 | |||
| 42166d5239 | |||
| d6772f51ea | |||
| f469193909 | |||
| 10d723372d | |||
| 1d05f95f74 | |||
| bd73427072 | |||
| 017b4608bc | |||
| 5f340f8ffd | |||
| 5b35eb041b | |||
| 699d5d1d62 | |||
| 07e3d0058d | |||
| b1ad820e1c | |||
| 3644ee7fca | |||
| b14b355c6f | |||
| 6042f1c036 | |||
| af2ac64cd4 | |||
| 06457bf3ce | |||
| b63f5f4a8f | |||
| 4bad8f702c | |||
| 76f12e0cb8 | |||
| 8cf766e77b | |||
| a23d624ab9 | |||
| 15a298304e | |||
| 664d1a3191 | |||
| 73047284c8 | |||
| ce9fb53df4 | |||
| 1f01b99d29 | |||
| 18a24562ec | |||
| 2f2d43e1b8 | |||
| 6c8a7da254 | |||
| ca4461ba2a | |||
| c6df3c302b | |||
| 328ebf5aa9 | |||
| 2c476a25d9 | |||
| b432a4e01d | |||
| f73eadda76 | |||
| 1acdad5c6b | |||
| 732a894945 | |||
| bbf0915bc9 | |||
| 5f70ecb943 | |||
| 2e709dace6 | |||
| 3bef7d8572 | |||
| 08df5fc278 | |||
| c97f25cb95 | |||
| 28c689d16f | |||
| a34946cece | |||
| 922cd35e84 | |||
| 4acd0de6fa | |||
| 44d23573b3 | |||
| 2443fff0a4 | |||
| cd767a648c | |||
| e7cc275340 | |||
| fddc9a52b9 | |||
| 0758e13bc7 | |||
| d490324bfc | |||
| 5fa7007d45 | |||
| 2d0e4a83b0 | |||
| e68f928e38 | |||
| 4a3678cea9 | |||
| d810cad8d0 | |||
| 4e7de501c0 | |||
| 6ff0903d83 | |||
| 133df45968 | |||
| 1f937a2ae0 | |||
| d861d3e849 | |||
| 3d4aec4abb | |||
| 62e589870d | |||
| 2b125414c9 | |||
| 59d7632927 | |||
| d81f886e8c | |||
| b29ba2db70 | |||
| 02a7363f01 | |||
| 9e60db4b0d | |||
| 4536767794 | |||
| 3fa4b21247 | |||
| 17acde09a3 | |||
| dd272bce64 | |||
| c20b1eaf10 | |||
| 72f761678a | |||
| 62317a2f3f | |||
| 823afd592b | |||
| ff03b38b81 | |||
| 35246d65b9 | |||
| 41652d29df | |||
| 142d364682 | |||
| 01e011a9ed | |||
| 94949c9120 | |||
| c52ad56ccc | |||
| f3476c5cc8 | |||
| 9c181f7ee1 | |||
| 271e7f3c69 | |||
| 6681bdfbf2 | |||
| ab60f14ff1 | |||
| d8ba9e1016 | |||
| 3622003a39 | |||
| 84cd96ecf7 | |||
| 8afda7424c | |||
| da4ab8b71c | |||
| 3745c3e947 | |||
| fd20837b55 | |||
| 0091e5b785 | |||
| 41045ae8aa | |||
| 4a83f01c1f | |||
| fc764a0fb3 | |||
| 22c46f2f80 | |||
| f408faaa80 | |||
| 0ad7ee4f9f | |||
| 1e55074cfa | |||
| 2a92d76276 | |||
| 687ad5db59 | |||
| f9c9789016 | |||
| 3142c2a4f0 | |||
| b5532b7679 | |||
| 8af299d09c | |||
| 5cf8a5061d | |||
| 017876475e | |||
| d88e4f1f9b | |||
| 17eac505a0 | |||
| 8043814138 | |||
| 554887ab54 | |||
| 2f46a01adc | |||
| a1db0574e9 | |||
| fd6decc706 | |||
| 0ba0d472e6 | |||
| 11b03eb93d | |||
| 46ca45cb1d | |||
| 4e5b066b91 | |||
| db8df9741f | |||
| 80c52870f5 | |||
| 5048bc8ede | |||
| fc0d7374e4 | |||
| e4c3affb9f | |||
| e160cae3d8 | |||
| cb9aa4f167 | |||
| b612d1c7aa | |||
| e4df8dce1d | |||
| 601d174720 | |||
| 3339d08e11 | |||
| bc65015af0 | |||
| 913637b0a5 | |||
| 86f2356cc8 | |||
| 55d09818f7 | |||
| aecdcd578c | |||
| 382069b094 | |||
| ffb1198da2 | |||
| 2c211f0aa6 | |||
| 0efb0916e6 | |||
| 82fbf796da | |||
| 94bf67d09d | |||
| f86d4bae32 | |||
| c7cecaebe6 | |||
| 866d527d35 | |||
| 70b1c3bbf3 | |||
| e9b145b6c3 | |||
| 99d848b394 | |||
| 4828d51da4 |
+4
-3
@@ -1,13 +1,14 @@
|
||||
# Global owners, automatically request review when pull request is submitted
|
||||
* @dfsek @solonovamax @duplexsystem @Astrashh @justaureus
|
||||
* @dfsek @solonovamax @duplexsystem @astrsh @justaureus
|
||||
|
||||
# Platforms
|
||||
/platforms/ @dfsek @solonovamax @duplexsystem @justaureus
|
||||
/platforms/bukkit @dfsek @solonovamax @duplexsystem @justaureus @OakLoaf
|
||||
|
||||
# Common
|
||||
/common/ @dfsek @solonovamax @duplexsystem @Astrashh
|
||||
/common/ @dfsek @solonovamax @duplexsystem @astrsh
|
||||
|
||||
# Gradle Stuff
|
||||
/buildSrc/ @dfsek @solonovamax @duplexsystem
|
||||
*.gradle.kts @dfsek @solonovamax @duplexsystem
|
||||
/gradle/ @dfsek @solonovamax @duplexsystem
|
||||
/gradle/ @dfsek @solonovamax @duplexsystem
|
||||
|
||||
@@ -0,0 +1,47 @@
|
||||
# This workflow uses actions that are not certified by GitHub.
|
||||
# They are provided by a third-party and are governed by
|
||||
# separate terms of service, privacy policy, and support
|
||||
# documentation.
|
||||
# This workflow will build a package using Gradle and then publish it to GitHub packages when a release is created
|
||||
# For more information see: https://github.com/actions/setup-java/blob/main/docs/advanced-usage.md#Publishing-using-gradle
|
||||
|
||||
name: Gradle Build
|
||||
|
||||
on: [ pull_request ]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
|
||||
- name: Set up JDK 21
|
||||
uses: actions/setup-java@387ac29b308b003ca37ba93a6cab5eb57c8f5f93
|
||||
with:
|
||||
java-version: '21'
|
||||
distribution: 'temurin'
|
||||
server-id: github # Value of the distributionManagement/repository/id field of the pom.xml
|
||||
settings-path: ${{ github.workspace }} # location for the settings.xml file
|
||||
|
||||
- uses: burrunan/gradle-cache-action@03c71a8ba93d670980695505f48f49daf43704a6
|
||||
name: Build Terra
|
||||
with:
|
||||
# Specifies arguments for Gradle execution
|
||||
# If arguments is missing or empty, then Gradle is not executed
|
||||
arguments: build
|
||||
# arguments can be multi-line for better readability
|
||||
# arguments: |
|
||||
# --no-paralell
|
||||
# build
|
||||
# -x test
|
||||
# Gradle version to use for execution:
|
||||
# wrapper (default), current, rc, nightly, release-nightly, or
|
||||
# versions like 6.6 (see https://services.gradle.org/versions/all)
|
||||
gradle-version: wrapper
|
||||
# Properties are passed as -Pname=value
|
||||
properties: |
|
||||
kotlin.js.compiler=ir
|
||||
kotlin.parallel.tasks.in.project=true
|
||||
@@ -249,3 +249,5 @@ nbdist/
|
||||
|
||||
platforms/**/run/**
|
||||
|
||||
#Vale Config File
|
||||
**/.vale.ini
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2020-2023 Polyhedral Development
|
||||
Copyright (c) 2020-2025 Polyhedral Development
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
||||
+6
-4
@@ -1,8 +1,8 @@
|
||||
preRelease(true)
|
||||
|
||||
versionProjects(":common:api", version("6.4.1"))
|
||||
versionProjects(":common:implementation", version("6.4.1"))
|
||||
versionProjects(":platforms", version("6.4.1"))
|
||||
versionProjects(":common:api", version("6.6.0"))
|
||||
versionProjects(":common:implementation", version("6.6.0"))
|
||||
versionProjects(":platforms", version("6.6.0"))
|
||||
|
||||
|
||||
allprojects {
|
||||
@@ -15,6 +15,7 @@ allprojects {
|
||||
tasks.withType<JavaCompile>().configureEach {
|
||||
options.isFork = true
|
||||
options.isIncremental = true
|
||||
options.release.set(21)
|
||||
}
|
||||
|
||||
tasks.withType<Test>().configureEach {
|
||||
@@ -43,8 +44,9 @@ afterEvaluate {
|
||||
configureDistribution()
|
||||
}
|
||||
project(":platforms:bukkit:common").configureDistribution()
|
||||
project(":platforms:minestom:example").configureDistribution()
|
||||
forSubProjects(":common:addons") {
|
||||
apply(plugin = "com.github.johnrengelman.shadow")
|
||||
apply(plugin = "com.gradleup.shadow")
|
||||
|
||||
tasks.named("build") {
|
||||
finalizedBy(tasks.named("shadowJar"))
|
||||
|
||||
@@ -9,18 +9,18 @@ repositories {
|
||||
maven("https://repo.codemc.org/repository/maven-public") {
|
||||
name = "CodeMC"
|
||||
}
|
||||
maven("https://papermc.io/repo/repository/maven-public/") {
|
||||
maven("https://repo.papermc.io/repository/maven-public/") {
|
||||
name = "PaperMC"
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
//TODO Allow pulling from Versions.kt
|
||||
implementation("com.github.johnrengelman", "shadow", "8.1.1")
|
||||
implementation("io.papermc.paperweight.userdev", "io.papermc.paperweight.userdev.gradle.plugin", "1.5.6")
|
||||
implementation("com.gradleup.shadow", "shadow-gradle-plugin", "8.3.1")
|
||||
implementation("io.papermc.paperweight.userdev", "io.papermc.paperweight.userdev.gradle.plugin", "1.7.2")
|
||||
|
||||
implementation("org.ow2.asm", "asm", "9.5")
|
||||
implementation("org.ow2.asm", "asm-tree", "9.5")
|
||||
implementation("com.dfsek.tectonic", "common", "4.2.0")
|
||||
implementation("org.yaml", "snakeyaml", "2.2")
|
||||
implementation("org.ow2.asm", "asm", "9.7")
|
||||
implementation("org.ow2.asm", "asm-tree", "9.7")
|
||||
implementation("com.dfsek.tectonic", "common", "4.2.1")
|
||||
implementation("org.yaml", "snakeyaml", "2.3")
|
||||
}
|
||||
@@ -22,8 +22,8 @@ fun Project.configureCompilation() {
|
||||
apply<TectonicDocPlugin>()
|
||||
|
||||
configure<JavaPluginExtension> {
|
||||
sourceCompatibility = JavaVersion.VERSION_17
|
||||
targetCompatibility = JavaVersion.VERSION_17
|
||||
sourceCompatibility = JavaVersion.VERSION_21
|
||||
targetCompatibility = JavaVersion.VERSION_21
|
||||
}
|
||||
|
||||
tasks.withType<JavaCompile> {
|
||||
|
||||
@@ -36,7 +36,7 @@ fun Project.configureDependencies() {
|
||||
maven("https://repo.codemc.org/repository/maven-public") {
|
||||
name = "CodeMC"
|
||||
}
|
||||
maven("https://papermc.io/repo/repository/maven-public/") {
|
||||
maven("https://repo.papermc.io/repository/maven-public/") {
|
||||
name = "PaperMC"
|
||||
}
|
||||
maven("https://files.minecraftforge.net/maven/") {
|
||||
@@ -48,17 +48,26 @@ fun Project.configureDependencies() {
|
||||
maven("https://jitpack.io") {
|
||||
name = "JitPack"
|
||||
}
|
||||
maven("https://nexuslite.gcnt.net/repos/other/") {
|
||||
name = "GCNT"
|
||||
maven("https://s01.oss.sonatype.org/content/repositories/snapshots/") {
|
||||
name = "Sonatype Snapshots"
|
||||
}
|
||||
maven("https://repo.opencollab.dev/maven-releases/") {
|
||||
name = "OpenCollab Releases"
|
||||
}
|
||||
maven("https://repo.opencollab.dev/maven-snapshots/") {
|
||||
name = "OpenCollab Snapshots"
|
||||
}
|
||||
maven("https://storehouse.okaeri.eu/repository/maven-public/") {
|
||||
name = "Okaeri"
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
testImplementation("org.junit.jupiter:junit-jupiter-api:5.7.0")
|
||||
testImplementation("org.junit.jupiter:junit-jupiter-engine:5.7.0")
|
||||
compileOnly("org.jetbrains:annotations:23.0.0")
|
||||
testImplementation("org.junit.jupiter", "junit-jupiter-api", Versions.Libraries.Internal.junit)
|
||||
testImplementation("org.junit.jupiter", "junit-jupiter-engine", Versions.Libraries.Internal.junit)
|
||||
compileOnly("org.jetbrains", "annotations", Versions.Libraries.Internal.jetBrainsAnnotations)
|
||||
|
||||
compileOnly("com.google.guava:guava:30.0-jre")
|
||||
testImplementation("com.google.guava:guava:30.0-jre")
|
||||
compileOnly("com.google.guava", "guava", Versions.Libraries.Internal.guava)
|
||||
testImplementation("com.google.guava", "guava", Versions.Libraries.Internal.guava)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,9 +4,11 @@ import java.io.File
|
||||
import java.io.FileWriter
|
||||
import java.net.URL
|
||||
import java.nio.file.FileSystems
|
||||
import java.nio.file.Path
|
||||
import org.gradle.api.DefaultTask
|
||||
import org.gradle.api.Project
|
||||
import org.gradle.api.plugins.BasePluginExtension
|
||||
import org.gradle.jvm.tasks.Jar
|
||||
import org.gradle.kotlin.dsl.apply
|
||||
import org.gradle.kotlin.dsl.configure
|
||||
import org.gradle.kotlin.dsl.extra
|
||||
@@ -19,15 +21,35 @@ import kotlin.io.path.createDirectories
|
||||
import kotlin.io.path.createFile
|
||||
import kotlin.io.path.exists
|
||||
|
||||
private fun Project.installAddonsInto(dest: Path) {
|
||||
FileSystems.newFileSystem(dest, mapOf("create" to "false"), null).use { fs ->
|
||||
forSubProjects(":common:addons") {
|
||||
val jar = getJarTask()
|
||||
|
||||
logger.info("Packaging addon ${jar.archiveFileName.get()} to $dest. size: ${jar.archiveFile.get().asFile.length() / 1024}KB")
|
||||
|
||||
val boot = if (extra.has("bootstrap") && extra.get("bootstrap") as Boolean) "bootstrap/" else ""
|
||||
val addonPath = fs.getPath("/addons/$boot${jar.archiveFileName.get()}")
|
||||
|
||||
if (!addonPath.exists()) {
|
||||
addonPath.parent.createDirectories()
|
||||
addonPath.createFile()
|
||||
jar.archiveFile.get().asFile.toPath().copyTo(addonPath, overwrite = true)
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun Project.configureDistribution() {
|
||||
apply(plugin = "com.github.johnrengelman.shadow")
|
||||
apply(plugin = "com.gradleup.shadow")
|
||||
|
||||
val downloadDefaultPacks = tasks.create("downloadDefaultPacks") {
|
||||
group = "terra"
|
||||
doFirst {
|
||||
file("${buildDir}/resources/main/packs/").deleteRecursively()
|
||||
val defaultPackUrl = URL("https://github.com/PolyhedralDev/TerraOverworldConfig/releases/download/latest/default.zip")
|
||||
val defaultPackUrl =
|
||||
URL("https://github.com/PolyhedralDev/TerraOverworldConfig/releases/download/" + Versions.Terra.overworldConfig + "/default.zip")
|
||||
downloadPack(defaultPackUrl, project)
|
||||
}
|
||||
}
|
||||
@@ -47,25 +69,17 @@ fun Project.configureDistribution() {
|
||||
doLast {
|
||||
// https://github.com/johnrengelman/shadow/issues/111
|
||||
val dest = tasks.named<ShadowJar>("shadowJar").get().archiveFile.get().path
|
||||
|
||||
|
||||
FileSystems.newFileSystem(dest, mapOf("create" to "false"), null).use { fs ->
|
||||
forSubProjects(":common:addons") {
|
||||
val jar = getJarTask()
|
||||
|
||||
logger.info("Packaging addon ${jar.archiveFileName.get()} to $dest. size: ${jar.archiveFile.get().asFile.length() / 1024}KB")
|
||||
|
||||
val boot = if (extra.has("bootstrap") && extra.get("bootstrap") as Boolean) "bootstrap/" else ""
|
||||
val addonPath = fs.getPath("/addons/$boot${jar.archiveFileName.get()}")
|
||||
|
||||
if (!addonPath.exists()) {
|
||||
addonPath.parent.createDirectories()
|
||||
addonPath.createFile()
|
||||
jar.archiveFile.get().asFile.toPath().copyTo(addonPath, overwrite = true)
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
installAddonsInto(dest)
|
||||
}
|
||||
}
|
||||
|
||||
tasks.create("installAddonsIntoDefaultJar") {
|
||||
group = "terra"
|
||||
dependsOn(compileAddons)
|
||||
|
||||
doLast {
|
||||
val dest = tasks.named<Jar>("jar").get().archiveFile.get().path
|
||||
installAddonsInto(dest)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -132,7 +146,6 @@ fun Project.configureDistribution() {
|
||||
version = project.version
|
||||
relocate("org.apache.commons", "com.dfsek.terra.lib.commons")
|
||||
relocate("org.objectweb.asm", "com.dfsek.terra.lib.asm")
|
||||
relocate("com.dfsek.paralithic", "com.dfsek.terra.lib.paralithic")
|
||||
relocate("org.json", "com.dfsek.terra.lib.json")
|
||||
relocate("org.yaml", "com.dfsek.terra.lib.yaml")
|
||||
|
||||
|
||||
@@ -1,26 +1,35 @@
|
||||
object Versions {
|
||||
object Terra {
|
||||
const val overworldConfig = "v1.3.4"
|
||||
}
|
||||
|
||||
object Libraries {
|
||||
const val tectonic = "4.2.1"
|
||||
const val paralithic = "0.7.1"
|
||||
const val paralithic = "0.8.1"
|
||||
const val strata = "1.3.2"
|
||||
|
||||
const val cloud = "1.8.4"
|
||||
const val cloud = "2.0.0"
|
||||
|
||||
const val slf4j = "2.0.9"
|
||||
const val log4j_slf4j_impl = "2.20.0"
|
||||
const val caffeine = "3.1.8"
|
||||
|
||||
const val slf4j = "2.0.16"
|
||||
|
||||
object Internal {
|
||||
const val shadow = "8.1.1"
|
||||
const val apacheText = "1.10.0"
|
||||
const val apacheIO = "2.14.0"
|
||||
const val guava = "32.1.3-jre"
|
||||
const val asm = "9.5"
|
||||
const val snakeYml = "2.2"
|
||||
const val shadow = "8.3.3"
|
||||
const val apacheText = "1.12.0"
|
||||
const val apacheIO = "2.17.0"
|
||||
const val guava = "33.3.1-jre"
|
||||
const val asm = "9.7.1"
|
||||
const val snakeYml = "2.3"
|
||||
const val jetBrainsAnnotations = "26.0.1"
|
||||
const val junit = "5.11.3"
|
||||
const val nbt = "6.1"
|
||||
}
|
||||
}
|
||||
|
||||
object Fabric {
|
||||
const val fabricAPI = "0.90.0+${Mod.minecraft}"
|
||||
const val fabricAPI = "0.118.0+${Mod.minecraft}"
|
||||
const val cloud = "2.0.0-beta.9"
|
||||
}
|
||||
//
|
||||
// object Quilt {
|
||||
@@ -29,32 +38,32 @@ object Versions {
|
||||
// }
|
||||
|
||||
object Mod {
|
||||
const val mixin = "0.12.5+mixin.0.8.5"
|
||||
const val mixin = "0.15.3+mixin.0.8.7"
|
||||
|
||||
const val minecraft = "1.20.2"
|
||||
const val yarn = "$minecraft+build.4"
|
||||
const val fabricLoader = "0.14.23"
|
||||
const val minecraft = "1.21.4"
|
||||
const val yarn = "$minecraft+build.8"
|
||||
const val fabricLoader = "0.16.10"
|
||||
|
||||
const val architecuryLoom = "1.3.357"
|
||||
const val architecturyPlugin = "3.4.146"
|
||||
|
||||
const val loomVineflower = "1.11.0"
|
||||
}
|
||||
|
||||
object Forge {
|
||||
const val forge = "${Mod.minecraft}-48.0.13"
|
||||
const val burningwave = "12.63.0"
|
||||
const val architecuryLoom = "1.7.413"
|
||||
const val architecturyPlugin = "3.4.159"
|
||||
|
||||
}
|
||||
//
|
||||
// object Forge {
|
||||
// const val forge = "${Mod.minecraft}-48.0.13"
|
||||
// const val burningwave = "12.63.0"
|
||||
// }
|
||||
|
||||
object Bukkit {
|
||||
const val paper = "1.18.2-R0.1-SNAPSHOT"
|
||||
const val paperLib = "1.0.5"
|
||||
const val foliaLib = "0.2.5"
|
||||
const val minecraft = "1.20.2"
|
||||
const val reflectionRemapper = "0.1.0-SNAPSHOT"
|
||||
const val paperDevBundle = "1.20.2-R0.1-SNAPSHOT"
|
||||
const val runPaper = "2.2.0"
|
||||
const val paperWeight = "1.5.6"
|
||||
const val minecraft = "1.21.4"
|
||||
const val paperBuild = "$minecraft-R0.1-20241211.212446-17"
|
||||
const val paper = paperBuild
|
||||
const val paperLib = "1.0.8"
|
||||
const val reflectionRemapper = "0.1.1"
|
||||
const val paperDevBundle = paperBuild
|
||||
const val runPaper = "2.3.1"
|
||||
const val paperWeight = "1.7.2"
|
||||
const val cloud = "2.0.0-beta.10"
|
||||
}
|
||||
|
||||
//
|
||||
@@ -65,7 +74,15 @@ object Versions {
|
||||
// }
|
||||
//
|
||||
object CLI {
|
||||
const val nbt = "6.1"
|
||||
const val logback = "1.4.11"
|
||||
const val logback = "1.5.8"
|
||||
const val picocli = "4.7.6"
|
||||
}
|
||||
}
|
||||
|
||||
object Allay {
|
||||
const val api = "0.1.3"
|
||||
}
|
||||
|
||||
object Minestom {
|
||||
const val minestom = "187931e50b"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2020-2023 Polyhedral Development
|
||||
Copyright (c) 2020-2025 Polyhedral Development
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2020-2023 Polyhedral Development
|
||||
* Copyright (c) 2020-2025 Polyhedral Development
|
||||
*
|
||||
* The Terra Core Addons are licensed under the terms of the MIT License. For more details,
|
||||
* reference the LICENSE file in this module's root directory.
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2020-2023 Polyhedral Development
|
||||
* Copyright (c) 2020-2025 Polyhedral Development
|
||||
*
|
||||
* The Terra Core Addons are licensed under the terms of the MIT License. For more details,
|
||||
* reference the LICENSE file in this module's root directory.
|
||||
|
||||
+2
-2
@@ -1,9 +1,9 @@
|
||||
package com.dfsek.terra.addons.biome.extrusion.api;
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
import com.dfsek.terra.api.world.biome.Biome;
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
|
||||
public interface Extrusion {
|
||||
Biome extrude(Biome original, int x, int y, int z, long seed);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2020-2023 Polyhedral Development
|
||||
Copyright (c) 2020-2025 Polyhedral Development
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2020-2023 Polyhedral Development
|
||||
* Copyright (c) 2020-2025 Polyhedral Development
|
||||
*
|
||||
* The Terra Core Addons are licensed under the terms of the MIT License. For more details,
|
||||
* reference the LICENSE file in this module's root directory.
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2020-2023 Polyhedral Development
|
||||
* Copyright (c) 2020-2025 Polyhedral Development
|
||||
*
|
||||
* The Terra Core Addons are licensed under the terms of the MIT License. For more details,
|
||||
* reference the LICENSE file in this module's root directory.
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2020-2023 Polyhedral Development
|
||||
* Copyright (c) 2020-2025 Polyhedral Development
|
||||
*
|
||||
* The Terra Core Addons are licensed under the terms of the MIT License. For more details,
|
||||
* reference the LICENSE file in this module's root directory.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2020-2023 Polyhedral Development
|
||||
Copyright (c) 2020-2025 Polyhedral Development
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2020-2023 Polyhedral Development
|
||||
* Copyright (c) 2020-2025 Polyhedral Development
|
||||
*
|
||||
* The Terra Core Addons are licensed under the terms of the MIT License. For more details,
|
||||
* reference the LICENSE file in this module's root directory.
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2020-2023 Polyhedral Development
|
||||
* Copyright (c) 2020-2025 Polyhedral Development
|
||||
*
|
||||
* The Terra Core Addons are licensed under the terms of the MIT License. For more details,
|
||||
* reference the LICENSE file in this module's root directory.
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2020-2023 Polyhedral Development
|
||||
* Copyright (c) 2020-2025 Polyhedral Development
|
||||
*
|
||||
* The Terra Core Addons are licensed under the terms of the MIT License. For more details,
|
||||
* reference the LICENSE file in this module's root directory.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2020-2023 Polyhedral Development
|
||||
Copyright (c) 2020-2025 Polyhedral Development
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2020-2023 Polyhedral Development
|
||||
* Copyright (c) 2020-2025 Polyhedral Development
|
||||
*
|
||||
* The Terra Core Addons are licensed under the terms of the MIT License. For more details,
|
||||
* reference the LICENSE file in this module's root directory.
|
||||
|
||||
+4
-3
@@ -1,5 +1,7 @@
|
||||
package com.dfsek.terra.addons.biome.pipeline.v2;
|
||||
|
||||
import com.dfsek.terra.api.util.cache.SeededVector2Key;
|
||||
|
||||
import com.github.benmanes.caffeine.cache.Caffeine;
|
||||
import com.github.benmanes.caffeine.cache.LoadingCache;
|
||||
|
||||
@@ -11,7 +13,6 @@ import java.util.stream.StreamSupport;
|
||||
|
||||
import com.dfsek.terra.addons.biome.pipeline.v2.api.BiomeChunk;
|
||||
import com.dfsek.terra.addons.biome.pipeline.v2.api.Pipeline;
|
||||
import com.dfsek.terra.addons.biome.pipeline.v2.api.SeededVector;
|
||||
import com.dfsek.terra.addons.biome.pipeline.v2.api.Stage;
|
||||
import com.dfsek.terra.addons.biome.pipeline.v2.api.biome.PipelineBiome;
|
||||
import com.dfsek.terra.api.noise.NoiseSampler;
|
||||
@@ -23,7 +24,7 @@ import com.dfsek.terra.api.world.biome.generation.BiomeProvider;
|
||||
|
||||
public class PipelineBiomeProvider implements BiomeProvider {
|
||||
|
||||
private final LoadingCache<SeededVector, BiomeChunk> biomeChunkCache;
|
||||
private final LoadingCache<SeededVector2Key, BiomeChunk> biomeChunkCache;
|
||||
private final int chunkSize;
|
||||
private final int resolution;
|
||||
private final NoiseSampler mutator;
|
||||
@@ -90,7 +91,7 @@ public class PipelineBiomeProvider implements BiomeProvider {
|
||||
int xInChunk = x - chunkWorldX;
|
||||
int zInChunk = z - chunkWorldZ;
|
||||
|
||||
return biomeChunkCache.get(new SeededVector(seed, chunkWorldX, chunkWorldZ)).get(xInChunk, zInChunk).getBiome();
|
||||
return biomeChunkCache.get(new SeededVector2Key(chunkWorldX, chunkWorldZ, seed)).get(xInChunk, zInChunk).getBiome();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+3
-1
@@ -1,10 +1,12 @@
|
||||
package com.dfsek.terra.addons.biome.pipeline.v2.api;
|
||||
|
||||
import com.dfsek.terra.api.util.cache.SeededVector2Key;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
public interface Pipeline {
|
||||
BiomeChunk generateChunk(SeededVector worldCoordinates);
|
||||
BiomeChunk generateChunk(SeededVector2Key worldCoordinates);
|
||||
|
||||
int getChunkSize();
|
||||
|
||||
|
||||
-19
@@ -1,19 +0,0 @@
|
||||
package com.dfsek.terra.addons.biome.pipeline.v2.api;
|
||||
|
||||
public record SeededVector(long seed, int x, int z) {
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if(obj instanceof SeededVector that) {
|
||||
return this.z == that.z && this.x == that.x && this.seed == that.seed;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
int code = x;
|
||||
code = 31 * code + z;
|
||||
return 31 * code + ((int) (seed ^ (seed >>> 32)));
|
||||
}
|
||||
}
|
||||
+2
-2
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2020-2023 Polyhedral Development
|
||||
* Copyright (c) 2020-2025 Polyhedral Development
|
||||
*
|
||||
* The Terra Core Addons are licensed under the terms of the MIT License. For more details,
|
||||
* reference the LICENSE file in this module's root directory.
|
||||
@@ -29,7 +29,7 @@ public class BiomePipelineTemplate implements ObjectTemplate<BiomeProvider> {
|
||||
@Default
|
||||
@Description("""
|
||||
The resolution at which to sample biomes.
|
||||
|
||||
|
||||
Larger values are quadratically faster, but produce lower quality results.
|
||||
For example, a value of 3 would sample every 3 blocks.""")
|
||||
protected @Meta int resolution = 1;
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2020-2023 Polyhedral Development
|
||||
* Copyright (c) 2020-2025 Polyhedral Development
|
||||
*
|
||||
* The Terra Core Addons are licensed under the terms of the MIT License. For more details,
|
||||
* reference the LICENSE file in this module's root directory.
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2020-2023 Polyhedral Development
|
||||
* Copyright (c) 2020-2025 Polyhedral Development
|
||||
*
|
||||
* The Terra Core Addons are licensed under the terms of the MIT License. For more details,
|
||||
* reference the LICENSE file in this module's root directory.
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2020-2023 Polyhedral Development
|
||||
* Copyright (c) 2020-2025 Polyhedral Development
|
||||
*
|
||||
* The Terra Core Addons are licensed under the terms of the MIT License. For more details,
|
||||
* reference the LICENSE file in this module's root directory.
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2020-2023 Polyhedral Development
|
||||
* Copyright (c) 2020-2025 Polyhedral Development
|
||||
*
|
||||
* The Terra Core Addons are licensed under the terms of the MIT License. For more details,
|
||||
* reference the LICENSE file in this module's root directory.
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2020-2023 Polyhedral Development
|
||||
* Copyright (c) 2020-2025 Polyhedral Development
|
||||
*
|
||||
* The Terra Core Addons are licensed under the terms of the MIT License. For more details,
|
||||
* reference the LICENSE file in this module's root directory.
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2020-2023 Polyhedral Development
|
||||
* Copyright (c) 2020-2025 Polyhedral Development
|
||||
*
|
||||
* The Terra Core Addons are licensed under the terms of the MIT License. For more details,
|
||||
* reference the LICENSE file in this module's root directory.
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2020-2023 Polyhedral Development
|
||||
* Copyright (c) 2020-2025 Polyhedral Development
|
||||
*
|
||||
* The Terra Core Addons are licensed under the terms of the MIT License. For more details,
|
||||
* reference the LICENSE file in this module's root directory.
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2020-2023 Polyhedral Development
|
||||
* Copyright (c) 2020-2025 Polyhedral Development
|
||||
*
|
||||
* The Terra Core Addons are licensed under the terms of the MIT License. For more details,
|
||||
* reference the LICENSE file in this module's root directory.
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2020-2023 Polyhedral Development
|
||||
* Copyright (c) 2020-2025 Polyhedral Development
|
||||
*
|
||||
* The Terra Core Addons are licensed under the terms of the MIT License. For more details,
|
||||
* reference the LICENSE file in this module's root directory.
|
||||
|
||||
+8
-8
@@ -4,20 +4,20 @@ import java.util.List;
|
||||
|
||||
import com.dfsek.terra.addons.biome.pipeline.v2.api.BiomeChunk;
|
||||
import com.dfsek.terra.addons.biome.pipeline.v2.api.Expander;
|
||||
import com.dfsek.terra.addons.biome.pipeline.v2.api.SeededVector;
|
||||
import com.dfsek.terra.addons.biome.pipeline.v2.api.Stage;
|
||||
import com.dfsek.terra.addons.biome.pipeline.v2.api.biome.PipelineBiome;
|
||||
import com.dfsek.terra.api.util.cache.SeededVector2Key;
|
||||
|
||||
|
||||
public class BiomeChunkImpl implements BiomeChunk {
|
||||
|
||||
private final SeededVector worldOrigin;
|
||||
private final SeededVector2Key worldOrigin;
|
||||
private final int chunkOriginArrayIndex;
|
||||
private final int worldCoordinateScale;
|
||||
private final int size;
|
||||
private PipelineBiome[] biomes;
|
||||
|
||||
public BiomeChunkImpl(SeededVector worldOrigin, PipelineImpl pipeline) {
|
||||
public BiomeChunkImpl(SeededVector2Key worldOrigin, PipelineImpl pipeline) {
|
||||
|
||||
this.worldOrigin = worldOrigin;
|
||||
this.chunkOriginArrayIndex = pipeline.getChunkOriginArrayIndex();
|
||||
@@ -44,7 +44,7 @@ public class BiomeChunkImpl implements BiomeChunk {
|
||||
for(int gridZ = 0; gridZ < gridSize; gridZ++) {
|
||||
int xIndex = gridOrigin + gridX * gridInterval;
|
||||
int zIndex = gridOrigin + gridZ * gridInterval;
|
||||
biomes[(xIndex * size) + zIndex] = pipeline.getSource().get(worldOrigin.seed(), xIndexToWorldCoordinate(xIndex),
|
||||
biomes[(xIndex * size) + zIndex] = pipeline.getSource().get(worldOrigin.seed, xIndexToWorldCoordinate(xIndex),
|
||||
zIndexToWorldCoordinate(zIndex));
|
||||
}
|
||||
}
|
||||
@@ -139,14 +139,14 @@ public class BiomeChunkImpl implements BiomeChunk {
|
||||
}
|
||||
|
||||
private int xIndexToWorldCoordinate(int xIndex) {
|
||||
return (worldOrigin.x() + xIndex - chunkOriginArrayIndex) * worldCoordinateScale;
|
||||
return (worldOrigin.x + xIndex - chunkOriginArrayIndex) * worldCoordinateScale;
|
||||
}
|
||||
|
||||
private int zIndexToWorldCoordinate(int zIndex) {
|
||||
return (worldOrigin.z() + zIndex - chunkOriginArrayIndex) * worldCoordinateScale;
|
||||
return (worldOrigin.z + zIndex - chunkOriginArrayIndex) * worldCoordinateScale;
|
||||
}
|
||||
|
||||
private SeededVector getOrigin() {
|
||||
private SeededVector2Key getOrigin() {
|
||||
return worldOrigin;
|
||||
}
|
||||
|
||||
@@ -216,7 +216,7 @@ public class BiomeChunkImpl implements BiomeChunk {
|
||||
}
|
||||
|
||||
public long worldSeed() {
|
||||
return chunk.getOrigin().seed();
|
||||
return chunk.getOrigin().seed;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+3
-2
@@ -1,5 +1,7 @@
|
||||
package com.dfsek.terra.addons.biome.pipeline.v2.pipeline;
|
||||
|
||||
import com.dfsek.terra.api.util.cache.SeededVector2Key;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
@@ -8,7 +10,6 @@ import java.util.List;
|
||||
import com.dfsek.terra.addons.biome.pipeline.v2.api.BiomeChunk;
|
||||
import com.dfsek.terra.addons.biome.pipeline.v2.api.Expander;
|
||||
import com.dfsek.terra.addons.biome.pipeline.v2.api.Pipeline;
|
||||
import com.dfsek.terra.addons.biome.pipeline.v2.api.SeededVector;
|
||||
import com.dfsek.terra.addons.biome.pipeline.v2.api.Source;
|
||||
import com.dfsek.terra.addons.biome.pipeline.v2.api.Stage;
|
||||
|
||||
@@ -55,7 +56,7 @@ public class PipelineImpl implements Pipeline {
|
||||
}
|
||||
|
||||
@Override
|
||||
public BiomeChunk generateChunk(SeededVector worldCoordinates) {
|
||||
public BiomeChunk generateChunk(SeededVector2Key worldCoordinates) {
|
||||
return new BiomeChunkImpl(worldCoordinates, this);
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2020-2023 Polyhedral Development
|
||||
* Copyright (c) 2020-2025 Polyhedral Development
|
||||
*
|
||||
* The Terra Core Addons are licensed under the terms of the MIT License. For more details,
|
||||
* reference the LICENSE file in this module's root directory.
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2020-2023 Polyhedral Development
|
||||
* Copyright (c) 2020-2025 Polyhedral Development
|
||||
*
|
||||
* The Terra Core Addons are licensed under the terms of the MIT License. For more details,
|
||||
* reference the LICENSE file in this module's root directory.
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2020-2023 Polyhedral Development
|
||||
* Copyright (c) 2020-2025 Polyhedral Development
|
||||
*
|
||||
* The Terra Core Addons are licensed under the terms of the MIT License. For more details,
|
||||
* reference the LICENSE file in this module's root directory.
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2020-2023 Polyhedral Development
|
||||
* Copyright (c) 2020-2025 Polyhedral Development
|
||||
*
|
||||
* The Terra Core Addons are licensed under the terms of the MIT License. For more details,
|
||||
* reference the LICENSE file in this module's root directory.
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2020-2023 Polyhedral Development
|
||||
* Copyright (c) 2020-2025 Polyhedral Development
|
||||
*
|
||||
* The Terra Core Addons are licensed under the terms of the MIT License. For more details,
|
||||
* reference the LICENSE file in this module's root directory.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2020-2023 Polyhedral Development
|
||||
Copyright (c) 2020-2025 Polyhedral Development
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2020-2023 Polyhedral Development
|
||||
* Copyright (c) 2020-2025 Polyhedral Development
|
||||
*
|
||||
* The Terra Core Addons are licensed under the terms of the MIT License. For more details,
|
||||
* reference the LICENSE file in this module's root directory.
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2020-2023 Polyhedral Development
|
||||
* Copyright (c) 2020-2025 Polyhedral Development
|
||||
*
|
||||
* The Terra Core Addons are licensed under the terms of the MIT License. For more details,
|
||||
* reference the LICENSE file in this module's root directory.
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2020-2023 Polyhedral Development
|
||||
* Copyright (c) 2020-2025 Polyhedral Development
|
||||
*
|
||||
* The Terra Core Addons are licensed under the terms of the MIT License. For more details,
|
||||
* reference the LICENSE file in this module's root directory.
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2020-2023 Polyhedral Development
|
||||
* Copyright (c) 2020-2025 Polyhedral Development
|
||||
*
|
||||
* The Terra Core Addons are licensed under the terms of the MIT License. For more details,
|
||||
* reference the LICENSE file in this module's root directory.
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2020-2023 Polyhedral Development
|
||||
* Copyright (c) 2020-2025 Polyhedral Development
|
||||
*
|
||||
* The Terra Core Addons are licensed under the terms of the MIT License. For more details,
|
||||
* reference the LICENSE file in this module's root directory.
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2020-2023 Polyhedral Development
|
||||
* Copyright (c) 2020-2025 Polyhedral Development
|
||||
*
|
||||
* The Terra Core Addons are licensed under the terms of the MIT License. For more details,
|
||||
* reference the LICENSE file in this module's root directory.
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2020-2023 Polyhedral Development
|
||||
* Copyright (c) 2020-2025 Polyhedral Development
|
||||
*
|
||||
* The Terra Core Addons are licensed under the terms of the MIT License. For more details,
|
||||
* reference the LICENSE file in this module's root directory.
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2020-2023 Polyhedral Development
|
||||
* Copyright (c) 2020-2025 Polyhedral Development
|
||||
*
|
||||
* The Terra Core Addons are licensed under the terms of the MIT License. For more details,
|
||||
* reference the LICENSE file in this module's root directory.
|
||||
|
||||
+2
-2
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2020-2023 Polyhedral Development
|
||||
* Copyright (c) 2020-2025 Polyhedral Development
|
||||
*
|
||||
* The Terra Core Addons are licensed under the terms of the MIT License. For more details,
|
||||
* reference the LICENSE file in this module's root directory.
|
||||
@@ -28,7 +28,7 @@ public class BiomePipelineTemplate extends BiomeProviderTemplate {
|
||||
@Description("""
|
||||
The initial size of biome chunks. This value must be at least 2.
|
||||
<b>This is not the final size of biome chunks. Final chunks will be much larger</b>.
|
||||
|
||||
|
||||
It is recommended to keep biome chunks' final size in the range of [50, 300]
|
||||
to prevent performance issues. To calculate the size of biome chunks, simply
|
||||
take initial-size and for each expand stage, multiply the running value by 2
|
||||
|
||||
+2
-2
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2020-2023 Polyhedral Development
|
||||
* Copyright (c) 2020-2025 Polyhedral Development
|
||||
*
|
||||
* The Terra Core Addons are licensed under the terms of the MIT License. For more details,
|
||||
* reference the LICENSE file in this module's root directory.
|
||||
@@ -22,7 +22,7 @@ public abstract class BiomeProviderTemplate implements ObjectTemplate<BiomeProvi
|
||||
@Default
|
||||
@Description("""
|
||||
The resolution at which to sample biomes.
|
||||
|
||||
|
||||
Larger values are quadratically faster, but produce lower quality results.
|
||||
For example, a value of 3 would sample every 3 blocks.""")
|
||||
protected @Meta int resolution = 1;
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2020-2023 Polyhedral Development
|
||||
* Copyright (c) 2020-2025 Polyhedral Development
|
||||
*
|
||||
* The Terra Core Addons are licensed under the terms of the MIT License. For more details,
|
||||
* reference the LICENSE file in this module's root directory.
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2020-2023 Polyhedral Development
|
||||
* Copyright (c) 2020-2025 Polyhedral Development
|
||||
*
|
||||
* The Terra Core Addons are licensed under the terms of the MIT License. For more details,
|
||||
* reference the LICENSE file in this module's root directory.
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2020-2023 Polyhedral Development
|
||||
* Copyright (c) 2020-2025 Polyhedral Development
|
||||
*
|
||||
* The Terra Core Addons are licensed under the terms of the MIT License. For more details,
|
||||
* reference the LICENSE file in this module's root directory.
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2020-2023 Polyhedral Development
|
||||
* Copyright (c) 2020-2025 Polyhedral Development
|
||||
*
|
||||
* The Terra Core Addons are licensed under the terms of the MIT License. For more details,
|
||||
* reference the LICENSE file in this module's root directory.
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2020-2023 Polyhedral Development
|
||||
* Copyright (c) 2020-2025 Polyhedral Development
|
||||
*
|
||||
* The Terra Core Addons are licensed under the terms of the MIT License. For more details,
|
||||
* reference the LICENSE file in this module's root directory.
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2020-2023 Polyhedral Development
|
||||
* Copyright (c) 2020-2025 Polyhedral Development
|
||||
*
|
||||
* The Terra Core Addons are licensed under the terms of the MIT License. For more details,
|
||||
* reference the LICENSE file in this module's root directory.
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2020-2023 Polyhedral Development
|
||||
* Copyright (c) 2020-2025 Polyhedral Development
|
||||
*
|
||||
* The Terra Core Addons are licensed under the terms of the MIT License. For more details,
|
||||
* reference the LICENSE file in this module's root directory.
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2020-2023 Polyhedral Development
|
||||
* Copyright (c) 2020-2025 Polyhedral Development
|
||||
*
|
||||
* The Terra Core Addons are licensed under the terms of the MIT License. For more details,
|
||||
* reference the LICENSE file in this module's root directory.
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2020-2023 Polyhedral Development
|
||||
* Copyright (c) 2020-2025 Polyhedral Development
|
||||
*
|
||||
* The Terra Core Addons are licensed under the terms of the MIT License. For more details,
|
||||
* reference the LICENSE file in this module's root directory.
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2020-2023 Polyhedral Development
|
||||
* Copyright (c) 2020-2025 Polyhedral Development
|
||||
*
|
||||
* The Terra Core Addons are licensed under the terms of the MIT License. For more details,
|
||||
* reference the LICENSE file in this module's root directory.
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2020-2023 Polyhedral Development
|
||||
* Copyright (c) 2020-2025 Polyhedral Development
|
||||
*
|
||||
* The Terra Core Addons are licensed under the terms of the MIT License. For more details,
|
||||
* reference the LICENSE file in this module's root directory.
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2020-2023 Polyhedral Development
|
||||
* Copyright (c) 2020-2025 Polyhedral Development
|
||||
*
|
||||
* The Terra Core Addons are licensed under the terms of the MIT License. For more details,
|
||||
* reference the LICENSE file in this module's root directory.
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2020-2023 Polyhedral Development
|
||||
* Copyright (c) 2020-2025 Polyhedral Development
|
||||
*
|
||||
* The Terra Core Addons are licensed under the terms of the MIT License. For more details,
|
||||
* reference the LICENSE file in this module's root directory.
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2020-2023 Polyhedral Development
|
||||
* Copyright (c) 2020-2025 Polyhedral Development
|
||||
*
|
||||
* The Terra Core Addons are licensed under the terms of the MIT License. For more details,
|
||||
* reference the LICENSE file in this module's root directory.
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2020-2023 Polyhedral Development
|
||||
* Copyright (c) 2020-2025 Polyhedral Development
|
||||
*
|
||||
* The Terra Core Addons are licensed under the terms of the MIT License. For more details,
|
||||
* reference the LICENSE file in this module's root directory.
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2020-2023 Polyhedral Development
|
||||
* Copyright (c) 2020-2025 Polyhedral Development
|
||||
*
|
||||
* The Terra Core Addons are licensed under the terms of the MIT License. For more details,
|
||||
* reference the LICENSE file in this module's root directory.
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2020-2023 Polyhedral Development
|
||||
* Copyright (c) 2020-2025 Polyhedral Development
|
||||
*
|
||||
* The Terra Core Addons are licensed under the terms of the MIT License. For more details,
|
||||
* reference the LICENSE file in this module's root directory.
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2020-2023 Polyhedral Development
|
||||
* Copyright (c) 2020-2025 Polyhedral Development
|
||||
*
|
||||
* The Terra Core Addons are licensed under the terms of the MIT License. For more details,
|
||||
* reference the LICENSE file in this module's root directory.
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2020-2023 Polyhedral Development
|
||||
* Copyright (c) 2020-2025 Polyhedral Development
|
||||
*
|
||||
* The Terra Core Addons are licensed under the terms of the MIT License. For more details,
|
||||
* reference the LICENSE file in this module's root directory.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2020-2023 Polyhedral Development
|
||||
Copyright (c) 2020-2025 Polyhedral Development
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2020-2023 Polyhedral Development
|
||||
* Copyright (c) 2020-2025 Polyhedral Development
|
||||
*
|
||||
* The Terra Core Addons are licensed under the terms of the MIT License. For more details,
|
||||
* reference the LICENSE file in this module's root directory.
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2020-2023 Polyhedral Development
|
||||
* Copyright (c) 2020-2025 Polyhedral Development
|
||||
*
|
||||
* The Terra Core Addons are licensed under the terms of the MIT License. For more details,
|
||||
* reference the LICENSE file in this module's root directory.
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2020-2023 Polyhedral Development
|
||||
* Copyright (c) 2020-2025 Polyhedral Development
|
||||
*
|
||||
* The Terra Core Addons are licensed under the terms of the MIT License. For more details,
|
||||
* reference the LICENSE file in this module's root directory.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2020-2023 Polyhedral Development
|
||||
Copyright (c) 2020-2025 Polyhedral Development
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
||||
+6
-4
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2020-2023 Polyhedral Development
|
||||
* Copyright (c) 2020-2025 Polyhedral Development
|
||||
*
|
||||
* The Terra Core Addons are licensed under the terms of the MIT License. For more details,
|
||||
* reference the LICENSE file in this module's root directory.
|
||||
@@ -13,6 +13,7 @@ import com.dfsek.terra.addons.chunkgenerator.config.noise.BiomeNoiseProperties;
|
||||
import com.dfsek.terra.addons.chunkgenerator.config.palette.BiomePaletteTemplate;
|
||||
import com.dfsek.terra.addons.chunkgenerator.config.palette.slant.SlantLayerTemplate;
|
||||
import com.dfsek.terra.addons.chunkgenerator.generation.NoiseChunkGenerator3D;
|
||||
import com.dfsek.terra.addons.chunkgenerator.generation.math.SlantCalculationMethod;
|
||||
import com.dfsek.terra.addons.chunkgenerator.palette.BiomePaletteInfo;
|
||||
import com.dfsek.terra.addons.chunkgenerator.palette.slant.SlantHolder;
|
||||
import com.dfsek.terra.addons.manifest.api.AddonInitializer;
|
||||
@@ -45,8 +46,8 @@ public class NoiseChunkGenerator3DAddon implements AddonInitializer {
|
||||
.priority(1000)
|
||||
.then(event -> {
|
||||
|
||||
event.getPack().applyLoader(SlantHolder.CalculationMethod.class,
|
||||
(type, o, loader, depthTracker) -> SlantHolder.CalculationMethod.valueOf((String) o));
|
||||
event.getPack().applyLoader(SlantCalculationMethod.class,
|
||||
(type, o, loader, depthTracker) -> SlantCalculationMethod.valueOf((String) o));
|
||||
|
||||
NoiseChunkGeneratorPackConfigTemplate config = event.loadTemplate(new NoiseChunkGeneratorPackConfigTemplate());
|
||||
event.getPack().getContext().put(config);
|
||||
@@ -57,7 +58,8 @@ public class NoiseChunkGenerator3DAddon implements AddonInitializer {
|
||||
pack -> new NoiseChunkGenerator3D(pack, platform, config.getElevationBlend(),
|
||||
config.getHorizontalRes(),
|
||||
config.getVerticalRes(), noisePropertiesPropertyKey,
|
||||
paletteInfoPropertyKey));
|
||||
paletteInfoPropertyKey, config.getSlantCalculationMethod(),
|
||||
config.isSlantPalettesEnabled()));
|
||||
event.getPack()
|
||||
.applyLoader(SlantHolder.Layer.class, SlantLayerTemplate::new);
|
||||
})
|
||||
|
||||
+11
-3
@@ -4,7 +4,7 @@ import com.dfsek.tectonic.api.config.template.ConfigTemplate;
|
||||
import com.dfsek.tectonic.api.config.template.annotations.Default;
|
||||
import com.dfsek.tectonic.api.config.template.annotations.Value;
|
||||
|
||||
import com.dfsek.terra.addons.chunkgenerator.palette.slant.SlantHolder;
|
||||
import com.dfsek.terra.addons.chunkgenerator.generation.math.SlantCalculationMethod;
|
||||
import com.dfsek.terra.api.config.meta.Meta;
|
||||
import com.dfsek.terra.api.properties.Properties;
|
||||
|
||||
@@ -24,7 +24,11 @@ public class NoiseChunkGeneratorPackConfigTemplate implements ConfigTemplate, Pr
|
||||
|
||||
@Value("slant.calculation-method")
|
||||
@Default
|
||||
private SlantHolder.@Meta CalculationMethod slantCalculationMethod = SlantHolder.CalculationMethod.Derivative;
|
||||
private @Meta SlantCalculationMethod slantCalculationMethod = SlantCalculationMethod.Derivative;
|
||||
|
||||
@Value("slant.disable-palettes")
|
||||
@Default
|
||||
private @Meta boolean disableSlantPalettes = false;
|
||||
|
||||
public int getElevationBlend() {
|
||||
return elevationBlend;
|
||||
@@ -38,7 +42,11 @@ public class NoiseChunkGeneratorPackConfigTemplate implements ConfigTemplate, Pr
|
||||
return verticalRes;
|
||||
}
|
||||
|
||||
public SlantHolder.CalculationMethod getSlantCalculationMethod() {
|
||||
public SlantCalculationMethod getSlantCalculationMethod() {
|
||||
return slantCalculationMethod;
|
||||
}
|
||||
|
||||
public boolean isSlantPalettesEnabled() {
|
||||
return !disableSlantPalettes;
|
||||
}
|
||||
}
|
||||
|
||||
+4
-3
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2020-2023 Polyhedral Development
|
||||
* Copyright (c) 2020-2025 Polyhedral Development
|
||||
*
|
||||
* The Terra Core Addons are licensed under the terms of the MIT License. For more details,
|
||||
* reference the LICENSE file in this module's root directory.
|
||||
@@ -16,6 +16,7 @@ import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.dfsek.terra.addons.chunkgenerator.generation.math.SlantCalculationMethod;
|
||||
import com.dfsek.terra.addons.chunkgenerator.palette.BiomePaletteInfo;
|
||||
import com.dfsek.terra.addons.chunkgenerator.palette.PaletteHolder;
|
||||
import com.dfsek.terra.addons.chunkgenerator.palette.slant.SlantHolder;
|
||||
@@ -27,7 +28,7 @@ import com.dfsek.terra.api.world.chunk.generation.util.Palette;
|
||||
|
||||
public class BiomePaletteTemplate implements ObjectTemplate<BiomePaletteInfo> {
|
||||
private final Platform platform;
|
||||
private final SlantHolder.CalculationMethod slantCalculationMethod;
|
||||
private final SlantCalculationMethod slantCalculationMethod;
|
||||
@Value("slant")
|
||||
@Default
|
||||
@Description("The slant palettes to use in this biome.")
|
||||
@@ -56,7 +57,7 @@ public class BiomePaletteTemplate implements ObjectTemplate<BiomePaletteInfo> {
|
||||
@Default
|
||||
private @Meta boolean updatePalette = false;
|
||||
|
||||
public BiomePaletteTemplate(Platform platform, SlantHolder.CalculationMethod slantCalculationMethod) {
|
||||
public BiomePaletteTemplate(Platform platform, SlantCalculationMethod slantCalculationMethod) {
|
||||
this.platform = platform;
|
||||
this.slantCalculationMethod = slantCalculationMethod;
|
||||
}
|
||||
|
||||
+26
-11
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2020-2023 Polyhedral Development
|
||||
* Copyright (c) 2020-2025 Polyhedral Development
|
||||
*
|
||||
* The Terra Core Addons are licensed under the terms of the MIT License. For more details,
|
||||
* reference the LICENSE file in this module's root directory.
|
||||
@@ -11,11 +11,12 @@ package com.dfsek.terra.addons.chunkgenerator.generation;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import com.dfsek.terra.addons.chunkgenerator.config.noise.BiomeNoiseProperties;
|
||||
import com.dfsek.terra.addons.chunkgenerator.generation.math.PaletteUtil;
|
||||
import com.dfsek.terra.addons.chunkgenerator.generation.math.SlantCalculationMethod;
|
||||
import com.dfsek.terra.addons.chunkgenerator.generation.math.interpolation.LazilyEvaluatedInterpolator;
|
||||
import com.dfsek.terra.addons.chunkgenerator.generation.math.samplers.Sampler3D;
|
||||
import com.dfsek.terra.addons.chunkgenerator.generation.math.samplers.SamplerProvider;
|
||||
import com.dfsek.terra.addons.chunkgenerator.palette.BiomePaletteInfo;
|
||||
import com.dfsek.terra.addons.chunkgenerator.palette.slant.SlantHolder;
|
||||
import com.dfsek.terra.api.Platform;
|
||||
import com.dfsek.terra.api.block.state.BlockState;
|
||||
import com.dfsek.terra.api.config.ConfigPack;
|
||||
@@ -42,16 +43,23 @@ public class NoiseChunkGenerator3D implements ChunkGenerator {
|
||||
private final PropertyKey<BiomePaletteInfo> paletteInfoPropertyKey;
|
||||
private final PropertyKey<BiomeNoiseProperties> noisePropertiesKey;
|
||||
|
||||
private final SlantCalculationMethod slantCalculationMethod;
|
||||
|
||||
private final boolean useSlantPalettes;
|
||||
|
||||
public NoiseChunkGenerator3D(ConfigPack pack, Platform platform, int elevationBlend, int carverHorizontalResolution,
|
||||
int carverVerticalResolution,
|
||||
PropertyKey<BiomeNoiseProperties> noisePropertiesKey,
|
||||
PropertyKey<BiomePaletteInfo> paletteInfoPropertyKey) {
|
||||
PropertyKey<BiomePaletteInfo> paletteInfoPropertyKey,
|
||||
SlantCalculationMethod slantCalculationMethod, boolean useSlantPalettes) {
|
||||
this.platform = platform;
|
||||
this.air = platform.getWorldHandle().air();
|
||||
this.carverHorizontalResolution = carverHorizontalResolution;
|
||||
this.carverVerticalResolution = carverVerticalResolution;
|
||||
this.paletteInfoPropertyKey = paletteInfoPropertyKey;
|
||||
this.noisePropertiesKey = noisePropertiesKey;
|
||||
this.slantCalculationMethod = slantCalculationMethod;
|
||||
this.useSlantPalettes = useSlantPalettes;
|
||||
int maxBlend = pack
|
||||
.getBiomeProvider()
|
||||
.stream()
|
||||
@@ -63,6 +71,17 @@ public class NoiseChunkGenerator3D implements ChunkGenerator {
|
||||
this.samplerCache = new SamplerProvider(platform, elevationBlend, noisePropertiesKey, maxBlend);
|
||||
}
|
||||
|
||||
private Palette paletteAt(int x, int y, int z, Sampler3D sampler, BiomePaletteInfo paletteInfo, int depth) {
|
||||
SlantHolder slantHolder = paletteInfo.slantHolder();
|
||||
if(useSlantPalettes && slantHolder.isAboveDepth(depth)) {
|
||||
double slant = slantCalculationMethod.slant(sampler, x, y, z);
|
||||
if(slantHolder.isInSlantThreshold(slant)) {
|
||||
return slantHolder.getPalette(slant).getPalette(y);
|
||||
}
|
||||
}
|
||||
return paletteInfo.paletteHolder().getPalette(y);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("try")
|
||||
public void generateChunkData(@NotNull ProtoChunk chunk, @NotNull WorldProperties world,
|
||||
@@ -103,8 +122,7 @@ public class NoiseChunkGenerator3D implements ChunkGenerator {
|
||||
|
||||
if(sampler.sample(x, y, z) > 0) {
|
||||
if(carver.sample(x, y, z) <= 0) {
|
||||
data = PaletteUtil
|
||||
.getPalette(x, y, z, sampler, paletteInfo, paletteLevel)
|
||||
data = paletteAt(x, y, z, sampler, paletteInfo, paletteLevel)
|
||||
.get(paletteLevel, cx, y, cz, seed);
|
||||
chunk.setBlock(x, y, z, data);
|
||||
paletteLevel++;
|
||||
@@ -135,7 +153,7 @@ public class NoiseChunkGenerator3D implements ChunkGenerator {
|
||||
int fdX = Math.floorMod(x, 16);
|
||||
int fdZ = Math.floorMod(z, 16);
|
||||
|
||||
Palette palette = PaletteUtil.getPalette(fdX, y, fdZ, sampler, paletteInfo, 0);
|
||||
Palette palette = paletteAt(fdX, y, fdZ, sampler, paletteInfo, 0);
|
||||
double noise = sampler.sample(fdX, y, fdZ);
|
||||
if(noise > 0) {
|
||||
int level = 0;
|
||||
@@ -157,11 +175,8 @@ public class NoiseChunkGenerator3D implements ChunkGenerator {
|
||||
public double getSlant(int x, int y, int z, WorldProperties world, BiomeProvider biomeProvider) {
|
||||
int fdX = Math.floorMod(x, 16);
|
||||
int fdZ = Math.floorMod(z, 16);
|
||||
return biomeProvider.getBiome(x, y, z, world.getSeed())
|
||||
.getContext()
|
||||
.get(paletteInfoPropertyKey)
|
||||
.slantHolder()
|
||||
.calculateSlant(samplerCache.get(x, z, world, biomeProvider), fdX, y, fdZ);
|
||||
Sampler3D sampler = samplerCache.get(x, z, world, biomeProvider);
|
||||
return slantCalculationMethod.slant(sampler, fdX, y, fdZ);
|
||||
}
|
||||
|
||||
public SamplerProvider samplerProvider() {
|
||||
|
||||
-29
@@ -1,29 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2020-2023 Polyhedral Development
|
||||
*
|
||||
* The Terra Core Addons are licensed under the terms of the MIT License. For more details,
|
||||
* reference the LICENSE file in this module's root directory.
|
||||
*/
|
||||
|
||||
package com.dfsek.terra.addons.chunkgenerator.generation.math;
|
||||
|
||||
import com.dfsek.terra.addons.chunkgenerator.generation.math.samplers.Sampler3D;
|
||||
import com.dfsek.terra.addons.chunkgenerator.palette.BiomePaletteInfo;
|
||||
import com.dfsek.terra.addons.chunkgenerator.palette.slant.SlantHolder;
|
||||
import com.dfsek.terra.api.world.chunk.generation.util.Palette;
|
||||
|
||||
|
||||
public final class PaletteUtil {
|
||||
|
||||
public static Palette getPalette(int x, int y, int z, Sampler3D sampler, BiomePaletteInfo paletteInfo, int depth) {
|
||||
SlantHolder slantHolder = paletteInfo.slantHolder();
|
||||
if(slantHolder.isAboveDepth(depth)) {
|
||||
double slant = slantHolder.calculateSlant(sampler, x, y, z);
|
||||
if(slantHolder.isInSlantThreshold(slant)) {
|
||||
return slantHolder.getPalette(slant).getPalette(y);
|
||||
}
|
||||
}
|
||||
|
||||
return paletteInfo.paletteHolder().getPalette(y);
|
||||
}
|
||||
}
|
||||
+69
@@ -0,0 +1,69 @@
|
||||
package com.dfsek.terra.addons.chunkgenerator.generation.math;
|
||||
|
||||
import com.dfsek.terra.addons.chunkgenerator.generation.math.samplers.Sampler3D;
|
||||
import com.dfsek.terra.api.util.vector.Vector3;
|
||||
|
||||
|
||||
public enum SlantCalculationMethod {
|
||||
DotProduct {
|
||||
private static final Vector3 DOT_PRODUCT_DIRECTION = Vector3.of(0, 1, 0);
|
||||
|
||||
private static final Vector3[] DOT_PRODUCT_SAMPLE_POINTS = {
|
||||
Vector3.of(0, 0, -DERIVATIVE_DIST),
|
||||
Vector3.of(0, 0, DERIVATIVE_DIST),
|
||||
Vector3.of(0, -DERIVATIVE_DIST, 0),
|
||||
Vector3.of(0, DERIVATIVE_DIST, 0),
|
||||
Vector3.of(-DERIVATIVE_DIST, 0, 0),
|
||||
Vector3.of(DERIVATIVE_DIST, 0, 0)
|
||||
};
|
||||
|
||||
@Override
|
||||
public double slant(Sampler3D sampler, double x, double y, double z) {
|
||||
Vector3.Mutable normalApproximation = Vector3.Mutable.of(0, 0, 0);
|
||||
for(Vector3 point : DOT_PRODUCT_SAMPLE_POINTS) {
|
||||
var scalar = -sampler.sample(x + point.getX(), y + point.getY(), z + point.getZ());
|
||||
normalApproximation.add(point.mutable().multiply(scalar));
|
||||
}
|
||||
return DOT_PRODUCT_DIRECTION.dot(normalApproximation.normalize());
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean floorToThreshold() {
|
||||
return false;
|
||||
}
|
||||
},
|
||||
|
||||
Derivative {
|
||||
@Override
|
||||
public double slant(Sampler3D sampler, double x, double y, double z) {
|
||||
double baseSample = sampler.sample(x, y, z);
|
||||
|
||||
double xVal1 = (sampler.sample(x + DERIVATIVE_DIST, y, z) - baseSample) / DERIVATIVE_DIST;
|
||||
double xVal2 = (sampler.sample(x - DERIVATIVE_DIST, y, z) - baseSample) / DERIVATIVE_DIST;
|
||||
double zVal1 = (sampler.sample(x, y, z + DERIVATIVE_DIST) - baseSample) / DERIVATIVE_DIST;
|
||||
double zVal2 = (sampler.sample(x, y, z - DERIVATIVE_DIST) - baseSample) / DERIVATIVE_DIST;
|
||||
double yVal1 = (sampler.sample(x, y + DERIVATIVE_DIST, z) - baseSample) / DERIVATIVE_DIST;
|
||||
double yVal2 = (sampler.sample(x, y - DERIVATIVE_DIST, z) - baseSample) / DERIVATIVE_DIST;
|
||||
|
||||
return Math.sqrt(
|
||||
((xVal2 - xVal1) * (xVal2 - xVal1)) + ((zVal2 - zVal1) * (zVal2 - zVal1)) + ((yVal2 - yVal1) * (yVal2 - yVal1)));
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean floorToThreshold() {
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
private static final double DERIVATIVE_DIST = 0.55;
|
||||
|
||||
public abstract double slant(Sampler3D sampler, double x, double y, double z);
|
||||
|
||||
/*
|
||||
* Controls whether palettes should be applied before or after their respective thresholds.
|
||||
*
|
||||
* If true, slant values will map to the palette of the next floor threshold, otherwise they
|
||||
* will map to the ceiling.
|
||||
*/
|
||||
public abstract boolean floorToThreshold();
|
||||
}
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2020-2023 Polyhedral Development
|
||||
* Copyright (c) 2020-2025 Polyhedral Development
|
||||
*
|
||||
* The Terra Core Addons are licensed under the terms of the MIT License. For more details,
|
||||
* reference the LICENSE file in this module's root directory.
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2020-2023 Polyhedral Development
|
||||
* Copyright (c) 2020-2025 Polyhedral Development
|
||||
*
|
||||
* The Terra Core Addons are licensed under the terms of the MIT License. For more details,
|
||||
* reference the LICENSE file in this module's root directory.
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2020-2023 Polyhedral Development
|
||||
* Copyright (c) 2020-2025 Polyhedral Development
|
||||
*
|
||||
* The Terra Core Addons are licensed under the terms of the MIT License. For more details,
|
||||
* reference the LICENSE file in this module's root directory.
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2020-2023 Polyhedral Development
|
||||
* Copyright (c) 2020-2025 Polyhedral Development
|
||||
*
|
||||
* The Terra Core Addons are licensed under the terms of the MIT License. For more details,
|
||||
* reference the LICENSE file in this module's root directory.
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2020-2023 Polyhedral Development
|
||||
* Copyright (c) 2020-2025 Polyhedral Development
|
||||
*
|
||||
* The Terra Core Addons are licensed under the terms of the MIT License. For more details,
|
||||
* reference the LICENSE file in this module's root directory.
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2020-2023 Polyhedral Development
|
||||
* Copyright (c) 2020-2025 Polyhedral Development
|
||||
*
|
||||
* The Terra Core Addons are licensed under the terms of the MIT License. For more details,
|
||||
* reference the LICENSE file in this module's root directory.
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2020-2023 Polyhedral Development
|
||||
* Copyright (c) 2020-2025 Polyhedral Development
|
||||
*
|
||||
* The Terra Core Addons are licensed under the terms of the MIT License. For more details,
|
||||
* reference the LICENSE file in this module's root directory.
|
||||
|
||||
+3
-2
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2020-2023 Polyhedral Development
|
||||
* Copyright (c) 2020-2025 Polyhedral Development
|
||||
*
|
||||
* The Terra Core Addons are licensed under the terms of the MIT License. For more details,
|
||||
* reference the LICENSE file in this module's root directory.
|
||||
@@ -14,6 +14,7 @@ import java.util.TreeMap;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
import com.dfsek.terra.addons.chunkgenerator.generation.math.SlantCalculationMethod;
|
||||
import com.dfsek.terra.addons.chunkgenerator.palette.PaletteHolder;
|
||||
|
||||
|
||||
@@ -21,7 +22,7 @@ public class MultipleSlantHolder extends SlantHolderImpl {
|
||||
private final NavigableMap<Double, PaletteHolder> layers;
|
||||
private final double slantThreshold;
|
||||
|
||||
MultipleSlantHolder(List<SlantHolder.Layer> slant, int slantDepth, CalculationMethod calculationMethod) {
|
||||
MultipleSlantHolder(List<SlantHolder.Layer> slant, int slantDepth, SlantCalculationMethod calculationMethod) {
|
||||
super(slantDepth, calculationMethod);
|
||||
NavigableMap<Double, PaletteHolder> layers = new TreeMap<>(
|
||||
slant.stream().collect(Collectors.toMap(SlantHolder.Layer::threshold, SlantHolder.Layer::palette)));
|
||||
|
||||
+2
-1
@@ -1,5 +1,6 @@
|
||||
package com.dfsek.terra.addons.chunkgenerator.palette.slant;
|
||||
|
||||
import com.dfsek.terra.addons.chunkgenerator.generation.math.SlantCalculationMethod;
|
||||
import com.dfsek.terra.addons.chunkgenerator.palette.PaletteHolder;
|
||||
|
||||
|
||||
@@ -7,7 +8,7 @@ final class SingleSlantHolder extends SlantHolderImpl {
|
||||
|
||||
private final SlantHolder.Layer layer;
|
||||
|
||||
public SingleSlantHolder(SlantHolder.Layer layer, int slantDepth, CalculationMethod calculationMethod) {
|
||||
public SingleSlantHolder(SlantHolder.Layer layer, int slantDepth, SlantCalculationMethod calculationMethod) {
|
||||
super(slantDepth, calculationMethod);
|
||||
this.layer = layer;
|
||||
}
|
||||
|
||||
+2
-75
@@ -2,19 +2,13 @@ package com.dfsek.terra.addons.chunkgenerator.palette.slant;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.dfsek.terra.addons.chunkgenerator.generation.math.samplers.Sampler3D;
|
||||
import com.dfsek.terra.addons.chunkgenerator.generation.math.SlantCalculationMethod;
|
||||
import com.dfsek.terra.addons.chunkgenerator.palette.PaletteHolder;
|
||||
import com.dfsek.terra.api.util.vector.Vector3;
|
||||
|
||||
|
||||
public interface SlantHolder {
|
||||
|
||||
SlantHolder EMPTY = new SlantHolder() {
|
||||
@Override
|
||||
public double calculateSlant(Sampler3D sampler, double x, double y, double z) {
|
||||
throw new UnsupportedOperationException("Empty holder should not calculate slant");
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isAboveDepth(int depth) {
|
||||
return false;
|
||||
@@ -31,7 +25,7 @@ public interface SlantHolder {
|
||||
}
|
||||
};
|
||||
|
||||
static SlantHolder of(List<SlantHolder.Layer> layers, int slantDepth, CalculationMethod calculationMethod) {
|
||||
static SlantHolder of(List<SlantHolder.Layer> layers, int slantDepth, SlantCalculationMethod calculationMethod) {
|
||||
if(layers.isEmpty()) {
|
||||
return EMPTY;
|
||||
} else if(layers.size() == 1) {
|
||||
@@ -40,8 +34,6 @@ public interface SlantHolder {
|
||||
return new MultipleSlantHolder(layers, slantDepth, calculationMethod);
|
||||
}
|
||||
|
||||
double calculateSlant(Sampler3D sampler, double x, double y, double z);
|
||||
|
||||
boolean isAboveDepth(int depth);
|
||||
|
||||
boolean isInSlantThreshold(double slant);
|
||||
@@ -49,71 +41,6 @@ public interface SlantHolder {
|
||||
PaletteHolder getPalette(double slant);
|
||||
|
||||
|
||||
enum CalculationMethod {
|
||||
DotProduct {
|
||||
private static final Vector3 DOT_PRODUCT_DIRECTION = Vector3.of(0, 1, 0);
|
||||
|
||||
private static final Vector3[] DOT_PRODUCT_SAMPLE_POINTS = {
|
||||
Vector3.of(0, 0, -DERIVATIVE_DIST),
|
||||
Vector3.of(0, 0, DERIVATIVE_DIST),
|
||||
Vector3.of(0, -DERIVATIVE_DIST, 0),
|
||||
Vector3.of(0, DERIVATIVE_DIST, 0),
|
||||
Vector3.of(-DERIVATIVE_DIST, 0, 0),
|
||||
Vector3.of(DERIVATIVE_DIST, 0, 0)
|
||||
};
|
||||
|
||||
@Override
|
||||
public double slant(Sampler3D sampler, double x, double y, double z) {
|
||||
Vector3.Mutable normalApproximation = Vector3.Mutable.of(0, 0, 0);
|
||||
for(Vector3 point : DOT_PRODUCT_SAMPLE_POINTS) {
|
||||
var scalar = -sampler.sample(x + point.getX(), y + point.getY(), z + point.getZ());
|
||||
normalApproximation.add(point.mutable().multiply(scalar));
|
||||
}
|
||||
return DOT_PRODUCT_DIRECTION.dot(normalApproximation.normalize());
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean floorToThreshold() {
|
||||
return false;
|
||||
}
|
||||
},
|
||||
|
||||
Derivative {
|
||||
@Override
|
||||
public double slant(Sampler3D sampler, double x, double y, double z) {
|
||||
double baseSample = sampler.sample(x, y, z);
|
||||
|
||||
double xVal1 = (sampler.sample(x + DERIVATIVE_DIST, y, z) - baseSample) / DERIVATIVE_DIST;
|
||||
double xVal2 = (sampler.sample(x - DERIVATIVE_DIST, y, z) - baseSample) / DERIVATIVE_DIST;
|
||||
double zVal1 = (sampler.sample(x, y, z + DERIVATIVE_DIST) - baseSample) / DERIVATIVE_DIST;
|
||||
double zVal2 = (sampler.sample(x, y, z - DERIVATIVE_DIST) - baseSample) / DERIVATIVE_DIST;
|
||||
double yVal1 = (sampler.sample(x, y + DERIVATIVE_DIST, z) - baseSample) / DERIVATIVE_DIST;
|
||||
double yVal2 = (sampler.sample(x, y - DERIVATIVE_DIST, z) - baseSample) / DERIVATIVE_DIST;
|
||||
|
||||
return Math.sqrt(
|
||||
((xVal2 - xVal1) * (xVal2 - xVal1)) + ((zVal2 - zVal1) * (zVal2 - zVal1)) + ((yVal2 - yVal1) * (yVal2 - yVal1)));
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean floorToThreshold() {
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
private static final double DERIVATIVE_DIST = 0.55;
|
||||
|
||||
public abstract double slant(Sampler3D sampler, double x, double y, double z);
|
||||
|
||||
/*
|
||||
* Controls whether palettes should be applied before or after their respective thresholds.
|
||||
*
|
||||
* If true, slant values will map to the palette of the next floor threshold, otherwise they
|
||||
* will map to the ceiling.
|
||||
*/
|
||||
public abstract boolean floorToThreshold();
|
||||
}
|
||||
|
||||
|
||||
record Layer(PaletteHolder palette, double threshold) {
|
||||
}
|
||||
}
|
||||
|
||||
+2
-9
@@ -1,26 +1,19 @@
|
||||
package com.dfsek.terra.addons.chunkgenerator.palette.slant;
|
||||
|
||||
import com.dfsek.terra.addons.chunkgenerator.generation.math.samplers.Sampler3D;
|
||||
import com.dfsek.terra.addons.chunkgenerator.generation.math.SlantCalculationMethod;
|
||||
|
||||
|
||||
public abstract class SlantHolderImpl implements SlantHolder {
|
||||
protected final boolean floorToThreshold;
|
||||
private final SlantHolder.CalculationMethod calculationMethod;
|
||||
private final int slantDepth;
|
||||
|
||||
protected SlantHolderImpl(int slantDepth, CalculationMethod calculationMethod) {
|
||||
protected SlantHolderImpl(int slantDepth, SlantCalculationMethod calculationMethod) {
|
||||
this.floorToThreshold = calculationMethod.floorToThreshold();
|
||||
this.calculationMethod = calculationMethod;
|
||||
this.slantDepth = slantDepth;
|
||||
}
|
||||
|
||||
protected abstract double getSlantThreshold();
|
||||
|
||||
@Override
|
||||
public final double calculateSlant(Sampler3D sampler, double x, double y, double z) {
|
||||
return calculationMethod.slant(sampler, x, y, z);
|
||||
}
|
||||
|
||||
@Override
|
||||
public final boolean isAboveDepth(int depth) {
|
||||
return depth <= slantDepth;
|
||||
|
||||
+5
-5
@@ -1,7 +1,7 @@
|
||||
package com.dfsek.terra.addons.commands.addons;
|
||||
|
||||
import cloud.commandframework.ArgumentDescription;
|
||||
import cloud.commandframework.CommandManager;
|
||||
import org.incendo.cloud.CommandManager;
|
||||
import org.incendo.cloud.description.Description;
|
||||
|
||||
import com.dfsek.terra.addons.manifest.api.AddonInitializer;
|
||||
import com.dfsek.terra.api.Platform;
|
||||
@@ -30,7 +30,7 @@ public class AddonsCommandAddon implements AddonInitializer {
|
||||
CommandManager<CommandSender> manager = event.getCommandManager();
|
||||
|
||||
manager.command(
|
||||
manager.commandBuilder("addons", ArgumentDescription.of("List installed Terra addons"))
|
||||
manager.commandBuilder("addons", Description.of("List installed Terra addons"))
|
||||
.permission("terra.addons")
|
||||
.handler(context -> {
|
||||
StringBuilder addons = new StringBuilder("Installed addons:\n");
|
||||
@@ -41,7 +41,7 @@ public class AddonsCommandAddon implements AddonInitializer {
|
||||
.append('@')
|
||||
.append(addon.getVersion().getFormatted())
|
||||
.append('\n'));
|
||||
context.getSender().sendMessage(addons.toString());
|
||||
context.sender().sendMessage(addons.toString());
|
||||
})
|
||||
)
|
||||
.command(
|
||||
@@ -61,7 +61,7 @@ public class AddonsCommandAddon implements AddonInitializer {
|
||||
.append('@')
|
||||
.append(versions.getFormatted())
|
||||
.append('\n'));
|
||||
context.getSender().sendMessage(addonInfo.toString());
|
||||
context.sender().sendMessage(addonInfo.toString());
|
||||
})
|
||||
);
|
||||
});
|
||||
|
||||
+10
-10
@@ -1,7 +1,7 @@
|
||||
package com.dfsek.terra.addons.commands.packs;
|
||||
|
||||
import cloud.commandframework.ArgumentDescription;
|
||||
import cloud.commandframework.CommandManager;
|
||||
import org.incendo.cloud.CommandManager;
|
||||
import org.incendo.cloud.description.Description;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
@@ -35,7 +35,7 @@ public class PacksCommandAddon implements AddonInitializer {
|
||||
CommandManager<CommandSender> manager = event.getCommandManager();
|
||||
|
||||
manager.command(
|
||||
manager.commandBuilder("packs", ArgumentDescription.of("List installed config packs"))
|
||||
manager.commandBuilder("packs", Description.of("List installed config packs"))
|
||||
.permission("terra.packs")
|
||||
.handler(context -> {
|
||||
StringBuilder packs = new StringBuilder("Installed packs:\n");
|
||||
@@ -43,12 +43,12 @@ public class PacksCommandAddon implements AddonInitializer {
|
||||
.append(pack.getID())
|
||||
.append('@')
|
||||
.append(pack.getVersion().getFormatted()));
|
||||
context.getSender().sendMessage(packs.toString());
|
||||
context.sender().sendMessage(packs.toString());
|
||||
})
|
||||
)
|
||||
.command(
|
||||
manager.commandBuilder("packs")
|
||||
.literal("info", ArgumentDescription.of("Get information about a pack"))
|
||||
.literal("info", Description.of("Get information about a pack"))
|
||||
.permission("terra.packs.info")
|
||||
.argument(RegistryArgument.of("pack", platform.getConfigRegistry()))
|
||||
.handler(context -> {
|
||||
@@ -65,21 +65,21 @@ public class PacksCommandAddon implements AddonInitializer {
|
||||
.append('@')
|
||||
.append(versions.getFormatted())
|
||||
.append('\n'));
|
||||
context.getSender().sendMessage(packInfo.toString());
|
||||
context.sender().sendMessage(packInfo.toString());
|
||||
}))
|
||||
.command(
|
||||
manager.commandBuilder("packs")
|
||||
.literal("reload", ArgumentDescription.of("Reload config packs"))
|
||||
.literal("reload", Description.of("Reload config packs"))
|
||||
.permission("terra.packs.reload")
|
||||
.handler(context -> {
|
||||
context.getSender().sendMessage("Reloading Terra...");
|
||||
context.sender().sendMessage("Reloading Terra...");
|
||||
logger.info("Reloading Terra...");
|
||||
if(platform.reload()) {
|
||||
logger.info("Terra reloaded successfully.");
|
||||
context.getSender().sendMessage("Terra reloaded successfully.");
|
||||
context.sender().sendMessage("Terra reloaded successfully.");
|
||||
} else {
|
||||
logger.error("Terra failed to reload.");
|
||||
context.getSender().sendMessage(
|
||||
context.sender().sendMessage(
|
||||
"Terra failed to reload. See logs for more information.");
|
||||
}
|
||||
}));
|
||||
|
||||
+14
-14
@@ -1,7 +1,7 @@
|
||||
package com.dfsek.terra.addons.commands.profiler;
|
||||
|
||||
import cloud.commandframework.ArgumentDescription;
|
||||
import cloud.commandframework.CommandManager;
|
||||
import org.incendo.cloud.CommandManager;
|
||||
import org.incendo.cloud.description.Description;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
@@ -33,24 +33,24 @@ public class ProfilerCommandAddon implements AddonInitializer {
|
||||
CommandManager<CommandSender> manager = event.getCommandManager();
|
||||
manager
|
||||
.command(
|
||||
manager.commandBuilder("profiler", ArgumentDescription.of("Access the profiler"))
|
||||
.literal("start", ArgumentDescription.of("Start profiling"), "st")
|
||||
manager.commandBuilder("profiler", Description.of("Access the profiler"))
|
||||
.literal("start", Description.of("Start profiling"), "st")
|
||||
.permission("terra.profiler.start")
|
||||
.handler(context -> {
|
||||
platform.getProfiler().start();
|
||||
context.getSender().sendMessage("Profiling started.");
|
||||
context.sender().sendMessage("Profiling started.");
|
||||
}))
|
||||
.command(
|
||||
manager.commandBuilder("profiler", ArgumentDescription.of("Access the profiler"))
|
||||
.literal("stop", ArgumentDescription.of("Stop profiling"), "s")
|
||||
manager.commandBuilder("profiler", Description.of("Access the profiler"))
|
||||
.literal("stop", Description.of("Stop profiling"), "s")
|
||||
.permission("terra.profiler.stop")
|
||||
.handler(context -> {
|
||||
platform.getProfiler().stop();
|
||||
context.getSender().sendMessage("Profiling stopped.");
|
||||
context.sender().sendMessage("Profiling stopped.");
|
||||
}))
|
||||
.command(
|
||||
manager.commandBuilder("profiler", ArgumentDescription.of("Access the profiler"))
|
||||
.literal("query", ArgumentDescription.of("Query profiler results"), "q")
|
||||
manager.commandBuilder("profiler", Description.of("Access the profiler"))
|
||||
.literal("query", Description.of("Query profiler results"), "q")
|
||||
.permission("terra.profiler.query")
|
||||
.handler(context -> {
|
||||
StringBuilder data = new StringBuilder("Terra Profiler data: \n");
|
||||
@@ -59,15 +59,15 @@ public class ProfilerCommandAddon implements AddonInitializer {
|
||||
.append(timings.toString())
|
||||
.append('\n'));
|
||||
logger.info(data.toString());
|
||||
context.getSender().sendMessage("Profiling data dumped to console.");
|
||||
context.sender().sendMessage("Profiling data dumped to console.");
|
||||
}))
|
||||
.command(
|
||||
manager.commandBuilder("profiler", ArgumentDescription.of("Access the profiler"))
|
||||
.literal("reset", ArgumentDescription.of("Reset the profiler"), "r")
|
||||
manager.commandBuilder("profiler", Description.of("Access the profiler"))
|
||||
.literal("reset", Description.of("Reset the profiler"), "r")
|
||||
.permission("terra.profiler.reset")
|
||||
.handler(context -> {
|
||||
platform.getProfiler().reset();
|
||||
context.getSender().sendMessage("Profiler reset.");
|
||||
context.sender().sendMessage("Profiler reset.");
|
||||
}));
|
||||
});
|
||||
}
|
||||
|
||||
+12
-11
@@ -1,10 +1,11 @@
|
||||
package com.dfsek.terra.addons.commands.structure;
|
||||
|
||||
import cloud.commandframework.ArgumentDescription;
|
||||
import cloud.commandframework.CommandManager;
|
||||
import cloud.commandframework.arguments.standard.EnumArgument;
|
||||
import cloud.commandframework.arguments.standard.LongArgument;
|
||||
import cloud.commandframework.context.CommandContext;
|
||||
import org.incendo.cloud.CommandManager;
|
||||
import org.incendo.cloud.component.DefaultValue;
|
||||
import org.incendo.cloud.context.CommandContext;
|
||||
import org.incendo.cloud.description.Description;
|
||||
import org.incendo.cloud.parser.standard.EnumParser;
|
||||
import org.incendo.cloud.parser.standard.LongParser;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
@@ -31,7 +32,7 @@ public class StructureCommandAddon implements AddonInitializer {
|
||||
private BaseAddon addon;
|
||||
|
||||
private static Registry<Structure> getStructureRegistry(CommandContext<CommandSender> sender) {
|
||||
return sender.getSender().getEntity().orElseThrow().world().getPack().getRegistry(Structure.class);
|
||||
return sender.sender().getEntity().orElseThrow().world().getPack().getRegistry(Structure.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -43,16 +44,16 @@ public class StructureCommandAddon implements AddonInitializer {
|
||||
CommandManager<CommandSender> manager = event.getCommandManager();
|
||||
|
||||
manager.command(
|
||||
manager.commandBuilder("structures", ArgumentDescription.of("Manage or generate structures"))
|
||||
manager.commandBuilder("structures", Description.of("Manage or generate structures"))
|
||||
.literal("generate")
|
||||
.argument(RegistryArgument.builder("structure",
|
||||
.optional(RegistryArgument.builder("structure",
|
||||
StructureCommandAddon::getStructureRegistry,
|
||||
TypeKey.of(Structure.class)))
|
||||
.argument(LongArgument.optional("seed", 0))
|
||||
.argument(EnumArgument.optional(Rotation.class, "rotation", Rotation.NONE))
|
||||
.optional("seed", LongParser.longParser(), DefaultValue.constant(0L))
|
||||
.optional("rotation", EnumParser.enumParser(Rotation.class), DefaultValue.constant(Rotation.NONE))
|
||||
.handler(context -> {
|
||||
Structure structure = context.get("structure");
|
||||
Entity sender = context.getSender().getEntity().orElseThrow();
|
||||
Entity sender = context.sender().getEntity().orElseThrow();
|
||||
structure.generate(
|
||||
sender.position().toInt(),
|
||||
sender.world(),
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user