Compare commits

..

30 Commits

Author SHA1 Message Date
Zoë Gidiere b10fd84e00 Merge remote-tracking branch 'origin/ver/6.5.0' into dev/metapacks 2024-01-05 09:11:42 -07:00
Zoë 3e04bae828 Merge branch 'ver/6.5.0' into dev/metapacks 2023-12-24 22:39:15 -06:00
Zoë 82334cfe9e Merge branch 'ver/6.5.0' into dev/metapacks 2023-12-22 15:03:04 -06:00
Zoë Gidiere 50ba1c6eab push changes 2023-12-21 08:47:52 -07:00
Zoë Gidiere 27a967f3a6 fix build 2023-12-12 20:17:15 -07:00
Zoë Gidiere 4c71355535 Reformat 2023-12-12 19:07:57 -07:00
Zoë Gidiere e83b70b5ae generation settings 2023-12-12 18:52:31 -07:00
Zoë Gidiere 56b428d501 refactor 2023-12-12 17:19:32 -07:00
Zoë Gidiere 7ca24faad3 fix loading 2023-12-12 17:15:54 -07:00
Zoë Gidiere 9d200565d7 more fixes 2023-12-12 16:54:27 -07:00
Zoë Gidiere f6c2795eaf remove debug loging 2023-12-12 16:12:36 -07:00
Zoë Gidiere 6f03746e41 another fix 2023-12-12 16:09:08 -07:00
Zoë Gidiere 47c8cb3168 Fix up random changes 2023-12-12 16:00:56 -07:00
Zoë Gidiere a9f973cae9 WIP Random Changes 2023-12-12 15:57:04 -07:00
Zoë Gidiere 033181d7c8 more wip changes 2023-12-12 15:48:31 -07:00
Zoë Gidiere e11a235386 WIP Dim opts 2023-12-12 13:55:03 -07:00
Zoë Gidiere db1e924246 more metapack work 2023-12-12 13:35:52 -07:00
Zoë Gidiere c86faa44ec Remove netherfossiloptimization because it's no longer applicable
also it's not needed mc seems to have done this themselves
2023-12-12 13:35:24 -07:00
Zoë Gidiere de91a6facb metapack linking instead of shading 2023-12-11 23:36:05 -07:00
Zoë Gidiere d4a328eb38 who let the datadrive (the dimensions) 2023-12-11 21:14:43 -07:00
Zoë Gidiere b039629b2d WIP meta pack system 2023-12-11 16:25:13 -07:00
Zoë Gidiere d48fa96ec7 opt import 2023-12-11 14:56:07 -07:00
Zoë Gidiere 8dd1f49b88 Merge remote-tracking branch 'origin/dev/remove-loader' into dev/metapacks 2023-12-11 14:54:59 -07:00
Zoë Gidiere 81528915a8 Merge branch 'ver/6.5.0' into dev/metapacks 2023-12-11 14:54:44 -07:00
Zoë Gidiere 5979254808 wip 2023-12-11 14:54:27 -07:00
Astrash c0aaf6c6e8 Add messages to exceptions 2023-11-28 10:36:30 +11:00
Astrash 1ab3233cba Reformat code 2023-11-25 15:14:16 +11:00
Astrash 59ea5a69d8 Refactor pack loading
- Combine initial load and reload logic together between each platform implementation
- Should prevent pack load errors from blocking other packs from loading.
2023-11-25 15:10:43 +11:00
Astrash 4ba71e9c27 packDirectory -> rootPath 2023-11-25 15:07:45 +11:00
Astrash 5c7441241c Replace Loader with java.nio.files 2023-11-25 13:31:42 +11:00
749 changed files with 3075 additions and 11784 deletions
+3 -4
View File
@@ -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
+6 -6
View File
@@ -17,16 +17,16 @@ jobs:
contents: read
steps:
- uses: actions/checkout@v4.2.2
- name: Set up JDK 21
uses: actions/setup-java@v4.7.1
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
- name: Set up JDK 17
uses: actions/setup-java@387ac29b308b003ca37ba93a6cab5eb57c8f5f93
with:
java-version: '21'
java-version: '17'
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 -1
View File
@@ -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
View File
@@ -1,8 +1,8 @@
preRelease(true)
versionProjects(":common:api", version("6.6.3"))
versionProjects(":common:implementation", version("6.6.3"))
versionProjects(":platforms", version("6.6.3"))
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
View File
@@ -6,27 +6,21 @@ 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"
}
maven("https://repo.papermc.io/repository/maven-public/") {
maven("https://papermc.io/repo/repository/maven-public/") {
name = "PaperMC"
}
}
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.5.11")
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.6")
implementation("org.ow2.asm", "asm-tree", "9.6")
implementation("com.dfsek.tectonic", "common", "4.2.1")
implementation("org.yaml", "snakeyaml", "2.4")
implementation("org.yaml", "snakeyaml", "2.2")
}
@@ -22,8 +22,8 @@ fun Project.configureCompilation() {
apply<TectonicDocPlugin>()
configure<JavaPluginExtension> {
sourceCompatibility = JavaVersion.VERSION_21
targetCompatibility = JavaVersion.VERSION_21
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
tasks.withType<JavaCompile> {
+3 -21
View File
@@ -30,19 +30,13 @@ 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"
}
maven("https://repo.codemc.org/repository/maven-public") {
name = "CodeMC"
}
maven("https://repo.papermc.io/repository/maven-public/") {
maven("https://papermc.io/repo/repository/maven-public/") {
name = "PaperMC"
}
maven("https://files.minecraftforge.net/maven/") {
@@ -54,23 +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"
}
}
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)
+25 -39
View File
@@ -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,17 @@ 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 +48,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 +133,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")
+30 -45
View File
@@ -1,35 +1,34 @@
object Versions {
object Terra {
const val overworldConfig = "v1.5.1"
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.9"
const val log4j_slf4j_impl = "2.20.0"
const val slf4j = "2.0.17"
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.11.0"
const val apacheIO = "2.15.1"
const val guava = "32.1.3-jre"
const val asm = "9.6"
const val snakeYml = "2.2"
const val jetBrainsAnnotations = "24.1.0"
const val junit = "5.10.1"
}
}
object Fabric {
const val fabricAPI = "0.127.0+${Mod.minecraft}"
const val cloud = "2.0.0-beta.10"
const val fabricAPI = "0.91.2+${Mod.minecraft}"
}
//
// object Quilt {
@@ -38,16 +37,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.6"
const val minecraft = "1.20.4"
const val yarn = "$minecraft+build.1"
const val fabricLoader = "0.16.14"
const val fabricLoader = "0.15.1"
const val architecuryLoom = "1.10.431"
const val architecturyPlugin = "3.4.161"
const val architecuryLoom = "1.4.369"
const val architecturyPlugin = "3.4.151"
}
//
// object Forge {
@@ -56,18 +53,17 @@ object Versions {
// }
object Bukkit {
const val minecraft = "1.21.6-R0.1"
const val paperBuild = "$minecraft-20250617.170821-8"
const val minecraft = "1.20.4"
const val paperBuild = "$minecraft-R0.1-20231209.173338-2"
const val paper = paperBuild
const val paperLib = "1.0.8"
const val reflectionRemapper = "0.1.2"
const val reflectionRemapper = "0.1.0"
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.10"
const val runPaper = "2.2.2"
const val paperWeight = "1.5.11"
}
//
//
// object Sponge {
// const val sponge = "9.0.0-SNAPSHOT"
// const val mixin = "0.8.2"
@@ -75,18 +71,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 = "187931e50b"
}
}
}
+1 -1
View File
@@ -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,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,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,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,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,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,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
View File
@@ -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,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,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,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,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,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,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();
@@ -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)));
}
}
@@ -1,9 +1,9 @@
package com.dfsek.terra.addons.biome.pipeline.v2.api.biome;
import java.util.Set;
import com.dfsek.terra.api.world.biome.Biome;
import java.util.Set;
public final class DelegatedPipelineBiome implements PipelineBiome {
private final Biome biome;
@@ -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,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,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,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,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,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,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,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,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,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.
@@ -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();
}
}
}
@@ -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,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,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,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.
@@ -7,17 +7,17 @@
package com.dfsek.terra.addons.biome.pipeline.v2.stage.mutators;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
import java.util.stream.Stream;
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.addons.biome.pipeline.v2.pipeline.BiomeChunkImpl;
import com.dfsek.terra.api.noise.NoiseSampler;
import com.dfsek.terra.api.util.collection.ProbabilityCollection;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
import java.util.stream.Stream;
public class ReplaceListStage implements Stage {
private final Map<PipelineBiome, ProbabilityCollection<PipelineBiome>> replace;
@@ -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,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,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,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,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,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,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,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,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,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,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
@@ -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,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,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,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,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,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,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,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,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,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,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,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,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,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,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,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,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,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,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,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
View File
@@ -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,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,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,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,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.
@@ -58,8 +58,7 @@ public class NoiseChunkGenerator3DAddon implements AddonInitializer {
pack -> new NoiseChunkGenerator3D(pack, platform, config.getElevationBlend(),
config.getHorizontalRes(),
config.getVerticalRes(), noisePropertiesPropertyKey,
paletteInfoPropertyKey, config.getSlantCalculationMethod(),
config.isSlantPalettesEnabled()));
paletteInfoPropertyKey, config.getSlantCalculationMethod()));
event.getPack()
.applyLoader(SlantHolder.Layer.class, SlantLayerTemplate::new);
})
@@ -26,10 +26,6 @@ public class NoiseChunkGeneratorPackConfigTemplate implements ConfigTemplate, Pr
@Default
private @Meta SlantCalculationMethod slantCalculationMethod = SlantCalculationMethod.Derivative;
@Value("slant.disable-palettes")
@Default
private @Meta boolean disableSlantPalettes = false;
public int getElevationBlend() {
return elevationBlend;
}
@@ -45,8 +41,4 @@ public class NoiseChunkGeneratorPackConfigTemplate implements ConfigTemplate, Pr
public SlantCalculationMethod getSlantCalculationMethod() {
return slantCalculationMethod;
}
public boolean isSlantPalettesEnabled() {
return !disableSlantPalettes;
}
}
@@ -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,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;
@@ -45,13 +47,10 @@ public class NoiseChunkGenerator3D implements ChunkGenerator {
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,
SlantCalculationMethod slantCalculationMethod, boolean useSlantPalettes) {
PropertyKey<BiomePaletteInfo> paletteInfoPropertyKey, SlantCalculationMethod slantCalculationMethod) {
this.platform = platform;
this.air = platform.getWorldHandle().air();
this.carverHorizontalResolution = carverHorizontalResolution;
@@ -59,7 +58,6 @@ public class NoiseChunkGenerator3D implements ChunkGenerator {
this.paletteInfoPropertyKey = paletteInfoPropertyKey;
this.noisePropertiesKey = noisePropertiesKey;
this.slantCalculationMethod = slantCalculationMethod;
this.useSlantPalettes = useSlantPalettes;
int maxBlend = pack
.getBiomeProvider()
.stream()
@@ -73,7 +71,7 @@ public class NoiseChunkGenerator3D implements ChunkGenerator {
private Palette paletteAt(int x, int y, int z, Sampler3D sampler, BiomePaletteInfo paletteInfo, int depth) {
SlantHolder slantHolder = paletteInfo.slantHolder();
if(useSlantPalettes && slantHolder.isAboveDepth(depth)) {
if(slantHolder.isAboveDepth(depth)) {
double slant = slantCalculationMethod.slant(sampler, x, y, z);
if(slantHolder.isInSlantThreshold(slant)) {
return slantHolder.getPalette(slant).getPalette(y);
@@ -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,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,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,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,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,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,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,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,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());
})
);
});
@@ -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.");
}
}));
@@ -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.");
}));
});
}
@@ -1,13 +1,13 @@
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;
import java.util.random.RandomGenerator;
import java.util.random.RandomGeneratorFactory;
import com.dfsek.terra.addons.manifest.api.AddonInitializer;
import com.dfsek.terra.api.Platform;
@@ -32,7 +32,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,20 +44,24 @@ 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(),
((Long) context.get("seed") == 0) ? new Random() : new Random(context.get("seed")),
((Long) context.get("seed") == 0)
? RandomGeneratorFactory.<RandomGenerator.SplittableGenerator>of("Xoroshiro128PlusPlus")
.create()
: RandomGeneratorFactory.<RandomGenerator.SplittableGenerator>of("Xoroshiro128PlusPlus")
.create(context.get("seed")),
context.get("rotation")
);
})
+1 -1
View File
@@ -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,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,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,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,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