From f070081825058ec27d040ed32fee71b5b2da5fb3 Mon Sep 17 00:00:00 2001 From: Jake Potrebic Date: Mon, 17 Feb 2025 15:33:26 -0800 Subject: [PATCH] Remove Experimental from TypedKey (#12134) --- .../generator/types/GeneratedKeyType.java | 3 --- .../paper/registry/keys/AttributeKeys.java | 2 -- .../registry/keys/BannerPatternKeys.java | 3 --- .../paper/registry/keys/BiomeKeys.java | 3 --- .../paper/registry/keys/BlockTypeKeys.java | 2 -- .../paper/registry/keys/CatVariantKeys.java | 2 -- .../paper/registry/keys/DamageTypeKeys.java | 3 --- .../paper/registry/keys/EnchantmentKeys.java | 3 --- .../paper/registry/keys/FluidKeys.java | 2 -- .../paper/registry/keys/FrogVariantKeys.java | 2 -- .../paper/registry/keys/GameEventKeys.java | 3 --- .../paper/registry/keys/InstrumentKeys.java | 3 --- .../paper/registry/keys/ItemTypeKeys.java | 2 -- .../paper/registry/keys/JukeboxSongKeys.java | 3 --- .../registry/keys/MapDecorationTypeKeys.java | 2 -- .../paper/registry/keys/MenuTypeKeys.java | 2 -- .../paper/registry/keys/MobEffectKeys.java | 2 -- .../registry/keys/PaintingVariantKeys.java | 3 --- .../paper/registry/keys/SoundEventKeys.java | 2 -- .../paper/registry/keys/StructureKeys.java | 3 --- .../registry/keys/StructureTypeKeys.java | 2 -- .../paper/registry/keys/TrimMaterialKeys.java | 3 --- .../paper/registry/keys/TrimPatternKeys.java | 3 --- .../registry/keys/VillagerProfessionKeys.java | 2 -- .../paper/registry/keys/VillagerTypeKeys.java | 2 -- .../paper/registry/keys/WolfVariantKeys.java | 3 --- .../papermc/paper/registry/RegistryKey.java | 27 ++++++++++++++++--- .../io/papermc/paper/registry/TypedKey.java | 5 +--- .../io/papermc/paper/registry/tag/TagKey.java | 20 ++++++++++++-- 29 files changed, 43 insertions(+), 74 deletions(-) diff --git a/paper-api-generator/src/main/java/io/papermc/generator/types/GeneratedKeyType.java b/paper-api-generator/src/main/java/io/papermc/generator/types/GeneratedKeyType.java index 4ef3d3af03..a0a214920b 100644 --- a/paper-api-generator/src/main/java/io/papermc/generator/types/GeneratedKeyType.java +++ b/paper-api-generator/src/main/java/io/papermc/generator/types/GeneratedKeyType.java @@ -101,7 +101,6 @@ public class GeneratedKeyType extends SimpleGenerator { .addCode("return $T.create($T.$L, $N);", TypedKey.class, RegistryKey.class, requireNonNull(REGISTRY_KEY_FIELD_NAMES.get(this.apiRegistryKey), "Missing field for " + this.apiRegistryKey), keyParam) .returns(returnType); if (this.publicCreateKeyMethod) { - create.addAnnotation(EXPERIMENTAL_API_ANNOTATION); // TODO remove once not experimental create.addJavadoc(CREATE_JAVADOC, this.apiType, this.registryKey.location().toString()); } return create; @@ -157,8 +156,6 @@ public class GeneratedKeyType extends SimpleGenerator { if (allExperimental) { typeBuilder.addAnnotations(experimentalAnnotations(null)); // Update for Experimental API createMethod.addAnnotations(experimentalAnnotations(null)); // Update for Experimental API - } else { - typeBuilder.addAnnotation(EXPERIMENTAL_API_ANNOTATION); // TODO experimental API } return typeBuilder.addMethod(createMethod.build()).build(); } diff --git a/paper-api/src/generated/java/io/papermc/paper/registry/keys/AttributeKeys.java b/paper-api/src/generated/java/io/papermc/paper/registry/keys/AttributeKeys.java index be67e86206..3eef52b64f 100644 --- a/paper-api/src/generated/java/io/papermc/paper/registry/keys/AttributeKeys.java +++ b/paper-api/src/generated/java/io/papermc/paper/registry/keys/AttributeKeys.java @@ -7,7 +7,6 @@ import io.papermc.paper.registry.RegistryKey; import io.papermc.paper.registry.TypedKey; import net.kyori.adventure.key.Key; import org.bukkit.attribute.Attribute; -import org.jetbrains.annotations.ApiStatus; import org.jspecify.annotations.NullMarked; /** @@ -25,7 +24,6 @@ import org.jspecify.annotations.NullMarked; }) @GeneratedFrom("1.21.4") @NullMarked -@ApiStatus.Experimental public final class AttributeKeys { /** * {@code minecraft:armor} diff --git a/paper-api/src/generated/java/io/papermc/paper/registry/keys/BannerPatternKeys.java b/paper-api/src/generated/java/io/papermc/paper/registry/keys/BannerPatternKeys.java index 23e1145e04..bc1f64a8bb 100644 --- a/paper-api/src/generated/java/io/papermc/paper/registry/keys/BannerPatternKeys.java +++ b/paper-api/src/generated/java/io/papermc/paper/registry/keys/BannerPatternKeys.java @@ -7,7 +7,6 @@ import io.papermc.paper.registry.RegistryKey; import io.papermc.paper.registry.TypedKey; import net.kyori.adventure.key.Key; import org.bukkit.block.banner.PatternType; -import org.jetbrains.annotations.ApiStatus; import org.jspecify.annotations.NullMarked; /** @@ -25,7 +24,6 @@ import org.jspecify.annotations.NullMarked; }) @GeneratedFrom("1.21.4") @NullMarked -@ApiStatus.Experimental public final class BannerPatternKeys { /** * {@code minecraft:base} @@ -337,7 +335,6 @@ public final class BannerPatternKeys { * @param key the value's key in the registry * @return a new typed key */ - @ApiStatus.Experimental public static TypedKey create(final Key key) { return TypedKey.create(RegistryKey.BANNER_PATTERN, key); } diff --git a/paper-api/src/generated/java/io/papermc/paper/registry/keys/BiomeKeys.java b/paper-api/src/generated/java/io/papermc/paper/registry/keys/BiomeKeys.java index bf0c0f6d9b..e87e00879f 100644 --- a/paper-api/src/generated/java/io/papermc/paper/registry/keys/BiomeKeys.java +++ b/paper-api/src/generated/java/io/papermc/paper/registry/keys/BiomeKeys.java @@ -7,7 +7,6 @@ import io.papermc.paper.registry.RegistryKey; import io.papermc.paper.registry.TypedKey; import net.kyori.adventure.key.Key; import org.bukkit.block.Biome; -import org.jetbrains.annotations.ApiStatus; import org.jspecify.annotations.NullMarked; /** @@ -25,7 +24,6 @@ import org.jspecify.annotations.NullMarked; }) @GeneratedFrom("1.21.4") @NullMarked -@ApiStatus.Experimental public final class BiomeKeys { /** * {@code minecraft:badlands} @@ -491,7 +489,6 @@ public final class BiomeKeys { * @param key the value's key in the registry * @return a new typed key */ - @ApiStatus.Experimental public static TypedKey create(final Key key) { return TypedKey.create(RegistryKey.BIOME, key); } diff --git a/paper-api/src/generated/java/io/papermc/paper/registry/keys/BlockTypeKeys.java b/paper-api/src/generated/java/io/papermc/paper/registry/keys/BlockTypeKeys.java index b71182ed34..f0504b1526 100644 --- a/paper-api/src/generated/java/io/papermc/paper/registry/keys/BlockTypeKeys.java +++ b/paper-api/src/generated/java/io/papermc/paper/registry/keys/BlockTypeKeys.java @@ -7,7 +7,6 @@ import io.papermc.paper.registry.RegistryKey; import io.papermc.paper.registry.TypedKey; import net.kyori.adventure.key.Key; import org.bukkit.block.BlockType; -import org.jetbrains.annotations.ApiStatus; import org.jspecify.annotations.NullMarked; /** @@ -25,7 +24,6 @@ import org.jspecify.annotations.NullMarked; }) @GeneratedFrom("1.21.4") @NullMarked -@ApiStatus.Experimental public final class BlockTypeKeys { /** * {@code minecraft:acacia_button} diff --git a/paper-api/src/generated/java/io/papermc/paper/registry/keys/CatVariantKeys.java b/paper-api/src/generated/java/io/papermc/paper/registry/keys/CatVariantKeys.java index cb3ee5d280..607aa1aee1 100644 --- a/paper-api/src/generated/java/io/papermc/paper/registry/keys/CatVariantKeys.java +++ b/paper-api/src/generated/java/io/papermc/paper/registry/keys/CatVariantKeys.java @@ -7,7 +7,6 @@ import io.papermc.paper.registry.RegistryKey; import io.papermc.paper.registry.TypedKey; import net.kyori.adventure.key.Key; import org.bukkit.entity.Cat; -import org.jetbrains.annotations.ApiStatus; import org.jspecify.annotations.NullMarked; /** @@ -25,7 +24,6 @@ import org.jspecify.annotations.NullMarked; }) @GeneratedFrom("1.21.4") @NullMarked -@ApiStatus.Experimental public final class CatVariantKeys { /** * {@code minecraft:all_black} diff --git a/paper-api/src/generated/java/io/papermc/paper/registry/keys/DamageTypeKeys.java b/paper-api/src/generated/java/io/papermc/paper/registry/keys/DamageTypeKeys.java index 37476f7b8c..47e9afe540 100644 --- a/paper-api/src/generated/java/io/papermc/paper/registry/keys/DamageTypeKeys.java +++ b/paper-api/src/generated/java/io/papermc/paper/registry/keys/DamageTypeKeys.java @@ -7,7 +7,6 @@ import io.papermc.paper.registry.RegistryKey; import io.papermc.paper.registry.TypedKey; import net.kyori.adventure.key.Key; import org.bukkit.damage.DamageType; -import org.jetbrains.annotations.ApiStatus; import org.jspecify.annotations.NullMarked; /** @@ -25,7 +24,6 @@ import org.jspecify.annotations.NullMarked; }) @GeneratedFrom("1.21.4") @NullMarked -@ApiStatus.Experimental public final class DamageTypeKeys { /** * {@code minecraft:arrow} @@ -379,7 +377,6 @@ public final class DamageTypeKeys { * @param key the value's key in the registry * @return a new typed key */ - @ApiStatus.Experimental public static TypedKey create(final Key key) { return TypedKey.create(RegistryKey.DAMAGE_TYPE, key); } diff --git a/paper-api/src/generated/java/io/papermc/paper/registry/keys/EnchantmentKeys.java b/paper-api/src/generated/java/io/papermc/paper/registry/keys/EnchantmentKeys.java index 33743dd4fb..ec7837c8ec 100644 --- a/paper-api/src/generated/java/io/papermc/paper/registry/keys/EnchantmentKeys.java +++ b/paper-api/src/generated/java/io/papermc/paper/registry/keys/EnchantmentKeys.java @@ -7,7 +7,6 @@ import io.papermc.paper.registry.RegistryKey; import io.papermc.paper.registry.TypedKey; import net.kyori.adventure.key.Key; import org.bukkit.enchantments.Enchantment; -import org.jetbrains.annotations.ApiStatus; import org.jspecify.annotations.NullMarked; /** @@ -25,7 +24,6 @@ import org.jspecify.annotations.NullMarked; }) @GeneratedFrom("1.21.4") @NullMarked -@ApiStatus.Experimental public final class EnchantmentKeys { /** * {@code minecraft:aqua_affinity} @@ -330,7 +328,6 @@ public final class EnchantmentKeys { * @param key the value's key in the registry * @return a new typed key */ - @ApiStatus.Experimental public static TypedKey create(final Key key) { return TypedKey.create(RegistryKey.ENCHANTMENT, key); } diff --git a/paper-api/src/generated/java/io/papermc/paper/registry/keys/FluidKeys.java b/paper-api/src/generated/java/io/papermc/paper/registry/keys/FluidKeys.java index 53b32d9897..faf98ef6d6 100644 --- a/paper-api/src/generated/java/io/papermc/paper/registry/keys/FluidKeys.java +++ b/paper-api/src/generated/java/io/papermc/paper/registry/keys/FluidKeys.java @@ -7,7 +7,6 @@ import io.papermc.paper.registry.RegistryKey; import io.papermc.paper.registry.TypedKey; import net.kyori.adventure.key.Key; import org.bukkit.Fluid; -import org.jetbrains.annotations.ApiStatus; import org.jspecify.annotations.NullMarked; /** @@ -25,7 +24,6 @@ import org.jspecify.annotations.NullMarked; }) @GeneratedFrom("1.21.4") @NullMarked -@ApiStatus.Experimental public final class FluidKeys { /** * {@code minecraft:empty} diff --git a/paper-api/src/generated/java/io/papermc/paper/registry/keys/FrogVariantKeys.java b/paper-api/src/generated/java/io/papermc/paper/registry/keys/FrogVariantKeys.java index 0a07c02782..b70f508ebc 100644 --- a/paper-api/src/generated/java/io/papermc/paper/registry/keys/FrogVariantKeys.java +++ b/paper-api/src/generated/java/io/papermc/paper/registry/keys/FrogVariantKeys.java @@ -7,7 +7,6 @@ import io.papermc.paper.registry.RegistryKey; import io.papermc.paper.registry.TypedKey; import net.kyori.adventure.key.Key; import org.bukkit.entity.Frog; -import org.jetbrains.annotations.ApiStatus; import org.jspecify.annotations.NullMarked; /** @@ -25,7 +24,6 @@ import org.jspecify.annotations.NullMarked; }) @GeneratedFrom("1.21.4") @NullMarked -@ApiStatus.Experimental public final class FrogVariantKeys { /** * {@code minecraft:cold} diff --git a/paper-api/src/generated/java/io/papermc/paper/registry/keys/GameEventKeys.java b/paper-api/src/generated/java/io/papermc/paper/registry/keys/GameEventKeys.java index 954f46e8d8..3477ccb14c 100644 --- a/paper-api/src/generated/java/io/papermc/paper/registry/keys/GameEventKeys.java +++ b/paper-api/src/generated/java/io/papermc/paper/registry/keys/GameEventKeys.java @@ -7,7 +7,6 @@ import io.papermc.paper.registry.RegistryKey; import io.papermc.paper.registry.TypedKey; import net.kyori.adventure.key.Key; import org.bukkit.GameEvent; -import org.jetbrains.annotations.ApiStatus; import org.jspecify.annotations.NullMarked; /** @@ -25,7 +24,6 @@ import org.jspecify.annotations.NullMarked; }) @GeneratedFrom("1.21.4") @NullMarked -@ApiStatus.Experimental public final class GameEventKeys { /** * {@code minecraft:block_activate} @@ -456,7 +454,6 @@ public final class GameEventKeys { * @param key the value's key in the registry * @return a new typed key */ - @ApiStatus.Experimental public static TypedKey create(final Key key) { return TypedKey.create(RegistryKey.GAME_EVENT, key); } diff --git a/paper-api/src/generated/java/io/papermc/paper/registry/keys/InstrumentKeys.java b/paper-api/src/generated/java/io/papermc/paper/registry/keys/InstrumentKeys.java index 4daa2fac52..391d9b059f 100644 --- a/paper-api/src/generated/java/io/papermc/paper/registry/keys/InstrumentKeys.java +++ b/paper-api/src/generated/java/io/papermc/paper/registry/keys/InstrumentKeys.java @@ -7,7 +7,6 @@ import io.papermc.paper.registry.RegistryKey; import io.papermc.paper.registry.TypedKey; import net.kyori.adventure.key.Key; import org.bukkit.MusicInstrument; -import org.jetbrains.annotations.ApiStatus; import org.jspecify.annotations.NullMarked; /** @@ -25,7 +24,6 @@ import org.jspecify.annotations.NullMarked; }) @GeneratedFrom("1.21.4") @NullMarked -@ApiStatus.Experimental public final class InstrumentKeys { /** * {@code minecraft:admire_goat_horn} @@ -92,7 +90,6 @@ public final class InstrumentKeys { * @param key the value's key in the registry * @return a new typed key */ - @ApiStatus.Experimental public static TypedKey create(final Key key) { return TypedKey.create(RegistryKey.INSTRUMENT, key); } diff --git a/paper-api/src/generated/java/io/papermc/paper/registry/keys/ItemTypeKeys.java b/paper-api/src/generated/java/io/papermc/paper/registry/keys/ItemTypeKeys.java index d13da7a453..75f9a1cc63 100644 --- a/paper-api/src/generated/java/io/papermc/paper/registry/keys/ItemTypeKeys.java +++ b/paper-api/src/generated/java/io/papermc/paper/registry/keys/ItemTypeKeys.java @@ -7,7 +7,6 @@ import io.papermc.paper.registry.RegistryKey; import io.papermc.paper.registry.TypedKey; import net.kyori.adventure.key.Key; import org.bukkit.inventory.ItemType; -import org.jetbrains.annotations.ApiStatus; import org.jspecify.annotations.NullMarked; /** @@ -25,7 +24,6 @@ import org.jspecify.annotations.NullMarked; }) @GeneratedFrom("1.21.4") @NullMarked -@ApiStatus.Experimental public final class ItemTypeKeys { /** * {@code minecraft:acacia_boat} diff --git a/paper-api/src/generated/java/io/papermc/paper/registry/keys/JukeboxSongKeys.java b/paper-api/src/generated/java/io/papermc/paper/registry/keys/JukeboxSongKeys.java index c2992bec9a..d86ad9bf29 100644 --- a/paper-api/src/generated/java/io/papermc/paper/registry/keys/JukeboxSongKeys.java +++ b/paper-api/src/generated/java/io/papermc/paper/registry/keys/JukeboxSongKeys.java @@ -7,7 +7,6 @@ import io.papermc.paper.registry.RegistryKey; import io.papermc.paper.registry.TypedKey; import net.kyori.adventure.key.Key; import org.bukkit.JukeboxSong; -import org.jetbrains.annotations.ApiStatus; import org.jspecify.annotations.NullMarked; /** @@ -25,7 +24,6 @@ import org.jspecify.annotations.NullMarked; }) @GeneratedFrom("1.21.4") @NullMarked -@ApiStatus.Experimental public final class JukeboxSongKeys { /** * {@code minecraft:11} @@ -169,7 +167,6 @@ public final class JukeboxSongKeys { * @param key the value's key in the registry * @return a new typed key */ - @ApiStatus.Experimental public static TypedKey create(final Key key) { return TypedKey.create(RegistryKey.JUKEBOX_SONG, key); } diff --git a/paper-api/src/generated/java/io/papermc/paper/registry/keys/MapDecorationTypeKeys.java b/paper-api/src/generated/java/io/papermc/paper/registry/keys/MapDecorationTypeKeys.java index f849e6602b..fbf67d6759 100644 --- a/paper-api/src/generated/java/io/papermc/paper/registry/keys/MapDecorationTypeKeys.java +++ b/paper-api/src/generated/java/io/papermc/paper/registry/keys/MapDecorationTypeKeys.java @@ -7,7 +7,6 @@ import io.papermc.paper.registry.RegistryKey; import io.papermc.paper.registry.TypedKey; import net.kyori.adventure.key.Key; import org.bukkit.map.MapCursor; -import org.jetbrains.annotations.ApiStatus; import org.jspecify.annotations.NullMarked; /** @@ -25,7 +24,6 @@ import org.jspecify.annotations.NullMarked; }) @GeneratedFrom("1.21.4") @NullMarked -@ApiStatus.Experimental public final class MapDecorationTypeKeys { /** * {@code minecraft:banner_black} diff --git a/paper-api/src/generated/java/io/papermc/paper/registry/keys/MenuTypeKeys.java b/paper-api/src/generated/java/io/papermc/paper/registry/keys/MenuTypeKeys.java index e33724921e..06c94936f2 100644 --- a/paper-api/src/generated/java/io/papermc/paper/registry/keys/MenuTypeKeys.java +++ b/paper-api/src/generated/java/io/papermc/paper/registry/keys/MenuTypeKeys.java @@ -7,7 +7,6 @@ import io.papermc.paper.registry.RegistryKey; import io.papermc.paper.registry.TypedKey; import net.kyori.adventure.key.Key; import org.bukkit.inventory.MenuType; -import org.jetbrains.annotations.ApiStatus; import org.jspecify.annotations.NullMarked; /** @@ -25,7 +24,6 @@ import org.jspecify.annotations.NullMarked; }) @GeneratedFrom("1.21.4") @NullMarked -@ApiStatus.Experimental public final class MenuTypeKeys { /** * {@code minecraft:anvil} diff --git a/paper-api/src/generated/java/io/papermc/paper/registry/keys/MobEffectKeys.java b/paper-api/src/generated/java/io/papermc/paper/registry/keys/MobEffectKeys.java index 0ab126f652..58b9c179f0 100644 --- a/paper-api/src/generated/java/io/papermc/paper/registry/keys/MobEffectKeys.java +++ b/paper-api/src/generated/java/io/papermc/paper/registry/keys/MobEffectKeys.java @@ -7,7 +7,6 @@ import io.papermc.paper.registry.RegistryKey; import io.papermc.paper.registry.TypedKey; import net.kyori.adventure.key.Key; import org.bukkit.potion.PotionEffectType; -import org.jetbrains.annotations.ApiStatus; import org.jspecify.annotations.NullMarked; /** @@ -25,7 +24,6 @@ import org.jspecify.annotations.NullMarked; }) @GeneratedFrom("1.21.4") @NullMarked -@ApiStatus.Experimental public final class MobEffectKeys { /** * {@code minecraft:absorption} diff --git a/paper-api/src/generated/java/io/papermc/paper/registry/keys/PaintingVariantKeys.java b/paper-api/src/generated/java/io/papermc/paper/registry/keys/PaintingVariantKeys.java index 60c7580f03..119dca4831 100644 --- a/paper-api/src/generated/java/io/papermc/paper/registry/keys/PaintingVariantKeys.java +++ b/paper-api/src/generated/java/io/papermc/paper/registry/keys/PaintingVariantKeys.java @@ -7,7 +7,6 @@ import io.papermc.paper.registry.RegistryKey; import io.papermc.paper.registry.TypedKey; import net.kyori.adventure.key.Key; import org.bukkit.Art; -import org.jetbrains.annotations.ApiStatus; import org.jspecify.annotations.NullMarked; /** @@ -25,7 +24,6 @@ import org.jspecify.annotations.NullMarked; }) @GeneratedFrom("1.21.4") @NullMarked -@ApiStatus.Experimental public final class PaintingVariantKeys { /** * {@code minecraft:alban} @@ -386,7 +384,6 @@ public final class PaintingVariantKeys { * @param key the value's key in the registry * @return a new typed key */ - @ApiStatus.Experimental public static TypedKey create(final Key key) { return TypedKey.create(RegistryKey.PAINTING_VARIANT, key); } diff --git a/paper-api/src/generated/java/io/papermc/paper/registry/keys/SoundEventKeys.java b/paper-api/src/generated/java/io/papermc/paper/registry/keys/SoundEventKeys.java index ece998b1e0..9cc0ae85b8 100644 --- a/paper-api/src/generated/java/io/papermc/paper/registry/keys/SoundEventKeys.java +++ b/paper-api/src/generated/java/io/papermc/paper/registry/keys/SoundEventKeys.java @@ -7,7 +7,6 @@ import io.papermc.paper.registry.RegistryKey; import io.papermc.paper.registry.TypedKey; import net.kyori.adventure.key.Key; import org.bukkit.Sound; -import org.jetbrains.annotations.ApiStatus; import org.jspecify.annotations.NullMarked; /** @@ -25,7 +24,6 @@ import org.jspecify.annotations.NullMarked; }) @GeneratedFrom("1.21.4") @NullMarked -@ApiStatus.Experimental public final class SoundEventKeys { /** * {@code minecraft:ambient.basalt_deltas.additions} diff --git a/paper-api/src/generated/java/io/papermc/paper/registry/keys/StructureKeys.java b/paper-api/src/generated/java/io/papermc/paper/registry/keys/StructureKeys.java index 4a390ebc99..9919f556b3 100644 --- a/paper-api/src/generated/java/io/papermc/paper/registry/keys/StructureKeys.java +++ b/paper-api/src/generated/java/io/papermc/paper/registry/keys/StructureKeys.java @@ -7,7 +7,6 @@ import io.papermc.paper.registry.RegistryKey; import io.papermc.paper.registry.TypedKey; import net.kyori.adventure.key.Key; import org.bukkit.generator.structure.Structure; -import org.jetbrains.annotations.ApiStatus; import org.jspecify.annotations.NullMarked; /** @@ -25,7 +24,6 @@ import org.jspecify.annotations.NullMarked; }) @GeneratedFrom("1.21.4") @NullMarked -@ApiStatus.Experimental public final class StructureKeys { /** * {@code minecraft:ancient_city} @@ -274,7 +272,6 @@ public final class StructureKeys { * @param key the value's key in the registry * @return a new typed key */ - @ApiStatus.Experimental public static TypedKey create(final Key key) { return TypedKey.create(RegistryKey.STRUCTURE, key); } diff --git a/paper-api/src/generated/java/io/papermc/paper/registry/keys/StructureTypeKeys.java b/paper-api/src/generated/java/io/papermc/paper/registry/keys/StructureTypeKeys.java index 469f355dbd..79be3249e5 100644 --- a/paper-api/src/generated/java/io/papermc/paper/registry/keys/StructureTypeKeys.java +++ b/paper-api/src/generated/java/io/papermc/paper/registry/keys/StructureTypeKeys.java @@ -7,7 +7,6 @@ import io.papermc.paper.registry.RegistryKey; import io.papermc.paper.registry.TypedKey; import net.kyori.adventure.key.Key; import org.bukkit.generator.structure.StructureType; -import org.jetbrains.annotations.ApiStatus; import org.jspecify.annotations.NullMarked; /** @@ -25,7 +24,6 @@ import org.jspecify.annotations.NullMarked; }) @GeneratedFrom("1.21.4") @NullMarked -@ApiStatus.Experimental public final class StructureTypeKeys { /** * {@code minecraft:buried_treasure} diff --git a/paper-api/src/generated/java/io/papermc/paper/registry/keys/TrimMaterialKeys.java b/paper-api/src/generated/java/io/papermc/paper/registry/keys/TrimMaterialKeys.java index 226f1dcada..c9a9759074 100644 --- a/paper-api/src/generated/java/io/papermc/paper/registry/keys/TrimMaterialKeys.java +++ b/paper-api/src/generated/java/io/papermc/paper/registry/keys/TrimMaterialKeys.java @@ -7,7 +7,6 @@ import io.papermc.paper.registry.RegistryKey; import io.papermc.paper.registry.TypedKey; import net.kyori.adventure.key.Key; import org.bukkit.inventory.meta.trim.TrimMaterial; -import org.jetbrains.annotations.ApiStatus; import org.jspecify.annotations.NullMarked; /** @@ -25,7 +24,6 @@ import org.jspecify.annotations.NullMarked; }) @GeneratedFrom("1.21.4") @NullMarked -@ApiStatus.Experimental public final class TrimMaterialKeys { /** * {@code minecraft:amethyst} @@ -113,7 +111,6 @@ public final class TrimMaterialKeys { * @param key the value's key in the registry * @return a new typed key */ - @ApiStatus.Experimental public static TypedKey create(final Key key) { return TypedKey.create(RegistryKey.TRIM_MATERIAL, key); } diff --git a/paper-api/src/generated/java/io/papermc/paper/registry/keys/TrimPatternKeys.java b/paper-api/src/generated/java/io/papermc/paper/registry/keys/TrimPatternKeys.java index 67ce5f1b38..a7f2c63410 100644 --- a/paper-api/src/generated/java/io/papermc/paper/registry/keys/TrimPatternKeys.java +++ b/paper-api/src/generated/java/io/papermc/paper/registry/keys/TrimPatternKeys.java @@ -7,7 +7,6 @@ import io.papermc.paper.registry.RegistryKey; import io.papermc.paper.registry.TypedKey; import net.kyori.adventure.key.Key; import org.bukkit.inventory.meta.trim.TrimPattern; -import org.jetbrains.annotations.ApiStatus; import org.jspecify.annotations.NullMarked; /** @@ -25,7 +24,6 @@ import org.jspecify.annotations.NullMarked; }) @GeneratedFrom("1.21.4") @NullMarked -@ApiStatus.Experimental public final class TrimPatternKeys { /** * {@code minecraft:bolt} @@ -162,7 +160,6 @@ public final class TrimPatternKeys { * @param key the value's key in the registry * @return a new typed key */ - @ApiStatus.Experimental public static TypedKey create(final Key key) { return TypedKey.create(RegistryKey.TRIM_PATTERN, key); } diff --git a/paper-api/src/generated/java/io/papermc/paper/registry/keys/VillagerProfessionKeys.java b/paper-api/src/generated/java/io/papermc/paper/registry/keys/VillagerProfessionKeys.java index 30adcd29ed..860e770d44 100644 --- a/paper-api/src/generated/java/io/papermc/paper/registry/keys/VillagerProfessionKeys.java +++ b/paper-api/src/generated/java/io/papermc/paper/registry/keys/VillagerProfessionKeys.java @@ -7,7 +7,6 @@ import io.papermc.paper.registry.RegistryKey; import io.papermc.paper.registry.TypedKey; import net.kyori.adventure.key.Key; import org.bukkit.entity.Villager; -import org.jetbrains.annotations.ApiStatus; import org.jspecify.annotations.NullMarked; /** @@ -25,7 +24,6 @@ import org.jspecify.annotations.NullMarked; }) @GeneratedFrom("1.21.4") @NullMarked -@ApiStatus.Experimental public final class VillagerProfessionKeys { /** * {@code minecraft:armorer} diff --git a/paper-api/src/generated/java/io/papermc/paper/registry/keys/VillagerTypeKeys.java b/paper-api/src/generated/java/io/papermc/paper/registry/keys/VillagerTypeKeys.java index 3905a99276..1b9a669d4c 100644 --- a/paper-api/src/generated/java/io/papermc/paper/registry/keys/VillagerTypeKeys.java +++ b/paper-api/src/generated/java/io/papermc/paper/registry/keys/VillagerTypeKeys.java @@ -7,7 +7,6 @@ import io.papermc.paper.registry.RegistryKey; import io.papermc.paper.registry.TypedKey; import net.kyori.adventure.key.Key; import org.bukkit.entity.Villager; -import org.jetbrains.annotations.ApiStatus; import org.jspecify.annotations.NullMarked; /** @@ -25,7 +24,6 @@ import org.jspecify.annotations.NullMarked; }) @GeneratedFrom("1.21.4") @NullMarked -@ApiStatus.Experimental public final class VillagerTypeKeys { /** * {@code minecraft:desert} diff --git a/paper-api/src/generated/java/io/papermc/paper/registry/keys/WolfVariantKeys.java b/paper-api/src/generated/java/io/papermc/paper/registry/keys/WolfVariantKeys.java index 6d59b9bf93..7962d0fae3 100644 --- a/paper-api/src/generated/java/io/papermc/paper/registry/keys/WolfVariantKeys.java +++ b/paper-api/src/generated/java/io/papermc/paper/registry/keys/WolfVariantKeys.java @@ -7,7 +7,6 @@ import io.papermc.paper.registry.RegistryKey; import io.papermc.paper.registry.TypedKey; import net.kyori.adventure.key.Key; import org.bukkit.entity.Wolf; -import org.jetbrains.annotations.ApiStatus; import org.jspecify.annotations.NullMarked; /** @@ -25,7 +24,6 @@ import org.jspecify.annotations.NullMarked; }) @GeneratedFrom("1.21.4") @NullMarked -@ApiStatus.Experimental public final class WolfVariantKeys { /** * {@code minecraft:ashen} @@ -99,7 +97,6 @@ public final class WolfVariantKeys { * @param key the value's key in the registry * @return a new typed key */ - @ApiStatus.Experimental public static TypedKey create(final Key key) { return TypedKey.create(RegistryKey.WOLF_VARIANT, key); } diff --git a/paper-api/src/main/java/io/papermc/paper/registry/RegistryKey.java b/paper-api/src/main/java/io/papermc/paper/registry/RegistryKey.java index ea795de955..0238eb155e 100644 --- a/paper-api/src/main/java/io/papermc/paper/registry/RegistryKey.java +++ b/paper-api/src/main/java/io/papermc/paper/registry/RegistryKey.java @@ -1,6 +1,7 @@ package io.papermc.paper.registry; import io.papermc.paper.datacomponent.DataComponentType; +import io.papermc.paper.registry.tag.TagKey; import net.kyori.adventure.key.Key; import net.kyori.adventure.key.KeyPattern; import net.kyori.adventure.key.Keyed; @@ -209,7 +210,6 @@ public sealed interface RegistryKey extends Keyed permits RegistryKeyImpl { * @param key the key of the typed key. * @return the constructed typed key. */ - @ApiStatus.Experimental default TypedKey typedKey(final Key key) { return TypedKey.create(this, key); } @@ -220,8 +220,29 @@ public sealed interface RegistryKey extends Keyed permits RegistryKeyImpl { * @param key the string representation of the key that will be passed to {@link Key#key(String)}. * @return the constructed typed key. */ - @ApiStatus.Experimental - default TypedKey typedKey(final @KeyPattern String key) { + default TypedKey typedKey(@KeyPattern final String key) { return TypedKey.create(this, key); } + + /** + * Constructs a new {@link TagKey} for this registry given the tag key's key. + * + * @param key the key of the typed key. + * @return the constructed tag key. + */ + @ApiStatus.Experimental + default TagKey tagKey(final Key key) { + return TagKey.create(this, key); + } + + /** + * Constructs a new {@link TagKey} for this registry given the tag key's key. + * + * @param key the string representation of the key that will be passed to {@link Key#key(String)}. + * @return the constructed tag key. + */ + @ApiStatus.Experimental + default TagKey tagKey(@KeyPattern final String key) { + return TagKey.create(this, key); + } } diff --git a/paper-api/src/main/java/io/papermc/paper/registry/TypedKey.java b/paper-api/src/main/java/io/papermc/paper/registry/TypedKey.java index c8f363a240..a1a25c3ca9 100644 --- a/paper-api/src/main/java/io/papermc/paper/registry/TypedKey.java +++ b/paper-api/src/main/java/io/papermc/paper/registry/TypedKey.java @@ -11,7 +11,6 @@ import org.jspecify.annotations.NullMarked; * * @param the value type for the registry */ -@ApiStatus.Experimental @NullMarked public sealed interface TypedKey extends Key permits TypedKeyImpl { @@ -39,7 +38,6 @@ public sealed interface TypedKey extends Key permits TypedKeyImpl { * @param value type * @return a new key for the value key and registry key */ - @ApiStatus.Experimental static TypedKey create(final RegistryKey registryKey, final Key key) { return new TypedKeyImpl<>(key, registryKey); } @@ -53,8 +51,7 @@ public sealed interface TypedKey extends Key permits TypedKeyImpl { * @return a new key for the value key and registry key * @see Key#key(String) */ - @ApiStatus.Experimental - static TypedKey create(final RegistryKey registryKey, final @KeyPattern String key) { + static TypedKey create(final RegistryKey registryKey, @KeyPattern final String key) { return create(registryKey, Key.key(key)); } } diff --git a/paper-api/src/main/java/io/papermc/paper/registry/tag/TagKey.java b/paper-api/src/main/java/io/papermc/paper/registry/tag/TagKey.java index f84d95b29f..4dda929860 100644 --- a/paper-api/src/main/java/io/papermc/paper/registry/tag/TagKey.java +++ b/paper-api/src/main/java/io/papermc/paper/registry/tag/TagKey.java @@ -1,7 +1,9 @@ package io.papermc.paper.registry.tag; import io.papermc.paper.registry.RegistryKey; +import io.papermc.paper.registry.TypedKey; import net.kyori.adventure.key.Key; +import net.kyori.adventure.key.KeyPattern; import net.kyori.adventure.key.Keyed; import org.jetbrains.annotations.ApiStatus; import org.jetbrains.annotations.Contract; @@ -15,15 +17,29 @@ public sealed interface TagKey extends Keyed permits TagKeyImpl { * Creates a new tag key for a registry. * * @param registryKey the registry for the tag - * @param key the specific key for the tag + * @param key the specific key for the tag + * @param the registry value type * @return a new tag key - * @param the registry value type */ @Contract(value = "_, _ -> new", pure = true) static TagKey create(final RegistryKey registryKey, final Key key) { return new TagKeyImpl<>(registryKey, key); } + /** + * Creates a new tag key for a registry. + * + * @param registryKey the registry for the tag + * @param key the string version of a {@link Key} that will be passed to {@link Key#key(String)} for parsing. + * @param the registry value type + * @return a new tag key + * @see Key#key(String) + */ + @ApiStatus.Experimental + static TagKey create(final RegistryKey registryKey, @KeyPattern final String key) { + return create(registryKey, Key.key(key)); + } + /** * Get the registry key for this tag key. *