mirror of
https://github.com/PolyhedralDev/Terra.git
synced 2026-05-20 16:50:28 +00:00
Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 8d01059833 | |||
| 500cf3c0b5 | |||
| 0507978c87 |
+3
-4
@@ -1,14 +1,13 @@
|
||||
# Global owners, automatically request review when pull request is submitted
|
||||
* @dfsek @solonovamax @duplexsystem @astrsh @justaureus
|
||||
* @dfsek @solonovamax @duplexsystem @Astrashh @justaureus
|
||||
|
||||
# Platforms
|
||||
/platforms/ @dfsek @solonovamax @duplexsystem @justaureus
|
||||
/platforms/bukkit @dfsek @solonovamax @duplexsystem @justaureus @OakLoaf
|
||||
|
||||
# Common
|
||||
/common/ @dfsek @solonovamax @duplexsystem @astrsh
|
||||
/common/ @dfsek @solonovamax @duplexsystem @Astrashh
|
||||
|
||||
# Gradle Stuff
|
||||
/buildSrc/ @dfsek @solonovamax @duplexsystem
|
||||
*.gradle.kts @dfsek @solonovamax @duplexsystem
|
||||
/gradle/ @dfsek @solonovamax @duplexsystem
|
||||
/gradle/ @dfsek @solonovamax @duplexsystem
|
||||
@@ -17,16 +17,16 @@ jobs:
|
||||
contents: read
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4.2.2
|
||||
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
|
||||
- name: Set up JDK 21
|
||||
uses: actions/setup-java@v4.7.1
|
||||
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@v3.0.1
|
||||
- uses: burrunan/gradle-cache-action@03c71a8ba93d670980695505f48f49daf43704a6
|
||||
name: Build Terra
|
||||
with:
|
||||
# Specifies arguments for Gradle execution
|
||||
@@ -44,4 +44,4 @@ jobs:
|
||||
# Properties are passed as -Pname=value
|
||||
properties: |
|
||||
kotlin.js.compiler=ir
|
||||
kotlin.parallel.tasks.in.project=true
|
||||
kotlin.parallel.tasks.in.project=true
|
||||
@@ -1,6 +1,6 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2020-2025 Polyhedral Development
|
||||
Copyright (c) 2020-2023 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
|
||||
|
||||
+4
-6
@@ -1,8 +1,8 @@
|
||||
preRelease(true)
|
||||
|
||||
versionProjects(":common:api", version("6.6.5"))
|
||||
versionProjects(":common:implementation", version("6.6.5"))
|
||||
versionProjects(":platforms", version("6.6.5"))
|
||||
versionProjects(":common:api", version("6.5.0"))
|
||||
versionProjects(":common:implementation", version("6.5.0"))
|
||||
versionProjects(":platforms", version("6.5.0"))
|
||||
|
||||
|
||||
allprojects {
|
||||
@@ -15,7 +15,6 @@ allprojects {
|
||||
tasks.withType<JavaCompile>().configureEach {
|
||||
options.isFork = true
|
||||
options.isIncremental = true
|
||||
options.release.set(21)
|
||||
}
|
||||
|
||||
tasks.withType<Test>().configureEach {
|
||||
@@ -44,9 +43,8 @@ afterEvaluate {
|
||||
configureDistribution()
|
||||
}
|
||||
project(":platforms:bukkit:common").configureDistribution()
|
||||
project(":platforms:minestom:example").configureDistribution()
|
||||
forSubProjects(":common:addons") {
|
||||
apply(plugin = "com.gradleup.shadow")
|
||||
apply(plugin = "com.github.johnrengelman.shadow")
|
||||
|
||||
tasks.named("build") {
|
||||
finalizedBy(tasks.named("shadowJar"))
|
||||
|
||||
@@ -6,12 +6,6 @@ plugins {
|
||||
repositories {
|
||||
mavenCentral()
|
||||
gradlePluginPortal()
|
||||
maven("https://maven.solo-studios.ca/releases") {
|
||||
name = "Solo Studios"
|
||||
}
|
||||
maven("https://maven.solo-studios.ca/snapshots") {
|
||||
name = "Solo Studios"
|
||||
}
|
||||
maven("https://repo.codemc.org/repository/maven-public") {
|
||||
name = "CodeMC"
|
||||
}
|
||||
@@ -22,11 +16,11 @@ repositories {
|
||||
|
||||
dependencies {
|
||||
//TODO Allow pulling from Versions.kt
|
||||
implementation("com.gradleup.shadow", "shadow-gradle-plugin", "8.3.6")
|
||||
implementation("com.github.johnrengelman", "shadow", "8.1.1")
|
||||
implementation("io.papermc.paperweight.userdev", "io.papermc.paperweight.userdev.gradle.plugin", "1.7.1")
|
||||
|
||||
implementation("io.papermc.paperweight.userdev", "io.papermc.paperweight.userdev.gradle.plugin", "2.0.0-beta.17")
|
||||
implementation("org.ow2.asm", "asm", "9.8")
|
||||
implementation("org.ow2.asm", "asm-tree", "9.8")
|
||||
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.4")
|
||||
implementation("org.yaml", "snakeyaml", "2.2")
|
||||
}
|
||||
@@ -30,12 +30,6 @@ fun Project.configureDependencies() {
|
||||
repositories {
|
||||
mavenCentral()
|
||||
gradlePluginPortal()
|
||||
maven("https://maven.solo-studios.ca/releases") {
|
||||
name = "Solo Studios"
|
||||
}
|
||||
maven("https://maven.solo-studios.ca/snapshots") {
|
||||
name = "Solo Studios"
|
||||
}
|
||||
maven("https://maven.fabricmc.net/") {
|
||||
name = "FabricMC"
|
||||
}
|
||||
@@ -54,26 +48,11 @@ fun Project.configureDependencies() {
|
||||
maven("https://jitpack.io") {
|
||||
name = "JitPack"
|
||||
}
|
||||
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"
|
||||
}
|
||||
maven("https://repo.onarandombox.com/multiverse-releases") {
|
||||
name = "onarandombox"
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
testImplementation("org.junit.jupiter", "junit-jupiter", Versions.Libraries.Internal.junit)
|
||||
"testRuntimeOnly"("org.junit.platform", "junit-platform-launcher")
|
||||
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", Versions.Libraries.Internal.guava)
|
||||
|
||||
@@ -4,11 +4,9 @@ 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
|
||||
@@ -21,38 +19,16 @@ 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.gradleup.shadow")
|
||||
apply(plugin = "com.github.johnrengelman.shadow")
|
||||
|
||||
val downloadDefaultPacks = tasks.create("downloadDefaultPacks") {
|
||||
group = "terra"
|
||||
doFirst {
|
||||
try {
|
||||
file("${buildDir}/resources/main/packs/").deleteRecursively()
|
||||
val defaultPackUrl =
|
||||
URL("https://github.com/PolyhedralDev/TerraOverworldConfig/releases/download/" + Versions.Terra.overworldConfig + "/default.zip")
|
||||
downloadPack(defaultPackUrl, project)
|
||||
} catch (_:Exception) {}
|
||||
file("${buildDir}/resources/main/packs/").deleteRecursively()
|
||||
val defaultPackUrl = URL("https://github.com/PolyhedralDev/TerraOverworldConfig/releases/download/" + Versions.Terra.overworldConfig + "/default.zip")
|
||||
downloadPack(defaultPackUrl, project)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -71,17 +47,25 @@ fun Project.configureDistribution() {
|
||||
doLast {
|
||||
// https://github.com/johnrengelman/shadow/issues/111
|
||||
val dest = tasks.named<ShadowJar>("shadowJar").get().archiveFile.get().path
|
||||
installAddonsInto(dest)
|
||||
}
|
||||
}
|
||||
|
||||
tasks.create("installAddonsIntoDefaultJar") {
|
||||
group = "terra"
|
||||
dependsOn(compileAddons)
|
||||
|
||||
doLast {
|
||||
val dest = tasks.named<Jar>("jar").get().archiveFile.get().path
|
||||
installAddonsInto(dest)
|
||||
|
||||
|
||||
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)
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -148,6 +132,7 @@ 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,35 +1,33 @@
|
||||
object Versions {
|
||||
object Terra {
|
||||
const val overworldConfig = "v1.5.2"
|
||||
const val overworldConfig = "v1.3.4"
|
||||
}
|
||||
|
||||
object Libraries {
|
||||
const val tectonic = "4.2.1"
|
||||
const val paralithic = "0.8.1"
|
||||
const val paralithic = "0.7.1"
|
||||
const val strata = "1.3.2"
|
||||
|
||||
const val cloud = "2.0.0"
|
||||
const val cloud = "1.8.4"
|
||||
|
||||
const val caffeine = "3.2.1"
|
||||
const val caffeine = "3.1.8"
|
||||
|
||||
const val slf4j = "2.0.17"
|
||||
const val slf4j = "2.0.13"
|
||||
|
||||
object Internal {
|
||||
const val shadow = "8.3.6"
|
||||
const val apacheText = "1.13.1"
|
||||
const val apacheIO = "2.19.0"
|
||||
const val guava = "33.4.8-jre"
|
||||
const val asm = "9.8"
|
||||
const val snakeYml = "2.4"
|
||||
const val jetBrainsAnnotations = "26.0.2"
|
||||
const val junit = "5.13.1"
|
||||
const val nbt = "6.1"
|
||||
const val shadow = "8.1.1"
|
||||
const val apacheText = "1.12.0"
|
||||
const val apacheIO = "2.16.1"
|
||||
const val guava = "33.1.0-jre"
|
||||
const val asm = "9.7"
|
||||
const val snakeYml = "2.2"
|
||||
const val jetBrainsAnnotations = "24.1.0"
|
||||
const val junit = "5.10.2"
|
||||
}
|
||||
}
|
||||
|
||||
object Fabric {
|
||||
const val fabricAPI = "0.128.1+${Mod.minecraft}"
|
||||
const val cloud = "2.0.0-beta.11"
|
||||
const val fabricAPI = "0.97.8+${Mod.minecraft}"
|
||||
}
|
||||
//
|
||||
// object Quilt {
|
||||
@@ -38,16 +36,14 @@ object Versions {
|
||||
// }
|
||||
|
||||
object Mod {
|
||||
const val mixin = "0.15.5+mixin.0.8.7"
|
||||
const val mixinExtras = "0.4.1"
|
||||
const val mixin = "0.12.5+mixin.0.8.5"
|
||||
|
||||
const val minecraft = "1.21.7"
|
||||
const val minecraft = "1.20.6"
|
||||
const val yarn = "$minecraft+build.1"
|
||||
const val fabricLoader = "0.16.14"
|
||||
const val fabricLoader = "0.15.10"
|
||||
|
||||
const val architecuryLoom = "1.10.431"
|
||||
const val architecturyPlugin = "3.4.161"
|
||||
|
||||
const val architecuryLoom = "1.6.395"
|
||||
const val architecturyPlugin = "3.4.155"
|
||||
}
|
||||
//
|
||||
// object Forge {
|
||||
@@ -56,19 +52,17 @@ object Versions {
|
||||
// }
|
||||
|
||||
object Bukkit {
|
||||
const val minecraft = "1.21.7-R0.1"
|
||||
const val paperBuild = "$minecraft-20250630.144242-1"
|
||||
const val minecraft = "1.20.6"
|
||||
const val paperBuild = "$minecraft-R0.1-20240602.222958-107"
|
||||
const val paper = paperBuild
|
||||
const val paperLib = "1.0.8"
|
||||
const val reflectionRemapper = "0.1.2"
|
||||
const val paperDevBundle = paperBuild
|
||||
const val runPaper = "2.3.1"
|
||||
const val paperWeight = "2.0.0-beta.17"
|
||||
const val cloud = "2.0.0-beta.11"
|
||||
const val multiverse = "5.0.2"
|
||||
const val reflectionRemapper = "0.1.1"
|
||||
const val paperDevBundle = "$minecraft-R0.1-20240601.143523-105"
|
||||
const val runPaper = "2.3.0"
|
||||
const val paperWeight = "1.7.1"
|
||||
}
|
||||
|
||||
//
|
||||
//
|
||||
// object Sponge {
|
||||
// const val sponge = "9.0.0-SNAPSHOT"
|
||||
// const val mixin = "0.8.2"
|
||||
@@ -76,18 +70,7 @@ object Versions {
|
||||
// }
|
||||
//
|
||||
object CLI {
|
||||
const val logback = "1.5.18"
|
||||
const val picocli = "4.7.7"
|
||||
const val nbt = "6.1"
|
||||
const val logback = "1.4.14"
|
||||
}
|
||||
|
||||
object Allay {
|
||||
const val api = "0.4.1"
|
||||
const val gson = "2.13.1"
|
||||
const val mappings = "3626653"
|
||||
const val mappingsGenerator = "366618e"
|
||||
}
|
||||
|
||||
object Minestom {
|
||||
const val minestom = "1_21_6-c3ccee696b"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2020-2025 Polyhedral Development
|
||||
Copyright (c) 2020-2023 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-2025 Polyhedral Development
|
||||
* 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.
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2020-2025 Polyhedral Development
|
||||
* 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.
|
||||
|
||||
+2
-2
@@ -1,9 +1,9 @@
|
||||
package com.dfsek.terra.addons.biome.extrusion.api;
|
||||
|
||||
import com.dfsek.terra.api.world.biome.Biome;
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
import com.dfsek.terra.api.world.biome.Biome;
|
||||
|
||||
|
||||
public interface Extrusion {
|
||||
Biome extrude(Biome original, int x, int y, int z, long seed);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2020-2025 Polyhedral Development
|
||||
Copyright (c) 2020-2023 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-2025 Polyhedral Development
|
||||
* 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.
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2020-2025 Polyhedral Development
|
||||
* 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.
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2020-2025 Polyhedral Development
|
||||
* 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.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2020-2025 Polyhedral Development
|
||||
Copyright (c) 2020-2023 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-2025 Polyhedral Development
|
||||
* 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.
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2020-2025 Polyhedral Development
|
||||
* 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.
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2020-2025 Polyhedral Development
|
||||
* 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.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2020-2025 Polyhedral Development
|
||||
Copyright (c) 2020-2023 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-2025 Polyhedral Development
|
||||
* 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.
|
||||
|
||||
+3
-4
@@ -1,7 +1,5 @@
|
||||
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;
|
||||
|
||||
@@ -13,6 +11,7 @@ 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;
|
||||
@@ -24,7 +23,7 @@ import com.dfsek.terra.api.world.biome.generation.BiomeProvider;
|
||||
|
||||
public class PipelineBiomeProvider implements BiomeProvider {
|
||||
|
||||
private final LoadingCache<SeededVector2Key, BiomeChunk> biomeChunkCache;
|
||||
private final LoadingCache<SeededVector, BiomeChunk> biomeChunkCache;
|
||||
private final int chunkSize;
|
||||
private final int resolution;
|
||||
private final NoiseSampler mutator;
|
||||
@@ -91,7 +90,7 @@ public class PipelineBiomeProvider implements BiomeProvider {
|
||||
int xInChunk = x - chunkWorldX;
|
||||
int zInChunk = z - chunkWorldZ;
|
||||
|
||||
return biomeChunkCache.get(new SeededVector2Key(chunkWorldX, chunkWorldZ, seed)).get(xInChunk, zInChunk).getBiome();
|
||||
return biomeChunkCache.get(new SeededVector(seed, chunkWorldX, chunkWorldZ)).get(xInChunk, zInChunk).getBiome();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+1
-3
@@ -1,12 +1,10 @@
|
||||
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(SeededVector2Key worldCoordinates);
|
||||
BiomeChunk generateChunk(SeededVector worldCoordinates);
|
||||
|
||||
int getChunkSize();
|
||||
|
||||
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
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-2025 Polyhedral Development
|
||||
* 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.
|
||||
@@ -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-2025 Polyhedral Development
|
||||
* 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.
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2020-2025 Polyhedral Development
|
||||
* 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.
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2020-2025 Polyhedral Development
|
||||
* 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.
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2020-2025 Polyhedral Development
|
||||
* 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.
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2020-2025 Polyhedral Development
|
||||
* 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.
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2020-2025 Polyhedral Development
|
||||
* 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.
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2020-2025 Polyhedral Development
|
||||
* 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.
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2020-2025 Polyhedral Development
|
||||
* 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.
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2020-2025 Polyhedral Development
|
||||
* 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.
|
||||
|
||||
+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 SeededVector2Key worldOrigin;
|
||||
private final SeededVector worldOrigin;
|
||||
private final int chunkOriginArrayIndex;
|
||||
private final int worldCoordinateScale;
|
||||
private final int size;
|
||||
private PipelineBiome[] biomes;
|
||||
|
||||
public BiomeChunkImpl(SeededVector2Key worldOrigin, PipelineImpl pipeline) {
|
||||
public BiomeChunkImpl(SeededVector 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 SeededVector2Key getOrigin() {
|
||||
private SeededVector getOrigin() {
|
||||
return worldOrigin;
|
||||
}
|
||||
|
||||
@@ -216,7 +216,7 @@ public class BiomeChunkImpl implements BiomeChunk {
|
||||
}
|
||||
|
||||
public long worldSeed() {
|
||||
return chunk.getOrigin().seed;
|
||||
return chunk.getOrigin().seed();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+2
-3
@@ -1,7 +1,5 @@
|
||||
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;
|
||||
|
||||
@@ -10,6 +8,7 @@ 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;
|
||||
|
||||
@@ -56,7 +55,7 @@ public class PipelineImpl implements Pipeline {
|
||||
}
|
||||
|
||||
@Override
|
||||
public BiomeChunk generateChunk(SeededVector2Key worldCoordinates) {
|
||||
public BiomeChunk generateChunk(SeededVector worldCoordinates) {
|
||||
return new BiomeChunkImpl(worldCoordinates, this);
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2020-2025 Polyhedral Development
|
||||
* 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.
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2020-2025 Polyhedral Development
|
||||
* 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.
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2020-2025 Polyhedral Development
|
||||
* 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.
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2020-2025 Polyhedral Development
|
||||
* 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.
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2020-2025 Polyhedral Development
|
||||
* 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.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2020-2025 Polyhedral Development
|
||||
Copyright (c) 2020-2023 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-2025 Polyhedral Development
|
||||
* 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.
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2020-2025 Polyhedral Development
|
||||
* 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.
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2020-2025 Polyhedral Development
|
||||
* 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.
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2020-2025 Polyhedral Development
|
||||
* 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.
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2020-2025 Polyhedral Development
|
||||
* 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.
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2020-2025 Polyhedral Development
|
||||
* 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.
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2020-2025 Polyhedral Development
|
||||
* 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.
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2020-2025 Polyhedral Development
|
||||
* 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.
|
||||
|
||||
+2
-2
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2020-2025 Polyhedral Development
|
||||
* 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.
|
||||
@@ -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-2025 Polyhedral Development
|
||||
* 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.
|
||||
@@ -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-2025 Polyhedral Development
|
||||
* 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.
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2020-2025 Polyhedral Development
|
||||
* 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.
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2020-2025 Polyhedral Development
|
||||
* 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.
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2020-2025 Polyhedral Development
|
||||
* 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.
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2020-2025 Polyhedral Development
|
||||
* 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.
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2020-2025 Polyhedral Development
|
||||
* 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.
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2020-2025 Polyhedral Development
|
||||
* 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.
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2020-2025 Polyhedral Development
|
||||
* 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.
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2020-2025 Polyhedral Development
|
||||
* 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.
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2020-2025 Polyhedral Development
|
||||
* 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.
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2020-2025 Polyhedral Development
|
||||
* 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.
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2020-2025 Polyhedral Development
|
||||
* 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.
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2020-2025 Polyhedral Development
|
||||
* 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.
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2020-2025 Polyhedral Development
|
||||
* 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.
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2020-2025 Polyhedral Development
|
||||
* 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.
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2020-2025 Polyhedral Development
|
||||
* 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.
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2020-2025 Polyhedral Development
|
||||
* 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.
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2020-2025 Polyhedral Development
|
||||
* 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.
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2020-2025 Polyhedral Development
|
||||
* 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.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2020-2025 Polyhedral Development
|
||||
Copyright (c) 2020-2023 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-2025 Polyhedral Development
|
||||
* 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.
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2020-2025 Polyhedral Development
|
||||
* 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.
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2020-2025 Polyhedral Development
|
||||
* 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.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2020-2025 Polyhedral Development
|
||||
Copyright (c) 2020-2023 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-2025 Polyhedral Development
|
||||
* 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.
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2020-2025 Polyhedral Development
|
||||
* 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.
|
||||
|
||||
+5
-3
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2020-2025 Polyhedral Development
|
||||
* 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.
|
||||
@@ -8,15 +8,17 @@
|
||||
package com.dfsek.terra.addons.chunkgenerator.generation;
|
||||
|
||||
|
||||
import com.dfsek.terra.addons.chunkgenerator.palette.slant.SlantHolder;
|
||||
|
||||
import com.dfsek.terra.addons.chunkgenerator.generation.math.SlantCalculationMethod;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import com.dfsek.terra.addons.chunkgenerator.config.noise.BiomeNoiseProperties;
|
||||
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;
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2020-2025 Polyhedral Development
|
||||
* 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.
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2020-2025 Polyhedral Development
|
||||
* 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.
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2020-2025 Polyhedral Development
|
||||
* 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.
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2020-2025 Polyhedral Development
|
||||
* 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.
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2020-2025 Polyhedral Development
|
||||
* 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.
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2020-2025 Polyhedral Development
|
||||
* 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.
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2020-2025 Polyhedral Development
|
||||
* 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.
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2020-2025 Polyhedral Development
|
||||
* 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.
|
||||
|
||||
+5
-5
@@ -1,7 +1,7 @@
|
||||
package com.dfsek.terra.addons.commands.addons;
|
||||
|
||||
import org.incendo.cloud.CommandManager;
|
||||
import org.incendo.cloud.description.Description;
|
||||
import cloud.commandframework.ArgumentDescription;
|
||||
import cloud.commandframework.CommandManager;
|
||||
|
||||
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", Description.of("List installed Terra addons"))
|
||||
manager.commandBuilder("addons", ArgumentDescription.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.sender().sendMessage(addons.toString());
|
||||
context.getSender().sendMessage(addons.toString());
|
||||
})
|
||||
)
|
||||
.command(
|
||||
@@ -61,7 +61,7 @@ public class AddonsCommandAddon implements AddonInitializer {
|
||||
.append('@')
|
||||
.append(versions.getFormatted())
|
||||
.append('\n'));
|
||||
context.sender().sendMessage(addonInfo.toString());
|
||||
context.getSender().sendMessage(addonInfo.toString());
|
||||
})
|
||||
);
|
||||
});
|
||||
|
||||
+10
-10
@@ -1,7 +1,7 @@
|
||||
package com.dfsek.terra.addons.commands.packs;
|
||||
|
||||
import org.incendo.cloud.CommandManager;
|
||||
import org.incendo.cloud.description.Description;
|
||||
import cloud.commandframework.ArgumentDescription;
|
||||
import cloud.commandframework.CommandManager;
|
||||
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", Description.of("List installed config packs"))
|
||||
manager.commandBuilder("packs", ArgumentDescription.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.sender().sendMessage(packs.toString());
|
||||
context.getSender().sendMessage(packs.toString());
|
||||
})
|
||||
)
|
||||
.command(
|
||||
manager.commandBuilder("packs")
|
||||
.literal("info", Description.of("Get information about a pack"))
|
||||
.literal("info", ArgumentDescription.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.sender().sendMessage(packInfo.toString());
|
||||
context.getSender().sendMessage(packInfo.toString());
|
||||
}))
|
||||
.command(
|
||||
manager.commandBuilder("packs")
|
||||
.literal("reload", Description.of("Reload config packs"))
|
||||
.literal("reload", ArgumentDescription.of("Reload config packs"))
|
||||
.permission("terra.packs.reload")
|
||||
.handler(context -> {
|
||||
context.sender().sendMessage("Reloading Terra...");
|
||||
context.getSender().sendMessage("Reloading Terra...");
|
||||
logger.info("Reloading Terra...");
|
||||
if(platform.reload()) {
|
||||
logger.info("Terra reloaded successfully.");
|
||||
context.sender().sendMessage("Terra reloaded successfully.");
|
||||
context.getSender().sendMessage("Terra reloaded successfully.");
|
||||
} else {
|
||||
logger.error("Terra failed to reload.");
|
||||
context.sender().sendMessage(
|
||||
context.getSender().sendMessage(
|
||||
"Terra failed to reload. See logs for more information.");
|
||||
}
|
||||
}));
|
||||
|
||||
+14
-14
@@ -1,7 +1,7 @@
|
||||
package com.dfsek.terra.addons.commands.profiler;
|
||||
|
||||
import org.incendo.cloud.CommandManager;
|
||||
import org.incendo.cloud.description.Description;
|
||||
import cloud.commandframework.ArgumentDescription;
|
||||
import cloud.commandframework.CommandManager;
|
||||
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", Description.of("Access the profiler"))
|
||||
.literal("start", Description.of("Start profiling"), "st")
|
||||
manager.commandBuilder("profiler", ArgumentDescription.of("Access the profiler"))
|
||||
.literal("start", ArgumentDescription.of("Start profiling"), "st")
|
||||
.permission("terra.profiler.start")
|
||||
.handler(context -> {
|
||||
platform.getProfiler().start();
|
||||
context.sender().sendMessage("Profiling started.");
|
||||
context.getSender().sendMessage("Profiling started.");
|
||||
}))
|
||||
.command(
|
||||
manager.commandBuilder("profiler", Description.of("Access the profiler"))
|
||||
.literal("stop", Description.of("Stop profiling"), "s")
|
||||
manager.commandBuilder("profiler", ArgumentDescription.of("Access the profiler"))
|
||||
.literal("stop", ArgumentDescription.of("Stop profiling"), "s")
|
||||
.permission("terra.profiler.stop")
|
||||
.handler(context -> {
|
||||
platform.getProfiler().stop();
|
||||
context.sender().sendMessage("Profiling stopped.");
|
||||
context.getSender().sendMessage("Profiling stopped.");
|
||||
}))
|
||||
.command(
|
||||
manager.commandBuilder("profiler", Description.of("Access the profiler"))
|
||||
.literal("query", Description.of("Query profiler results"), "q")
|
||||
manager.commandBuilder("profiler", ArgumentDescription.of("Access the profiler"))
|
||||
.literal("query", ArgumentDescription.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.sender().sendMessage("Profiling data dumped to console.");
|
||||
context.getSender().sendMessage("Profiling data dumped to console.");
|
||||
}))
|
||||
.command(
|
||||
manager.commandBuilder("profiler", Description.of("Access the profiler"))
|
||||
.literal("reset", Description.of("Reset the profiler"), "r")
|
||||
manager.commandBuilder("profiler", ArgumentDescription.of("Access the profiler"))
|
||||
.literal("reset", ArgumentDescription.of("Reset the profiler"), "r")
|
||||
.permission("terra.profiler.reset")
|
||||
.handler(context -> {
|
||||
platform.getProfiler().reset();
|
||||
context.sender().sendMessage("Profiler reset.");
|
||||
context.getSender().sendMessage("Profiler reset.");
|
||||
}));
|
||||
});
|
||||
}
|
||||
|
||||
+11
-12
@@ -1,11 +1,10 @@
|
||||
package com.dfsek.terra.addons.commands.structure;
|
||||
|
||||
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 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 java.util.Random;
|
||||
|
||||
@@ -32,7 +31,7 @@ public class StructureCommandAddon implements AddonInitializer {
|
||||
private BaseAddon addon;
|
||||
|
||||
private static Registry<Structure> getStructureRegistry(CommandContext<CommandSender> sender) {
|
||||
return sender.sender().getEntity().orElseThrow().world().getPack().getRegistry(Structure.class);
|
||||
return sender.getSender().getEntity().orElseThrow().world().getPack().getRegistry(Structure.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -44,16 +43,16 @@ public class StructureCommandAddon implements AddonInitializer {
|
||||
CommandManager<CommandSender> manager = event.getCommandManager();
|
||||
|
||||
manager.command(
|
||||
manager.commandBuilder("structures", Description.of("Manage or generate structures"))
|
||||
manager.commandBuilder("structures", ArgumentDescription.of("Manage or generate structures"))
|
||||
.literal("generate")
|
||||
.optional(RegistryArgument.builder("structure",
|
||||
.argument(RegistryArgument.builder("structure",
|
||||
StructureCommandAddon::getStructureRegistry,
|
||||
TypeKey.of(Structure.class)))
|
||||
.optional("seed", LongParser.longParser(), DefaultValue.constant(0L))
|
||||
.optional("rotation", EnumParser.enumParser(Rotation.class), DefaultValue.constant(Rotation.NONE))
|
||||
.argument(LongArgument.optional("seed", 0))
|
||||
.argument(EnumArgument.optional(Rotation.class, "rotation", Rotation.NONE))
|
||||
.handler(context -> {
|
||||
Structure structure = context.get("structure");
|
||||
Entity sender = context.sender().getEntity().orElseThrow();
|
||||
Entity sender = context.getSender().getEntity().orElseThrow();
|
||||
structure.generate(
|
||||
sender.position().toInt(),
|
||||
sender.world(),
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2020-2025 Polyhedral Development
|
||||
Copyright (c) 2020-2023 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-2025 Polyhedral Development
|
||||
* 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.
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2020-2025 Polyhedral Development
|
||||
* 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.
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2020-2025 Polyhedral Development
|
||||
* 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.
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2020-2025 Polyhedral Development
|
||||
* 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.
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2020-2025 Polyhedral Development
|
||||
* 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.
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2020-2025 Polyhedral Development
|
||||
* 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.
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2020-2025 Polyhedral Development
|
||||
* 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.
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user