diff --git a/build.gradle.kts b/build.gradle.kts index 900da820a27..6eb9da096ee 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,125 +1,135 @@ import net.ltgt.gradle.errorprone.errorprone +import org.jetbrains.gradle.ext.delegateActions +import org.jetbrains.gradle.ext.settings +import org.jetbrains.gradle.ext.taskTriggers buildscript { dependencies { - classpath("fr.inria.gforge.spoon:spoon-core:10.2.0") // bump for EIG + classpath(libs.spoon) // bump for EIG } } plugins { eclipse - id("org.spongepowered.gradle.sponge.dev") - id("net.kyori.indra.checkstyle") - id("net.kyori.indra.crossdoc") - id("net.kyori.indra.publishing") - id("net.kyori.indra.publishing.sonatype") - id("org.spongepowered.gradle.event-impl-gen") - id("org.jetbrains.gradle.plugin.idea-ext") - id("net.ltgt.errorprone") -} - -repositories { - maven("https://repo.spongepowered.org/repository/maven-public/") { - name = "sponge" - } + alias(libs.plugins.spongeGradle.convention) + alias(libs.plugins.indra.checkstyle) + alias(libs.plugins.indra.crossdoc) + alias(libs.plugins.indra.publishing) + alias(libs.plugins.indra.publishing.sonatype) + alias(libs.plugins.eventImplGen) + alias(libs.plugins.ideaExt) + alias(libs.plugins.errorprone) + alias(libs.plugins.nexusPublish) } +val javaTarget: String by project val ap by sourceSets.registering { compileClasspath += sourceSets.main.get().compileClasspath + sourceSets.main.get().output } +configurations { + sequenceOf(apiElements, runtimeElements).forEach { + it.configure { + exclude(group = "org.jetbrains", module = "annotations") + } + } +} + // Project dependencies -val adventureVersion: String by project -val configurateVersion: String by project -val gsonVersion: String by project -val log4jVersion: String by project -val mathVersion: String by project dependencies { - val caffeineVersion: String by project - val errorproneVersion: String by project - val junitVersion: String by project - val mockitoVersion: String by project - val pluginSpiVersion: String by project - // Directly tied to what's available from Minecraft - api("org.apache.logging.log4j:log4j-api:$log4jVersion") - api("com.google.code.gson:gson:$gsonVersion") + api(libs.log4j.api) + api(libs.gson) // Adventure - api(platform("net.kyori:adventure-bom:$adventureVersion")) - api("net.kyori:adventure-api") - api("net.kyori:adventure-text-serializer-gson") { + api(platform(libs.adventure.bom)) + api(libs.adventure.api) + api(libs.adventure.textSerializer.gson) { exclude(group = "com.google.code.gson", module = "gson") exclude(group = "net.kyori", module = "adventure-api") } - api("net.kyori:adventure-text-serializer-legacy") { + api(libs.adventure.textSerializer.legacy) { exclude(group = "net.kyori", module = "adventure-api") } - api("net.kyori:adventure-text-serializer-plain") { + api(libs.adventure.textSerializer.plain) { exclude(group = "net.kyori", module = "adventure-api") } - api("net.kyori:adventure-text-minimessage") { + api(libs.adventure.minimessage) { exclude(group = "net.kyori", module = "adventure-api") } // Dependency injection - api("com.google.inject:guice:5.0.1") { - exclude(group ="com.google.code.findbugs", module = "jsr305") // We don't want to use jsr305, use checkerframework + api(libs.guice) { + exclude(group = "com.google.code.findbugs", module = "jsr305") // We don't want to use jsr305, use checkerframework exclude(group = "javax.inject", module = "javax.inject") exclude(group = "com.google.guava", module = "guava") // We use an older version than Guice does + exclude(group = "org.ow2.asm", module = "asm") } // High performance cache + guava - shaded guava - api("com.github.ben-manes.caffeine:caffeine:$caffeineVersion") { - exclude(group= "org.checkerframework", module = "checker-qual") + api(libs.caffeine) { + exclude(group = "org.checkerframework", module = "checker-qual") exclude(group = "com.google.errorprone", module = "error_prone_annotations") + exclude(group = "org.junit", module = "junit-bom") + exclude(group = "org.yaml", module = "snakeyaml") + exclude(group = "com.fasterxml.jackson", module = "jackson-bom") + exclude(group = "org.ow2.asm", module = "asm-bom") } // Plugin spi, includes plugin-meta - api("org.spongepowered:plugin-spi:$pluginSpiVersion") + api(libs.pluginSpi) { + exclude(group = "org.checkerframework", module = "checker-qual") + exclude(group = "com.google.code.gson", module = "gson") + exclude(group = "org.apache.logging.log4j", module = "log4j-api") + } // Configurate - api(platform("org.spongepowered:configurate-bom:$configurateVersion")) - api("org.spongepowered:configurate-core") { + api(platform(libs.configurate.bom)) + api(libs.configurate.core) { exclude(group = "org.checkerframework", module = "checker-qual") // We use our own version } - api("org.spongepowered:configurate-hocon") { + api(libs.configurate.hocon) { exclude(group = "org.spongepowered", module = "configurate-core") - exclude(group= "org.checkerframework", module = "checker-qual") + exclude(group = "org.checkerframework", module = "checker-qual") } - api("org.spongepowered:configurate-gson") { + api(libs.configurate.gson) { exclude(group = "org.spongepowered", module = "configurate-core") exclude(group = "com.google.code.gson", module = "gson") // We have the same version technically, but use the gson we provide. - exclude(group= "org.checkerframework", module = "checker-qual") + exclude(group = "org.checkerframework", module = "checker-qual") } - api("org.spongepowered:configurate-yaml") { + api(libs.configurate.yaml) { exclude(group = "org.spongepowered", module = "configurate-core") - exclude(group= "org.checkerframework", module = "checker-qual") + exclude(group = "org.checkerframework", module = "checker-qual") } - api("org.spongepowered:configurate-extra-guice") { + api(libs.configurate.extraGuice) { exclude(group = "com.google.inject", module = "guice") } // Compile-time static analysis - compileOnly("com.google.errorprone:error_prone_annotations:$errorproneVersion") - errorprone("com.google.errorprone:error_prone_core:$errorproneVersion") + compileOnly(libs.errorprone.annotations) + errorprone(libs.errorprone) // Math library - api("org.spongepowered:math:$mathVersion") + api(libs.math) { + exclude(group = "com.google.errorprone", module = "error_prone_annotations") + } - testImplementation(platform("org.junit:junit-bom:$junitVersion")) - testImplementation("org.junit.jupiter:junit-jupiter-api") - testImplementation("org.junit.jupiter:junit-jupiter-params") - testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine") - testImplementation("org.hamcrest:hamcrest:2.2") - testImplementation("org.mockito:mockito-core:$mockitoVersion") + compileOnlyApi(libs.checkerQual) + + testImplementation(platform(libs.junit.bom)) + testImplementation(libs.junit.api) + testImplementation(libs.junit.params) + testRuntimeOnly(libs.junit.engine) + testRuntimeOnly(libs.junit.launcher) + testImplementation(libs.hamcrest) + testImplementation(libs.mockito) } tasks { genEventImpl { - sourceCompatibility = "16" - destinationDir = project.layout.buildDirectory.dir("generated/event-factory").get().asFile + sourceCompatibility = javaTarget + destinationDirectory = project.layout.buildDirectory.dir("generated/event-factory") outputFactory = "org.spongepowered.api.event.SpongeEventFactory" include("org/spongepowered/api/event/*/**/*") @@ -164,14 +174,14 @@ tasks { options { (this as? StandardJavadocDocletOptions)?.apply { links( - "https://logging.apache.org/log4j/log4j-$log4jVersion/log4j-api/apidocs/", - "https://google.github.io/guice/api-docs/5.0.1/javadoc/", - "https://configurate.aoeu.xyz/$configurateVersion/apidocs/", - "https://www.javadoc.io/doc/com.google.code.gson/gson/$gsonVersion/", - "https://jd.spongepowered.org/math/$mathVersion" + "https://logging.apache.org/log4j/log4j-${libs.versions.log4j.get()}/log4j-api/apidocs/", + "https://google.github.io/guice/api-docs/${libs.versions.guice.get()}/javadoc/", + "https://configurate.aoeu.xyz/${libs.versions.configurate.get()}/apidocs/", + "https://www.javadoc.io/doc/com.google.code.gson/gson/${libs.versions.gson.get()}/", + "https://jd.spongepowered.org/math/${libs.versions.math.get()}" ) sequenceOf("api", "key", "text-serializer-gson", "text-serializer-legacy", "text-serializer-plain").forEach { - links("https://jd.advntr.dev/$it/$adventureVersion/") + links("https://jd.advntr.dev/$it/${libs.versions.adventure.get()}/") } addBooleanOption("quiet", true) } @@ -196,14 +206,12 @@ tasks { idea { if (project != null) { - (project as ExtensionAware).extensions["settings"].run { - require(this is ExtensionAware) - - this.extensions.getByType(org.jetbrains.gradle.ext.ActionDelegationConfig::class).run { + project.settings.run { + delegateActions { delegateBuildRunToGradle = false testRunner = org.jetbrains.gradle.ext.ActionDelegationConfig.TestRunner.PLATFORM } - this.extensions.getByType(org.jetbrains.gradle.ext.TaskTriggersConfig::class).run { + taskTriggers { beforeBuild(tasks.genEventImpl) } } @@ -233,15 +241,13 @@ spongeConvention { } indra { - val checkstyleVersion: String by project - javaVersions { - target(17) + target(javaTarget.toInt()) } - checkstyle(checkstyleVersion) + checkstyle(libs.versions.checkstyle.get()) configurePublications { - artifactId = project.name.toLowerCase() + artifactId = project.name.lowercase() pom { this.url.set(projectUrl) this.description.set(projectDescription) diff --git a/gradle.properties b/gradle.properties index 13f45eda37c..969e73ca4fd 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,22 +1,10 @@ group=org.spongepowered -version=10.1.0-SNAPSHOT +version=11.0.0-SNAPSHOT organization=SpongePowered projectUrl=https://www.spongepowered.org projectDescription=A plugin API for Minecraft: Java Edition +javaTarget=17 javadocPublishRoot=https://jd.spongepowered.org/ org.gradle.parallel=true - -adventureVersion=4.12.0 -caffeineVersion=3.1.2 -checkstyleVersion=10.5.0 -configurateVersion=4.1.2 -errorproneVersion=2.16 -gsonVersion=2.10 -junitVersion=5.9.1 -log4jVersion=2.19.0 - -mathVersion=2.0.1 -mockitoVersion=4.8.0 -pluginSpiVersion=0.3.0 diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml new file mode 100644 index 00000000000..3c4d734882c --- /dev/null +++ b/gradle/libs.versions.toml @@ -0,0 +1,67 @@ +[metadata] +format = { version = "1.1" } + +[versions] +adventure = "4.12.0" +caffeine = "3.1.8" +checker = "3.42.0" +checkstyle = "10.12.7" +configurate = "4.1.2" +errorprone = "2.24.1" +gson = "2.10.1" +guice = "5.0.1" +ideaExt = "1.1.7" +indra = "3.1.3" +junit = "5.10.1" +log4j = "2.19.0" +math = "2.0.1" +mockito = "5.9.0" +pluginSpi = "0.3.0" + +[libraries] +adventure-bom = { module = "net.kyori:adventure-bom", version.ref = "adventure" } +adventure-api = { module = "net.kyori:adventure-api" } +adventure-textSerializer-gson = { module = "net.kyori:adventure-text-serializer-gson" } +adventure-textSerializer-legacy = { module = "net.kyori:adventure-text-serializer-legacy" } +adventure-textSerializer-plain = { module = "net.kyori:adventure-text-serializer-plain" } +adventure-minimessage = { module = "net.kyori:adventure-text-minimessage" } +caffeine = { module = "com.github.ben-manes.caffeine:caffeine", version.ref = "caffeine" } +configurate-bom = { module = "org.spongepowered:configurate-bom", version.ref = "configurate" } +configurate-core = { module = "org.spongepowered:configurate-core" } +configurate-hocon = { module = "org.spongepowered:configurate-hocon" } +configurate-gson = { module = "org.spongepowered:configurate-gson" } +configurate-yaml = { module = "org.spongepowered:configurate-yaml" } +configurate-extraGuice = { module = "org.spongepowered:configurate-extra-guice" } +gson = { module = "com.google.code.gson:gson", version.ref = "gson" } +guice = { module = "com.google.inject:guice", version.ref = "guice" } +log4j-api = { module = "org.apache.logging.log4j:log4j-api", version.ref = "log4j" } +math = { module = "org.spongepowered:math", version.ref = "math" } +pluginSpi = { module = "org.spongepowered:plugin-spi", version.ref = "pluginSpi" } + +# build-time/annotations + +checkerQual = { module = "org.checkerframework:checker-qual", version.ref = "checker" } +errorprone = { module = "com.google.errorprone:error_prone_core", version.ref = "errorprone" } +errorprone-annotations = { module = "com.google.errorprone:error_prone_annotations", version.ref = "errorprone" } +spoon = { module = "fr.inria.gforge.spoon:spoon-core", version = "10.4.2" } # bump for EIG + +# testing + +hamcrest = { module = "org.hamcrest:hamcrest", version = "2.2" } +junit-bom = { module = "org.junit:junit-bom", version.ref = "junit" } +junit-api = { module = "org.junit.jupiter:junit-jupiter-api" } +junit-params = { module = "org.junit.jupiter:junit-jupiter-params" } +junit-engine = { module = "org.junit.jupiter:junit-jupiter-engine" } +junit-launcher = { module = "org.junit.platform:junit-platform-launcher" } +mockito = { module = "org.mockito:mockito-core", version.ref = "mockito" } + +[plugins] +errorprone = { id = "net.ltgt.errorprone", version = "3.1.0" } +eventImplGen = { id = "org.spongepowered.gradle.event-impl-gen", version = "7.1.0" } +ideaExt = { id = "org.jetbrains.gradle.plugin.idea-ext", version.ref = "ideaExt" } +indra-checkstyle = { id = "net.kyori.indra.checkstyle", version.ref = "indra" } +indra-crossdoc = { id = "net.kyori.indra.crossdoc", version.ref = "indra" } +indra-publishing = { id = "net.kyori.indra.publishing", version.ref = "indra" } +indra-publishing-sonatype = { id = "net.kyori.indra.publishing.sonatype", version.ref = "indra" } +nexusPublish = { id = "io.github.gradle-nexus.publish-plugin", version = "2.0.0-rc-1"} +spongeGradle-convention = { id = "org.spongepowered.gradle.sponge.dev", version = "2.2.0" } diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index 943f0cbfa75..7f93135c49b 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index f398c33c4b0..3fa8f862f75 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,7 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip networkTimeout=10000 +validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/gradlew b/gradlew index 65dcd68d65c..1aa94a42690 100755 --- a/gradlew +++ b/gradlew @@ -83,10 +83,8 @@ done # This is normally unused # shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit - -# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum @@ -133,10 +131,13 @@ location of your Java installation." fi else JAVACMD=java - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + if ! command -v java >/dev/null 2>&1 + then + die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. Please set the JAVA_HOME variable in your environment to match the location of your Java installation." + fi fi # Increase the maximum file descriptors if we can. @@ -144,7 +145,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then case $MAX_FD in #( max*) # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 + # shellcheck disable=SC2039,SC3045 MAX_FD=$( ulimit -H -n ) || warn "Could not query maximum file descriptor limit" esac @@ -152,7 +153,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then '' | soft) :;; #( *) # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 + # shellcheck disable=SC2039,SC3045 ulimit -n "$MAX_FD" || warn "Could not set maximum file descriptor limit to $MAX_FD" esac @@ -197,11 +198,15 @@ if "$cygwin" || "$msys" ; then done fi -# Collect all arguments for the java command; -# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of -# shell script including quotes and variable substitutions, so put them in -# double quotes to make sure that they get re-expanded; and -# * put everything else in single quotes, so that it's not re-expanded. + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. set -- \ "-Dorg.gradle.appname=$APP_BASE_NAME" \ diff --git a/settings.gradle.kts b/settings.gradle.kts index 6765aa5f086..9007387b615 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -6,18 +6,13 @@ pluginManagement { name = "sponge" } } - plugins { - val indraVersion = "3.0.1" - id("org.spongepowered.gradle.event-impl-gen") version "7.0.0" - id("org.spongepowered.gradle.sponge.dev") version "2.1.1" - id("org.jetbrains.gradle.plugin.idea-ext") version "1.1.7" - id("net.ltgt.errorprone") version "3.0.1" - id("net.kyori.indra.publishing") version indraVersion - id("net.kyori.indra.publishing.sonatype") version indraVersion - id("net.kyori.indra.checkstyle") version indraVersion - id("net.kyori.indra.crossdoc") version indraVersion - } } + plugins { - id("org.gradle.toolchains.foojay-resolver-convention") version ("0.3.0") + id("org.gradle.toolchains.foojay-resolver-convention") version ("0.8.0") +} + +dependencyResolutionManagement { + repositoriesMode = RepositoriesMode.FAIL_ON_PROJECT_REPOS + pluginManagement.repositories.forEach(repositories::add) } diff --git a/src/main/java/org/spongepowered/api/advancement/Advancement.java b/src/main/java/org/spongepowered/api/advancement/Advancement.java index 93836ae23ed..98daddb4395 100644 --- a/src/main/java/org/spongepowered/api/advancement/Advancement.java +++ b/src/main/java/org/spongepowered/api/advancement/Advancement.java @@ -26,34 +26,17 @@ import net.kyori.adventure.text.Component; import net.kyori.adventure.text.ComponentLike; -import org.spongepowered.api.ResourceKeyed; +import org.spongepowered.api.ResourceKey; import org.spongepowered.api.advancement.criteria.AdvancementCriterion; import org.spongepowered.api.data.persistence.DataSerializable; -import java.util.Collection; import java.util.List; import java.util.Optional; /** * An advancement. */ -public interface Advancement extends ComponentLike, ResourceKeyed, DataSerializable { - - /** - * Gets the {@link AdvancementTree} this advancement is located in, - * will only be present if the root advancement was used to create - * a {@link AdvancementTree}. - * - * @return The advancement tree - */ - Optional tree(); - - /** - * Gets all the children {@link Advancement}s. - * - * @return The children advancements - */ - Collection children(); +public interface Advancement extends ComponentLike, DataSerializable { /** * Gets all the {@link AdvancementCriterion} that should be achieved @@ -72,7 +55,7 @@ public interface Advancement extends ComponentLike, ResourceKeyed, DataSerializa * * @return The parent advancement, if present */ - Optional parent(); + Optional parent(); /** * Gets the {@link DisplayInfo} of this advancement, if present. diff --git a/src/main/java/org/spongepowered/api/advancement/TreeLayout.java b/src/main/java/org/spongepowered/api/advancement/AdvancementNode.java similarity index 62% rename from src/main/java/org/spongepowered/api/advancement/TreeLayout.java rename to src/main/java/org/spongepowered/api/advancement/AdvancementNode.java index 8a9b4a15ab8..02bef84fab1 100644 --- a/src/main/java/org/spongepowered/api/advancement/TreeLayout.java +++ b/src/main/java/org/spongepowered/api/advancement/AdvancementNode.java @@ -24,37 +24,29 @@ */ package org.spongepowered.api.advancement; +import org.spongepowered.api.ResourceKeyed; +import org.spongepowered.api.entity.living.player.Player; + import java.util.Collection; -import java.util.Optional; /** - * Represents the tree (tab) layout of a {@link AdvancementTree}. + * A node in a {@link AdvancementTree} + * visible to a {@link Player} once the root {@link Advancement} gets achieved. */ -public interface TreeLayout { - - /** - * Gets the {@link AdvancementTree} this layout is assigned to. - * - * @return The tree - */ - AdvancementTree tree(); +public interface AdvancementNode extends ResourceKeyed { /** - * Gets all the {@link TreeLayoutElement}s that are - * present in this layout. + * Gets the root {@link Advancement}. * - * @return The tree layout elements + * @return The root advancement */ - Collection elements(); + Advancement rootAdvancement(); /** - * Gets the {@link TreeLayoutElement} for the specified {@link Advancement}, - * {@link Optional#empty()} will be returned if the advancement is not present - * in the tree or if there is no {@link DisplayInfo} present. + * Gets all the children {@link Advancement}s. * - * @param advancement The advancement - * @return The tree layout element + * @return The children advancements */ - Optional element(Advancement advancement); + Collection children(); } diff --git a/src/main/java/org/spongepowered/api/advancement/AdvancementTemplate.java b/src/main/java/org/spongepowered/api/advancement/AdvancementTemplate.java index 8fa72685338..7388e885696 100644 --- a/src/main/java/org/spongepowered/api/advancement/AdvancementTemplate.java +++ b/src/main/java/org/spongepowered/api/advancement/AdvancementTemplate.java @@ -31,6 +31,8 @@ import org.spongepowered.api.datapack.DataPackEntry; import org.spongepowered.api.util.ResourceKeyedBuilder; +import java.util.Optional; + /** * A template for an {@link Advancement}. */ @@ -52,19 +54,36 @@ static Builder builder() { */ Advancement advancement(); + /** + * Gets the {@link AdvancementTree} of this advancement + * will only be present if it is a root advancement. + * + * @return The advancement tree + */ + Optional tree(); + /** * A builder to create {@link Advancement}s. */ interface Builder extends ResourceKeyedBuilder { /** - * Sets the parent {@link Advancement}. + * Sets the parent {@link Advancement} template. + *

For the root advancement use {@link #root}

+ * + * @param parent The parent advancement + * @return This builder, for chaining + */ + Builder parent(AdvancementTemplate parent); + + /** + * Sets the parent {@link Advancement} key. *

For the root advancement use {@link #root}

* * @param parent The parent advancement * @return This builder, for chaining */ - Builder parent(Advancement parent); + Builder parent(ResourceKey parent); /** * Sets this advancement as root. diff --git a/src/main/java/org/spongepowered/api/advancement/AdvancementTree.java b/src/main/java/org/spongepowered/api/advancement/AdvancementTree.java index 2f892b76e05..a477132c2dd 100644 --- a/src/main/java/org/spongepowered/api/advancement/AdvancementTree.java +++ b/src/main/java/org/spongepowered/api/advancement/AdvancementTree.java @@ -27,26 +27,49 @@ import org.spongepowered.api.ResourceKey; import org.spongepowered.api.entity.living.player.Player; +import java.util.Collection; import java.util.Optional; /** * Represents a {@link Advancement} tree or tab menu. The tree will become - * visible to a {@link Player} once the root {@link Advancement} gets achieved. + * visible to a {@link Player} once the {@link #rootAdvancement() root advancement} gets achieved. */ -public interface AdvancementTree { +public interface AdvancementTree extends AdvancementNode { /** - * Gets the root {@link Advancement}. + * Gets the background texture of this tree. * - * @return The root advancement + * @return The background texture */ - Advancement rootAdvancement(); + Optional backgroundPath(); /** - * Gets the background texture of this tree. + * Gets all the {@link TreeLayoutElement}s that are + * present in this layout. * - * @return The background texture + * @return The tree layout elements */ - Optional backgroundPath(); + Collection layoutElements(); + + /** + * Gets the {@link TreeLayoutElement} for the specified {@link Advancement}, + * {@link Optional#empty()} will be returned if the advancement is not present + * in the tree or if there is no {@link DisplayInfo} present. + * + * @param advancement The advancement + * @return The tree layout element + */ + Optional layoutElement(AdvancementTemplate advancement); + + + /** + * Gets the {@link TreeLayoutElement} for the specified {@link Advancement}, + * {@link Optional#empty()} will be returned if the advancement is not present + * in the tree or if there is no {@link DisplayInfo} present. + * + * @param advancementKey The advancement key + * @return The tree layout element + */ + Optional layoutElement(ResourceKey advancementKey); } diff --git a/src/main/java/org/spongepowered/api/advancement/TreeLayoutElement.java b/src/main/java/org/spongepowered/api/advancement/TreeLayoutElement.java index 5cd0e00993d..3e84bab4173 100644 --- a/src/main/java/org/spongepowered/api/advancement/TreeLayoutElement.java +++ b/src/main/java/org/spongepowered/api/advancement/TreeLayoutElement.java @@ -27,7 +27,7 @@ import org.spongepowered.math.vector.Vector2d; /** - * Represents a element in the {@link TreeLayout}. + * Represents a layout element in the {@link AdvancementTree}. */ public interface TreeLayoutElement { diff --git a/src/main/java/org/spongepowered/api/advancement/criteria/AdvancementCriterion.java b/src/main/java/org/spongepowered/api/advancement/criteria/AdvancementCriterion.java index 08c8959914b..9477ef1b44d 100644 --- a/src/main/java/org/spongepowered/api/advancement/criteria/AdvancementCriterion.java +++ b/src/main/java/org/spongepowered/api/advancement/criteria/AdvancementCriterion.java @@ -27,6 +27,8 @@ import org.spongepowered.api.Sponge; import org.spongepowered.api.advancement.Advancement; import org.spongepowered.api.advancement.criteria.trigger.FilteredTrigger; +import org.spongepowered.api.advancement.criteria.trigger.FilteredTriggerConfiguration; +import org.spongepowered.api.advancement.criteria.trigger.Trigger; import org.spongepowered.api.util.CopyableBuilder; import org.spongepowered.api.util.Nameable; @@ -127,6 +129,13 @@ static Builder builder() { */ Optional> trigger(); + /** + * Gets the {@link Trigger} of this {@link AdvancementCriterion}, if present. + * + * @return The trigger + */ + Optional> type(); + /** * A builder to create {@link AdvancementCriterion}s. */ @@ -142,10 +151,11 @@ interface BaseBuilder trigger); + B trigger(Trigger type, FilteredTrigger trigger); /** * Sets the name of the {@link AdvancementCriterion}. Names can be diff --git a/src/main/java/org/spongepowered/api/advancement/criteria/trigger/FilteredTrigger.java b/src/main/java/org/spongepowered/api/advancement/criteria/trigger/FilteredTrigger.java index d9169ec070b..2a542d9a8d6 100644 --- a/src/main/java/org/spongepowered/api/advancement/criteria/trigger/FilteredTrigger.java +++ b/src/main/java/org/spongepowered/api/advancement/criteria/trigger/FilteredTrigger.java @@ -44,13 +44,6 @@ static Builder builder() { return Sponge.game().builderProvider().provide(Builder.class); } - /** - * Gets the {@link Trigger}. - * - * @return The type - */ - Trigger type(); - /** * Gets the {@link FilteredTriggerConfiguration} of this trigger. * @@ -66,22 +59,13 @@ static Builder builder() { interface Builder extends org.spongepowered.api.util.Builder, Builder>, CopyableBuilder, Builder> { - /** - * Sets the {@link Trigger}. - * - * @param type The trigger type - * @param The configuration type - * @return This builder, for chaining - */ - Builder type(Trigger type); - /** * Sets the {@link FilteredTriggerConfiguration}. * * @param config The configuration * @return This builder, for chaining */ - Builder config(C config); + Builder config(T config); /** * Builds the {@link FilteredTrigger}. diff --git a/src/main/java/org/spongepowered/api/advancement/criteria/trigger/Trigger.java b/src/main/java/org/spongepowered/api/advancement/criteria/trigger/Trigger.java index 1252514036f..3d276758640 100644 --- a/src/main/java/org/spongepowered/api/advancement/criteria/trigger/Trigger.java +++ b/src/main/java/org/spongepowered/api/advancement/criteria/trigger/Trigger.java @@ -26,7 +26,6 @@ import com.google.gson.Gson; import io.leangen.geantyref.TypeToken; -import org.spongepowered.api.ResourceKeyed; import org.spongepowered.api.Sponge; import org.spongepowered.api.advancement.criteria.AdvancementCriterion; import org.spongepowered.api.config.ConfigManager; @@ -37,8 +36,8 @@ import org.spongepowered.api.event.advancement.CriterionEvent; import org.spongepowered.api.registry.DefaultedRegistryValue; import org.spongepowered.api.scoreboard.criteria.Criterion; +import org.spongepowered.api.util.Builder; import org.spongepowered.api.util.CopyableBuilder; -import org.spongepowered.api.util.ResourceKeyedBuilder; import org.spongepowered.api.util.annotation.CatalogedBy; import org.spongepowered.configurate.ConfigurationOptions; import org.spongepowered.configurate.serialize.TypeSerializer; @@ -55,7 +54,7 @@ */ @SuppressWarnings("unchecked") @CatalogedBy(Triggers.class) -public interface Trigger extends DefaultedRegistryValue, ResourceKeyed { +public interface Trigger extends DefaultedRegistryValue { /** * Creates a new {@link Builder} which can be used to create @@ -103,7 +102,7 @@ static Builder builder() { * * @param The configuration type */ - interface Builder extends ResourceKeyedBuilder, Builder>, + interface Builder extends org.spongepowered.api.util.Builder, Builder>, CopyableBuilder, Builder> { /** diff --git a/src/main/java/org/spongepowered/api/advancement/criteria/trigger/Triggers.java b/src/main/java/org/spongepowered/api/advancement/criteria/trigger/Triggers.java index cdea5a65bb3..3301377423d 100644 --- a/src/main/java/org/spongepowered/api/advancement/criteria/trigger/Triggers.java +++ b/src/main/java/org/spongepowered/api/advancement/criteria/trigger/Triggers.java @@ -114,6 +114,8 @@ public final class Triggers { public static final DefaultedRegistryReference> RAID_WIN = Triggers.key(ResourceKey.minecraft("hero_of_the_village")); + public static final DefaultedRegistryReference> RECIPE_CRAFTED = Triggers.key(ResourceKey.minecraft("recipe_crafted")); + public static final DefaultedRegistryReference> RECIPE_UNLOCKED = Triggers.key(ResourceKey.minecraft("recipe_unlocked")); public static final DefaultedRegistryReference> RIDE_ENTITY_IN_LAVA = Triggers.key(ResourceKey.minecraft("ride_entity_in_lava")); diff --git a/src/main/java/org/spongepowered/api/block/BlockTypes.java b/src/main/java/org/spongepowered/api/block/BlockTypes.java index 1280e8426a6..b1e0ff6a220 100644 --- a/src/main/java/org/spongepowered/api/block/BlockTypes.java +++ b/src/main/java/org/spongepowered/api/block/BlockTypes.java @@ -24,7 +24,6 @@ */ package org.spongepowered.api.block; -import org.jetbrains.annotations.ApiStatus; import org.spongepowered.api.ResourceKey; import org.spongepowered.api.Sponge; import org.spongepowered.api.registry.DefaultedRegistryReference; @@ -33,7 +32,6 @@ import org.spongepowered.api.registry.RegistryScope; import org.spongepowered.api.registry.RegistryScopes; import org.spongepowered.api.registry.RegistryTypes; -import org.spongepowered.api.util.annotation.Experimental; /** * @@ -51,8 +49,6 @@ public final class BlockTypes { public static final DefaultedRegistryReference ACACIA_FENCE_GATE = BlockTypes.key(ResourceKey.minecraft("acacia_fence_gate")); - @Experimental("update_1_20") - @ApiStatus.Experimental public static final DefaultedRegistryReference ACACIA_HANGING_SIGN = BlockTypes.key(ResourceKey.minecraft("acacia_hanging_sign")); public static final DefaultedRegistryReference ACACIA_LEAVES = BlockTypes.key(ResourceKey.minecraft("acacia_leaves")); @@ -73,8 +69,6 @@ public final class BlockTypes { public static final DefaultedRegistryReference ACACIA_TRAPDOOR = BlockTypes.key(ResourceKey.minecraft("acacia_trapdoor")); - @Experimental("update_1_20") - @ApiStatus.Experimental public static final DefaultedRegistryReference ACACIA_WALL_HANGING_SIGN = BlockTypes.key(ResourceKey.minecraft("acacia_wall_hanging_sign")); public static final DefaultedRegistryReference ACACIA_WALL_SIGN = BlockTypes.key(ResourceKey.minecraft("acacia_wall_sign")); @@ -115,74 +109,40 @@ public final class BlockTypes { public static final DefaultedRegistryReference BAMBOO = BlockTypes.key(ResourceKey.minecraft("bamboo")); - @Experimental("update_1_20") - @ApiStatus.Experimental public static final DefaultedRegistryReference BAMBOO_BLOCK = BlockTypes.key(ResourceKey.minecraft("bamboo_block")); - @Experimental("update_1_20") - @ApiStatus.Experimental public static final DefaultedRegistryReference BAMBOO_BUTTON = BlockTypes.key(ResourceKey.minecraft("bamboo_button")); - @Experimental("update_1_20") - @ApiStatus.Experimental public static final DefaultedRegistryReference BAMBOO_DOOR = BlockTypes.key(ResourceKey.minecraft("bamboo_door")); - @Experimental("update_1_20") - @ApiStatus.Experimental public static final DefaultedRegistryReference BAMBOO_FENCE = BlockTypes.key(ResourceKey.minecraft("bamboo_fence")); - @Experimental("update_1_20") - @ApiStatus.Experimental public static final DefaultedRegistryReference BAMBOO_FENCE_GATE = BlockTypes.key(ResourceKey.minecraft("bamboo_fence_gate")); - @Experimental("update_1_20") - @ApiStatus.Experimental public static final DefaultedRegistryReference BAMBOO_HANGING_SIGN = BlockTypes.key(ResourceKey.minecraft("bamboo_hanging_sign")); - @Experimental("update_1_20") - @ApiStatus.Experimental public static final DefaultedRegistryReference BAMBOO_MOSAIC = BlockTypes.key(ResourceKey.minecraft("bamboo_mosaic")); - @Experimental("update_1_20") - @ApiStatus.Experimental public static final DefaultedRegistryReference BAMBOO_MOSAIC_SLAB = BlockTypes.key(ResourceKey.minecraft("bamboo_mosaic_slab")); - @Experimental("update_1_20") - @ApiStatus.Experimental public static final DefaultedRegistryReference BAMBOO_MOSAIC_STAIRS = BlockTypes.key(ResourceKey.minecraft("bamboo_mosaic_stairs")); - @Experimental("update_1_20") - @ApiStatus.Experimental public static final DefaultedRegistryReference BAMBOO_PLANKS = BlockTypes.key(ResourceKey.minecraft("bamboo_planks")); - @Experimental("update_1_20") - @ApiStatus.Experimental public static final DefaultedRegistryReference BAMBOO_PRESSURE_PLATE = BlockTypes.key(ResourceKey.minecraft("bamboo_pressure_plate")); public static final DefaultedRegistryReference BAMBOO_SAPLING = BlockTypes.key(ResourceKey.minecraft("bamboo_sapling")); - @Experimental("update_1_20") - @ApiStatus.Experimental public static final DefaultedRegistryReference BAMBOO_SIGN = BlockTypes.key(ResourceKey.minecraft("bamboo_sign")); - @Experimental("update_1_20") - @ApiStatus.Experimental public static final DefaultedRegistryReference BAMBOO_SLAB = BlockTypes.key(ResourceKey.minecraft("bamboo_slab")); - @Experimental("update_1_20") - @ApiStatus.Experimental public static final DefaultedRegistryReference BAMBOO_STAIRS = BlockTypes.key(ResourceKey.minecraft("bamboo_stairs")); - @Experimental("update_1_20") - @ApiStatus.Experimental public static final DefaultedRegistryReference BAMBOO_TRAPDOOR = BlockTypes.key(ResourceKey.minecraft("bamboo_trapdoor")); - @Experimental("update_1_20") - @ApiStatus.Experimental public static final DefaultedRegistryReference BAMBOO_WALL_HANGING_SIGN = BlockTypes.key(ResourceKey.minecraft("bamboo_wall_hanging_sign")); - @Experimental("update_1_20") - @ApiStatus.Experimental public static final DefaultedRegistryReference BAMBOO_WALL_SIGN = BlockTypes.key(ResourceKey.minecraft("bamboo_wall_sign")); public static final DefaultedRegistryReference BARREL = BlockTypes.key(ResourceKey.minecraft("barrel")); @@ -215,8 +175,6 @@ public final class BlockTypes { public static final DefaultedRegistryReference BIRCH_FENCE_GATE = BlockTypes.key(ResourceKey.minecraft("birch_fence_gate")); - @Experimental("update_1_20") - @ApiStatus.Experimental public static final DefaultedRegistryReference BIRCH_HANGING_SIGN = BlockTypes.key(ResourceKey.minecraft("birch_hanging_sign")); public static final DefaultedRegistryReference BIRCH_LEAVES = BlockTypes.key(ResourceKey.minecraft("birch_leaves")); @@ -237,8 +195,6 @@ public final class BlockTypes { public static final DefaultedRegistryReference BIRCH_TRAPDOOR = BlockTypes.key(ResourceKey.minecraft("birch_trapdoor")); - @Experimental("update_1_20") - @ApiStatus.Experimental public static final DefaultedRegistryReference BIRCH_WALL_HANGING_SIGN = BlockTypes.key(ResourceKey.minecraft("birch_wall_hanging_sign")); public static final DefaultedRegistryReference BIRCH_WALL_SIGN = BlockTypes.key(ResourceKey.minecraft("birch_wall_sign")); @@ -387,6 +343,8 @@ public final class BlockTypes { public static final DefaultedRegistryReference CALCITE = BlockTypes.key(ResourceKey.minecraft("calcite")); + public static final DefaultedRegistryReference CALIBRATED_SCULK_SENSOR = BlockTypes.key(ResourceKey.minecraft("calibrated_sculk_sensor")); + public static final DefaultedRegistryReference CAMPFIRE = BlockTypes.key(ResourceKey.minecraft("campfire")); public static final DefaultedRegistryReference CANDLE = BlockTypes.key(ResourceKey.minecraft("candle")); @@ -411,80 +369,44 @@ public final class BlockTypes { public static final DefaultedRegistryReference CHAIN_COMMAND_BLOCK = BlockTypes.key(ResourceKey.minecraft("chain_command_block")); - @Experimental("update_1_20") - @ApiStatus.Experimental public static final DefaultedRegistryReference CHERRY_BUTTON = BlockTypes.key(ResourceKey.minecraft("cherry_button")); - @Experimental("update_1_20") - @ApiStatus.Experimental public static final DefaultedRegistryReference CHERRY_DOOR = BlockTypes.key(ResourceKey.minecraft("cherry_door")); - @Experimental("update_1_20") - @ApiStatus.Experimental public static final DefaultedRegistryReference CHERRY_FENCE = BlockTypes.key(ResourceKey.minecraft("cherry_fence")); - @Experimental("update_1_20") - @ApiStatus.Experimental public static final DefaultedRegistryReference CHERRY_FENCE_GATE = BlockTypes.key(ResourceKey.minecraft("cherry_fence_gate")); - @Experimental("update_1_20") - @ApiStatus.Experimental public static final DefaultedRegistryReference CHERRY_HANGING_SIGN = BlockTypes.key(ResourceKey.minecraft("cherry_hanging_sign")); - @Experimental("update_1_20") - @ApiStatus.Experimental public static final DefaultedRegistryReference CHERRY_LEAVES = BlockTypes.key(ResourceKey.minecraft("cherry_leaves")); - @Experimental("update_1_20") - @ApiStatus.Experimental public static final DefaultedRegistryReference CHERRY_LOG = BlockTypes.key(ResourceKey.minecraft("cherry_log")); - @Experimental("update_1_20") - @ApiStatus.Experimental public static final DefaultedRegistryReference CHERRY_PLANKS = BlockTypes.key(ResourceKey.minecraft("cherry_planks")); - @Experimental("update_1_20") - @ApiStatus.Experimental public static final DefaultedRegistryReference CHERRY_PRESSURE_PLATE = BlockTypes.key(ResourceKey.minecraft("cherry_pressure_plate")); - @Experimental("update_1_20") - @ApiStatus.Experimental public static final DefaultedRegistryReference CHERRY_SAPLING = BlockTypes.key(ResourceKey.minecraft("cherry_sapling")); - @Experimental("update_1_20") - @ApiStatus.Experimental public static final DefaultedRegistryReference CHERRY_SIGN = BlockTypes.key(ResourceKey.minecraft("cherry_sign")); - @Experimental("update_1_20") - @ApiStatus.Experimental public static final DefaultedRegistryReference CHERRY_SLAB = BlockTypes.key(ResourceKey.minecraft("cherry_slab")); - @Experimental("update_1_20") - @ApiStatus.Experimental public static final DefaultedRegistryReference CHERRY_STAIRS = BlockTypes.key(ResourceKey.minecraft("cherry_stairs")); - @Experimental("update_1_20") - @ApiStatus.Experimental public static final DefaultedRegistryReference CHERRY_TRAPDOOR = BlockTypes.key(ResourceKey.minecraft("cherry_trapdoor")); - @Experimental("update_1_20") - @ApiStatus.Experimental public static final DefaultedRegistryReference CHERRY_WALL_HANGING_SIGN = BlockTypes.key(ResourceKey.minecraft("cherry_wall_hanging_sign")); - @Experimental("update_1_20") - @ApiStatus.Experimental public static final DefaultedRegistryReference CHERRY_WALL_SIGN = BlockTypes.key(ResourceKey.minecraft("cherry_wall_sign")); - @Experimental("update_1_20") - @ApiStatus.Experimental public static final DefaultedRegistryReference CHERRY_WOOD = BlockTypes.key(ResourceKey.minecraft("cherry_wood")); public static final DefaultedRegistryReference CHEST = BlockTypes.key(ResourceKey.minecraft("chest")); public static final DefaultedRegistryReference CHIPPED_ANVIL = BlockTypes.key(ResourceKey.minecraft("chipped_anvil")); - @Experimental("update_1_20") - @ApiStatus.Experimental public static final DefaultedRegistryReference CHISELED_BOOKSHELF = BlockTypes.key(ResourceKey.minecraft("chiseled_bookshelf")); public static final DefaultedRegistryReference CHISELED_DEEPSLATE = BlockTypes.key(ResourceKey.minecraft("chiseled_deepslate")); @@ -573,8 +495,6 @@ public final class BlockTypes { public static final DefaultedRegistryReference CRIMSON_FUNGUS = BlockTypes.key(ResourceKey.minecraft("crimson_fungus")); - @Experimental("update_1_20") - @ApiStatus.Experimental public static final DefaultedRegistryReference CRIMSON_HANGING_SIGN = BlockTypes.key(ResourceKey.minecraft("crimson_hanging_sign")); public static final DefaultedRegistryReference CRIMSON_HYPHAE = BlockTypes.key(ResourceKey.minecraft("crimson_hyphae")); @@ -597,8 +517,6 @@ public final class BlockTypes { public static final DefaultedRegistryReference CRIMSON_TRAPDOOR = BlockTypes.key(ResourceKey.minecraft("crimson_trapdoor")); - @Experimental("update_1_20") - @ApiStatus.Experimental public static final DefaultedRegistryReference CRIMSON_WALL_HANGING_SIGN = BlockTypes.key(ResourceKey.minecraft("crimson_wall_hanging_sign")); public static final DefaultedRegistryReference CRIMSON_WALL_SIGN = BlockTypes.key(ResourceKey.minecraft("crimson_wall_sign")); @@ -659,8 +577,6 @@ public final class BlockTypes { public static final DefaultedRegistryReference DARK_OAK_FENCE_GATE = BlockTypes.key(ResourceKey.minecraft("dark_oak_fence_gate")); - @Experimental("update_1_20") - @ApiStatus.Experimental public static final DefaultedRegistryReference DARK_OAK_HANGING_SIGN = BlockTypes.key(ResourceKey.minecraft("dark_oak_hanging_sign")); public static final DefaultedRegistryReference DARK_OAK_LEAVES = BlockTypes.key(ResourceKey.minecraft("dark_oak_leaves")); @@ -681,8 +597,6 @@ public final class BlockTypes { public static final DefaultedRegistryReference DARK_OAK_TRAPDOOR = BlockTypes.key(ResourceKey.minecraft("dark_oak_trapdoor")); - @Experimental("update_1_20") - @ApiStatus.Experimental public static final DefaultedRegistryReference DARK_OAK_WALL_HANGING_SIGN = BlockTypes.key(ResourceKey.minecraft("dark_oak_wall_hanging_sign")); public static final DefaultedRegistryReference DARK_OAK_WALL_SIGN = BlockTypes.key(ResourceKey.minecraft("dark_oak_wall_sign")); @@ -739,8 +653,6 @@ public final class BlockTypes { public static final DefaultedRegistryReference DEAD_TUBE_CORAL_WALL_FAN = BlockTypes.key(ResourceKey.minecraft("dead_tube_coral_wall_fan")); - @Experimental("update_1_20") - @ApiStatus.Experimental public static final DefaultedRegistryReference DECORATED_POT = BlockTypes.key(ResourceKey.minecraft("decorated_pot")); public static final DefaultedRegistryReference DEEPSLATE = BlockTypes.key(ResourceKey.minecraft("deepslate")); @@ -1017,8 +929,6 @@ public final class BlockTypes { public static final DefaultedRegistryReference JUNGLE_FENCE_GATE = BlockTypes.key(ResourceKey.minecraft("jungle_fence_gate")); - @Experimental("update_1_20") - @ApiStatus.Experimental public static final DefaultedRegistryReference JUNGLE_HANGING_SIGN = BlockTypes.key(ResourceKey.minecraft("jungle_hanging_sign")); public static final DefaultedRegistryReference JUNGLE_LEAVES = BlockTypes.key(ResourceKey.minecraft("jungle_leaves")); @@ -1039,8 +949,6 @@ public final class BlockTypes { public static final DefaultedRegistryReference JUNGLE_TRAPDOOR = BlockTypes.key(ResourceKey.minecraft("jungle_trapdoor")); - @Experimental("update_1_20") - @ApiStatus.Experimental public static final DefaultedRegistryReference JUNGLE_WALL_HANGING_SIGN = BlockTypes.key(ResourceKey.minecraft("jungle_wall_hanging_sign")); public static final DefaultedRegistryReference JUNGLE_WALL_SIGN = BlockTypes.key(ResourceKey.minecraft("jungle_wall_sign")); @@ -1209,8 +1117,6 @@ public final class BlockTypes { public static final DefaultedRegistryReference MANGROVE_FENCE_GATE = BlockTypes.key(ResourceKey.minecraft("mangrove_fence_gate")); - @Experimental("update_1_20") - @ApiStatus.Experimental public static final DefaultedRegistryReference MANGROVE_HANGING_SIGN = BlockTypes.key(ResourceKey.minecraft("mangrove_hanging_sign")); public static final DefaultedRegistryReference MANGROVE_LEAVES = BlockTypes.key(ResourceKey.minecraft("mangrove_leaves")); @@ -1233,8 +1139,6 @@ public final class BlockTypes { public static final DefaultedRegistryReference MANGROVE_TRAPDOOR = BlockTypes.key(ResourceKey.minecraft("mangrove_trapdoor")); - @Experimental("update_1_20") - @ApiStatus.Experimental public static final DefaultedRegistryReference MANGROVE_WALL_HANGING_SIGN = BlockTypes.key(ResourceKey.minecraft("mangrove_wall_hanging_sign")); public static final DefaultedRegistryReference MANGROVE_WALL_SIGN = BlockTypes.key(ResourceKey.minecraft("mangrove_wall_sign")); @@ -1321,8 +1225,6 @@ public final class BlockTypes { public static final DefaultedRegistryReference OAK_FENCE_GATE = BlockTypes.key(ResourceKey.minecraft("oak_fence_gate")); - @Experimental("update_1_20") - @ApiStatus.Experimental public static final DefaultedRegistryReference OAK_HANGING_SIGN = BlockTypes.key(ResourceKey.minecraft("oak_hanging_sign")); public static final DefaultedRegistryReference OAK_LEAVES = BlockTypes.key(ResourceKey.minecraft("oak_leaves")); @@ -1343,8 +1245,6 @@ public final class BlockTypes { public static final DefaultedRegistryReference OAK_TRAPDOOR = BlockTypes.key(ResourceKey.minecraft("oak_trapdoor")); - @Experimental("update_1_20") - @ApiStatus.Experimental public static final DefaultedRegistryReference OAK_WALL_HANGING_SIGN = BlockTypes.key(ResourceKey.minecraft("oak_wall_hanging_sign")); public static final DefaultedRegistryReference OAK_WALL_SIGN = BlockTypes.key(ResourceKey.minecraft("oak_wall_sign")); @@ -1407,12 +1307,8 @@ public final class BlockTypes { public static final DefaultedRegistryReference PETRIFIED_OAK_SLAB = BlockTypes.key(ResourceKey.minecraft("petrified_oak_slab")); - @Experimental("update_1_20") - @ApiStatus.Experimental public static final DefaultedRegistryReference PIGLIN_HEAD = BlockTypes.key(ResourceKey.minecraft("piglin_head")); - @Experimental("update_1_20") - @ApiStatus.Experimental public static final DefaultedRegistryReference PIGLIN_WALL_HEAD = BlockTypes.key(ResourceKey.minecraft("piglin_wall_head")); public static final DefaultedRegistryReference PINK_BANNER = BlockTypes.key(ResourceKey.minecraft("pink_banner")); @@ -1431,8 +1327,6 @@ public final class BlockTypes { public static final DefaultedRegistryReference PINK_GLAZED_TERRACOTTA = BlockTypes.key(ResourceKey.minecraft("pink_glazed_terracotta")); - @Experimental("update_1_20") - @ApiStatus.Experimental public static final DefaultedRegistryReference PINK_PETALS = BlockTypes.key(ResourceKey.minecraft("pink_petals")); public static final DefaultedRegistryReference PINK_SHULKER_BOX = BlockTypes.key(ResourceKey.minecraft("pink_shulker_box")); @@ -1453,6 +1347,10 @@ public final class BlockTypes { public static final DefaultedRegistryReference PISTON_HEAD = BlockTypes.key(ResourceKey.minecraft("piston_head")); + public static final DefaultedRegistryReference PITCHER_CROP = BlockTypes.key(ResourceKey.minecraft("pitcher_crop")); + + public static final DefaultedRegistryReference PITCHER_PLANT = BlockTypes.key(ResourceKey.minecraft("pitcher_plant")); + public static final DefaultedRegistryReference PLAYER_HEAD = BlockTypes.key(ResourceKey.minecraft("player_head")); public static final DefaultedRegistryReference PLAYER_WALL_HEAD = BlockTypes.key(ResourceKey.minecraft("player_wall_head")); @@ -1531,8 +1429,6 @@ public final class BlockTypes { public static final DefaultedRegistryReference POTTED_CACTUS = BlockTypes.key(ResourceKey.minecraft("potted_cactus")); - @Experimental("update_1_20") - @ApiStatus.Experimental public static final DefaultedRegistryReference POTTED_CHERRY_SAPLING = BlockTypes.key(ResourceKey.minecraft("potted_cherry_sapling")); public static final DefaultedRegistryReference POTTED_CORNFLOWER = BlockTypes.key(ResourceKey.minecraft("potted_cornflower")); @@ -1573,8 +1469,6 @@ public final class BlockTypes { public static final DefaultedRegistryReference POTTED_SPRUCE_SAPLING = BlockTypes.key(ResourceKey.minecraft("potted_spruce_sapling")); - @Experimental("update_1_20") - @ApiStatus.Experimental public static final DefaultedRegistryReference POTTED_TORCHFLOWER = BlockTypes.key(ResourceKey.minecraft("potted_torchflower")); public static final DefaultedRegistryReference POTTED_WARPED_FUNGUS = BlockTypes.key(ResourceKey.minecraft("potted_warped_fungus")); @@ -1809,6 +1703,8 @@ public final class BlockTypes { public static final DefaultedRegistryReference SMOOTH_STONE_SLAB = BlockTypes.key(ResourceKey.minecraft("smooth_stone_slab")); + public static final DefaultedRegistryReference SNIFFER_EGG = BlockTypes.key(ResourceKey.minecraft("sniffer_egg")); + public static final DefaultedRegistryReference SNOW = BlockTypes.key(ResourceKey.minecraft("snow")); public static final DefaultedRegistryReference SNOW_BLOCK = BlockTypes.key(ResourceKey.minecraft("snow_block")); @@ -1841,8 +1737,6 @@ public final class BlockTypes { public static final DefaultedRegistryReference SPRUCE_FENCE_GATE = BlockTypes.key(ResourceKey.minecraft("spruce_fence_gate")); - @Experimental("update_1_20") - @ApiStatus.Experimental public static final DefaultedRegistryReference SPRUCE_HANGING_SIGN = BlockTypes.key(ResourceKey.minecraft("spruce_hanging_sign")); public static final DefaultedRegistryReference SPRUCE_LEAVES = BlockTypes.key(ResourceKey.minecraft("spruce_leaves")); @@ -1863,8 +1757,6 @@ public final class BlockTypes { public static final DefaultedRegistryReference SPRUCE_TRAPDOOR = BlockTypes.key(ResourceKey.minecraft("spruce_trapdoor")); - @Experimental("update_1_20") - @ApiStatus.Experimental public static final DefaultedRegistryReference SPRUCE_WALL_HANGING_SIGN = BlockTypes.key(ResourceKey.minecraft("spruce_wall_hanging_sign")); public static final DefaultedRegistryReference SPRUCE_WALL_SIGN = BlockTypes.key(ResourceKey.minecraft("spruce_wall_sign")); @@ -1897,20 +1789,14 @@ public final class BlockTypes { public static final DefaultedRegistryReference STRIPPED_ACACIA_WOOD = BlockTypes.key(ResourceKey.minecraft("stripped_acacia_wood")); - @Experimental("update_1_20") - @ApiStatus.Experimental public static final DefaultedRegistryReference STRIPPED_BAMBOO_BLOCK = BlockTypes.key(ResourceKey.minecraft("stripped_bamboo_block")); public static final DefaultedRegistryReference STRIPPED_BIRCH_LOG = BlockTypes.key(ResourceKey.minecraft("stripped_birch_log")); public static final DefaultedRegistryReference STRIPPED_BIRCH_WOOD = BlockTypes.key(ResourceKey.minecraft("stripped_birch_wood")); - @Experimental("update_1_20") - @ApiStatus.Experimental public static final DefaultedRegistryReference STRIPPED_CHERRY_LOG = BlockTypes.key(ResourceKey.minecraft("stripped_cherry_log")); - @Experimental("update_1_20") - @ApiStatus.Experimental public static final DefaultedRegistryReference STRIPPED_CHERRY_WOOD = BlockTypes.key(ResourceKey.minecraft("stripped_cherry_wood")); public static final DefaultedRegistryReference STRIPPED_CRIMSON_HYPHAE = BlockTypes.key(ResourceKey.minecraft("stripped_crimson_hyphae")); @@ -1949,8 +1835,8 @@ public final class BlockTypes { public static final DefaultedRegistryReference SUNFLOWER = BlockTypes.key(ResourceKey.minecraft("sunflower")); - @Experimental("update_1_20") - @ApiStatus.Experimental + public static final DefaultedRegistryReference SUSPICIOUS_GRAVEL = BlockTypes.key(ResourceKey.minecraft("suspicious_gravel")); + public static final DefaultedRegistryReference SUSPICIOUS_SAND = BlockTypes.key(ResourceKey.minecraft("suspicious_sand")); public static final DefaultedRegistryReference SWEET_BERRY_BUSH = BlockTypes.key(ResourceKey.minecraft("sweet_berry_bush")); @@ -1969,12 +1855,8 @@ public final class BlockTypes { public static final DefaultedRegistryReference TORCH = BlockTypes.key(ResourceKey.minecraft("torch")); - @Experimental("update_1_20") - @ApiStatus.Experimental public static final DefaultedRegistryReference TORCHFLOWER = BlockTypes.key(ResourceKey.minecraft("torchflower")); - @Experimental("update_1_20") - @ApiStatus.Experimental public static final DefaultedRegistryReference TORCHFLOWER_CROP = BlockTypes.key(ResourceKey.minecraft("torchflower_crop")); public static final DefaultedRegistryReference TRAPPED_CHEST = BlockTypes.key(ResourceKey.minecraft("trapped_chest")); @@ -2017,8 +1899,6 @@ public final class BlockTypes { public static final DefaultedRegistryReference WARPED_FUNGUS = BlockTypes.key(ResourceKey.minecraft("warped_fungus")); - @Experimental("update_1_20") - @ApiStatus.Experimental public static final DefaultedRegistryReference WARPED_HANGING_SIGN = BlockTypes.key(ResourceKey.minecraft("warped_hanging_sign")); public static final DefaultedRegistryReference WARPED_HYPHAE = BlockTypes.key(ResourceKey.minecraft("warped_hyphae")); @@ -2041,8 +1921,6 @@ public final class BlockTypes { public static final DefaultedRegistryReference WARPED_TRAPDOOR = BlockTypes.key(ResourceKey.minecraft("warped_trapdoor")); - @Experimental("update_1_20") - @ApiStatus.Experimental public static final DefaultedRegistryReference WARPED_WALL_HANGING_SIGN = BlockTypes.key(ResourceKey.minecraft("warped_wall_hanging_sign")); public static final DefaultedRegistryReference WARPED_WALL_SIGN = BlockTypes.key(ResourceKey.minecraft("warped_wall_sign")); diff --git a/src/main/java/org/spongepowered/api/block/entity/BlockEntityTypes.java b/src/main/java/org/spongepowered/api/block/entity/BlockEntityTypes.java index 95bdeeb3b81..2bfefc93dc5 100644 --- a/src/main/java/org/spongepowered/api/block/entity/BlockEntityTypes.java +++ b/src/main/java/org/spongepowered/api/block/entity/BlockEntityTypes.java @@ -57,6 +57,10 @@ public final class BlockEntityTypes { public static final DefaultedRegistryReference BREWING_STAND = BlockEntityTypes.key(ResourceKey.minecraft("brewing_stand")); + public static final DefaultedRegistryReference BRUSHABLE_BLOCK = BlockEntityTypes.key(ResourceKey.minecraft("brushable_block")); + + public static final DefaultedRegistryReference CALIBRATED_SCULK_SENSOR = BlockEntityTypes.key(ResourceKey.minecraft("calibrated_sculk_sensor")); + public static final DefaultedRegistryReference CAMPFIRE = BlockEntityTypes.key(ResourceKey.minecraft("campfire")); public static final DefaultedRegistryReference CHEST = BlockEntityTypes.key(ResourceKey.minecraft("chest")); @@ -117,8 +121,6 @@ public final class BlockEntityTypes { public static final DefaultedRegistryReference STRUCTURE_BLOCK = BlockEntityTypes.key(ResourceKey.minecraft("structure_block")); - public static final DefaultedRegistryReference SUSPICIOUS_SAND = BlockEntityTypes.key(ResourceKey.minecraft("suspicious_sand")); - public static final DefaultedRegistryReference TRAPPED_CHEST = BlockEntityTypes.key(ResourceKey.minecraft("trapped_chest")); // @formatter:on diff --git a/src/main/java/org/spongepowered/api/block/entity/Sign.java b/src/main/java/org/spongepowered/api/block/entity/Sign.java index 044d46671af..2caaad9c146 100644 --- a/src/main/java/org/spongepowered/api/block/entity/Sign.java +++ b/src/main/java/org/spongepowered/api/block/entity/Sign.java @@ -25,7 +25,9 @@ package org.spongepowered.api.block.entity; import net.kyori.adventure.text.Component; +import org.spongepowered.api.data.DataHolder; import org.spongepowered.api.data.Keys; +import org.spongepowered.api.data.type.DyeColor; import org.spongepowered.api.data.value.ListValue; import org.spongepowered.api.data.value.Value; import org.spongepowered.api.util.Nameable; @@ -46,10 +48,69 @@ default ListValue.Mutable lines() { } /** - * {@return Whether this sign has glowing text}. + * Gets whether the front side {@link SignText} has {@link SignText#glowingText() glowing text} + * + * @return Whether this sign has glowing text */ default Value.Mutable glowingText() { return this.requireValue(Keys.GLOWING_TEXT).asMutable(); } + /** + * Gets whether this sign is waxed. + * + * @return true when this sign is waxed. + */ + default Value.Mutable waxed() { + return this.requireValue(Keys.SIGN_WAXED).asMutable(); + } + + /** + * Gets the back side {@link SignText} + * + * @return the back side sign-text + */ + default SignText backText() { + return this.require(Keys.SIGN_BACK_TEXT); + } + + /** + * Gets the front side {@link SignText} + * + * @return the back side sign-text + */ + default SignText frontText() { + return this.require(Keys.SIGN_FRONT_TEXT); + } + + interface SignText extends DataHolder.Mutable { + + /** + * Gets the {@link org.spongepowered.api.data.value.ListValue.Mutable} of {@link Component} for the {@link Sign} + * to show. + * + * @return The list of text lines + */ + default ListValue.Mutable lines() { + return this.requireValue(Keys.SIGN_LINES).asMutable(); + } + + /** + * Gets whether this sign has glowing text. + * + * @return Whether this sign has glowing text. + */ + default Value.Mutable glowingText() { + return this.requireValue(Keys.GLOWING_TEXT).asMutable(); + } + + /** + * Gets the {@link DyeColor} of this sign text. + * + * @return the dye-color of this sign text + */ + default Value.Mutable dyeColor() { + return this.requireValue(Keys.DYE_COLOR).asMutable(); + } + } } diff --git a/src/main/java/org/spongepowered/api/command/selector/Selector.java b/src/main/java/org/spongepowered/api/command/selector/Selector.java index 7174e46420a..352d4ba285c 100644 --- a/src/main/java/org/spongepowered/api/command/selector/Selector.java +++ b/src/main/java/org/spongepowered/api/command/selector/Selector.java @@ -24,6 +24,7 @@ */ package org.spongepowered.api.command.selector; +import org.spongepowered.api.ResourceKey; import org.spongepowered.api.Sponge; import org.spongepowered.api.advancement.Advancement; import org.spongepowered.api.advancement.criteria.AdvancementCriterion; @@ -201,41 +202,41 @@ interface Builder extends org.spongepowered.api.util.Builder * Adds an {@link Advancement} constraint to this selector, requiring * that the advancement must be granted to be selected. * - * @param advancement The advancement that players must have. + * @param advancement The key of the advancement that players must have. * @return This builder, for chaining */ - Builder addAdvancement(Advancement advancement); + Builder addAdvancement(ResourceKey advancement); /** * Adds an {@link Advancement} constraint to this selector, requiring * that the advancement must NOT be granted to be selected. * - * @param advancement The advancement that players must not have. + * @param advancement The key of the advancement that players must not have. * @return This builder, for chaining */ - Builder addNotAdvancement(Advancement advancement); + Builder addNotAdvancement(ResourceKey advancement); /** * Adds an {@link AdvancementCriterion} constraint to this selector, * requiring that the criterion on the given {@link Advancement} must * be granted to be selected. * - * @param advancement The advancement + * @param advancement The key of the advancement * @param criterion The criterion the player must have * @return This builder, for chaining */ - Builder addAdvancementCriterion(Advancement advancement, AdvancementCriterion criterion); + Builder addAdvancementCriterion(ResourceKey advancement, AdvancementCriterion criterion); /** * Adds an {@link AdvancementCriterion} constraint to this selector, * requiring that the criterion on the given {@link Advancement} must * not be granted to be selected. * - * @param advancement The advancement + * @param advancement The key of the advancement * @param criterion The criterion the player must not have * @return This builder, for chaining */ - Builder addNotAdvancementCriterion(Advancement advancement, AdvancementCriterion criterion); + Builder addNotAdvancementCriterion(ResourceKey advancement, AdvancementCriterion criterion); /** * Adds an {@link DataView} as an NBT style constraint. diff --git a/src/main/java/org/spongepowered/api/data/BlockStateKeys.java b/src/main/java/org/spongepowered/api/data/BlockStateKeys.java index 227af97372e..7255316d386 100644 --- a/src/main/java/org/spongepowered/api/data/BlockStateKeys.java +++ b/src/main/java/org/spongepowered/api/data/BlockStateKeys.java @@ -110,6 +110,8 @@ public final class BlockStateKeys { public static final Key> CONDITIONAL = BlockStateKeys.key(ResourceKey.minecraft("property/conditional"), Boolean.class); + public static final Key> CRACKED = BlockStateKeys.key(ResourceKey.minecraft("property/cracked"), Boolean.class); + public static final Key> DELAY = BlockStateKeys.key(ResourceKey.minecraft("property/delay"), Integer.class); public static final Key> DISARMED = BlockStateKeys.key(ResourceKey.minecraft("property/disarmed"), Boolean.class); diff --git a/src/main/java/org/spongepowered/api/data/DataManipulator.java b/src/main/java/org/spongepowered/api/data/DataManipulator.java index 950f9f37a5c..05254bc457e 100644 --- a/src/main/java/org/spongepowered/api/data/DataManipulator.java +++ b/src/main/java/org/spongepowered/api/data/DataManipulator.java @@ -496,11 +496,7 @@ default Mutable set(final Value value) { */ default Mutable set(final Value... values) { for (final Value value : Objects.requireNonNull(values)) { - try { - this.set(Objects.requireNonNull(value, "A null value was provided!")); - } catch (final IllegalArgumentException e) { - e.printStackTrace(); - } + this.set(Objects.requireNonNull(value, "A null value was provided!")); } return this; } @@ -518,11 +514,7 @@ default Mutable set(final Value... values) { */ default Mutable set(final Iterable> values) { for (final Value value : Objects.requireNonNull(values)) { - try { - this.set(Objects.requireNonNull(value, "A null value was provided!")); - } catch (final IllegalArgumentException e) { - e.printStackTrace(); - } + this.set(Objects.requireNonNull(value, "A null value was provided!")); } return this; } diff --git a/src/main/java/org/spongepowered/api/data/Keys.java b/src/main/java/org/spongepowered/api/data/Keys.java index ce25b19daf9..2bda39be875 100644 --- a/src/main/java/org/spongepowered/api/data/Keys.java +++ b/src/main/java/org/spongepowered/api/data/Keys.java @@ -1148,8 +1148,8 @@ public final class Keys { public static final Key> GRASS_COLOR_MODIFIER = Keys.key(ResourceKey.sponge("grass_color_modifier"), GrassColorModifier.class); /** - * Whether a {@link Sign} has glowing text (from dying - * with {@link ItemTypes#GLOW_INK_SAC}). + * Whether a {@link org.spongepowered.api.block.entity.Sign.SignText} has glowing text (from dying + * with {@link ItemTypes#GLOW_INK_SAC}). When using it on {@link Sign} this refers to the {@link #SIGN_FRONT_TEXT} only. */ public static final Key> GLOWING_TEXT = Keys.key(ResourceKey.sponge("glowing_text"), Boolean.class); @@ -2761,10 +2761,16 @@ public final class Keys { public static final Key> SHOW_BOTTOM = Keys.key(ResourceKey.sponge("show_bottom"), Boolean.class); /** - * The lines displayed on a {@link Sign}. + * The lines of a {@link org.spongepowered.api.block.entity.Sign.SignText}. + * When using it on {@link Sign} this refers to the {@link #SIGN_FRONT_TEXT} only. */ public static final Key> SIGN_LINES = Keys.listKey(ResourceKey.sponge("sign_lines"), Component.class); + public static final Key> SIGN_BACK_TEXT = Keys.key(ResourceKey.sponge("sign_back_text"), Sign.SignText.class); + public static final Key> SIGN_FRONT_TEXT = Keys.key(ResourceKey.sponge("sign_front_text"), Sign.SignText.class); + + public static final Key> SIGN_WAXED = Keys.key(ResourceKey.sponge("sign_waxed"), Boolean.class); + /** * The size of a {@link Slime}. * or diff --git a/src/main/java/org/spongepowered/api/data/type/ArmorMaterials.java b/src/main/java/org/spongepowered/api/data/type/ArmorMaterials.java index 161c200b1a2..1b067997a2a 100644 --- a/src/main/java/org/spongepowered/api/data/type/ArmorMaterials.java +++ b/src/main/java/org/spongepowered/api/data/type/ArmorMaterials.java @@ -38,9 +38,7 @@ public final class ArmorMaterials { // @formatter:off - // SORTFIELDS:ON - public static final DefaultedRegistryReference CHAINMAIL = ArmorMaterials.key(ResourceKey.sponge("chainmail")); public static final DefaultedRegistryReference DIAMOND = ArmorMaterials.key(ResourceKey.sponge("diamond")); @@ -51,12 +49,12 @@ public final class ArmorMaterials { public static final DefaultedRegistryReference LEATHER = ArmorMaterials.key(ResourceKey.sponge("leather")); + public static final DefaultedRegistryReference NETHERITE = ArmorMaterials.key(ResourceKey.sponge("netherite")); + public static final DefaultedRegistryReference TURTLE = ArmorMaterials.key(ResourceKey.sponge("turtle")); // SORTFIELDS:OFF - // @formatter:on - private ArmorMaterials() { } diff --git a/src/main/java/org/spongepowered/api/data/type/BambooLeavesTypes.java b/src/main/java/org/spongepowered/api/data/type/BambooLeavesTypes.java index 603aa569812..ecffa37e235 100644 --- a/src/main/java/org/spongepowered/api/data/type/BambooLeavesTypes.java +++ b/src/main/java/org/spongepowered/api/data/type/BambooLeavesTypes.java @@ -38,15 +38,13 @@ public final class BambooLeavesTypes { // @formatter:off + public static final DefaultedRegistryReference LARGE = BambooLeavesTypes.key(ResourceKey.sponge("large")); public static final DefaultedRegistryReference NONE = BambooLeavesTypes.key(ResourceKey.sponge("none")); public static final DefaultedRegistryReference SMALL = BambooLeavesTypes.key(ResourceKey.sponge("small")); - public static final DefaultedRegistryReference LARGE = BambooLeavesTypes.key(ResourceKey.sponge("large")); - // @formatter:on - private BambooLeavesTypes() { } diff --git a/src/main/java/org/spongepowered/api/data/type/DyeColors.java b/src/main/java/org/spongepowered/api/data/type/DyeColors.java index 47849e6235a..66cf59ba488 100644 --- a/src/main/java/org/spongepowered/api/data/type/DyeColors.java +++ b/src/main/java/org/spongepowered/api/data/type/DyeColors.java @@ -41,9 +41,7 @@ public final class DyeColors { // @formatter:off - // SORTFIELDS:ON - public static final DefaultedRegistryReference BLACK = DyeColors.key(ResourceKey.sponge("black")); public static final DefaultedRegistryReference BLUE = DyeColors.key(ResourceKey.sponge("blue")); @@ -77,9 +75,7 @@ public final class DyeColors { public static final DefaultedRegistryReference YELLOW = DyeColors.key(ResourceKey.sponge("yellow")); // SORTFIELDS:OFF - // @formatter:on - private DyeColors() { } diff --git a/src/main/java/org/spongepowered/api/data/type/FoxTypes.java b/src/main/java/org/spongepowered/api/data/type/FoxTypes.java index 83c7df6715f..6fd233ed4e8 100644 --- a/src/main/java/org/spongepowered/api/data/type/FoxTypes.java +++ b/src/main/java/org/spongepowered/api/data/type/FoxTypes.java @@ -41,17 +41,13 @@ public final class FoxTypes { // @formatter:off - // SORTFIELDS:ON - public static final DefaultedRegistryReference RED = FoxTypes.key(ResourceKey.sponge("red")); public static final DefaultedRegistryReference SNOW = FoxTypes.key(ResourceKey.sponge("snow")); // SORTFIELDS:OFF - // @formatter:on - private FoxTypes() { } diff --git a/src/main/java/org/spongepowered/api/data/type/HorseColors.java b/src/main/java/org/spongepowered/api/data/type/HorseColors.java index 86507018aea..ba02ac51c5b 100644 --- a/src/main/java/org/spongepowered/api/data/type/HorseColors.java +++ b/src/main/java/org/spongepowered/api/data/type/HorseColors.java @@ -41,9 +41,7 @@ public final class HorseColors { // @formatter:off - // SORTFIELDS:ON - public static final DefaultedRegistryReference BLACK = HorseColors.key(ResourceKey.sponge("black")); public static final DefaultedRegistryReference BROWN = HorseColors.key(ResourceKey.sponge("brown")); @@ -59,9 +57,7 @@ public final class HorseColors { public static final DefaultedRegistryReference WHITE = HorseColors.key(ResourceKey.sponge("white")); // SORTFIELDS:OFF - // @formatter:on - private HorseColors() { } diff --git a/src/main/java/org/spongepowered/api/data/type/HorseStyles.java b/src/main/java/org/spongepowered/api/data/type/HorseStyles.java index d76452e3631..7b4516f51fb 100644 --- a/src/main/java/org/spongepowered/api/data/type/HorseStyles.java +++ b/src/main/java/org/spongepowered/api/data/type/HorseStyles.java @@ -41,23 +41,19 @@ public final class HorseStyles { // @formatter:off - // SORTFIELDS:ON - public static final DefaultedRegistryReference BLACK_DOTS = HorseStyles.key(ResourceKey.sponge("black_dots")); public static final DefaultedRegistryReference NONE = HorseStyles.key(ResourceKey.sponge("none")); public static final DefaultedRegistryReference WHITE = HorseStyles.key(ResourceKey.sponge("white")); - public static final DefaultedRegistryReference WHITE_FIELD = HorseStyles.key(ResourceKey.sponge("white_field")); - public static final DefaultedRegistryReference WHITE_DOTS = HorseStyles.key(ResourceKey.sponge("white_dots")); - // SORTFIELDS:OFF + public static final DefaultedRegistryReference WHITE_FIELD = HorseStyles.key(ResourceKey.sponge("white_field")); + // SORTFIELDS:OFF // @formatter:on - private HorseStyles() { } diff --git a/src/main/java/org/spongepowered/api/data/type/InstrumentTypes.java b/src/main/java/org/spongepowered/api/data/type/InstrumentTypes.java index 8addb97a117..24d933ea849 100644 --- a/src/main/java/org/spongepowered/api/data/type/InstrumentTypes.java +++ b/src/main/java/org/spongepowered/api/data/type/InstrumentTypes.java @@ -41,15 +41,13 @@ public final class InstrumentTypes { // @formatter:off - // SORTFIELDS:ON - public static final DefaultedRegistryReference BANJO = InstrumentTypes.key(ResourceKey.sponge("banjo")); - public static final DefaultedRegistryReference BASS = InstrumentTypes.key(ResourceKey.sponge("bass")); - public static final DefaultedRegistryReference BASE_DRUM = InstrumentTypes.key(ResourceKey.sponge("basedrum")); + public static final DefaultedRegistryReference BASS = InstrumentTypes.key(ResourceKey.sponge("bass")); + public static final DefaultedRegistryReference BELL = InstrumentTypes.key(ResourceKey.sponge("bell")); public static final DefaultedRegistryReference BIT = InstrumentTypes.key(ResourceKey.sponge("bit")); @@ -58,8 +56,14 @@ public final class InstrumentTypes { public static final DefaultedRegistryReference COW_BELL = InstrumentTypes.key(ResourceKey.sponge("cow_bell")); + public static final DefaultedRegistryReference CREEPER = InstrumentTypes.key(ResourceKey.sponge("creeper")); + + public static final DefaultedRegistryReference CUSTOM_HEAD = InstrumentTypes.key(ResourceKey.sponge("custom_head")); + public static final DefaultedRegistryReference DIDGERIDOO = InstrumentTypes.key(ResourceKey.sponge("didgeridoo")); + public static final DefaultedRegistryReference DRAGON = InstrumentTypes.key(ResourceKey.sponge("dragon")); + public static final DefaultedRegistryReference FLUTE = InstrumentTypes.key(ResourceKey.sponge("flute")); public static final DefaultedRegistryReference GUITAR = InstrumentTypes.key(ResourceKey.sponge("guitar")); @@ -70,16 +74,22 @@ public final class InstrumentTypes { public static final DefaultedRegistryReference IRON_XYLOPHONE = InstrumentTypes.key(ResourceKey.sponge("iron_xylophone")); + public static final DefaultedRegistryReference PIGLIN = InstrumentTypes.key(ResourceKey.sponge("piglin")); + public static final DefaultedRegistryReference PLING = InstrumentTypes.key(ResourceKey.sponge("pling")); + public static final DefaultedRegistryReference SKELETON = InstrumentTypes.key(ResourceKey.sponge("skeleton")); + public static final DefaultedRegistryReference SNARE = InstrumentTypes.key(ResourceKey.sponge("snare")); + public static final DefaultedRegistryReference WITHER_SKELETON = InstrumentTypes.key(ResourceKey.sponge("wither_skeleton")); + public static final DefaultedRegistryReference XYLOPHONE = InstrumentTypes.key(ResourceKey.sponge("xylophone")); - // SORTFIELDS:OFF + public static final DefaultedRegistryReference ZOMBIE = InstrumentTypes.key(ResourceKey.sponge("zombie")); + // SORTFIELDS:OFF // @formatter:on - private InstrumentTypes() { } diff --git a/src/main/java/org/spongepowered/api/data/type/TropicalFishShapes.java b/src/main/java/org/spongepowered/api/data/type/TropicalFishShapes.java index 290de413f96..3f5521cca3f 100644 --- a/src/main/java/org/spongepowered/api/data/type/TropicalFishShapes.java +++ b/src/main/java/org/spongepowered/api/data/type/TropicalFishShapes.java @@ -42,9 +42,7 @@ public final class TropicalFishShapes { // @formatter:off - // SORTFIELDS:ON - public static final DefaultedRegistryReference BETTY = TropicalFishShapes.key(ResourceKey.sponge("betty")); public static final DefaultedRegistryReference BLOCKFISH = TropicalFishShapes.key(ResourceKey.sponge("blockfish")); @@ -70,9 +68,7 @@ public final class TropicalFishShapes { public static final DefaultedRegistryReference SUNSTREAK = TropicalFishShapes.key(ResourceKey.sponge("sunstreak")); // SORTFIELDS:OFF - // @formatter:on - private TropicalFishShapes() { } diff --git a/src/main/java/org/spongepowered/api/effect/particle/ParticleOptions.java b/src/main/java/org/spongepowered/api/effect/particle/ParticleOptions.java index 924d98524d7..f7debab78e6 100644 --- a/src/main/java/org/spongepowered/api/effect/particle/ParticleOptions.java +++ b/src/main/java/org/spongepowered/api/effect/particle/ParticleOptions.java @@ -37,6 +37,7 @@ import org.spongepowered.api.registry.RegistryTypes; import org.spongepowered.api.util.Color; import org.spongepowered.api.util.Direction; +import org.spongepowered.api.util.Ticks; import org.spongepowered.math.vector.Vector3d; /** @@ -74,21 +75,21 @@ public final class ParticleOptions { */ public static final DefaultedRegistryReference> COLOR = ParticleOptions.key(ResourceKey.sponge("color")); + /** + * This option will affect the delay of particles that are spawned. + * The only vanilla {@link ParticleType}s this option isn't applicable to are: + * + *
    + *
  • {@link ParticleTypes#SHRIEK}
  • + *
+ */ + public static final DefaultedRegistryReference> DELAY = ParticleOptions.key(ResourceKey.sponge("delay")); + /** * This option will change the direction of a particle. */ public static final DefaultedRegistryReference> DIRECTION = ParticleOptions.key(ResourceKey.sponge("direction")); -// /** TODO -// * This option will modify the color of a particle. The only vanilla -// * {@link ParticleType}s this option is applicable to is -// * {@link ParticleTypes#FIREWORKS}. -// * -// *

The {@link List} may never be empty. Or a {@link IllegalArgumentException} -// * will be thrown when applying.

-// */ -// public static final Supplier>> FIREWORK_EFFECTS = Sponge.getRegistry().getCatalogRegistry().provideSupplier(ParticleOption.class, "firework_effects"); - /** * This option will affect the appearance of a particle. The only vanilla * {@link ParticleType} this option is applicable to are: @@ -101,13 +102,6 @@ public final class ParticleOptions { */ public static final DefaultedRegistryReference> ITEM_STACK_SNAPSHOT = ParticleOptions.key(ResourceKey.sponge("item_stack_snapshot")); -// /** TODO -// * This option will affect the appearance of a particle. The only vanilla -// * {@link ParticleType} this option is applicable to is -// * {@link ParticleTypes#NOTE}. -// */ -// public static final Supplier> NOTE = Sponge.getRegistry().getCatalogRegistry().provideSupplier(ParticleOption.class, "note"); - /** * This option will affect how all the particles are spread. */ @@ -134,6 +128,16 @@ public final class ParticleOptions { */ public static final DefaultedRegistryReference> QUANTITY = ParticleOptions.key(ResourceKey.sponge("quantity")); + /** + * This option will change the roll of a particle. The only + * vanilla {@link ParticleType}s this option is applicable to is: + * + *
    + *
  • {@link ParticleTypes#SCULK_CHARGE}
  • + *
+ */ + public static final DefaultedRegistryReference> ROLL = ParticleOptions.key(ResourceKey.sponge("roll")); + /** * This option will change the scale of a particle. The only * vanilla {@link ParticleType}s this option is applicable to is: @@ -147,21 +151,25 @@ public final class ParticleOptions { */ public static final DefaultedRegistryReference> SCALE = ParticleOptions.key(ResourceKey.sponge("scale")); -// /** TODO -// * This option will affect whether a particle type will have a lower -// * velocity in the horizontal plane. The only vanilla {@link ParticleType}s -// * that this option will affect are: -// * -// *
    -// *
  • {@link ParticleTypes#EFFECT}
  • -// *
  • {@link ParticleTypes#INSTANT_EFFECT}
  • -// *
  • {@link ParticleTypes#WITCH_MAGIC}
  • -// *
-// * -// *

These particle types don't have a configurable velocity (through -// * {@link #VELOCITY}) in the horizontal plane.

-// */ -// public static final Supplier> SLOW_HORIZONTAL_VELOCITY = Sponge.getRegistry().getCatalogRegistry().provideSupplier(ParticleOption.class, "slow_horizontal_velocity"); + /** + * This option will change the color the transition particle will change to. + * The only vanilla {@link ParticleType}s this option is applicable to is: + * + *
    + *
  • {@link ParticleTypes#DUST_COLOR_TRANSITION}
  • + *
+ */ + public static final DefaultedRegistryReference> TO_COLOR = ParticleOptions.key(ResourceKey.sponge("to_color")); + + /** + * This option will change the travel time of a particle. + * The only vanilla {@link ParticleType}s this option is applicable to is: + * + *
    + *
  • {@link ParticleTypes#VIBRATION}
  • + *
+ */ + public static final DefaultedRegistryReference> TRAVEL_TIME = ParticleOptions.key(ResourceKey.sponge("travel_time")); /** * This option will affect how most particles are moving. diff --git a/src/main/java/org/spongepowered/api/effect/particle/ParticleTypes.java b/src/main/java/org/spongepowered/api/effect/particle/ParticleTypes.java index 8c19f1d314c..3ba58942e08 100644 --- a/src/main/java/org/spongepowered/api/effect/particle/ParticleTypes.java +++ b/src/main/java/org/spongepowered/api/effect/particle/ParticleTypes.java @@ -61,6 +61,8 @@ public final class ParticleTypes { public static final DefaultedRegistryReference CAMPFIRE_SIGNAL_SMOKE = ParticleTypes.key(ResourceKey.minecraft("campfire_signal_smoke")); + public static final DefaultedRegistryReference CHERRY_LEAVES = ParticleTypes.key(ResourceKey.minecraft("cherry_leaves")); + public static final DefaultedRegistryReference CLOUD = ParticleTypes.key(ResourceKey.minecraft("cloud")); public static final DefaultedRegistryReference COMPOSTER = ParticleTypes.key(ResourceKey.minecraft("composter")); @@ -77,8 +79,6 @@ public final class ParticleTypes { public static final DefaultedRegistryReference DRAGON_BREATH = ParticleTypes.key(ResourceKey.minecraft("dragon_breath")); - public static final DefaultedRegistryReference DRIPPING_CHERRY_LEAVES = ParticleTypes.key(ResourceKey.minecraft("dripping_cherry_leaves")); - public static final DefaultedRegistryReference DRIPPING_DRIPSTONE_LAVA = ParticleTypes.key(ResourceKey.minecraft("dripping_dripstone_lava")); public static final DefaultedRegistryReference DRIPPING_DRIPSTONE_WATER = ParticleTypes.key(ResourceKey.minecraft("dripping_dripstone_water")); @@ -97,6 +97,8 @@ public final class ParticleTypes { public static final DefaultedRegistryReference EFFECT = ParticleTypes.key(ResourceKey.minecraft("effect")); + public static final DefaultedRegistryReference EGG_CRACK = ParticleTypes.key(ResourceKey.minecraft("egg_crack")); + public static final DefaultedRegistryReference ELDER_GUARDIAN = ParticleTypes.key(ResourceKey.minecraft("elder_guardian")); public static final DefaultedRegistryReference ELECTRIC_SPARK = ParticleTypes.key(ResourceKey.minecraft("electric_spark")); @@ -113,8 +115,6 @@ public final class ParticleTypes { public static final DefaultedRegistryReference EXPLOSION_EMITTER = ParticleTypes.key(ResourceKey.minecraft("explosion_emitter")); - public static final DefaultedRegistryReference FALLING_CHERRY_LEAVES = ParticleTypes.key(ResourceKey.minecraft("falling_cherry_leaves")); - public static final DefaultedRegistryReference FALLING_DRIPSTONE_LAVA = ParticleTypes.key(ResourceKey.minecraft("falling_dripstone_lava")); public static final DefaultedRegistryReference FALLING_DRIPSTONE_WATER = ParticleTypes.key(ResourceKey.minecraft("falling_dripstone_water")); @@ -157,8 +157,6 @@ public final class ParticleTypes { public static final DefaultedRegistryReference ITEM_SNOWBALL = ParticleTypes.key(ResourceKey.minecraft("item_snowball")); - public static final DefaultedRegistryReference LANDING_CHERRY_LEAVES = ParticleTypes.key(ResourceKey.minecraft("landing_cherry_leaves")); - public static final DefaultedRegistryReference LANDING_HONEY = ParticleTypes.key(ResourceKey.minecraft("landing_honey")); public static final DefaultedRegistryReference LANDING_LAVA = ParticleTypes.key(ResourceKey.minecraft("landing_lava")); diff --git a/src/main/java/org/spongepowered/api/effect/potion/PotionEffect.java b/src/main/java/org/spongepowered/api/effect/potion/PotionEffect.java index 2b83756d6e2..350a9d0cea7 100644 --- a/src/main/java/org/spongepowered/api/effect/potion/PotionEffect.java +++ b/src/main/java/org/spongepowered/api/effect/potion/PotionEffect.java @@ -61,7 +61,7 @@ static Builder builder() { * @param amplifier The zero-indexed amplifier * @param duration The duration in ticks * @return The potion effect - * @throws IllegalArgumentException If the amplifier is negative or the duration is not positive + * @throws IllegalArgumentException If the duration is not positive */ static PotionEffect of(final PotionEffectType type, final int amplifier, final Ticks duration) throws IllegalArgumentException { return PotionEffect.builder().potionType(type).amplifier(amplifier).duration(duration).build(); @@ -76,7 +76,7 @@ static PotionEffect of(final PotionEffectType type, final int amplifier, final T * @param amplifier The amplifier * @param duration The duration in ticks * @return The potion effect - * @throws IllegalArgumentException If the amplifier is negative or the duration is not positive + * @throws IllegalArgumentException If the duration is not positive */ static PotionEffect of(final Supplier type, final int amplifier, final Ticks duration) throws IllegalArgumentException { return PotionEffect.builder().potionType(type).amplifier(amplifier).duration(duration).build(); @@ -172,15 +172,14 @@ default Builder potionType(final Supplier potionEffe /** * Sets the amplifier power of the potion effect. * - *

Amplifiers must be greater than or equal to zero. See + *

See * {@link #amplifier()} for an explanation of what the amplifier means. *

* * @param amplifier The amplifier power * @return This builder, for chaining - * @throws IllegalArgumentException If the amplifier is less than zero */ - Builder amplifier(int amplifier) throws IllegalArgumentException; + Builder amplifier(int amplifier); /** * Sets whether the potion effect is ambient. diff --git a/src/main/java/org/spongepowered/api/effect/sound/SoundTypes.java b/src/main/java/org/spongepowered/api/effect/sound/SoundTypes.java index 9c736a70186..aa76ceaf85d 100644 --- a/src/main/java/org/spongepowered/api/effect/sound/SoundTypes.java +++ b/src/main/java/org/spongepowered/api/effect/sound/SoundTypes.java @@ -95,6 +95,8 @@ public final class SoundTypes { public static final DefaultedRegistryReference BLOCK_AMETHYST_BLOCK_PLACE = SoundTypes.key(ResourceKey.minecraft("block.amethyst_block.place")); + public static final DefaultedRegistryReference BLOCK_AMETHYST_BLOCK_RESONATE = SoundTypes.key(ResourceKey.minecraft("block.amethyst_block.resonate")); + public static final DefaultedRegistryReference BLOCK_AMETHYST_BLOCK_STEP = SoundTypes.key(ResourceKey.minecraft("block.amethyst_block.step")); public static final DefaultedRegistryReference BLOCK_AMETHYST_CLUSTER_BREAK = SoundTypes.key(ResourceKey.minecraft("block.amethyst_cluster.break")); @@ -1145,6 +1147,8 @@ public final class SoundTypes { public static final DefaultedRegistryReference BLOCK_SHULKER_BOX_OPEN = SoundTypes.key(ResourceKey.minecraft("block.shulker_box.open")); + public static final DefaultedRegistryReference BLOCK_SIGN_WAXED_INTERACT_FAIL = SoundTypes.key(ResourceKey.minecraft("block.sign.waxed_interact_fail")); + public static final DefaultedRegistryReference BLOCK_SLIME_BLOCK_BREAK = SoundTypes.key(ResourceKey.minecraft("block.slime_block.break")); public static final DefaultedRegistryReference BLOCK_SLIME_BLOCK_FALL = SoundTypes.key(ResourceKey.minecraft("block.slime_block.fall")); @@ -1173,6 +1177,12 @@ public final class SoundTypes { public static final DefaultedRegistryReference BLOCK_SMOKER_SMOKE = SoundTypes.key(ResourceKey.minecraft("block.smoker.smoke")); + public static final DefaultedRegistryReference BLOCK_SNIFFER_EGG_CRACK = SoundTypes.key(ResourceKey.minecraft("block.sniffer_egg.crack")); + + public static final DefaultedRegistryReference BLOCK_SNIFFER_EGG_HATCH = SoundTypes.key(ResourceKey.minecraft("block.sniffer_egg.hatch")); + + public static final DefaultedRegistryReference BLOCK_SNIFFER_EGG_PLOP = SoundTypes.key(ResourceKey.minecraft("block.sniffer_egg.plop")); + public static final DefaultedRegistryReference BLOCK_SNOW_BREAK = SoundTypes.key(ResourceKey.minecraft("block.snow.break")); public static final DefaultedRegistryReference BLOCK_SNOW_FALL = SoundTypes.key(ResourceKey.minecraft("block.snow.fall")); @@ -1203,6 +1213,18 @@ public final class SoundTypes { public static final DefaultedRegistryReference BLOCK_SOUL_SOIL_STEP = SoundTypes.key(ResourceKey.minecraft("block.soul_soil.step")); + public static final DefaultedRegistryReference BLOCK_SPONGE_ABSORB = SoundTypes.key(ResourceKey.minecraft("block.sponge.absorb")); + + public static final DefaultedRegistryReference BLOCK_SPONGE_BREAK = SoundTypes.key(ResourceKey.minecraft("block.sponge.break")); + + public static final DefaultedRegistryReference BLOCK_SPONGE_FALL = SoundTypes.key(ResourceKey.minecraft("block.sponge.fall")); + + public static final DefaultedRegistryReference BLOCK_SPONGE_HIT = SoundTypes.key(ResourceKey.minecraft("block.sponge.hit")); + + public static final DefaultedRegistryReference BLOCK_SPONGE_PLACE = SoundTypes.key(ResourceKey.minecraft("block.sponge.place")); + + public static final DefaultedRegistryReference BLOCK_SPONGE_STEP = SoundTypes.key(ResourceKey.minecraft("block.sponge.step")); + public static final DefaultedRegistryReference BLOCK_SPORE_BLOSSOM_BREAK = SoundTypes.key(ResourceKey.minecraft("block.spore_blossom.break")); public static final DefaultedRegistryReference BLOCK_SPORE_BLOSSOM_FALL = SoundTypes.key(ResourceKey.minecraft("block.spore_blossom.fall")); @@ -1241,6 +1263,16 @@ public final class SoundTypes { public static final DefaultedRegistryReference BLOCK_STONE_PRESSURE_PLATE_CLICK_ON = SoundTypes.key(ResourceKey.minecraft("block.stone_pressure_plate.click_on")); + public static final DefaultedRegistryReference BLOCK_SUSPICIOUS_GRAVEL_BREAK = SoundTypes.key(ResourceKey.minecraft("block.suspicious_gravel.break")); + + public static final DefaultedRegistryReference BLOCK_SUSPICIOUS_GRAVEL_FALL = SoundTypes.key(ResourceKey.minecraft("block.suspicious_gravel.fall")); + + public static final DefaultedRegistryReference BLOCK_SUSPICIOUS_GRAVEL_HIT = SoundTypes.key(ResourceKey.minecraft("block.suspicious_gravel.hit")); + + public static final DefaultedRegistryReference BLOCK_SUSPICIOUS_GRAVEL_PLACE = SoundTypes.key(ResourceKey.minecraft("block.suspicious_gravel.place")); + + public static final DefaultedRegistryReference BLOCK_SUSPICIOUS_GRAVEL_STEP = SoundTypes.key(ResourceKey.minecraft("block.suspicious_gravel.step")); + public static final DefaultedRegistryReference BLOCK_SUSPICIOUS_SAND_BREAK = SoundTypes.key(ResourceKey.minecraft("block.suspicious_sand.break")); public static final DefaultedRegistryReference BLOCK_SUSPICIOUS_SAND_FALL = SoundTypes.key(ResourceKey.minecraft("block.suspicious_sand.fall")); @@ -1317,6 +1349,16 @@ public final class SoundTypes { public static final DefaultedRegistryReference BLOCK_WET_GRASS_STEP = SoundTypes.key(ResourceKey.minecraft("block.wet_grass.step")); + public static final DefaultedRegistryReference BLOCK_WET_SPONGE_BREAK = SoundTypes.key(ResourceKey.minecraft("block.wet_sponge.break")); + + public static final DefaultedRegistryReference BLOCK_WET_SPONGE_FALL = SoundTypes.key(ResourceKey.minecraft("block.wet_sponge.fall")); + + public static final DefaultedRegistryReference BLOCK_WET_SPONGE_HIT = SoundTypes.key(ResourceKey.minecraft("block.wet_sponge.hit")); + + public static final DefaultedRegistryReference BLOCK_WET_SPONGE_PLACE = SoundTypes.key(ResourceKey.minecraft("block.wet_sponge.place")); + + public static final DefaultedRegistryReference BLOCK_WET_SPONGE_STEP = SoundTypes.key(ResourceKey.minecraft("block.wet_sponge.step")); + public static final DefaultedRegistryReference BLOCK_WOOD_BREAK = SoundTypes.key(ResourceKey.minecraft("block.wood.break")); public static final DefaultedRegistryReference BLOCK_WOOD_FALL = SoundTypes.key(ResourceKey.minecraft("block.wood.fall")); @@ -2723,9 +2765,15 @@ public final class SoundTypes { public static final DefaultedRegistryReference ITEM_BOTTLE_FILL_DRAGONBREATH = SoundTypes.key(ResourceKey.minecraft("item.bottle.fill_dragonbreath")); - public static final DefaultedRegistryReference ITEM_BRUSH_BRUSH_SAND_COMPLETED = SoundTypes.key(ResourceKey.minecraft("item.brush.brush_sand_completed")); + public static final DefaultedRegistryReference ITEM_BRUSH_BRUSHING_GENERIC = SoundTypes.key(ResourceKey.minecraft("item.brush.brushing.generic")); + + public static final DefaultedRegistryReference ITEM_BRUSH_BRUSHING_GRAVEL = SoundTypes.key(ResourceKey.minecraft("item.brush.brushing.gravel")); + + public static final DefaultedRegistryReference ITEM_BRUSH_BRUSHING_GRAVEL_COMPLETE = SoundTypes.key(ResourceKey.minecraft("item.brush.brushing.gravel.complete")); + + public static final DefaultedRegistryReference ITEM_BRUSH_BRUSHING_SAND = SoundTypes.key(ResourceKey.minecraft("item.brush.brushing.sand")); - public static final DefaultedRegistryReference ITEM_BRUSH_BRUSHING = SoundTypes.key(ResourceKey.minecraft("item.brush.brushing")); + public static final DefaultedRegistryReference ITEM_BRUSH_BRUSHING_SAND_COMPLETE = SoundTypes.key(ResourceKey.minecraft("item.brush.brushing.sand.complete")); public static final DefaultedRegistryReference ITEM_BUCKET_EMPTY = SoundTypes.key(ResourceKey.minecraft("item.bucket.empty")); @@ -2867,19 +2915,29 @@ public final class SoundTypes { public static final DefaultedRegistryReference MUSIC_NETHER_WARPED_FOREST = SoundTypes.key(ResourceKey.minecraft("music.nether.warped_forest")); + public static final DefaultedRegistryReference MUSIC_OVERWORLD_BADLANDS = SoundTypes.key(ResourceKey.minecraft("music.overworld.badlands")); + + public static final DefaultedRegistryReference MUSIC_OVERWORLD_BAMBOO_JUNGLE = SoundTypes.key(ResourceKey.minecraft("music.overworld.bamboo_jungle")); + public static final DefaultedRegistryReference MUSIC_OVERWORLD_CHERRY_GROVE = SoundTypes.key(ResourceKey.minecraft("music.overworld.cherry_grove")); public static final DefaultedRegistryReference MUSIC_OVERWORLD_DEEP_DARK = SoundTypes.key(ResourceKey.minecraft("music.overworld.deep_dark")); + public static final DefaultedRegistryReference MUSIC_OVERWORLD_DESERT = SoundTypes.key(ResourceKey.minecraft("music.overworld.desert")); + public static final DefaultedRegistryReference MUSIC_OVERWORLD_DRIPSTONE_CAVES = SoundTypes.key(ResourceKey.minecraft("music.overworld.dripstone_caves")); + public static final DefaultedRegistryReference MUSIC_OVERWORLD_FLOWER_FOREST = SoundTypes.key(ResourceKey.minecraft("music.overworld.flower_forest")); + + public static final DefaultedRegistryReference MUSIC_OVERWORLD_FOREST = SoundTypes.key(ResourceKey.minecraft("music.overworld.forest")); + public static final DefaultedRegistryReference MUSIC_OVERWORLD_FROZEN_PEAKS = SoundTypes.key(ResourceKey.minecraft("music.overworld.frozen_peaks")); public static final DefaultedRegistryReference MUSIC_OVERWORLD_GROVE = SoundTypes.key(ResourceKey.minecraft("music.overworld.grove")); public static final DefaultedRegistryReference MUSIC_OVERWORLD_JAGGED_PEAKS = SoundTypes.key(ResourceKey.minecraft("music.overworld.jagged_peaks")); - public static final DefaultedRegistryReference MUSIC_OVERWORLD_JUNGLE_AND_FOREST = SoundTypes.key(ResourceKey.minecraft("music.overworld.jungle_and_forest")); + public static final DefaultedRegistryReference MUSIC_OVERWORLD_JUNGLE = SoundTypes.key(ResourceKey.minecraft("music.overworld.jungle")); public static final DefaultedRegistryReference MUSIC_OVERWORLD_LUSH_CAVES = SoundTypes.key(ResourceKey.minecraft("music.overworld.lush_caves")); @@ -2889,6 +2947,8 @@ public final class SoundTypes { public static final DefaultedRegistryReference MUSIC_OVERWORLD_SNOWY_SLOPES = SoundTypes.key(ResourceKey.minecraft("music.overworld.snowy_slopes")); + public static final DefaultedRegistryReference MUSIC_OVERWORLD_SPARSE_JUNGLE = SoundTypes.key(ResourceKey.minecraft("music.overworld.sparse_jungle")); + public static final DefaultedRegistryReference MUSIC_OVERWORLD_STONY_PEAKS = SoundTypes.key(ResourceKey.minecraft("music.overworld.stony_peaks")); public static final DefaultedRegistryReference MUSIC_OVERWORLD_SWAMP = SoundTypes.key(ResourceKey.minecraft("music.overworld.swamp")); @@ -2917,6 +2977,8 @@ public final class SoundTypes { public static final DefaultedRegistryReference MUSIC_DISC_PIGSTEP = SoundTypes.key(ResourceKey.minecraft("music_disc.pigstep")); + public static final DefaultedRegistryReference MUSIC_DISC_RELIC = SoundTypes.key(ResourceKey.minecraft("music_disc.relic")); + public static final DefaultedRegistryReference MUSIC_DISC_STAL = SoundTypes.key(ResourceKey.minecraft("music_disc.stal")); public static final DefaultedRegistryReference MUSIC_DISC_STRAD = SoundTypes.key(ResourceKey.minecraft("music_disc.strad")); diff --git a/src/main/java/org/spongepowered/api/entity/EntityTypes.java b/src/main/java/org/spongepowered/api/entity/EntityTypes.java index ce9576e020b..748a9d07d14 100644 --- a/src/main/java/org/spongepowered/api/entity/EntityTypes.java +++ b/src/main/java/org/spongepowered/api/entity/EntityTypes.java @@ -150,7 +150,6 @@ import org.spongepowered.api.registry.RegistryScope; import org.spongepowered.api.registry.RegistryScopes; import org.spongepowered.api.registry.RegistryTypes; -import org.spongepowered.api.util.annotation.Experimental; @SuppressWarnings("unused") @RegistryScopes(scopes = RegistryScope.GAME) @@ -344,7 +343,6 @@ public final class EntityTypes { public static final DefaultedRegistryReference> SMALL_FIREBALL = EntityTypes.key(ResourceKey.minecraft("small_fireball")); - @Experimental("update_1_20") public static final DefaultedRegistryReference> SNIFFER = EntityTypes.key(ResourceKey.minecraft("sniffer")); public static final DefaultedRegistryReference> SNOWBALL = EntityTypes.key(ResourceKey.minecraft("snowball")); diff --git a/src/main/java/org/spongepowered/api/entity/attribute/type/AttributeTypes.java b/src/main/java/org/spongepowered/api/entity/attribute/type/AttributeTypes.java index 1f204b4102c..eabab189eaa 100644 --- a/src/main/java/org/spongepowered/api/entity/attribute/type/AttributeTypes.java +++ b/src/main/java/org/spongepowered/api/entity/attribute/type/AttributeTypes.java @@ -59,6 +59,8 @@ public final class AttributeTypes { public static final DefaultedRegistryReference GENERIC_LUCK = AttributeTypes.key(ResourceKey.minecraft("generic.luck")); + public static final DefaultedRegistryReference GENERIC_MAX_ABSORPTION = AttributeTypes.key(ResourceKey.minecraft("generic.max_absorption")); + public static final DefaultedRegistryReference GENERIC_MAX_HEALTH = AttributeTypes.key(ResourceKey.minecraft("generic.max_health")); public static final DefaultedRegistryReference GENERIC_MOVEMENT_SPEED = AttributeTypes.key(ResourceKey.minecraft("generic.movement_speed")); diff --git a/src/main/java/org/spongepowered/api/entity/living/animal/Sniffer.java b/src/main/java/org/spongepowered/api/entity/living/animal/Sniffer.java index d184a21e47d..ab937f66656 100644 --- a/src/main/java/org/spongepowered/api/entity/living/animal/Sniffer.java +++ b/src/main/java/org/spongepowered/api/entity/living/animal/Sniffer.java @@ -24,11 +24,6 @@ */ package org.spongepowered.api.entity.living.animal; -import org.jetbrains.annotations.ApiStatus; -import org.spongepowered.api.util.annotation.Experimental; - -@ApiStatus.Experimental -@Experimental("update_1_20") public interface Sniffer extends Animal { } diff --git a/src/main/java/org/spongepowered/api/entity/living/player/server/ServerPlayer.java b/src/main/java/org/spongepowered/api/entity/living/player/server/ServerPlayer.java index 76ee0653359..f408b4f2740 100644 --- a/src/main/java/org/spongepowered/api/entity/living/player/server/ServerPlayer.java +++ b/src/main/java/org/spongepowered/api/entity/living/player/server/ServerPlayer.java @@ -30,6 +30,7 @@ import org.spongepowered.api.Server; import org.spongepowered.api.advancement.Advancement; import org.spongepowered.api.advancement.AdvancementProgress; +import org.spongepowered.api.advancement.AdvancementTemplate; import org.spongepowered.api.advancement.AdvancementTree; import org.spongepowered.api.data.Keys; import org.spongepowered.api.data.type.SkinPart; @@ -280,7 +281,7 @@ default SetValue.Mutable displayedSkinParts() { * @param advancement The advancement * @return The advancement progress */ - AdvancementProgress progress(Advancement advancement); + AdvancementProgress progress(AdvancementTemplate advancement); /** * Gets all the {@link AdvancementTree}s that this diff --git a/src/main/java/org/spongepowered/api/event/advancement/AdvancementEvent.java b/src/main/java/org/spongepowered/api/event/advancement/AdvancementEvent.java index b71a7c111da..16348f97a78 100644 --- a/src/main/java/org/spongepowered/api/event/advancement/AdvancementEvent.java +++ b/src/main/java/org/spongepowered/api/event/advancement/AdvancementEvent.java @@ -24,6 +24,7 @@ */ package org.spongepowered.api.event.advancement; +import org.spongepowered.api.ResourceKey; import org.spongepowered.api.advancement.Advancement; import org.spongepowered.api.advancement.criteria.AdvancementCriterion; import org.spongepowered.api.entity.living.player.server.ServerPlayer; @@ -52,6 +53,13 @@ public interface AdvancementEvent extends Event { */ Advancement advancement(); + /** + * Gets the {@link Advancement} that is being targeted. + * + * @return The advancement + */ + ResourceKey advancementKey(); + /** * Is called when a {@link Advancement} is granted/unlocked. * diff --git a/src/main/java/org/spongepowered/api/event/advancement/AdvancementTreeEvent.java b/src/main/java/org/spongepowered/api/event/advancement/AdvancementTreeEvent.java index 8b07fb33e7a..880b5237187 100644 --- a/src/main/java/org/spongepowered/api/event/advancement/AdvancementTreeEvent.java +++ b/src/main/java/org/spongepowered/api/event/advancement/AdvancementTreeEvent.java @@ -25,7 +25,6 @@ package org.spongepowered.api.event.advancement; import org.spongepowered.api.advancement.AdvancementTree; -import org.spongepowered.api.advancement.TreeLayout; import org.spongepowered.api.event.Event; /** @@ -43,16 +42,10 @@ public interface AdvancementTreeEvent extends Event { /** * Is called when the layout of a {@link AdvancementTree} gets * updated, this is done after the vanilla game generates the - * layout. You can safely move elements in the {@link TreeLayout} + * layout. You can safely move layout elements in the {@link AdvancementTree} * within this event. */ interface GenerateLayout extends AdvancementTreeEvent { - /** - * Gets the {@link TreeLayout} that got generated. - * - * @return The tree layout - */ - TreeLayout layout(); } } diff --git a/src/main/java/org/spongepowered/api/event/advancement/CriterionEvent.java b/src/main/java/org/spongepowered/api/event/advancement/CriterionEvent.java index bc0bf1982fb..f3a4606f48a 100644 --- a/src/main/java/org/spongepowered/api/event/advancement/CriterionEvent.java +++ b/src/main/java/org/spongepowered/api/event/advancement/CriterionEvent.java @@ -28,6 +28,7 @@ import org.spongepowered.api.advancement.criteria.ScoreAdvancementCriterion; import org.spongepowered.api.advancement.criteria.trigger.FilteredTrigger; import org.spongepowered.api.advancement.criteria.trigger.FilteredTriggerConfiguration; +import org.spongepowered.api.advancement.criteria.trigger.Trigger; import org.spongepowered.api.event.Cancellable; import org.spongepowered.api.event.Cause; import org.spongepowered.api.event.GenericEvent; @@ -129,6 +130,14 @@ interface Trigger extends CriterionEvent */ FilteredTrigger trigger(); + /** + * Gets the {@link FilteredTrigger} + * that is being processed. + * + * @return The trigger + */ + org.spongepowered.api.advancement.criteria.trigger.Trigger type(); + /** * Gets the result of the trigger event. * diff --git a/src/main/java/org/spongepowered/api/event/block/entity/ChangeSignEvent.java b/src/main/java/org/spongepowered/api/event/block/entity/ChangeSignEvent.java index b70ec2bc9ae..e187b6505df 100644 --- a/src/main/java/org/spongepowered/api/event/block/entity/ChangeSignEvent.java +++ b/src/main/java/org/spongepowered/api/event/block/entity/ChangeSignEvent.java @@ -53,4 +53,11 @@ public interface ChangeSignEvent extends Event, Cancellable { */ ListValue.Mutable text(); + /** + * Gets whether this event is for the front side or back side of the sign. + * + * @return true if this event fired for the front side. + */ + boolean isFrontSide(); + } diff --git a/src/main/java/org/spongepowered/api/event/block/entity/CookingEvent.java b/src/main/java/org/spongepowered/api/event/block/entity/CookingEvent.java index acedf03258d..c71c95e4faa 100644 --- a/src/main/java/org/spongepowered/api/event/block/entity/CookingEvent.java +++ b/src/main/java/org/spongepowered/api/event/block/entity/CookingEvent.java @@ -24,6 +24,7 @@ */ package org.spongepowered.api.event.block.entity; +import org.spongepowered.api.ResourceKey; import org.spongepowered.api.block.entity.BlockEntity; import org.spongepowered.api.event.Cancellable; import org.spongepowered.api.event.Event; @@ -62,6 +63,8 @@ public interface CookingEvent extends Event { */ Optional recipe(); + Optional recipeKey(); + /** * The first tick of an item cooking. */ diff --git a/src/main/java/org/spongepowered/api/event/cause/entity/damage/DamageTypes.java b/src/main/java/org/spongepowered/api/event/cause/entity/damage/DamageTypes.java index 5822dba6064..f53dbdcff72 100644 --- a/src/main/java/org/spongepowered/api/event/cause/entity/damage/DamageTypes.java +++ b/src/main/java/org/spongepowered/api/event/cause/entity/damage/DamageTypes.java @@ -75,6 +75,8 @@ public final class DamageTypes { public static final DefaultedRegistryReference GENERIC = DamageTypes.key(ResourceKey.minecraft("generic")); + public static final DefaultedRegistryReference GENERIC_KILL = DamageTypes.key(ResourceKey.minecraft("generic_kill")); + public static final DefaultedRegistryReference HOT_FLOOR = DamageTypes.key(ResourceKey.minecraft("hot_floor")); public static final DefaultedRegistryReference IN_FIRE = DamageTypes.key(ResourceKey.minecraft("in_fire")); @@ -99,6 +101,8 @@ public final class DamageTypes { public static final DefaultedRegistryReference OUT_OF_WORLD = DamageTypes.key(ResourceKey.minecraft("out_of_world")); + public static final DefaultedRegistryReference OUTSIDE_BORDER = DamageTypes.key(ResourceKey.minecraft("outside_border")); + public static final DefaultedRegistryReference PLAYER_ATTACK = DamageTypes.key(ResourceKey.minecraft("player_attack")); public static final DefaultedRegistryReference PLAYER_EXPLOSION = DamageTypes.key(ResourceKey.minecraft("player_explosion")); diff --git a/src/main/java/org/spongepowered/api/event/item/inventory/CraftItemEvent.java b/src/main/java/org/spongepowered/api/event/item/inventory/CraftItemEvent.java index 84f3abd6bbe..6341cff580c 100644 --- a/src/main/java/org/spongepowered/api/event/item/inventory/CraftItemEvent.java +++ b/src/main/java/org/spongepowered/api/event/item/inventory/CraftItemEvent.java @@ -24,6 +24,7 @@ */ package org.spongepowered.api.event.item.inventory; +import org.spongepowered.api.ResourceKey; import org.spongepowered.api.event.item.inventory.container.ClickContainerEvent; import org.spongepowered.api.item.inventory.ItemStackSnapshot; import org.spongepowered.api.item.inventory.Slot; @@ -51,6 +52,8 @@ public interface CraftItemEvent extends ChangeInventoryEvent { */ Optional recipe(); + Optional recipeKey(); + /** * This event is fired before the item is taken out of the * output slot but after completing the recipe in the grid. diff --git a/src/main/java/org/spongepowered/api/event/lifecycle/RegisterRegistryValueEvent.java b/src/main/java/org/spongepowered/api/event/lifecycle/RegisterRegistryValueEvent.java index b5ad65060e5..d8129480980 100644 --- a/src/main/java/org/spongepowered/api/event/lifecycle/RegisterRegistryValueEvent.java +++ b/src/main/java/org/spongepowered/api/event/lifecycle/RegisterRegistryValueEvent.java @@ -27,6 +27,7 @@ import org.spongepowered.api.Engine; import org.spongepowered.api.ResourceKey; import org.spongepowered.api.event.GenericEvent; +import org.spongepowered.api.registry.DefaultedRegistryValue; import org.spongepowered.api.registry.RegistryType; public interface RegisterRegistryValueEvent extends LifecycleEvent { @@ -38,6 +39,11 @@ interface RegistryStep { RegistryStep register(ResourceKey key, T value); } + interface BuiltIn extends LifecycleEvent { + + RegistryStep registry(RegistryType registryType); + } + interface GameScoped extends RegisterRegistryValueEvent { } diff --git a/src/main/java/org/spongepowered/api/item/ItemTypes.java b/src/main/java/org/spongepowered/api/item/ItemTypes.java index 5646aa9d7c9..8c1df497907 100644 --- a/src/main/java/org/spongepowered/api/item/ItemTypes.java +++ b/src/main/java/org/spongepowered/api/item/ItemTypes.java @@ -24,7 +24,6 @@ */ package org.spongepowered.api.item; -import org.jetbrains.annotations.ApiStatus; import org.spongepowered.api.ResourceKey; import org.spongepowered.api.Sponge; import org.spongepowered.api.registry.DefaultedRegistryReference; @@ -33,7 +32,6 @@ import org.spongepowered.api.registry.RegistryScope; import org.spongepowered.api.registry.RegistryScopes; import org.spongepowered.api.registry.RegistryTypes; -import org.spongepowered.api.util.annotation.Experimental; /** * @@ -55,8 +53,6 @@ public final class ItemTypes { public static final DefaultedRegistryReference ACACIA_FENCE_GATE = ItemTypes.key(ResourceKey.minecraft("acacia_fence_gate")); - @Experimental("update_1_20") - @ApiStatus.Experimental public static final DefaultedRegistryReference ACACIA_HANGING_SIGN = ItemTypes.key(ResourceKey.minecraft("acacia_hanging_sign")); public static final DefaultedRegistryReference ACACIA_LEAVES = ItemTypes.key(ResourceKey.minecraft("acacia_leaves")); @@ -103,12 +99,18 @@ public final class ItemTypes { public static final DefaultedRegistryReference ANDESITE_WALL = ItemTypes.key(ResourceKey.minecraft("andesite_wall")); + public static final DefaultedRegistryReference ANGLER_POTTERY_SHERD = ItemTypes.key(ResourceKey.minecraft("angler_pottery_sherd")); + public static final DefaultedRegistryReference ANVIL = ItemTypes.key(ResourceKey.minecraft("anvil")); public static final DefaultedRegistryReference APPLE = ItemTypes.key(ResourceKey.minecraft("apple")); + public static final DefaultedRegistryReference ARCHER_POTTERY_SHERD = ItemTypes.key(ResourceKey.minecraft("archer_pottery_sherd")); + public static final DefaultedRegistryReference ARMOR_STAND = ItemTypes.key(ResourceKey.minecraft("armor_stand")); + public static final DefaultedRegistryReference ARMS_UP_POTTERY_SHERD = ItemTypes.key(ResourceKey.minecraft("arms_up_pottery_sherd")); + public static final DefaultedRegistryReference ARROW = ItemTypes.key(ResourceKey.minecraft("arrow")); public static final DefaultedRegistryReference AXOLOTL_BUCKET = ItemTypes.key(ResourceKey.minecraft("axolotl_bucket")); @@ -125,72 +127,38 @@ public final class ItemTypes { public static final DefaultedRegistryReference BAMBOO = ItemTypes.key(ResourceKey.minecraft("bamboo")); - @Experimental("update_1_20") - @ApiStatus.Experimental public static final DefaultedRegistryReference BAMBOO_BLOCK = ItemTypes.key(ResourceKey.minecraft("bamboo_block")); - @Experimental("update_1_20") - @ApiStatus.Experimental public static final DefaultedRegistryReference BAMBOO_BUTTON = ItemTypes.key(ResourceKey.minecraft("bamboo_button")); - @Experimental("update_1_20") - @ApiStatus.Experimental public static final DefaultedRegistryReference BAMBOO_CHEST_RAFT = ItemTypes.key(ResourceKey.minecraft("bamboo_chest_raft")); - @Experimental("update_1_20") - @ApiStatus.Experimental public static final DefaultedRegistryReference BAMBOO_DOOR = ItemTypes.key(ResourceKey.minecraft("bamboo_door")); - @Experimental("update_1_20") - @ApiStatus.Experimental public static final DefaultedRegistryReference BAMBOO_FENCE = ItemTypes.key(ResourceKey.minecraft("bamboo_fence")); - @Experimental("update_1_20") - @ApiStatus.Experimental public static final DefaultedRegistryReference BAMBOO_FENCE_GATE = ItemTypes.key(ResourceKey.minecraft("bamboo_fence_gate")); - @Experimental("update_1_20") - @ApiStatus.Experimental public static final DefaultedRegistryReference BAMBOO_HANGING_SIGN = ItemTypes.key(ResourceKey.minecraft("bamboo_hanging_sign")); - @Experimental("update_1_20") - @ApiStatus.Experimental public static final DefaultedRegistryReference BAMBOO_MOSAIC = ItemTypes.key(ResourceKey.minecraft("bamboo_mosaic")); - @Experimental("update_1_20") - @ApiStatus.Experimental public static final DefaultedRegistryReference BAMBOO_MOSAIC_SLAB = ItemTypes.key(ResourceKey.minecraft("bamboo_mosaic_slab")); - @Experimental("update_1_20") - @ApiStatus.Experimental public static final DefaultedRegistryReference BAMBOO_MOSAIC_STAIRS = ItemTypes.key(ResourceKey.minecraft("bamboo_mosaic_stairs")); - @Experimental("update_1_20") - @ApiStatus.Experimental public static final DefaultedRegistryReference BAMBOO_PLANKS = ItemTypes.key(ResourceKey.minecraft("bamboo_planks")); - @Experimental("update_1_20") - @ApiStatus.Experimental public static final DefaultedRegistryReference BAMBOO_PRESSURE_PLATE = ItemTypes.key(ResourceKey.minecraft("bamboo_pressure_plate")); - @Experimental("update_1_20") - @ApiStatus.Experimental public static final DefaultedRegistryReference BAMBOO_RAFT = ItemTypes.key(ResourceKey.minecraft("bamboo_raft")); - @Experimental("update_1_20") - @ApiStatus.Experimental public static final DefaultedRegistryReference BAMBOO_SIGN = ItemTypes.key(ResourceKey.minecraft("bamboo_sign")); - @Experimental("update_1_20") - @ApiStatus.Experimental public static final DefaultedRegistryReference BAMBOO_SLAB = ItemTypes.key(ResourceKey.minecraft("bamboo_slab")); - @Experimental("update_1_20") - @ApiStatus.Experimental public static final DefaultedRegistryReference BAMBOO_STAIRS = ItemTypes.key(ResourceKey.minecraft("bamboo_stairs")); - @Experimental("update_1_20") - @ApiStatus.Experimental public static final DefaultedRegistryReference BAMBOO_TRAPDOOR = ItemTypes.key(ResourceKey.minecraft("bamboo_trapdoor")); public static final DefaultedRegistryReference BARREL = ItemTypes.key(ResourceKey.minecraft("barrel")); @@ -235,8 +203,6 @@ public final class ItemTypes { public static final DefaultedRegistryReference BIRCH_FENCE_GATE = ItemTypes.key(ResourceKey.minecraft("birch_fence_gate")); - @Experimental("update_1_20") - @ApiStatus.Experimental public static final DefaultedRegistryReference BIRCH_HANGING_SIGN = ItemTypes.key(ResourceKey.minecraft("birch_hanging_sign")); public static final DefaultedRegistryReference BIRCH_LEAVES = ItemTypes.key(ResourceKey.minecraft("birch_leaves")); @@ -293,6 +259,8 @@ public final class ItemTypes { public static final DefaultedRegistryReference BLACKSTONE_WALL = ItemTypes.key(ResourceKey.minecraft("blackstone_wall")); + public static final DefaultedRegistryReference BLADE_POTTERY_SHERD = ItemTypes.key(ResourceKey.minecraft("blade_pottery_sherd")); + public static final DefaultedRegistryReference BLAST_FURNACE = ItemTypes.key(ResourceKey.minecraft("blast_furnace")); public static final DefaultedRegistryReference BLAZE_POWDER = ItemTypes.key(ResourceKey.minecraft("blaze_powder")); @@ -353,6 +321,8 @@ public final class ItemTypes { public static final DefaultedRegistryReference BREAD = ItemTypes.key(ResourceKey.minecraft("bread")); + public static final DefaultedRegistryReference BREWER_POTTERY_SHERD = ItemTypes.key(ResourceKey.minecraft("brewer_pottery_sherd")); + public static final DefaultedRegistryReference BREWING_STAND = ItemTypes.key(ResourceKey.minecraft("brewing_stand")); public static final DefaultedRegistryReference BRICK = ItemTypes.key(ResourceKey.minecraft("brick")); @@ -395,8 +365,6 @@ public final class ItemTypes { public static final DefaultedRegistryReference BROWN_WOOL = ItemTypes.key(ResourceKey.minecraft("brown_wool")); - @Experimental("update_1_20") - @ApiStatus.Experimental public static final DefaultedRegistryReference BRUSH = ItemTypes.key(ResourceKey.minecraft("brush")); public static final DefaultedRegistryReference BUBBLE_CORAL = ItemTypes.key(ResourceKey.minecraft("bubble_coral")); @@ -411,14 +379,16 @@ public final class ItemTypes { public static final DefaultedRegistryReference BUNDLE = ItemTypes.key(ResourceKey.minecraft("bundle")); + public static final DefaultedRegistryReference BURN_POTTERY_SHERD = ItemTypes.key(ResourceKey.minecraft("burn_pottery_sherd")); + public static final DefaultedRegistryReference CACTUS = ItemTypes.key(ResourceKey.minecraft("cactus")); public static final DefaultedRegistryReference CAKE = ItemTypes.key(ResourceKey.minecraft("cake")); public static final DefaultedRegistryReference CALCITE = ItemTypes.key(ResourceKey.minecraft("calcite")); - @Experimental("update_1_20") - @ApiStatus.Experimental + public static final DefaultedRegistryReference CALIBRATED_SCULK_SENSOR = ItemTypes.key(ResourceKey.minecraft("calibrated_sculk_sensor")); + public static final DefaultedRegistryReference CAMEL_SPAWN_EGG = ItemTypes.key(ResourceKey.minecraft("camel_spawn_egg")); public static final DefaultedRegistryReference CAMPFIRE = ItemTypes.key(ResourceKey.minecraft("campfire")); @@ -453,72 +423,38 @@ public final class ItemTypes { public static final DefaultedRegistryReference CHARCOAL = ItemTypes.key(ResourceKey.minecraft("charcoal")); - @Experimental("update_1_20") - @ApiStatus.Experimental public static final DefaultedRegistryReference CHERRY_BOAT = ItemTypes.key(ResourceKey.minecraft("cherry_boat")); - @Experimental("update_1_20") - @ApiStatus.Experimental public static final DefaultedRegistryReference CHERRY_BUTTON = ItemTypes.key(ResourceKey.minecraft("cherry_button")); - @Experimental("update_1_20") - @ApiStatus.Experimental public static final DefaultedRegistryReference CHERRY_CHEST_BOAT = ItemTypes.key(ResourceKey.minecraft("cherry_chest_boat")); - @Experimental("update_1_20") - @ApiStatus.Experimental public static final DefaultedRegistryReference CHERRY_DOOR = ItemTypes.key(ResourceKey.minecraft("cherry_door")); - @Experimental("update_1_20") - @ApiStatus.Experimental public static final DefaultedRegistryReference CHERRY_FENCE = ItemTypes.key(ResourceKey.minecraft("cherry_fence")); - @Experimental("update_1_20") - @ApiStatus.Experimental public static final DefaultedRegistryReference CHERRY_FENCE_GATE = ItemTypes.key(ResourceKey.minecraft("cherry_fence_gate")); - @Experimental("update_1_20") - @ApiStatus.Experimental public static final DefaultedRegistryReference CHERRY_HANGING_SIGN = ItemTypes.key(ResourceKey.minecraft("cherry_hanging_sign")); - @Experimental("update_1_20") - @ApiStatus.Experimental public static final DefaultedRegistryReference CHERRY_LEAVES = ItemTypes.key(ResourceKey.minecraft("cherry_leaves")); - @Experimental("update_1_20") - @ApiStatus.Experimental public static final DefaultedRegistryReference CHERRY_LOG = ItemTypes.key(ResourceKey.minecraft("cherry_log")); - @Experimental("update_1_20") - @ApiStatus.Experimental public static final DefaultedRegistryReference CHERRY_PLANKS = ItemTypes.key(ResourceKey.minecraft("cherry_planks")); - @Experimental("update_1_20") - @ApiStatus.Experimental public static final DefaultedRegistryReference CHERRY_PRESSURE_PLATE = ItemTypes.key(ResourceKey.minecraft("cherry_pressure_plate")); - @Experimental("update_1_20") - @ApiStatus.Experimental public static final DefaultedRegistryReference CHERRY_SAPLING = ItemTypes.key(ResourceKey.minecraft("cherry_sapling")); - @Experimental("update_1_20") - @ApiStatus.Experimental public static final DefaultedRegistryReference CHERRY_SIGN = ItemTypes.key(ResourceKey.minecraft("cherry_sign")); - @Experimental("update_1_20") - @ApiStatus.Experimental public static final DefaultedRegistryReference CHERRY_SLAB = ItemTypes.key(ResourceKey.minecraft("cherry_slab")); - @Experimental("update_1_20") - @ApiStatus.Experimental public static final DefaultedRegistryReference CHERRY_STAIRS = ItemTypes.key(ResourceKey.minecraft("cherry_stairs")); - @Experimental("update_1_20") - @ApiStatus.Experimental public static final DefaultedRegistryReference CHERRY_TRAPDOOR = ItemTypes.key(ResourceKey.minecraft("cherry_trapdoor")); - @Experimental("update_1_20") - @ApiStatus.Experimental public static final DefaultedRegistryReference CHERRY_WOOD = ItemTypes.key(ResourceKey.minecraft("cherry_wood")); public static final DefaultedRegistryReference CHEST = ItemTypes.key(ResourceKey.minecraft("chest")); @@ -531,8 +467,6 @@ public final class ItemTypes { public static final DefaultedRegistryReference CHIPPED_ANVIL = ItemTypes.key(ResourceKey.minecraft("chipped_anvil")); - @Experimental("update_1_20") - @ApiStatus.Experimental public static final DefaultedRegistryReference CHISELED_BOOKSHELF = ItemTypes.key(ResourceKey.minecraft("chiseled_bookshelf")); public static final DefaultedRegistryReference CHISELED_DEEPSLATE = ItemTypes.key(ResourceKey.minecraft("chiseled_deepslate")); @@ -569,8 +503,6 @@ public final class ItemTypes { public static final DefaultedRegistryReference COARSE_DIRT = ItemTypes.key(ResourceKey.minecraft("coarse_dirt")); - @Experimental("update_1_20") - @ApiStatus.Experimental public static final DefaultedRegistryReference COAST_ARMOR_TRIM_SMITHING_TEMPLATE = ItemTypes.key(ResourceKey.minecraft("coast_armor_trim_smithing_template")); public static final DefaultedRegistryReference COBBLED_DEEPSLATE = ItemTypes.key(ResourceKey.minecraft("cobbled_deepslate")); @@ -665,8 +597,6 @@ public final class ItemTypes { public static final DefaultedRegistryReference CRIMSON_FUNGUS = ItemTypes.key(ResourceKey.minecraft("crimson_fungus")); - @Experimental("update_1_20") - @ApiStatus.Experimental public static final DefaultedRegistryReference CRIMSON_HANGING_SIGN = ItemTypes.key(ResourceKey.minecraft("crimson_hanging_sign")); public static final DefaultedRegistryReference CRIMSON_HYPHAE = ItemTypes.key(ResourceKey.minecraft("crimson_hyphae")); @@ -737,6 +667,8 @@ public final class ItemTypes { public static final DefaultedRegistryReference DANDELION = ItemTypes.key(ResourceKey.minecraft("dandelion")); + public static final DefaultedRegistryReference DANGER_POTTERY_SHERD = ItemTypes.key(ResourceKey.minecraft("danger_pottery_sherd")); + public static final DefaultedRegistryReference DARK_OAK_BOAT = ItemTypes.key(ResourceKey.minecraft("dark_oak_boat")); public static final DefaultedRegistryReference DARK_OAK_BUTTON = ItemTypes.key(ResourceKey.minecraft("dark_oak_button")); @@ -749,8 +681,6 @@ public final class ItemTypes { public static final DefaultedRegistryReference DARK_OAK_FENCE_GATE = ItemTypes.key(ResourceKey.minecraft("dark_oak_fence_gate")); - @Experimental("update_1_20") - @ApiStatus.Experimental public static final DefaultedRegistryReference DARK_OAK_HANGING_SIGN = ItemTypes.key(ResourceKey.minecraft("dark_oak_hanging_sign")); public static final DefaultedRegistryReference DARK_OAK_LEAVES = ItemTypes.key(ResourceKey.minecraft("dark_oak_leaves")); @@ -815,8 +745,6 @@ public final class ItemTypes { public static final DefaultedRegistryReference DEBUG_STICK = ItemTypes.key(ResourceKey.minecraft("debug_stick")); - @Experimental("update_1_20") - @ApiStatus.Experimental public static final DefaultedRegistryReference DECORATED_POT = ItemTypes.key(ResourceKey.minecraft("decorated_pot")); public static final DefaultedRegistryReference DEEPSLATE = ItemTypes.key(ResourceKey.minecraft("deepslate")); @@ -917,8 +845,6 @@ public final class ItemTypes { public static final DefaultedRegistryReference DROWNED_SPAWN_EGG = ItemTypes.key(ResourceKey.minecraft("drowned_spawn_egg")); - @Experimental("update_1_20") - @ApiStatus.Experimental public static final DefaultedRegistryReference DUNE_ARMOR_TRIM_SMITHING_TEMPLATE = ItemTypes.key(ResourceKey.minecraft("dune_armor_trim_smithing_template")); public static final DefaultedRegistryReference ECHO_SHARD = ItemTypes.key(ResourceKey.minecraft("echo_shard")); @@ -973,6 +899,8 @@ public final class ItemTypes { public static final DefaultedRegistryReference EXPERIENCE_BOTTLE = ItemTypes.key(ResourceKey.minecraft("experience_bottle")); + public static final DefaultedRegistryReference EXPLORER_POTTERY_SHERD = ItemTypes.key(ResourceKey.minecraft("explorer_pottery_sherd")); + public static final DefaultedRegistryReference EXPOSED_COPPER = ItemTypes.key(ResourceKey.minecraft("exposed_copper")); public static final DefaultedRegistryReference EXPOSED_CUT_COPPER = ItemTypes.key(ResourceKey.minecraft("exposed_cut_copper")); @@ -981,8 +909,6 @@ public final class ItemTypes { public static final DefaultedRegistryReference EXPOSED_CUT_COPPER_STAIRS = ItemTypes.key(ResourceKey.minecraft("exposed_cut_copper_stairs")); - @Experimental("update_1_20") - @ApiStatus.Experimental public static final DefaultedRegistryReference EYE_ARMOR_TRIM_SMITHING_TEMPLATE = ItemTypes.key(ResourceKey.minecraft("eye_armor_trim_smithing_template")); public static final DefaultedRegistryReference FARMLAND = ItemTypes.key(ResourceKey.minecraft("farmland")); @@ -1025,6 +951,8 @@ public final class ItemTypes { public static final DefaultedRegistryReference FOX_SPAWN_EGG = ItemTypes.key(ResourceKey.minecraft("fox_spawn_egg")); + public static final DefaultedRegistryReference FRIEND_POTTERY_SHERD = ItemTypes.key(ResourceKey.minecraft("friend_pottery_sherd")); + public static final DefaultedRegistryReference FROG_SPAWN_EGG = ItemTypes.key(ResourceKey.minecraft("frog_spawn_egg")); public static final DefaultedRegistryReference FROGSPAWN = ItemTypes.key(ResourceKey.minecraft("frogspawn")); @@ -1177,6 +1105,10 @@ public final class ItemTypes { public static final DefaultedRegistryReference HEART_OF_THE_SEA = ItemTypes.key(ResourceKey.minecraft("heart_of_the_sea")); + public static final DefaultedRegistryReference HEART_POTTERY_SHERD = ItemTypes.key(ResourceKey.minecraft("heart_pottery_sherd")); + + public static final DefaultedRegistryReference HEARTBREAK_POTTERY_SHERD = ItemTypes.key(ResourceKey.minecraft("heartbreak_pottery_sherd")); + public static final DefaultedRegistryReference HEAVY_WEIGHTED_PRESSURE_PLATE = ItemTypes.key(ResourceKey.minecraft("heavy_weighted_pressure_plate")); public static final DefaultedRegistryReference HOGLIN_SPAWN_EGG = ItemTypes.key(ResourceKey.minecraft("hoglin_spawn_egg")); @@ -1201,6 +1133,10 @@ public final class ItemTypes { public static final DefaultedRegistryReference HORSE_SPAWN_EGG = ItemTypes.key(ResourceKey.minecraft("horse_spawn_egg")); + public static final DefaultedRegistryReference HOST_ARMOR_TRIM_SMITHING_TEMPLATE = ItemTypes.key(ResourceKey.minecraft("host_armor_trim_smithing_template")); + + public static final DefaultedRegistryReference HOWL_POTTERY_SHERD = ItemTypes.key(ResourceKey.minecraft("howl_pottery_sherd")); + public static final DefaultedRegistryReference HUSK_SPAWN_EGG = ItemTypes.key(ResourceKey.minecraft("husk_spawn_egg")); public static final DefaultedRegistryReference ICE = ItemTypes.key(ResourceKey.minecraft("ice")); @@ -1277,8 +1213,6 @@ public final class ItemTypes { public static final DefaultedRegistryReference JUNGLE_FENCE_GATE = ItemTypes.key(ResourceKey.minecraft("jungle_fence_gate")); - @Experimental("update_1_20") - @ApiStatus.Experimental public static final DefaultedRegistryReference JUNGLE_HANGING_SIGN = ItemTypes.key(ResourceKey.minecraft("jungle_hanging_sign")); public static final DefaultedRegistryReference JUNGLE_LEAVES = ItemTypes.key(ResourceKey.minecraft("jungle_leaves")); @@ -1481,8 +1415,6 @@ public final class ItemTypes { public static final DefaultedRegistryReference MANGROVE_FENCE_GATE = ItemTypes.key(ResourceKey.minecraft("mangrove_fence_gate")); - @Experimental("update_1_20") - @ApiStatus.Experimental public static final DefaultedRegistryReference MANGROVE_HANGING_SIGN = ItemTypes.key(ResourceKey.minecraft("mangrove_hanging_sign")); public static final DefaultedRegistryReference MANGROVE_LEAVES = ItemTypes.key(ResourceKey.minecraft("mangrove_leaves")); @@ -1521,6 +1453,8 @@ public final class ItemTypes { public static final DefaultedRegistryReference MINECART = ItemTypes.key(ResourceKey.minecraft("minecart")); + public static final DefaultedRegistryReference MINER_POTTERY_SHERD = ItemTypes.key(ResourceKey.minecraft("miner_pottery_sherd")); + public static final DefaultedRegistryReference MOJANG_BANNER_PATTERN = ItemTypes.key(ResourceKey.minecraft("mojang_banner_pattern")); public static final DefaultedRegistryReference MOOSHROOM_SPAWN_EGG = ItemTypes.key(ResourceKey.minecraft("mooshroom_spawn_egg")); @@ -1545,6 +1479,8 @@ public final class ItemTypes { public static final DefaultedRegistryReference MOSSY_STONE_BRICKS = ItemTypes.key(ResourceKey.minecraft("mossy_stone_bricks")); + public static final DefaultedRegistryReference MOURNER_POTTERY_SHERD = ItemTypes.key(ResourceKey.minecraft("mourner_pottery_sherd")); + public static final DefaultedRegistryReference MUD = ItemTypes.key(ResourceKey.minecraft("mud")); public static final DefaultedRegistryReference MUD_BRICK_SLAB = ItemTypes.key(ResourceKey.minecraft("mud_brick_slab")); @@ -1585,6 +1521,8 @@ public final class ItemTypes { public static final DefaultedRegistryReference MUSIC_DISC_PIGSTEP = ItemTypes.key(ResourceKey.minecraft("music_disc_pigstep")); + public static final DefaultedRegistryReference MUSIC_DISC_RELIC = ItemTypes.key(ResourceKey.minecraft("music_disc_relic")); + public static final DefaultedRegistryReference MUSIC_DISC_STAL = ItemTypes.key(ResourceKey.minecraft("music_disc_stal")); public static final DefaultedRegistryReference MUSIC_DISC_STRAD = ItemTypes.key(ResourceKey.minecraft("music_disc_strad")); @@ -1649,8 +1587,6 @@ public final class ItemTypes { public static final DefaultedRegistryReference NETHERITE_SWORD = ItemTypes.key(ResourceKey.minecraft("netherite_sword")); - @Experimental("update_1_20") - @ApiStatus.Experimental public static final DefaultedRegistryReference NETHERITE_UPGRADE_SMITHING_TEMPLATE = ItemTypes.key(ResourceKey.minecraft("netherite_upgrade_smithing_template")); public static final DefaultedRegistryReference NETHERRACK = ItemTypes.key(ResourceKey.minecraft("netherrack")); @@ -1669,8 +1605,6 @@ public final class ItemTypes { public static final DefaultedRegistryReference OAK_FENCE_GATE = ItemTypes.key(ResourceKey.minecraft("oak_fence_gate")); - @Experimental("update_1_20") - @ApiStatus.Experimental public static final DefaultedRegistryReference OAK_HANGING_SIGN = ItemTypes.key(ResourceKey.minecraft("oak_hanging_sign")); public static final DefaultedRegistryReference OAK_LEAVES = ItemTypes.key(ResourceKey.minecraft("oak_leaves")); @@ -1767,8 +1701,6 @@ public final class ItemTypes { public static final DefaultedRegistryReference PIGLIN_BRUTE_SPAWN_EGG = ItemTypes.key(ResourceKey.minecraft("piglin_brute_spawn_egg")); - @Experimental("update_1_20") - @ApiStatus.Experimental public static final DefaultedRegistryReference PIGLIN_HEAD = ItemTypes.key(ResourceKey.minecraft("piglin_head")); public static final DefaultedRegistryReference PIGLIN_SPAWN_EGG = ItemTypes.key(ResourceKey.minecraft("piglin_spawn_egg")); @@ -1791,8 +1723,6 @@ public final class ItemTypes { public static final DefaultedRegistryReference PINK_GLAZED_TERRACOTTA = ItemTypes.key(ResourceKey.minecraft("pink_glazed_terracotta")); - @Experimental("update_1_20") - @ApiStatus.Experimental public static final DefaultedRegistryReference PINK_PETALS = ItemTypes.key(ResourceKey.minecraft("pink_petals")); public static final DefaultedRegistryReference PINK_SHULKER_BOX = ItemTypes.key(ResourceKey.minecraft("pink_shulker_box")); @@ -1809,8 +1739,14 @@ public final class ItemTypes { public static final DefaultedRegistryReference PISTON = ItemTypes.key(ResourceKey.minecraft("piston")); + public static final DefaultedRegistryReference PITCHER_PLANT = ItemTypes.key(ResourceKey.minecraft("pitcher_plant")); + + public static final DefaultedRegistryReference PITCHER_POD = ItemTypes.key(ResourceKey.minecraft("pitcher_pod")); + public static final DefaultedRegistryReference PLAYER_HEAD = ItemTypes.key(ResourceKey.minecraft("player_head")); + public static final DefaultedRegistryReference PLENTY_POTTERY_SHERD = ItemTypes.key(ResourceKey.minecraft("plenty_pottery_sherd")); + public static final DefaultedRegistryReference PODZOL = ItemTypes.key(ResourceKey.minecraft("podzol")); public static final DefaultedRegistryReference POINTED_DRIPSTONE = ItemTypes.key(ResourceKey.minecraft("pointed_dripstone")); @@ -1877,22 +1813,6 @@ public final class ItemTypes { public static final DefaultedRegistryReference POTION = ItemTypes.key(ResourceKey.minecraft("potion")); - @Experimental("update_1_20") - @ApiStatus.Experimental - public static final DefaultedRegistryReference POTTERY_SHARD_ARCHER = ItemTypes.key(ResourceKey.minecraft("pottery_shard_archer")); - - @Experimental("update_1_20") - @ApiStatus.Experimental - public static final DefaultedRegistryReference POTTERY_SHARD_ARMS_UP = ItemTypes.key(ResourceKey.minecraft("pottery_shard_arms_up")); - - @Experimental("update_1_20") - @ApiStatus.Experimental - public static final DefaultedRegistryReference POTTERY_SHARD_PRIZE = ItemTypes.key(ResourceKey.minecraft("pottery_shard_prize")); - - @Experimental("update_1_20") - @ApiStatus.Experimental - public static final DefaultedRegistryReference POTTERY_SHARD_SKULL = ItemTypes.key(ResourceKey.minecraft("pottery_shard_skull")); - public static final DefaultedRegistryReference POWDER_SNOW_BUCKET = ItemTypes.key(ResourceKey.minecraft("powder_snow_bucket")); public static final DefaultedRegistryReference POWERED_RAIL = ItemTypes.key(ResourceKey.minecraft("powered_rail")); @@ -1915,6 +1835,8 @@ public final class ItemTypes { public static final DefaultedRegistryReference PRISMARINE_WALL = ItemTypes.key(ResourceKey.minecraft("prismarine_wall")); + public static final DefaultedRegistryReference PRIZE_POTTERY_SHERD = ItemTypes.key(ResourceKey.minecraft("prize_pottery_sherd")); + public static final DefaultedRegistryReference PUFFERFISH = ItemTypes.key(ResourceKey.minecraft("pufferfish")); public static final DefaultedRegistryReference PUFFERFISH_BUCKET = ItemTypes.key(ResourceKey.minecraft("pufferfish_bucket")); @@ -1985,6 +1907,8 @@ public final class ItemTypes { public static final DefaultedRegistryReference RAIL = ItemTypes.key(ResourceKey.minecraft("rail")); + public static final DefaultedRegistryReference RAISER_ARMOR_TRIM_SMITHING_TEMPLATE = ItemTypes.key(ResourceKey.minecraft("raiser_armor_trim_smithing_template")); + public static final DefaultedRegistryReference RAVAGER_SPAWN_EGG = ItemTypes.key(ResourceKey.minecraft("ravager_spawn_egg")); public static final DefaultedRegistryReference RAW_COPPER = ItemTypes.key(ResourceKey.minecraft("raw_copper")); @@ -2069,8 +1993,6 @@ public final class ItemTypes { public static final DefaultedRegistryReference RESPAWN_ANCHOR = ItemTypes.key(ResourceKey.minecraft("respawn_anchor")); - @Experimental("update_1_20") - @ApiStatus.Experimental public static final DefaultedRegistryReference RIB_ARMOR_TRIM_SMITHING_TEMPLATE = ItemTypes.key(ResourceKey.minecraft("rib_armor_trim_smithing_template")); public static final DefaultedRegistryReference ROOTED_DIRT = ItemTypes.key(ResourceKey.minecraft("rooted_dirt")); @@ -2117,14 +2039,18 @@ public final class ItemTypes { public static final DefaultedRegistryReference SEAGRASS = ItemTypes.key(ResourceKey.minecraft("seagrass")); - @Experimental("update_1_20") - @ApiStatus.Experimental public static final DefaultedRegistryReference SENTRY_ARMOR_TRIM_SMITHING_TEMPLATE = ItemTypes.key(ResourceKey.minecraft("sentry_armor_trim_smithing_template")); + public static final DefaultedRegistryReference SHAPER_ARMOR_TRIM_SMITHING_TEMPLATE = ItemTypes.key(ResourceKey.minecraft("shaper_armor_trim_smithing_template")); + + public static final DefaultedRegistryReference SHEAF_POTTERY_SHERD = ItemTypes.key(ResourceKey.minecraft("sheaf_pottery_sherd")); + public static final DefaultedRegistryReference SHEARS = ItemTypes.key(ResourceKey.minecraft("shears")); public static final DefaultedRegistryReference SHEEP_SPAWN_EGG = ItemTypes.key(ResourceKey.minecraft("sheep_spawn_egg")); + public static final DefaultedRegistryReference SHELTER_POTTERY_SHERD = ItemTypes.key(ResourceKey.minecraft("shelter_pottery_sherd")); + public static final DefaultedRegistryReference SHIELD = ItemTypes.key(ResourceKey.minecraft("shield")); public static final DefaultedRegistryReference SHROOMLIGHT = ItemTypes.key(ResourceKey.minecraft("shroomlight")); @@ -2135,6 +2061,8 @@ public final class ItemTypes { public static final DefaultedRegistryReference SHULKER_SPAWN_EGG = ItemTypes.key(ResourceKey.minecraft("shulker_spawn_egg")); + public static final DefaultedRegistryReference SILENCE_ARMOR_TRIM_SMITHING_TEMPLATE = ItemTypes.key(ResourceKey.minecraft("silence_armor_trim_smithing_template")); + public static final DefaultedRegistryReference SILVERFISH_SPAWN_EGG = ItemTypes.key(ResourceKey.minecraft("silverfish_spawn_egg")); public static final DefaultedRegistryReference SKELETON_HORSE_SPAWN_EGG = ItemTypes.key(ResourceKey.minecraft("skeleton_horse_spawn_egg")); @@ -2145,6 +2073,8 @@ public final class ItemTypes { public static final DefaultedRegistryReference SKULL_BANNER_PATTERN = ItemTypes.key(ResourceKey.minecraft("skull_banner_pattern")); + public static final DefaultedRegistryReference SKULL_POTTERY_SHERD = ItemTypes.key(ResourceKey.minecraft("skull_pottery_sherd")); + public static final DefaultedRegistryReference SLIME_BALL = ItemTypes.key(ResourceKey.minecraft("slime_ball")); public static final DefaultedRegistryReference SLIME_BLOCK = ItemTypes.key(ResourceKey.minecraft("slime_block")); @@ -2183,12 +2113,12 @@ public final class ItemTypes { public static final DefaultedRegistryReference SMOOTH_STONE_SLAB = ItemTypes.key(ResourceKey.minecraft("smooth_stone_slab")); - @Experimental("update_1_20") - @ApiStatus.Experimental + public static final DefaultedRegistryReference SNIFFER_EGG = ItemTypes.key(ResourceKey.minecraft("sniffer_egg")); + public static final DefaultedRegistryReference SNIFFER_SPAWN_EGG = ItemTypes.key(ResourceKey.minecraft("sniffer_spawn_egg")); - @Experimental("update_1_20") - @ApiStatus.Experimental + public static final DefaultedRegistryReference SNORT_POTTERY_SHERD = ItemTypes.key(ResourceKey.minecraft("snort_pottery_sherd")); + public static final DefaultedRegistryReference SNOUT_ARMOR_TRIM_SMITHING_TEMPLATE = ItemTypes.key(ResourceKey.minecraft("snout_armor_trim_smithing_template")); public static final DefaultedRegistryReference SNOW = ItemTypes.key(ResourceKey.minecraft("snow")); @@ -2217,8 +2147,6 @@ public final class ItemTypes { public static final DefaultedRegistryReference SPIDER_SPAWN_EGG = ItemTypes.key(ResourceKey.minecraft("spider_spawn_egg")); - @Experimental("update_1_20") - @ApiStatus.Experimental public static final DefaultedRegistryReference SPIRE_ARMOR_TRIM_SMITHING_TEMPLATE = ItemTypes.key(ResourceKey.minecraft("spire_armor_trim_smithing_template")); public static final DefaultedRegistryReference SPLASH_POTION = ItemTypes.key(ResourceKey.minecraft("splash_potion")); @@ -2239,8 +2167,6 @@ public final class ItemTypes { public static final DefaultedRegistryReference SPRUCE_FENCE_GATE = ItemTypes.key(ResourceKey.minecraft("spruce_fence_gate")); - @Experimental("update_1_20") - @ApiStatus.Experimental public static final DefaultedRegistryReference SPRUCE_HANGING_SIGN = ItemTypes.key(ResourceKey.minecraft("spruce_hanging_sign")); public static final DefaultedRegistryReference SPRUCE_LEAVES = ItemTypes.key(ResourceKey.minecraft("spruce_leaves")); @@ -2311,20 +2237,14 @@ public final class ItemTypes { public static final DefaultedRegistryReference STRIPPED_ACACIA_WOOD = ItemTypes.key(ResourceKey.minecraft("stripped_acacia_wood")); - @Experimental("update_1_20") - @ApiStatus.Experimental public static final DefaultedRegistryReference STRIPPED_BAMBOO_BLOCK = ItemTypes.key(ResourceKey.minecraft("stripped_bamboo_block")); public static final DefaultedRegistryReference STRIPPED_BIRCH_LOG = ItemTypes.key(ResourceKey.minecraft("stripped_birch_log")); public static final DefaultedRegistryReference STRIPPED_BIRCH_WOOD = ItemTypes.key(ResourceKey.minecraft("stripped_birch_wood")); - @Experimental("update_1_20") - @ApiStatus.Experimental public static final DefaultedRegistryReference STRIPPED_CHERRY_LOG = ItemTypes.key(ResourceKey.minecraft("stripped_cherry_log")); - @Experimental("update_1_20") - @ApiStatus.Experimental public static final DefaultedRegistryReference STRIPPED_CHERRY_WOOD = ItemTypes.key(ResourceKey.minecraft("stripped_cherry_wood")); public static final DefaultedRegistryReference STRIPPED_CRIMSON_HYPHAE = ItemTypes.key(ResourceKey.minecraft("stripped_crimson_hyphae")); @@ -2365,8 +2285,8 @@ public final class ItemTypes { public static final DefaultedRegistryReference SUNFLOWER = ItemTypes.key(ResourceKey.minecraft("sunflower")); - @Experimental("update_1_20") - @ApiStatus.Experimental + public static final DefaultedRegistryReference SUSPICIOUS_GRAVEL = ItemTypes.key(ResourceKey.minecraft("suspicious_gravel")); + public static final DefaultedRegistryReference SUSPICIOUS_SAND = ItemTypes.key(ResourceKey.minecraft("suspicious_sand")); public static final DefaultedRegistryReference SUSPICIOUS_STEW = ItemTypes.key(ResourceKey.minecraft("suspicious_stew")); @@ -2383,8 +2303,6 @@ public final class ItemTypes { public static final DefaultedRegistryReference TERRACOTTA = ItemTypes.key(ResourceKey.minecraft("terracotta")); - @Experimental("update_1_20") - @ApiStatus.Experimental public static final DefaultedRegistryReference TIDE_ARMOR_TRIM_SMITHING_TEMPLATE = ItemTypes.key(ResourceKey.minecraft("tide_armor_trim_smithing_template")); public static final DefaultedRegistryReference TINTED_GLASS = ItemTypes.key(ResourceKey.minecraft("tinted_glass")); @@ -2397,12 +2315,8 @@ public final class ItemTypes { public static final DefaultedRegistryReference TORCH = ItemTypes.key(ResourceKey.minecraft("torch")); - @Experimental("update_1_20") - @ApiStatus.Experimental public static final DefaultedRegistryReference TORCHFLOWER = ItemTypes.key(ResourceKey.minecraft("torchflower")); - @Experimental("update_1_20") - @ApiStatus.Experimental public static final DefaultedRegistryReference TORCHFLOWER_SEEDS = ItemTypes.key(ResourceKey.minecraft("torchflower_seeds")); public static final DefaultedRegistryReference TOTEM_OF_UNDYING = ItemTypes.key(ResourceKey.minecraft("totem_of_undying")); @@ -2439,8 +2353,6 @@ public final class ItemTypes { public static final DefaultedRegistryReference VERDANT_FROGLIGHT = ItemTypes.key(ResourceKey.minecraft("verdant_froglight")); - @Experimental("update_1_20") - @ApiStatus.Experimental public static final DefaultedRegistryReference VEX_ARMOR_TRIM_SMITHING_TEMPLATE = ItemTypes.key(ResourceKey.minecraft("vex_armor_trim_smithing_template")); public static final DefaultedRegistryReference VEX_SPAWN_EGG = ItemTypes.key(ResourceKey.minecraft("vex_spawn_egg")); @@ -2453,8 +2365,6 @@ public final class ItemTypes { public static final DefaultedRegistryReference WANDERING_TRADER_SPAWN_EGG = ItemTypes.key(ResourceKey.minecraft("wandering_trader_spawn_egg")); - @Experimental("update_1_20") - @ApiStatus.Experimental public static final DefaultedRegistryReference WARD_ARMOR_TRIM_SMITHING_TEMPLATE = ItemTypes.key(ResourceKey.minecraft("ward_armor_trim_smithing_template")); public static final DefaultedRegistryReference WARDEN_SPAWN_EGG = ItemTypes.key(ResourceKey.minecraft("warden_spawn_egg")); @@ -2471,8 +2381,6 @@ public final class ItemTypes { public static final DefaultedRegistryReference WARPED_FUNGUS_ON_A_STICK = ItemTypes.key(ResourceKey.minecraft("warped_fungus_on_a_stick")); - @Experimental("update_1_20") - @ApiStatus.Experimental public static final DefaultedRegistryReference WARPED_HANGING_SIGN = ItemTypes.key(ResourceKey.minecraft("warped_hanging_sign")); public static final DefaultedRegistryReference WARPED_HYPHAE = ItemTypes.key(ResourceKey.minecraft("warped_hyphae")); @@ -2531,6 +2439,8 @@ public final class ItemTypes { public static final DefaultedRegistryReference WAXED_WEATHERED_CUT_COPPER_STAIRS = ItemTypes.key(ResourceKey.minecraft("waxed_weathered_cut_copper_stairs")); + public static final DefaultedRegistryReference WAYFINDER_ARMOR_TRIM_SMITHING_TEMPLATE = ItemTypes.key(ResourceKey.minecraft("wayfinder_armor_trim_smithing_template")); + public static final DefaultedRegistryReference WEATHERED_COPPER = ItemTypes.key(ResourceKey.minecraft("weathered_copper")); public static final DefaultedRegistryReference WEATHERED_CUT_COPPER = ItemTypes.key(ResourceKey.minecraft("weathered_cut_copper")); @@ -2575,8 +2485,6 @@ public final class ItemTypes { public static final DefaultedRegistryReference WHITE_WOOL = ItemTypes.key(ResourceKey.minecraft("white_wool")); - @Experimental("update_1_20") - @ApiStatus.Experimental public static final DefaultedRegistryReference WILD_ARMOR_TRIM_SMITHING_TEMPLATE = ItemTypes.key(ResourceKey.minecraft("wild_armor_trim_smithing_template")); public static final DefaultedRegistryReference WITCH_SPAWN_EGG = ItemTypes.key(ResourceKey.minecraft("witch_spawn_egg")); diff --git a/src/main/java/org/spongepowered/api/item/recipe/Recipe.java b/src/main/java/org/spongepowered/api/item/recipe/Recipe.java index ba0fd6c65b4..f3d263619c7 100644 --- a/src/main/java/org/spongepowered/api/item/recipe/Recipe.java +++ b/src/main/java/org/spongepowered/api/item/recipe/Recipe.java @@ -24,7 +24,6 @@ */ package org.spongepowered.api.item.recipe; -import org.spongepowered.api.ResourceKeyed; import org.spongepowered.api.block.BlockTypes; import org.spongepowered.api.block.entity.carrier.Campfire; import org.spongepowered.api.block.entity.carrier.furnace.BlastFurnace; @@ -58,7 +57,7 @@ *

{@link StoneCutterRecipe} for recipes in a {@link BlockTypes#STONECUTTER} block

*

{@link SmithingRecipe} for recipes in a {@link BlockTypes#SMITHING_TABLE} block

*/ -public interface Recipe extends ResourceKeyed { +public interface Recipe { /** * Checks if the given inventory fits the required constraints to make a valid recipe diff --git a/src/main/java/org/spongepowered/api/item/recipe/RecipeRegistration.java b/src/main/java/org/spongepowered/api/item/recipe/RecipeRegistration.java index a33cf51d572..905b955a2dd 100644 --- a/src/main/java/org/spongepowered/api/item/recipe/RecipeRegistration.java +++ b/src/main/java/org/spongepowered/api/item/recipe/RecipeRegistration.java @@ -32,5 +32,5 @@ *

All registrations through the API will generate into the Vanilla data pack system

*/ public interface RecipeRegistration extends DataPackEntry { - + Recipe recipe(); } diff --git a/src/main/java/org/spongepowered/api/item/recipe/smithing/SmithingRecipe.java b/src/main/java/org/spongepowered/api/item/recipe/smithing/SmithingRecipe.java index c725b6d651e..91a6b5f03a0 100644 --- a/src/main/java/org/spongepowered/api/item/recipe/smithing/SmithingRecipe.java +++ b/src/main/java/org/spongepowered/api/item/recipe/smithing/SmithingRecipe.java @@ -58,34 +58,67 @@ static SmithingRecipe.Builder builder() { */ interface Builder extends ResourceKeyedBuilder { + // TODO Trim recipe? + /** - * Sets the base ingredient and returns this builder. + * Sets the template ingredient and returns this builder. * * @param ingredient The ingredient * * @return This builder, for chaining */ - AdditionStep base(ItemType ingredient); + BaseStep template(ItemType ingredient); /** - * Sets the base ingredient and returns this builder. + * Sets the template ingredient and returns this builder. * * @param ingredient The ingredient * * @return This builder, for chaining */ - default AdditionStep base(Supplier ingredient) { - return this.base(ingredient.get()); + default BaseStep template(Supplier ingredient) { + return this.template(ingredient.get()); } /** - * Sets the base ingredient and returns this builder. + * Sets the template ingredient and returns this builder. * * @param ingredient The ingredient * * @return This builder, for chaining */ - AdditionStep base(Ingredient ingredient); + BaseStep template(Ingredient ingredient); + + interface BaseStep extends SmithingRecipe.Builder { + /** + * Sets the base ingredient and returns this builder. + * + * @param ingredient The ingredient + * + * @return This builder, for chaining + */ + AdditionStep base(ItemType ingredient); + + /** + * Sets the base ingredient and returns this builder. + * + * @param ingredient The ingredient + * + * @return This builder, for chaining + */ + default AdditionStep base(Supplier ingredient) { + return this.base(ingredient.get()); + } + + /** + * Sets the base ingredient and returns this builder. + * + * @param ingredient The ingredient + * + * @return This builder, for chaining + */ + AdditionStep base(Ingredient ingredient); + } interface AdditionStep extends SmithingRecipe.Builder { /** diff --git a/src/main/java/org/spongepowered/api/registry/RegistryTypes.java b/src/main/java/org/spongepowered/api/registry/RegistryTypes.java index cb94503c5a3..d4d773c1af6 100644 --- a/src/main/java/org/spongepowered/api/registry/RegistryTypes.java +++ b/src/main/java/org/spongepowered/api/registry/RegistryTypes.java @@ -266,6 +266,8 @@ public final class RegistryTypes { public static final DefaultedRegistryType STRUCTURE_TYPE = RegistryTypes.minecraftKeyInGame("worldgen/structure_type"); + public static final DefaultedRegistryType> TRIGGER = RegistryTypes.minecraftKeyInGame("trigger_type"); + public static final DefaultedRegistryType VILLAGER_TYPE = RegistryTypes.minecraftKeyInGame("villager_type"); public static final DefaultedRegistryType WORLD_TYPE = RegistryTypes.minecraftKeyInServer("dimension_type"); @@ -490,8 +492,6 @@ public final class RegistryTypes { public static final DefaultedRegistryType TRANSACTION_TYPE = RegistryTypes.spongeKeyInGame("transaction_type"); - public static final DefaultedRegistryType> TRIGGER = RegistryTypes.spongeKeyInGame("trigger"); - public static final DefaultedRegistryType TROPICAL_FISH_SHAPE = RegistryTypes.spongeKeyInGame("tropical_fish_shape"); public static final DefaultedRegistryType TILT = RegistryTypes.spongeKeyInGame("tilt"); diff --git a/src/main/java/org/spongepowered/api/scoreboard/Score.java b/src/main/java/org/spongepowered/api/scoreboard/Score.java index b95d2c8569b..64d87f09c06 100644 --- a/src/main/java/org/spongepowered/api/scoreboard/Score.java +++ b/src/main/java/org/spongepowered/api/scoreboard/Score.java @@ -25,8 +25,10 @@ package org.spongepowered.api.scoreboard; import net.kyori.adventure.text.Component; +import org.checkerframework.checker.nullness.qual.Nullable; import org.spongepowered.api.scoreboard.objective.Objective; +import java.util.Optional; import java.util.Set; /** @@ -39,7 +41,7 @@ public interface Score { * * @return The name of this score */ - Component name(); + String name(); /** * Gets the current score value. @@ -69,6 +71,36 @@ public interface Score { */ void setLocked(boolean locked); + // TODO javadocs + + /** + * Sets this score display + * + * @param display the display + */ + void setDisplay(@Nullable Component display); + + /** + * Returns this score display + * + * @return the display + */ + Optional display(); + + /** + * Sets the score number format + * + * @param format the number format + */ + void setNumberFormat(@Nullable ScoreFormat format); + + /** + * Returns the score number format + * + * @return the number format + */ + Optional numberFormat(); + /** * Returns a {@link Set} of parent {@link Objective}s this {@link Score} is * registered to. diff --git a/src/main/java/org/spongepowered/api/scoreboard/ScoreFormat.java b/src/main/java/org/spongepowered/api/scoreboard/ScoreFormat.java new file mode 100644 index 00000000000..329324a22cb --- /dev/null +++ b/src/main/java/org/spongepowered/api/scoreboard/ScoreFormat.java @@ -0,0 +1,76 @@ +/* + * This file is part of SpongeAPI, licensed under the MIT License (MIT). + * + * Copyright (c) SpongePowered + * Copyright (c) contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ +package org.spongepowered.api.scoreboard; + +import net.kyori.adventure.text.Component; +import net.kyori.adventure.text.format.Style; +import org.spongepowered.api.Sponge; + +/** + * A Score Number Format + */ +public interface ScoreFormat { + + static ScoreFormat blank() { + return Sponge.game().factoryProvider().provide(Factory.class).blank(); + } + + static ScoreFormat fixed(Component component) { + return Sponge.game().factoryProvider().provide(Factory.class).fixed(component); + } + + static ScoreFormat styled(Style style) { + return Sponge.game().factoryProvider().provide(Factory.class).styled(style); + } + + interface Factory { + + /** + * Blank score formatting. + * + * @return the format + */ + ScoreFormat blank(); + + /** + * Fixed score formatting + * + * @param component the fixed component + * + * @return the format + */ + ScoreFormat fixed(Component component); + + /** + * Styled number formatting + * + * @param style the style + * + * @return the format + */ + ScoreFormat styled(Style style); + } + +} diff --git a/src/main/java/org/spongepowered/api/scoreboard/Scoreboard.java b/src/main/java/org/spongepowered/api/scoreboard/Scoreboard.java index e8d8d7b8080..a43fc9a4fc9 100644 --- a/src/main/java/org/spongepowered/api/scoreboard/Scoreboard.java +++ b/src/main/java/org/spongepowered/api/scoreboard/Scoreboard.java @@ -193,7 +193,7 @@ default Set objectivesByCriterion(Supplier crite * @param name The name whose scores are being retrieved * @return A set of all scores for the name */ - Set scores(Component name); + Set scores(String name); /** * Removes all scores with the specified name on this scoreboard, @@ -201,7 +201,7 @@ default Set objectivesByCriterion(Supplier crite * * @param name The name to remove all scores for */ - void removeScores(Component name); + void removeScores(String name); /** * Gets a {@link Team} by name on this scoreboard. diff --git a/src/main/java/org/spongepowered/api/scoreboard/objective/Objective.java b/src/main/java/org/spongepowered/api/scoreboard/objective/Objective.java index 00cf258dc3b..6c8237ab73f 100644 --- a/src/main/java/org/spongepowered/api/scoreboard/objective/Objective.java +++ b/src/main/java/org/spongepowered/api/scoreboard/objective/Objective.java @@ -26,6 +26,8 @@ import net.kyori.adventure.text.Component; import org.spongepowered.api.Sponge; +import org.spongepowered.api.entity.Entity; +import org.spongepowered.api.profile.GameProfile; import org.spongepowered.api.scoreboard.Score; import org.spongepowered.api.scoreboard.Scoreboard; import org.spongepowered.api.scoreboard.criteria.Criterion; @@ -103,7 +105,7 @@ static Builder builder() { * * @return The set of {@link Score}s for this objective */ - Map scores(); + Map scores(); /** * Returns whether this objective has a {@link Score} with the given name. @@ -111,7 +113,25 @@ static Builder builder() { * @param name The name of the {@link Score} to check for. * @return Whether this objective has a {@link Score} with the given name. */ - boolean hasScore(Component name); + boolean hasScore(String name); + + + /** + * Returns whether this objective has a {@link Score} with the given entity. + * + * @param entity The entity of the {@link Score} to check for. + * @return Whether this objective has a {@link Score} with the given entity. + */ + boolean hasScore(Entity entity); + + + /** + * Returns whether this objective has a {@link Score} with the given profile. + * + * @param profile The profile of the {@link Score} to check for. + * @return Whether this objective has a {@link Score} with the given profile. + */ + boolean hasScore(GameProfile profile); /** * Adds the specified {@link Score} to this objective. @@ -125,9 +145,9 @@ static Builder builder() { * Gets an entry's {@link Score} for this objective, if it exists. * * @param name The name of the {@link Score} to get. - * @return The {@link Score} for te specified {@link Component}, if it exists. + * @return The {@link Score} for the specified name, if it exists. */ - default Optional findScore(final Component name) { + default Optional findScore(final String name) { if (!this.hasScore(name)) { return Optional.empty(); } @@ -140,25 +160,87 @@ default Optional findScore(final Component name) { *

If the {@link Score} does not exist, it will be created.

* * @param name The name of the {@link Score} to get - * @return The {@link Score} for the specified {@link Component} + * @return The {@link Score} for the specified name */ - Score findOrCreateScore(Component name); + Score findOrCreateScore(String name); /** - * Removes the specified {@link Score} from this objective, if present. + * Removes the {@link Score} with the specified name from this objective, if present. * - * @param score The {@link Score} to remove + * @param name The name of the {@link Score} to remove. * @return Whether the score existed on this objective */ - boolean removeScore(Score score); + boolean removeScore(String name); /** - * Removes the {@link Score} with the specified name from this objective, if present. + * Gets an entry's {@link Score} for this objective, if it exists. * - * @param name The name of the {@link Score} to remove. + * @param entity The entity of the {@link Score} to get. + * @return The {@link Score} for the specified entity, if it exists. + */ + default Optional findScore(final Entity entity) { + if (!this.hasScore(entity)) { + return Optional.empty(); + } + return Optional.of(this.findOrCreateScore(entity)); + } + + /** + * Gets an entry's {@link Score} for this objective. + * + *

If the {@link Score} does not exist, it will be created.

+ * + * @param entity The name of the {@link Score} to get + * @return The {@link Score} for the specified entity + */ + Score findOrCreateScore(Entity entity); + + /** + * Removes the {@link Score} with the specified entity from this objective, if present. + * + * @param entity The entity of the {@link Score} to remove. + * @return Whether the score existed on this objective + */ + boolean removeScore(Entity entity); + + /** + * Gets an entry's {@link Score} for this objective, if it exists. + * + * @param profile The profile of the {@link Score} to get. + * @return The {@link Score} for the specified profile, if it exists. + */ + default Optional findScore(final GameProfile profile) { + if (!this.hasScore(profile)) { + return Optional.empty(); + } + return Optional.of(this.findOrCreateScore(profile)); + } + + /** + * Gets an entry's {@link Score} for this objective. + * + *

If the {@link Score} does not exist, it will be created.

+ * + * @param profile The profile of the {@link Score} to get + * @return The {@link Score} for the specified profile + */ + Score findOrCreateScore(GameProfile profile); + + /** + * Removes the {@link Score} with the specified profile from this objective, if present. + * + * @param profile The profile of the {@link Score} to remove. * @return Whether the score existed on this objective */ - boolean removeScore(Component name); + boolean removeScore(GameProfile profile); + + /** + * Removes the specified {@link Score} from this objective, if present. + * + * @param score The {@link Score} to remove + * @return Whether the score existed on this objective + */ + boolean removeScore(Score score); /** * Returns a {@link Set} of parent {@link Scoreboard}s this diff --git a/src/main/java/org/spongepowered/api/state/BooleanStateProperties.java b/src/main/java/org/spongepowered/api/state/BooleanStateProperties.java index fe48229e4c4..5c48414afd6 100644 --- a/src/main/java/org/spongepowered/api/state/BooleanStateProperties.java +++ b/src/main/java/org/spongepowered/api/state/BooleanStateProperties.java @@ -81,6 +81,10 @@ public static BooleanStateProperty property_CONDITIONAL() { return BooleanStateProperty.of("CONDITIONAL"); } + public static BooleanStateProperty property_CRACKED() { + return BooleanStateProperty.of("CRACKED"); + } + public static BooleanStateProperty property_DISARMED() { return BooleanStateProperty.of("DISARMED"); } diff --git a/src/main/java/org/spongepowered/api/tag/BiomeTags.java b/src/main/java/org/spongepowered/api/tag/BiomeTags.java index a130af9075d..d4e278786af 100644 --- a/src/main/java/org/spongepowered/api/tag/BiomeTags.java +++ b/src/main/java/org/spongepowered/api/tag/BiomeTags.java @@ -96,6 +96,8 @@ public final class BiomeTags { public static final Tag HAS_STRUCTURE_SWAMP_HUT = BiomeTags.key(ResourceKey.minecraft("has_structure/swamp_hut")); + public static final Tag HAS_STRUCTURE_TRAIL_RUINS = BiomeTags.key(ResourceKey.minecraft("has_structure/trail_ruins")); + public static final Tag HAS_STRUCTURE_VILLAGE_DESERT = BiomeTags.key(ResourceKey.minecraft("has_structure/village_desert")); public static final Tag HAS_STRUCTURE_VILLAGE_PLAINS = BiomeTags.key(ResourceKey.minecraft("has_structure/village_plains")); diff --git a/src/main/java/org/spongepowered/api/tag/BlockTypeTags.java b/src/main/java/org/spongepowered/api/tag/BlockTypeTags.java index 8efa7bc9be9..a3bc25cef48 100644 --- a/src/main/java/org/spongepowered/api/tag/BlockTypeTags.java +++ b/src/main/java/org/spongepowered/api/tag/BlockTypeTags.java @@ -40,6 +40,8 @@ public final class BlockTypeTags { // @formatter:off public static final Tag ACACIA_LOGS = BlockTypeTags.key(ResourceKey.minecraft("acacia_logs")); + public static final Tag ALL_HANGING_SIGNS = BlockTypeTags.key(ResourceKey.minecraft("all_hanging_signs")); + public static final Tag ALL_SIGNS = BlockTypeTags.key(ResourceKey.minecraft("all_signs")); public static final Tag ANCIENT_CITY_REPLACEABLE = BlockTypeTags.key(ResourceKey.minecraft("ancient_city_replaceable")); @@ -54,6 +56,8 @@ public final class BlockTypeTags { public static final Tag AZALEA_ROOT_REPLACEABLE = BlockTypeTags.key(ResourceKey.minecraft("azalea_root_replaceable")); + public static final Tag BAMBOO_BLOCKS = BlockTypeTags.key(ResourceKey.minecraft("bamboo_blocks")); + public static final Tag BAMBOO_PLANTABLE_ON = BlockTypeTags.key(ResourceKey.minecraft("bamboo_plantable_on")); public static final Tag BANNERS = BlockTypeTags.key(ResourceKey.minecraft("banners")); @@ -76,6 +80,8 @@ public final class BlockTypeTags { public static final Tag BUTTONS = BlockTypeTags.key(ResourceKey.minecraft("buttons")); + public static final Tag CAMEL_SAND_STEP_SOUND_BLOCKS = BlockTypeTags.key(ResourceKey.minecraft("camel_sand_step_sound_blocks")); + public static final Tag CAMPFIRES = BlockTypeTags.key(ResourceKey.minecraft("campfires")); public static final Tag CANDLE_CAKES = BlockTypeTags.key(ResourceKey.minecraft("candle_cakes")); @@ -86,12 +92,20 @@ public final class BlockTypeTags { public static final Tag CAVE_VINES = BlockTypeTags.key(ResourceKey.minecraft("cave_vines")); + public static final Tag CEILING_HANGING_SIGNS = BlockTypeTags.key(ResourceKey.minecraft("ceiling_hanging_signs")); + + public static final Tag CHERRY_LOGS = BlockTypeTags.key(ResourceKey.minecraft("cherry_logs")); + public static final Tag CLIMBABLE = BlockTypeTags.key(ResourceKey.minecraft("climbable")); public static final Tag COAL_ORES = BlockTypeTags.key(ResourceKey.minecraft("coal_ores")); + public static final Tag COMBINATION_STEP_SOUND_BLOCKS = BlockTypeTags.key(ResourceKey.minecraft("combination_step_sound_blocks")); + public static final Tag COMPLETES_FIND_TREE_TUTORIAL = BlockTypeTags.key(ResourceKey.minecraft("completes_find_tree_tutorial")); + public static final Tag CONCRETE_POWDER = BlockTypeTags.key(ResourceKey.minecraft("concrete_powder")); + public static final Tag CONVERTABLE_TO_MUD = BlockTypeTags.key(ResourceKey.minecraft("convertable_to_mud")); public static final Tag COPPER_ORES = BlockTypeTags.key(ResourceKey.minecraft("copper_ores")); @@ -130,6 +144,10 @@ public final class BlockTypeTags { public static final Tag EMERALD_ORES = BlockTypeTags.key(ResourceKey.minecraft("emerald_ores")); + public static final Tag ENCHANTMENT_POWER_PROVIDER = BlockTypeTags.key(ResourceKey.minecraft("enchantment_power_provider")); + + public static final Tag ENCHANTMENT_POWER_TRANSMITTER = BlockTypeTags.key(ResourceKey.minecraft("enchantment_power_transmitter")); + public static final Tag ENDERMAN_HOLDABLE = BlockTypeTags.key(ResourceKey.minecraft("enderman_holdable")); public static final Tag FALL_DAMAGE_RESETTING = BlockTypeTags.key(ResourceKey.minecraft("fall_damage_resetting")); @@ -192,6 +210,8 @@ public final class BlockTypeTags { public static final Tag LUSH_GROUND_REPLACEABLE = BlockTypeTags.key(ResourceKey.minecraft("lush_ground_replaceable")); + public static final Tag MAINTAINS_FARMLAND = BlockTypeTags.key(ResourceKey.minecraft("maintains_farmland")); + public static final Tag MANGROVE_LOGS = BlockTypeTags.key(ResourceKey.minecraft("mangrove_logs")); public static final Tag MANGROVE_LOGS_CAN_GROW_THROUGH = BlockTypeTags.key(ResourceKey.minecraft("mangrove_logs_can_grow_through")); @@ -250,7 +270,9 @@ public final class BlockTypeTags { public static final Tag REDSTONE_ORES = BlockTypeTags.key(ResourceKey.minecraft("redstone_ores")); - public static final Tag REPLACEABLE_PLANTS = BlockTypeTags.key(ResourceKey.minecraft("replaceable_plants")); + public static final Tag REPLACEABLE = BlockTypeTags.key(ResourceKey.minecraft("replaceable")); + + public static final Tag REPLACEABLE_BY_TREES = BlockTypeTags.key(ResourceKey.minecraft("replaceable_by_trees")); public static final Tag SAND = BlockTypeTags.key(ResourceKey.minecraft("sand")); @@ -274,6 +296,10 @@ public final class BlockTypeTags { public static final Tag SNAPS_GOAT_HORN = BlockTypeTags.key(ResourceKey.minecraft("snaps_goat_horn")); + public static final Tag SNIFFER_DIGGABLE_BLOCK = BlockTypeTags.key(ResourceKey.minecraft("sniffer_diggable_block")); + + public static final Tag SNIFFER_EGG_HATCH_BOOST = BlockTypeTags.key(ResourceKey.minecraft("sniffer_egg_hatch_boost")); + public static final Tag SNOW = BlockTypeTags.key(ResourceKey.minecraft("snow")); public static final Tag SNOW_LAYER_CAN_SURVIVE_ON = BlockTypeTags.key(ResourceKey.minecraft("snow_layer_can_survive_on")); @@ -292,16 +318,22 @@ public final class BlockTypeTags { public static final Tag STONE_BRICKS = BlockTypeTags.key(ResourceKey.minecraft("stone_bricks")); + public static final Tag STONE_BUTTONS = BlockTypeTags.key(ResourceKey.minecraft("stone_buttons")); + public static final Tag STONE_ORE_REPLACEABLES = BlockTypeTags.key(ResourceKey.minecraft("stone_ore_replaceables")); public static final Tag STONE_PRESSURE_PLATES = BlockTypeTags.key(ResourceKey.minecraft("stone_pressure_plates")); public static final Tag STRIDER_WARM_BLOCKS = BlockTypeTags.key(ResourceKey.minecraft("strider_warm_blocks")); + public static final Tag SWORD_EFFICIENT = BlockTypeTags.key(ResourceKey.minecraft("sword_efficient")); + public static final Tag TALL_FLOWERS = BlockTypeTags.key(ResourceKey.minecraft("tall_flowers")); public static final Tag TERRACOTTA = BlockTypeTags.key(ResourceKey.minecraft("terracotta")); + public static final Tag TRAIL_RUINS_REPLACEABLE = BlockTypeTags.key(ResourceKey.minecraft("trail_ruins_replaceable")); + public static final Tag TRAPDOORS = BlockTypeTags.key(ResourceKey.minecraft("trapdoors")); public static final Tag UNDERWATER_BONEMEALS = BlockTypeTags.key(ResourceKey.minecraft("underwater_bonemeals")); @@ -310,8 +342,12 @@ public final class BlockTypeTags { public static final Tag VALID_SPAWN = BlockTypeTags.key(ResourceKey.minecraft("valid_spawn")); + public static final Tag VIBRATION_RESONATORS = BlockTypeTags.key(ResourceKey.minecraft("vibration_resonators")); + public static final Tag WALL_CORALS = BlockTypeTags.key(ResourceKey.minecraft("wall_corals")); + public static final Tag WALL_HANGING_SIGNS = BlockTypeTags.key(ResourceKey.minecraft("wall_hanging_signs")); + public static final Tag WALL_POST_OVERRIDE = BlockTypeTags.key(ResourceKey.minecraft("wall_post_override")); public static final Tag WALL_SIGNS = BlockTypeTags.key(ResourceKey.minecraft("wall_signs")); diff --git a/src/main/java/org/spongepowered/api/tag/DamageTypeTags.java b/src/main/java/org/spongepowered/api/tag/DamageTypeTags.java index 6be378dbffc..237f98db4de 100644 --- a/src/main/java/org/spongepowered/api/tag/DamageTypeTags.java +++ b/src/main/java/org/spongepowered/api/tag/DamageTypeTags.java @@ -40,6 +40,8 @@ public final class DamageTypeTags { // @formatter:off public static final Tag ALWAYS_HURTS_ENDER_DRAGONS = DamageTypeTags.key(ResourceKey.minecraft("always_hurts_ender_dragons")); + public static final Tag ALWAYS_KILLS_ARMOR_STANDS = DamageTypeTags.key(ResourceKey.minecraft("always_kills_armor_stands")); + public static final Tag ALWAYS_MOST_SIGNIFICANT_FALL = DamageTypeTags.key(ResourceKey.minecraft("always_most_significant_fall")); public static final Tag ALWAYS_TRIGGERS_SILVERFISH = DamageTypeTags.key(ResourceKey.minecraft("always_triggers_silverfish")); @@ -82,6 +84,8 @@ public final class DamageTypeTags { public static final Tag NO_IMPACT = DamageTypeTags.key(ResourceKey.minecraft("no_impact")); + public static final Tag NO_KNOCKBACK = DamageTypeTags.key(ResourceKey.minecraft("no_knockback")); + public static final Tag WITCH_RESISTANT_TO = DamageTypeTags.key(ResourceKey.minecraft("witch_resistant_to")); public static final Tag WITHER_IMMUNE_TO = DamageTypeTags.key(ResourceKey.minecraft("wither_immune_to")); diff --git a/src/main/java/org/spongepowered/api/tag/EntityTypeTags.java b/src/main/java/org/spongepowered/api/tag/EntityTypeTags.java index 50d4dd6cd7c..99130a72b26 100644 --- a/src/main/java/org/spongepowered/api/tag/EntityTypeTags.java +++ b/src/main/java/org/spongepowered/api/tag/EntityTypeTags.java @@ -58,6 +58,8 @@ public final class EntityTypeTags { public static final Tag> IMPACT_PROJECTILES = EntityTypeTags.key(ResourceKey.minecraft("impact_projectiles")); + public static final Tag> NON_CONTROLLING_RIDER = EntityTypeTags.key(ResourceKey.minecraft("non_controlling_rider")); + public static final Tag> POWDER_SNOW_WALKABLE_MOBS = EntityTypeTags.key(ResourceKey.minecraft("powder_snow_walkable_mobs")); public static final Tag> RAIDERS = EntityTypeTags.key(ResourceKey.minecraft("raiders")); diff --git a/src/main/java/org/spongepowered/api/tag/ItemTypeTags.java b/src/main/java/org/spongepowered/api/tag/ItemTypeTags.java index 2aad66b95c8..13c3bfc0fa4 100644 --- a/src/main/java/org/spongepowered/api/tag/ItemTypeTags.java +++ b/src/main/java/org/spongepowered/api/tag/ItemTypeTags.java @@ -48,6 +48,8 @@ public final class ItemTypeTags { public static final Tag AXOLOTL_TEMPT_ITEMS = ItemTypeTags.key(ResourceKey.minecraft("axolotl_tempt_items")); + public static final Tag BAMBOO_BLOCKS = ItemTypeTags.key(ResourceKey.minecraft("bamboo_blocks")); + public static final Tag BANNERS = ItemTypeTags.key(ResourceKey.minecraft("banners")); public static final Tag BEACON_PAYMENT_ITEMS = ItemTypeTags.key(ResourceKey.minecraft("beacon_payment_items")); @@ -58,10 +60,16 @@ public final class ItemTypeTags { public static final Tag BOATS = ItemTypeTags.key(ResourceKey.minecraft("boats")); + public static final Tag BOOKSHELF_BOOKS = ItemTypeTags.key(ResourceKey.minecraft("bookshelf_books")); + + public static final Tag BREAKS_DECORATED_POTS = ItemTypeTags.key(ResourceKey.minecraft("breaks_decorated_pots")); + public static final Tag BUTTONS = ItemTypeTags.key(ResourceKey.minecraft("buttons")); public static final Tag CANDLES = ItemTypeTags.key(ResourceKey.minecraft("candles")); + public static final Tag CHERRY_LOGS = ItemTypeTags.key(ResourceKey.minecraft("cherry_logs")); + public static final Tag CHEST_BOATS = ItemTypeTags.key(ResourceKey.minecraft("chest_boats")); public static final Tag CLUSTER_MAX_HARVESTABLES = ItemTypeTags.key(ResourceKey.minecraft("cluster_max_harvestables")); @@ -86,6 +94,10 @@ public final class ItemTypeTags { public static final Tag DARK_OAK_LOGS = ItemTypeTags.key(ResourceKey.minecraft("dark_oak_logs")); + public static final Tag DECORATED_POT_INGREDIENTS = ItemTypeTags.key(ResourceKey.minecraft("decorated_pot_ingredients")); + + public static final Tag DECORATED_POT_SHERDS = ItemTypeTags.key(ResourceKey.minecraft("decorated_pot_sherds")); + public static final Tag DIAMOND_ORES = ItemTypeTags.key(ResourceKey.minecraft("diamond_ores")); public static final Tag DIRT = ItemTypeTags.key(ResourceKey.minecraft("dirt")); @@ -108,6 +120,8 @@ public final class ItemTypeTags { public static final Tag GOLD_ORES = ItemTypeTags.key(ResourceKey.minecraft("gold_ores")); + public static final Tag HANGING_SIGNS = ItemTypeTags.key(ResourceKey.minecraft("hanging_signs")); + public static final Tag HOES = ItemTypeTags.key(ResourceKey.minecraft("hoes")); public static final Tag IGNORED_BY_PIGLIN_BABIES = ItemTypeTags.key(ResourceKey.minecraft("ignored_by_piglin_babies")); @@ -132,6 +146,8 @@ public final class ItemTypeTags { public static final Tag NON_FLAMMABLE_WOOD = ItemTypeTags.key(ResourceKey.minecraft("non_flammable_wood")); + public static final Tag NOTEBLOCK_TOP_INSTRUMENTS = ItemTypeTags.key(ResourceKey.minecraft("noteblock_top_instruments")); + public static final Tag OAK_LOGS = ItemTypeTags.key(ResourceKey.minecraft("oak_logs")); public static final Tag PICKAXES = ItemTypeTags.key(ResourceKey.minecraft("pickaxes")); @@ -162,6 +178,8 @@ public final class ItemTypeTags { public static final Tag SMELTS_TO_GLASS = ItemTypeTags.key(ResourceKey.minecraft("smelts_to_glass")); + public static final Tag SNIFFER_FOOD = ItemTypeTags.key(ResourceKey.minecraft("sniffer_food")); + public static final Tag SOUL_FIRE_BASE_BLOCKS = ItemTypeTags.key(ResourceKey.minecraft("soul_fire_base_blocks")); public static final Tag SPRUCE_LOGS = ItemTypeTags.key(ResourceKey.minecraft("spruce_logs")); @@ -170,6 +188,8 @@ public final class ItemTypeTags { public static final Tag STONE_BRICKS = ItemTypeTags.key(ResourceKey.minecraft("stone_bricks")); + public static final Tag STONE_BUTTONS = ItemTypeTags.key(ResourceKey.minecraft("stone_buttons")); + public static final Tag STONE_CRAFTING_MATERIALS = ItemTypeTags.key(ResourceKey.minecraft("stone_crafting_materials")); public static final Tag STONE_TOOL_MATERIALS = ItemTypeTags.key(ResourceKey.minecraft("stone_tool_materials")); @@ -184,6 +204,14 @@ public final class ItemTypeTags { public static final Tag TRAPDOORS = ItemTypeTags.key(ResourceKey.minecraft("trapdoors")); + public static final Tag TRIM_MATERIALS = ItemTypeTags.key(ResourceKey.minecraft("trim_materials")); + + public static final Tag TRIM_TEMPLATES = ItemTypeTags.key(ResourceKey.minecraft("trim_templates")); + + public static final Tag TRIMMABLE_ARMOR = ItemTypeTags.key(ResourceKey.minecraft("trimmable_armor")); + + public static final Tag VILLAGER_PLANTABLE_SEEDS = ItemTypeTags.key(ResourceKey.minecraft("villager_plantable_seeds")); + public static final Tag WALLS = ItemTypeTags.key(ResourceKey.minecraft("walls")); public static final Tag WARPED_STEMS = ItemTypeTags.key(ResourceKey.minecraft("warped_stems")); diff --git a/src/main/java/org/spongepowered/api/world/biome/Biomes.java b/src/main/java/org/spongepowered/api/world/biome/Biomes.java index ff1d4bdd67d..0390b94f7e9 100644 --- a/src/main/java/org/spongepowered/api/world/biome/Biomes.java +++ b/src/main/java/org/spongepowered/api/world/biome/Biomes.java @@ -51,6 +51,8 @@ public final class Biomes { public static final RegistryReference BIRCH_FOREST = Biomes.key(ResourceKey.minecraft("birch_forest")); + public static final RegistryReference CHERRY_GROVE = Biomes.key(ResourceKey.minecraft("cherry_grove")); + public static final RegistryReference COLD_OCEAN = Biomes.key(ResourceKey.minecraft("cold_ocean")); public static final RegistryReference CRIMSON_FOREST = Biomes.key(ResourceKey.minecraft("crimson_forest")); diff --git a/src/main/java/org/spongepowered/api/world/chunk/ChunkStates.java b/src/main/java/org/spongepowered/api/world/chunk/ChunkStates.java index ff89e5f255b..b8c08114191 100644 --- a/src/main/java/org/spongepowered/api/world/chunk/ChunkStates.java +++ b/src/main/java/org/spongepowered/api/world/chunk/ChunkStates.java @@ -79,12 +79,7 @@ public final class ChunkStates { */ public static final DefaultedRegistryReference FULL = ChunkStates.key(ResourceKey.minecraft("full")); - /** - * A {@link Chunk} state that is "cleaning" up remnant objects of a - * chunk in process of world generation. Generally, height maps are being - * calculated at this point as entity spawning can affect block placement. - */ - public static final DefaultedRegistryReference HEIGHTMAPS = ChunkStates.key(ResourceKey.minecraft("heightmaps")); + public static final DefaultedRegistryReference INITIALIZE_LIGHT = ChunkStates.key(ResourceKey.minecraft("initialize_light")); /** * A {@link Chunk} state that has yet been processed with lighting in @@ -94,12 +89,6 @@ public final class ChunkStates { */ public static final DefaultedRegistryReference LIGHT = ChunkStates.key(ResourceKey.minecraft("light")); - /** - * A {@link Chunk} state that is being "carved" with liquid cave - * features, such as underwater ravines, underwater caves, etc. - */ - public static final DefaultedRegistryReference LIQUID_CARVERS = ChunkStates.key(ResourceKey.minecraft("liquid_carvers")); - /** * A {@link Chunk} where the {@link BlockState block states} are being * set and structure locations are set. diff --git a/src/main/java/org/spongepowered/api/world/chunk/WorldChunk.java b/src/main/java/org/spongepowered/api/world/chunk/WorldChunk.java index aad9e76be66..884afd26a61 100644 --- a/src/main/java/org/spongepowered/api/world/chunk/WorldChunk.java +++ b/src/main/java/org/spongepowered/api/world/chunk/WorldChunk.java @@ -25,6 +25,7 @@ package org.spongepowered.api.world.chunk; import org.spongepowered.api.Sponge; +import org.spongepowered.api.data.DataHolder; import org.spongepowered.api.util.Direction; import org.spongepowered.api.world.World; import org.spongepowered.api.world.volume.block.PhysicsAwareMutableBlockVolume; @@ -39,7 +40,7 @@ *

In Minecraft, the chunk is 16 by 16 blocks on the X and Z axes. The height * of each chunk varies between worlds.

*/ -public interface WorldChunk extends Chunk, EntityVolume.Modifiable, PhysicsAwareMutableBlockVolume { +public interface WorldChunk extends Chunk, EntityVolume.Modifiable, PhysicsAwareMutableBlockVolume, DataHolder.Mutable { /** * Gets the world the chunk is in. diff --git a/src/main/java/org/spongepowered/api/world/gamerule/GameRules.java b/src/main/java/org/spongepowered/api/world/gamerule/GameRules.java index a474288e6a5..7a382dd3429 100644 --- a/src/main/java/org/spongepowered/api/world/gamerule/GameRules.java +++ b/src/main/java/org/spongepowered/api/world/gamerule/GameRules.java @@ -26,31 +26,6 @@ import org.spongepowered.api.ResourceKey; import org.spongepowered.api.Sponge; -import org.spongepowered.api.block.BlockTypes; -import org.spongepowered.api.block.entity.CommandBlock; -import org.spongepowered.api.entity.living.Agent; -import org.spongepowered.api.entity.living.Bat; -import org.spongepowered.api.entity.living.animal.Rabbit; -import org.spongepowered.api.entity.living.animal.Sheep; -import org.spongepowered.api.entity.living.golem.SnowGolem; -import org.spongepowered.api.entity.living.monster.Creeper; -import org.spongepowered.api.entity.living.monster.Enderman; -import org.spongepowered.api.entity.living.monster.Ghast; -import org.spongepowered.api.entity.living.monster.Patroller; -import org.spongepowered.api.entity.living.monster.Phantom; -import org.spongepowered.api.entity.living.monster.Silverfish; -import org.spongepowered.api.entity.living.monster.boss.Wither; -import org.spongepowered.api.entity.living.monster.boss.dragon.EnderDragon; -import org.spongepowered.api.entity.living.monster.skeleton.Skeleton; -import org.spongepowered.api.entity.living.monster.zombie.Zombie; -import org.spongepowered.api.entity.living.monster.zombie.ZombifiedPiglin; -import org.spongepowered.api.entity.living.player.Player; -import org.spongepowered.api.entity.living.player.gamemode.GameModes; -import org.spongepowered.api.entity.living.trader.Villager; -import org.spongepowered.api.entity.living.trader.WanderingTrader; -import org.spongepowered.api.entity.vehicle.Boat; -import org.spongepowered.api.entity.vehicle.minecart.MinecartLike; -import org.spongepowered.api.raid.Raid; import org.spongepowered.api.registry.DefaultedRegistryReference; import org.spongepowered.api.registry.Registry; import org.spongepowered.api.registry.RegistryKey; @@ -66,330 +41,101 @@ public final class GameRules { // @formatter:off - // SORTFIELDS:ON - - /** - * If advancements should be announced to the server. - * - *

This is a boolean game rule, with a default value of {@code true}.

- */ public static final DefaultedRegistryReference> ANNOUNCE_ADVANCEMENTS = GameRules.key(ResourceKey.sponge("announce_advancements")); - /** - * Whether {@link CommandBlock}s should notify admins when - * they perform commands. - * - *

This is a boolean game rule, with a default value of {@code true}.

- */ + public static final DefaultedRegistryReference> BLOCK_EXPLOSION_DROP_DECAY = GameRules.key(ResourceKey.sponge("block_explosion_drop_decay")); + public static final DefaultedRegistryReference> COMMAND_BLOCK_OUTPUT = GameRules.key(ResourceKey.sponge("command_block_output")); - /** - * Whether the server should skip checking player speed when - * the player is wearing elytra. - * - *

This is a boolean game rule, with a default value of - * {@code false}.

- */ + public static final DefaultedRegistryReference> COMMAND_MODIFICATION_BLOCK_LIMIT = GameRules.key(ResourceKey.sponge("command_modification_block_limit")); + public static final DefaultedRegistryReference> DISABLE_ELYTRA_MOVEMENT_CHECK = GameRules.key(ResourceKey.sponge("disable_elytra_movement_check")); - /** - * Whether {@link Raid}s are disabled. - * - *

If the value of this game rule is {@code true}, all {@link Raid}s will stop. - * - *

This is a boolean game rule, with a default value of - * {@code false}.

- */ public static final DefaultedRegistryReference> DISABLE_RAIDS = GameRules.key(ResourceKey.sponge("disable_raids")); - /** - * Whether the day-night cycle and moon phases progress. - * - *

This is a boolean game rule, with a default value of - * {@code true}.

- */ public static final DefaultedRegistryReference> DO_DAYLIGHT_CYCLE = GameRules.key(ResourceKey.sponge("do_daylight_cycle")); - /** - * Whether entities that are not mobs should have drops. - * - *

This is a boolean game rule, with a default value of - * {@code true}.

- */ public static final DefaultedRegistryReference> DO_ENTITY_DROPS = GameRules.key(ResourceKey.sponge("do_entity_drops")); - /** - * Whether fire should spread and naturally extinguish. - * - *

This is a boolean game rule, with a default value of - * {@code true}.

- */ public static final DefaultedRegistryReference> DO_FIRE_TICK = GameRules.key(ResourceKey.sponge("do_fire_tick")); - /** - * Whether {@link Phantom}s can spawn in the night-time. - * - *

This is a boolean game rule, with a default value of - * {@code true}.

- */ - public static final DefaultedRegistryReference> DO_INSOMNIA = GameRules.key(ResourceKey.sponge("do_insomnia")); - - /** - * Whether {@link Player}s should respawn immediately without showing the death screen. - * - *

This is a boolean game rule, with a default value of - * {@code true}.

- */ public static final DefaultedRegistryReference> DO_IMMEDIATE_RESPAWN = GameRules.key(ResourceKey.sponge("do_immediate_respawn")); - /** - * Whether {@link Player}s can only craft recipes they have unlocked. - * - *

This is a boolean game rule, with a default value of - * {@code false}.

- */ + public static final DefaultedRegistryReference> DO_INSOMNIA = GameRules.key(ResourceKey.sponge("do_insomnia")); + public static final DefaultedRegistryReference> DO_LIMITED_CRAFTING = GameRules.key(ResourceKey.sponge("do_limited_crafting")); - /** - * Whether {@link Agent}s should drop items. - * - *

This is a boolean game rule, with a default value of {@code true}.

- */ public static final DefaultedRegistryReference> DO_MOB_LOOT = GameRules.key(ResourceKey.sponge("do_mob_loot")); - /** - * Whether {@link Agent}s should naturally spawn. - * - *

This is a boolean game rule, with a default value of {@code true}.

- */ public static final DefaultedRegistryReference> DO_MOB_SPAWNING = GameRules.key(ResourceKey.sponge("do_mob_spawning")); - /** - * Whether {@link Patroller patrollers} will go out on patrol (typically in a {@link Raid}. - * - *

This is a boolean game rule, with a default value of {@code true}.

- */ public static final DefaultedRegistryReference> DO_PATROL_SPAWNING = GameRules.key(ResourceKey.sponge("do_patrol_spawning")); - /** - * Whether blocks should have drops. - * - *

This is a boolean game rule, with a default value of {@code true}.

- */ public static final DefaultedRegistryReference> DO_TILE_DROPS = GameRules.key(ResourceKey.sponge("do_tile_drops")); - /** - * Whether {@link WanderingTrader traders} will naturally spawn. - * - *

This is a boolean game rule, with a default value of {@code true}.

- */ public static final DefaultedRegistryReference> DO_TRADER_SPAWNING = GameRules.key(ResourceKey.sponge("do_trader_spawning")); - /** - * Whether the weather will change. - * - *

This is a boolean game rule, with a default value of {@code true}.

- */ + public static final DefaultedRegistryReference> DO_VINES_SPREAD = GameRules.key(ResourceKey.sponge("do_vines_spread")); + + public static final DefaultedRegistryReference> DO_WARDEN_SPAWNING = GameRules.key(ResourceKey.sponge("do_warden_spawning")); + public static final DefaultedRegistryReference> DO_WEATHER_CYCLE = GameRules.key(ResourceKey.sponge("do_weather_cycle")); - /** - * Whether entities should take drowning damage. - * - *

This is a boolean game rule, with a default value of - * {@code true}.

- */ public static final DefaultedRegistryReference> DROWNING_DAMAGE = GameRules.key(ResourceKey.sponge("drowning_damage")); - /** - * Whether entities should take fall damage. - * - *

This is a boolean game rule, with a default value of - * {@code true}.

- */ + public static final DefaultedRegistryReference> ENDER_PEARLS_VANISH_ON_DEATH = GameRules.key(ResourceKey.sponge("ender_pearls_vanish_on_death")); + public static final DefaultedRegistryReference> FALL_DAMAGE = GameRules.key(ResourceKey.sponge("fall_damage")); - /** - * Whether entities should take fire damage. - * - *

This is a boolean game rule, with a default value of - * {@code true}.

- */ public static final DefaultedRegistryReference> FIRE_DAMAGE = GameRules.key(ResourceKey.sponge("fire_damage")); - /** - * Makes angered neutral mobs stop being angry when the targeted player dies nearby. - * - *

This is a boolean game rule, with a default value of - * {@code true}.

- */ public static final DefaultedRegistryReference> FORGIVE_DEAD_PLAYERS = GameRules.key(ResourceKey.sponge("forgive_dead_players")); - /** - * Whether entities should take freeze damage. - * - *

This is a boolean game rule, with a default value of - * {@code true}.

- */ public static final DefaultedRegistryReference> FREEZE_DAMAGE = GameRules.key(ResourceKey.sponge("freeze_damage")); - /** - * Whether {@link Player}s should keep items in their inventory - * after death. - * - *

This is a boolean game rule, with a default value of - * {@code false}.

- */ + public static final DefaultedRegistryReference> GLOBAL_SOUND_EVENTS = GameRules.key(ResourceKey.sponge("global_sound_events")); + public static final DefaultedRegistryReference> KEEP_INVENTORY = GameRules.key(ResourceKey.sponge("keep_inventory")); - /** - * Whether to log admin commands to server log. - * - *

This is a boolean game rule, with a default value of - * {@code true}.

- */ + public static final DefaultedRegistryReference> LAVA_SOURCE_CONVERSION = GameRules.key(ResourceKey.sponge("lava_source_conversion")); + public static final DefaultedRegistryReference> LOG_ADMIN_COMMANDS = GameRules.key(ResourceKey.sponge("log_admin_commands")); - /** - * The total number of {@link BlockTypes#CHAIN_COMMAND_BLOCK chain command - * blocks} that can run during a single tick. - * - *

This is a numerical game rule, with a default value - * of {@code 65536}.

- */ public static final DefaultedRegistryReference> MAX_COMMAND_CHAIN_LENGTH = GameRules.key(ResourceKey.sponge("max_command_chain_length")); - /** - * The maximum number of other pushable entities a mob or player can push, - * before taking 3 suffocation damage per half-second. - * - *

Damage affects {@link GameModes#SURVIVAL survival mode} or - * {@link GameModes#ADVENTURE adventure mode} {@link Player}s, and all - * mobs but bats. Pushable entities include non-spectator-mode - * {@link Player}, any mob except {@link Bat}s, as well as - * {@link Boat}s and {@link MinecartLike}.

- * - *

Setting to {@code 0} disables the rule.

- * - *

This is a numerical game rule, with a default value of {@code 24}.

- */ public static final DefaultedRegistryReference> MAX_ENTITY_CRAMMING = GameRules.key(ResourceKey.sponge("max_entity_cramming")); - /** - * Whether {@link Agent}s should be able to change blocks, and whether - * {@link Agent}s can pick up items. - * - *

In vanilla Minecraft, the following entities can change blocks when - * this game rule is {@code true}: - *

    - *
  • {@link Creeper}
  • - *
  • {@link Zombie}
  • - *
  • {@link Enderman}
  • - *
  • {@link Ghast}
  • - *
  • {@link Wither}
  • - *
  • {@link EnderDragon}
  • - *
  • {@link Rabbit}
  • - *
  • {@link Sheep}
  • - *
  • {@link Villager}
  • - *
  • {@link SnowGolem}
  • - *
  • {@link Silverfish}
  • - *
- * - *

In vanilla Minecraft, the following entities can pick up items when - * this game rule is {@code true}: - *

    - *
  • {@link Villager}
  • - *
  • {@link Zombie}
  • - *
  • {@link Skeleton}
  • - *
  • {@link ZombifiedPiglin}
  • - *
- * - *

This is a boolean game rule, with a default value of {@code true}.

- */ + public static final DefaultedRegistryReference> MOB_EXPLOSION_DROP_DECAY = GameRules.key(ResourceKey.sponge("mob_explosion_drop_decay")); + public static final DefaultedRegistryReference> MOB_GRIEFING = GameRules.key(ResourceKey.sponge("mob_griefing")); - /** - * Whether {@link Player}s can regenerate health naturally if their - * hunger is full enough (doesn't affect external healing, such as - * golden apples, the Regeneration effect, etc.). - * - *

This is a boolean game rule, with a default value of {@code true}.

- */ public static final DefaultedRegistryReference> NATURAL_REGENERATION = GameRules.key(ResourceKey.sponge("natural_regeneration")); - /** - * What percentage of players must sleep to skip the night. - * - *

This is a numerical game rule, with a default value of {@code 100}.

- */ public static final DefaultedRegistryReference> PLAYERS_SLEEPING_PERCENTAGE = GameRules.key(ResourceKey.sponge("players_sleeping_percentage")); - /** - * How often a random block tick occurs (such as plant growth, - * leaf decay, etc.) per chunk section per game tick. - * - *

0 will disable random ticks, higher numbers will increase random - * ticks

- * - *

This is a numerical game rule, with a default value of {@code 3}.

- */ public static final DefaultedRegistryReference> RANDOM_TICK_SPEED = GameRules.key(ResourceKey.sponge("random_tick_speed")); - /** - * Whether the debug screen shows all or reduced information. - * - *

This is a boolean game rule, with a default value of - * {@code false}.

- */ public static final DefaultedRegistryReference> REDUCED_DEBUG_INFO = GameRules.key(ResourceKey.sponge("reduced_debug_info")); - /** - * Whether the feedback from commands executed by a {@link Player} - * should show up in chat. - * - *

This game rule affects the default behavior of whether - * {@link CommandBlock}s store their output text.

- * - *

This is a boolean game rule, with a default value of {@code true}.

- */ public static final DefaultedRegistryReference> SEND_COMMAND_FEEDBACK = GameRules.key(ResourceKey.sponge("send_command_feedback")); - /** - * Whether a message appears in chat when a {@link Player} dies. - * - *

This is a boolean game rule, with a default value of {@code true}.

- */ public static final DefaultedRegistryReference> SHOW_DEATH_MESSAGES = GameRules.key(ResourceKey.sponge("show_death_messages")); - /** - * The number of blocks outward from the world spawn coordinates - * that a player will spawn in when first joining a server or when - * dying without a spawn point. - * - *

This is a numerical game rule, with a default value of {@code 10}.

- */ + public static final DefaultedRegistryReference> SNOW_ACCUMULATION_HEIGHT = GameRules.key(ResourceKey.sponge("snow_accumulation_height")); + public static final DefaultedRegistryReference> SPAWN_RADIUS = GameRules.key(ResourceKey.sponge("spawn_radius")); - /** - * Whether players in {@link GameModes#SPECTATOR spectator mode} can - * generate chunks. - * - *

This is a boolean game rule, with a default value of {@code true}.

- */ public static final DefaultedRegistryReference> SPECTATORS_GENERATE_CHUNKS = GameRules.key(ResourceKey.sponge("spectators_generate_chunks")); - /** - * Makes angered neutral mobs attack any nearby player, not just the player that angered them. - * - *

This is a boolean game rule, with a default value of - * {@code false}.

- */ + public static final DefaultedRegistryReference> TNT_EXPLOSION_DROP_DECAY = GameRules.key(ResourceKey.sponge("tnt_explosion_drop_decay")); + public static final DefaultedRegistryReference> UNIVERSAL_ANGER = GameRules.key(ResourceKey.sponge("universal_anger")); - // SORTFIELDS:OFF + public static final DefaultedRegistryReference> WATER_SOURCE_CONVERSION = GameRules.key(ResourceKey.sponge("water_source_conversion")); + // SORTFIELDS:OFF // @formatter:on - private GameRules() { } diff --git a/src/main/java/org/spongepowered/api/world/generation/feature/Features.java b/src/main/java/org/spongepowered/api/world/generation/feature/Features.java index 5b1e5fe5282..c3ddb8eb208 100644 --- a/src/main/java/org/spongepowered/api/world/generation/feature/Features.java +++ b/src/main/java/org/spongepowered/api/world/generation/feature/Features.java @@ -245,6 +245,8 @@ public final class Features { public static final DefaultedRegistryReference ORE_DIAMOND_LARGE = Features.key(ResourceKey.minecraft("ore_diamond_large")); + public static final DefaultedRegistryReference ORE_DIAMOND_MEDIUM = Features.key(ResourceKey.minecraft("ore_diamond_medium")); + public static final DefaultedRegistryReference ORE_DIAMOND_SMALL = Features.key(ResourceKey.minecraft("ore_diamond_small")); public static final DefaultedRegistryReference ORE_DIORITE = Features.key(ResourceKey.minecraft("ore_diorite")); diff --git a/src/main/java/org/spongepowered/api/world/generation/feature/PlacedFeatures.java b/src/main/java/org/spongepowered/api/world/generation/feature/PlacedFeatures.java index cd61c5464f5..09b1257d6af 100644 --- a/src/main/java/org/spongepowered/api/world/generation/feature/PlacedFeatures.java +++ b/src/main/java/org/spongepowered/api/world/generation/feature/PlacedFeatures.java @@ -241,6 +241,8 @@ public final class PlacedFeatures { public static final DefaultedRegistryReference ORE_DIAMOND_LARGE = PlacedFeatures.key(ResourceKey.minecraft("ore_diamond_large")); + public static final DefaultedRegistryReference ORE_DIAMOND_MEDIUM = PlacedFeatures.key(ResourceKey.minecraft("ore_diamond_medium")); + public static final DefaultedRegistryReference ORE_DIORITE_LOWER = PlacedFeatures.key(ResourceKey.minecraft("ore_diorite_lower")); public static final DefaultedRegistryReference ORE_DIORITE_UPPER = PlacedFeatures.key(ResourceKey.minecraft("ore_diorite_upper")); diff --git a/src/main/java/org/spongepowered/api/world/generation/structure/StructureSets.java b/src/main/java/org/spongepowered/api/world/generation/structure/StructureSets.java index 03cf1db5775..0cae98e775e 100644 --- a/src/main/java/org/spongepowered/api/world/generation/structure/StructureSets.java +++ b/src/main/java/org/spongepowered/api/world/generation/structure/StructureSets.java @@ -73,6 +73,8 @@ public final class StructureSets { public static final DefaultedRegistryReference SWAMP_HUTS = StructureSets.key(ResourceKey.minecraft("swamp_huts")); + public static final DefaultedRegistryReference TRAIL_RUINS = StructureSets.key(ResourceKey.minecraft("trail_ruins")); + public static final DefaultedRegistryReference VILLAGES = StructureSets.key(ResourceKey.minecraft("villages")); public static final DefaultedRegistryReference WOODLAND_MANSIONS = StructureSets.key(ResourceKey.minecraft("woodland_mansions")); diff --git a/src/main/java/org/spongepowered/api/world/generation/structure/Structures.java b/src/main/java/org/spongepowered/api/world/generation/structure/Structures.java index ea6ce0b5b36..500ff8a9472 100644 --- a/src/main/java/org/spongepowered/api/world/generation/structure/Structures.java +++ b/src/main/java/org/spongepowered/api/world/generation/structure/Structures.java @@ -95,6 +95,8 @@ public final class Structures { public static final DefaultedRegistryReference SWAMP_HUT = Structures.key(ResourceKey.minecraft("swamp_hut")); + public static final DefaultedRegistryReference TRAIL_RUINS = Structures.key(ResourceKey.minecraft("trail_ruins")); + public static final DefaultedRegistryReference VILLAGE_DESERT = Structures.key(ResourceKey.minecraft("village_desert")); public static final DefaultedRegistryReference VILLAGE_PLAINS = Structures.key(ResourceKey.minecraft("village_plains")); diff --git a/src/main/java/org/spongepowered/api/world/generation/structure/jigsaw/JigsawPools.java b/src/main/java/org/spongepowered/api/world/generation/structure/jigsaw/JigsawPools.java index 03d52d15c87..81f31a6f45e 100644 --- a/src/main/java/org/spongepowered/api/world/generation/structure/jigsaw/JigsawPools.java +++ b/src/main/java/org/spongepowered/api/world/generation/structure/jigsaw/JigsawPools.java @@ -185,6 +185,20 @@ public final class JigsawPools { public static final DefaultedRegistryReference PILLAGER_OUTPOST_TOWERS = JigsawPools.key(ResourceKey.minecraft("pillager_outpost/towers")); + public static final DefaultedRegistryReference TRAIL_RUINS_BUILDINGS = JigsawPools.key(ResourceKey.minecraft("trail_ruins/buildings")); + + public static final DefaultedRegistryReference TRAIL_RUINS_BUILDINGS_GROUPED = JigsawPools.key(ResourceKey.minecraft("trail_ruins/buildings/grouped")); + + public static final DefaultedRegistryReference TRAIL_RUINS_DECOR = JigsawPools.key(ResourceKey.minecraft("trail_ruins/decor")); + + public static final DefaultedRegistryReference TRAIL_RUINS_ROADS = JigsawPools.key(ResourceKey.minecraft("trail_ruins/roads")); + + public static final DefaultedRegistryReference TRAIL_RUINS_TOWER = JigsawPools.key(ResourceKey.minecraft("trail_ruins/tower")); + + public static final DefaultedRegistryReference TRAIL_RUINS_TOWER_ADDITIONS = JigsawPools.key(ResourceKey.minecraft("trail_ruins/tower/additions")); + + public static final DefaultedRegistryReference TRAIL_RUINS_TOWER_TOWER_TOP = JigsawPools.key(ResourceKey.minecraft("trail_ruins/tower/tower_top")); + public static final DefaultedRegistryReference VILLAGE_COMMON_ANIMALS = JigsawPools.key(ResourceKey.minecraft("village/common/animals")); public static final DefaultedRegistryReference VILLAGE_COMMON_BUTCHER_ANIMALS = JigsawPools.key(ResourceKey.minecraft("village/common/butcher_animals")); diff --git a/src/main/java/org/spongepowered/api/world/generation/structure/jigsaw/ProcessorLists.java b/src/main/java/org/spongepowered/api/world/generation/structure/jigsaw/ProcessorLists.java index b940695d1f4..3cc6c111e23 100644 --- a/src/main/java/org/spongepowered/api/world/generation/structure/jigsaw/ProcessorLists.java +++ b/src/main/java/org/spongepowered/api/world/generation/structure/jigsaw/ProcessorLists.java @@ -101,6 +101,12 @@ public final class ProcessorLists { public static final DefaultedRegistryReference STREET_SNOWY_OR_TAIGA = ProcessorLists.key(ResourceKey.minecraft("street_snowy_or_taiga")); + public static final DefaultedRegistryReference TRAIL_RUINS_HOUSES_ARCHAEOLOGY = ProcessorLists.key(ResourceKey.minecraft("trail_ruins_houses_archaeology")); + + public static final DefaultedRegistryReference TRAIL_RUINS_ROADS_ARCHAEOLOGY = ProcessorLists.key(ResourceKey.minecraft("trail_ruins_roads_archaeology")); + + public static final DefaultedRegistryReference TRAIL_RUINS_TOWER_TOP_ARCHAEOLOGY = ProcessorLists.key(ResourceKey.minecraft("trail_ruins_tower_top_archaeology")); + public static final DefaultedRegistryReference TREASURE_ROOMS = ProcessorLists.key(ResourceKey.minecraft("treasure_rooms")); public static final DefaultedRegistryReference ZOMBIE_DESERT = ProcessorLists.key(ResourceKey.minecraft("zombie_desert")); diff --git a/src/main/java/org/spongepowered/api/world/generation/structure/jigsaw/ProcessorTypes.java b/src/main/java/org/spongepowered/api/world/generation/structure/jigsaw/ProcessorTypes.java index 0c69fbb431a..48c6d43d59b 100644 --- a/src/main/java/org/spongepowered/api/world/generation/structure/jigsaw/ProcessorTypes.java +++ b/src/main/java/org/spongepowered/api/world/generation/structure/jigsaw/ProcessorTypes.java @@ -49,6 +49,8 @@ public final class ProcessorTypes { public static final DefaultedRegistryReference BLOCK_ROT = ProcessorTypes.key(ResourceKey.minecraft("block_rot")); + public static final DefaultedRegistryReference CAPPED = ProcessorTypes.key(ResourceKey.minecraft("capped")); + public static final DefaultedRegistryReference GRAVITY = ProcessorTypes.key(ResourceKey.minecraft("gravity")); public static final DefaultedRegistryReference JIGSAW_REPLACEMENT = ProcessorTypes.key(ResourceKey.minecraft("jigsaw_replacement"));