Remove Experimental from TypedKey (#12134)

This commit is contained in:
Jake Potrebic
2025-02-17 15:33:26 -08:00
committed by GitHub
parent b386a8f527
commit f070081825
29 changed files with 43 additions and 74 deletions

View File

@@ -101,7 +101,6 @@ public class GeneratedKeyType<T, A> 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) .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); .returns(returnType);
if (this.publicCreateKeyMethod) { if (this.publicCreateKeyMethod) {
create.addAnnotation(EXPERIMENTAL_API_ANNOTATION); // TODO remove once not experimental
create.addJavadoc(CREATE_JAVADOC, this.apiType, this.registryKey.location().toString()); create.addJavadoc(CREATE_JAVADOC, this.apiType, this.registryKey.location().toString());
} }
return create; return create;
@@ -157,8 +156,6 @@ public class GeneratedKeyType<T, A> extends SimpleGenerator {
if (allExperimental) { if (allExperimental) {
typeBuilder.addAnnotations(experimentalAnnotations(null)); // Update for Experimental API typeBuilder.addAnnotations(experimentalAnnotations(null)); // Update for Experimental API
createMethod.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(); return typeBuilder.addMethod(createMethod.build()).build();
} }

View File

@@ -7,7 +7,6 @@ import io.papermc.paper.registry.RegistryKey;
import io.papermc.paper.registry.TypedKey; import io.papermc.paper.registry.TypedKey;
import net.kyori.adventure.key.Key; import net.kyori.adventure.key.Key;
import org.bukkit.attribute.Attribute; import org.bukkit.attribute.Attribute;
import org.jetbrains.annotations.ApiStatus;
import org.jspecify.annotations.NullMarked; import org.jspecify.annotations.NullMarked;
/** /**
@@ -25,7 +24,6 @@ import org.jspecify.annotations.NullMarked;
}) })
@GeneratedFrom("1.21.4") @GeneratedFrom("1.21.4")
@NullMarked @NullMarked
@ApiStatus.Experimental
public final class AttributeKeys { public final class AttributeKeys {
/** /**
* {@code minecraft:armor} * {@code minecraft:armor}

View File

@@ -7,7 +7,6 @@ import io.papermc.paper.registry.RegistryKey;
import io.papermc.paper.registry.TypedKey; import io.papermc.paper.registry.TypedKey;
import net.kyori.adventure.key.Key; import net.kyori.adventure.key.Key;
import org.bukkit.block.banner.PatternType; import org.bukkit.block.banner.PatternType;
import org.jetbrains.annotations.ApiStatus;
import org.jspecify.annotations.NullMarked; import org.jspecify.annotations.NullMarked;
/** /**
@@ -25,7 +24,6 @@ import org.jspecify.annotations.NullMarked;
}) })
@GeneratedFrom("1.21.4") @GeneratedFrom("1.21.4")
@NullMarked @NullMarked
@ApiStatus.Experimental
public final class BannerPatternKeys { public final class BannerPatternKeys {
/** /**
* {@code minecraft:base} * {@code minecraft:base}
@@ -337,7 +335,6 @@ public final class BannerPatternKeys {
* @param key the value's key in the registry * @param key the value's key in the registry
* @return a new typed key * @return a new typed key
*/ */
@ApiStatus.Experimental
public static TypedKey<PatternType> create(final Key key) { public static TypedKey<PatternType> create(final Key key) {
return TypedKey.create(RegistryKey.BANNER_PATTERN, key); return TypedKey.create(RegistryKey.BANNER_PATTERN, key);
} }

View File

@@ -7,7 +7,6 @@ import io.papermc.paper.registry.RegistryKey;
import io.papermc.paper.registry.TypedKey; import io.papermc.paper.registry.TypedKey;
import net.kyori.adventure.key.Key; import net.kyori.adventure.key.Key;
import org.bukkit.block.Biome; import org.bukkit.block.Biome;
import org.jetbrains.annotations.ApiStatus;
import org.jspecify.annotations.NullMarked; import org.jspecify.annotations.NullMarked;
/** /**
@@ -25,7 +24,6 @@ import org.jspecify.annotations.NullMarked;
}) })
@GeneratedFrom("1.21.4") @GeneratedFrom("1.21.4")
@NullMarked @NullMarked
@ApiStatus.Experimental
public final class BiomeKeys { public final class BiomeKeys {
/** /**
* {@code minecraft:badlands} * {@code minecraft:badlands}
@@ -491,7 +489,6 @@ public final class BiomeKeys {
* @param key the value's key in the registry * @param key the value's key in the registry
* @return a new typed key * @return a new typed key
*/ */
@ApiStatus.Experimental
public static TypedKey<Biome> create(final Key key) { public static TypedKey<Biome> create(final Key key) {
return TypedKey.create(RegistryKey.BIOME, key); return TypedKey.create(RegistryKey.BIOME, key);
} }

View File

@@ -7,7 +7,6 @@ import io.papermc.paper.registry.RegistryKey;
import io.papermc.paper.registry.TypedKey; import io.papermc.paper.registry.TypedKey;
import net.kyori.adventure.key.Key; import net.kyori.adventure.key.Key;
import org.bukkit.block.BlockType; import org.bukkit.block.BlockType;
import org.jetbrains.annotations.ApiStatus;
import org.jspecify.annotations.NullMarked; import org.jspecify.annotations.NullMarked;
/** /**
@@ -25,7 +24,6 @@ import org.jspecify.annotations.NullMarked;
}) })
@GeneratedFrom("1.21.4") @GeneratedFrom("1.21.4")
@NullMarked @NullMarked
@ApiStatus.Experimental
public final class BlockTypeKeys { public final class BlockTypeKeys {
/** /**
* {@code minecraft:acacia_button} * {@code minecraft:acacia_button}

View File

@@ -7,7 +7,6 @@ import io.papermc.paper.registry.RegistryKey;
import io.papermc.paper.registry.TypedKey; import io.papermc.paper.registry.TypedKey;
import net.kyori.adventure.key.Key; import net.kyori.adventure.key.Key;
import org.bukkit.entity.Cat; import org.bukkit.entity.Cat;
import org.jetbrains.annotations.ApiStatus;
import org.jspecify.annotations.NullMarked; import org.jspecify.annotations.NullMarked;
/** /**
@@ -25,7 +24,6 @@ import org.jspecify.annotations.NullMarked;
}) })
@GeneratedFrom("1.21.4") @GeneratedFrom("1.21.4")
@NullMarked @NullMarked
@ApiStatus.Experimental
public final class CatVariantKeys { public final class CatVariantKeys {
/** /**
* {@code minecraft:all_black} * {@code minecraft:all_black}

View File

@@ -7,7 +7,6 @@ import io.papermc.paper.registry.RegistryKey;
import io.papermc.paper.registry.TypedKey; import io.papermc.paper.registry.TypedKey;
import net.kyori.adventure.key.Key; import net.kyori.adventure.key.Key;
import org.bukkit.damage.DamageType; import org.bukkit.damage.DamageType;
import org.jetbrains.annotations.ApiStatus;
import org.jspecify.annotations.NullMarked; import org.jspecify.annotations.NullMarked;
/** /**
@@ -25,7 +24,6 @@ import org.jspecify.annotations.NullMarked;
}) })
@GeneratedFrom("1.21.4") @GeneratedFrom("1.21.4")
@NullMarked @NullMarked
@ApiStatus.Experimental
public final class DamageTypeKeys { public final class DamageTypeKeys {
/** /**
* {@code minecraft:arrow} * {@code minecraft:arrow}
@@ -379,7 +377,6 @@ public final class DamageTypeKeys {
* @param key the value's key in the registry * @param key the value's key in the registry
* @return a new typed key * @return a new typed key
*/ */
@ApiStatus.Experimental
public static TypedKey<DamageType> create(final Key key) { public static TypedKey<DamageType> create(final Key key) {
return TypedKey.create(RegistryKey.DAMAGE_TYPE, key); return TypedKey.create(RegistryKey.DAMAGE_TYPE, key);
} }

View File

@@ -7,7 +7,6 @@ import io.papermc.paper.registry.RegistryKey;
import io.papermc.paper.registry.TypedKey; import io.papermc.paper.registry.TypedKey;
import net.kyori.adventure.key.Key; import net.kyori.adventure.key.Key;
import org.bukkit.enchantments.Enchantment; import org.bukkit.enchantments.Enchantment;
import org.jetbrains.annotations.ApiStatus;
import org.jspecify.annotations.NullMarked; import org.jspecify.annotations.NullMarked;
/** /**
@@ -25,7 +24,6 @@ import org.jspecify.annotations.NullMarked;
}) })
@GeneratedFrom("1.21.4") @GeneratedFrom("1.21.4")
@NullMarked @NullMarked
@ApiStatus.Experimental
public final class EnchantmentKeys { public final class EnchantmentKeys {
/** /**
* {@code minecraft:aqua_affinity} * {@code minecraft:aqua_affinity}
@@ -330,7 +328,6 @@ public final class EnchantmentKeys {
* @param key the value's key in the registry * @param key the value's key in the registry
* @return a new typed key * @return a new typed key
*/ */
@ApiStatus.Experimental
public static TypedKey<Enchantment> create(final Key key) { public static TypedKey<Enchantment> create(final Key key) {
return TypedKey.create(RegistryKey.ENCHANTMENT, key); return TypedKey.create(RegistryKey.ENCHANTMENT, key);
} }

View File

@@ -7,7 +7,6 @@ import io.papermc.paper.registry.RegistryKey;
import io.papermc.paper.registry.TypedKey; import io.papermc.paper.registry.TypedKey;
import net.kyori.adventure.key.Key; import net.kyori.adventure.key.Key;
import org.bukkit.Fluid; import org.bukkit.Fluid;
import org.jetbrains.annotations.ApiStatus;
import org.jspecify.annotations.NullMarked; import org.jspecify.annotations.NullMarked;
/** /**
@@ -25,7 +24,6 @@ import org.jspecify.annotations.NullMarked;
}) })
@GeneratedFrom("1.21.4") @GeneratedFrom("1.21.4")
@NullMarked @NullMarked
@ApiStatus.Experimental
public final class FluidKeys { public final class FluidKeys {
/** /**
* {@code minecraft:empty} * {@code minecraft:empty}

View File

@@ -7,7 +7,6 @@ import io.papermc.paper.registry.RegistryKey;
import io.papermc.paper.registry.TypedKey; import io.papermc.paper.registry.TypedKey;
import net.kyori.adventure.key.Key; import net.kyori.adventure.key.Key;
import org.bukkit.entity.Frog; import org.bukkit.entity.Frog;
import org.jetbrains.annotations.ApiStatus;
import org.jspecify.annotations.NullMarked; import org.jspecify.annotations.NullMarked;
/** /**
@@ -25,7 +24,6 @@ import org.jspecify.annotations.NullMarked;
}) })
@GeneratedFrom("1.21.4") @GeneratedFrom("1.21.4")
@NullMarked @NullMarked
@ApiStatus.Experimental
public final class FrogVariantKeys { public final class FrogVariantKeys {
/** /**
* {@code minecraft:cold} * {@code minecraft:cold}

View File

@@ -7,7 +7,6 @@ import io.papermc.paper.registry.RegistryKey;
import io.papermc.paper.registry.TypedKey; import io.papermc.paper.registry.TypedKey;
import net.kyori.adventure.key.Key; import net.kyori.adventure.key.Key;
import org.bukkit.GameEvent; import org.bukkit.GameEvent;
import org.jetbrains.annotations.ApiStatus;
import org.jspecify.annotations.NullMarked; import org.jspecify.annotations.NullMarked;
/** /**
@@ -25,7 +24,6 @@ import org.jspecify.annotations.NullMarked;
}) })
@GeneratedFrom("1.21.4") @GeneratedFrom("1.21.4")
@NullMarked @NullMarked
@ApiStatus.Experimental
public final class GameEventKeys { public final class GameEventKeys {
/** /**
* {@code minecraft:block_activate} * {@code minecraft:block_activate}
@@ -456,7 +454,6 @@ public final class GameEventKeys {
* @param key the value's key in the registry * @param key the value's key in the registry
* @return a new typed key * @return a new typed key
*/ */
@ApiStatus.Experimental
public static TypedKey<GameEvent> create(final Key key) { public static TypedKey<GameEvent> create(final Key key) {
return TypedKey.create(RegistryKey.GAME_EVENT, key); return TypedKey.create(RegistryKey.GAME_EVENT, key);
} }

View File

@@ -7,7 +7,6 @@ import io.papermc.paper.registry.RegistryKey;
import io.papermc.paper.registry.TypedKey; import io.papermc.paper.registry.TypedKey;
import net.kyori.adventure.key.Key; import net.kyori.adventure.key.Key;
import org.bukkit.MusicInstrument; import org.bukkit.MusicInstrument;
import org.jetbrains.annotations.ApiStatus;
import org.jspecify.annotations.NullMarked; import org.jspecify.annotations.NullMarked;
/** /**
@@ -25,7 +24,6 @@ import org.jspecify.annotations.NullMarked;
}) })
@GeneratedFrom("1.21.4") @GeneratedFrom("1.21.4")
@NullMarked @NullMarked
@ApiStatus.Experimental
public final class InstrumentKeys { public final class InstrumentKeys {
/** /**
* {@code minecraft:admire_goat_horn} * {@code minecraft:admire_goat_horn}
@@ -92,7 +90,6 @@ public final class InstrumentKeys {
* @param key the value's key in the registry * @param key the value's key in the registry
* @return a new typed key * @return a new typed key
*/ */
@ApiStatus.Experimental
public static TypedKey<MusicInstrument> create(final Key key) { public static TypedKey<MusicInstrument> create(final Key key) {
return TypedKey.create(RegistryKey.INSTRUMENT, key); return TypedKey.create(RegistryKey.INSTRUMENT, key);
} }

View File

@@ -7,7 +7,6 @@ import io.papermc.paper.registry.RegistryKey;
import io.papermc.paper.registry.TypedKey; import io.papermc.paper.registry.TypedKey;
import net.kyori.adventure.key.Key; import net.kyori.adventure.key.Key;
import org.bukkit.inventory.ItemType; import org.bukkit.inventory.ItemType;
import org.jetbrains.annotations.ApiStatus;
import org.jspecify.annotations.NullMarked; import org.jspecify.annotations.NullMarked;
/** /**
@@ -25,7 +24,6 @@ import org.jspecify.annotations.NullMarked;
}) })
@GeneratedFrom("1.21.4") @GeneratedFrom("1.21.4")
@NullMarked @NullMarked
@ApiStatus.Experimental
public final class ItemTypeKeys { public final class ItemTypeKeys {
/** /**
* {@code minecraft:acacia_boat} * {@code minecraft:acacia_boat}

View File

@@ -7,7 +7,6 @@ import io.papermc.paper.registry.RegistryKey;
import io.papermc.paper.registry.TypedKey; import io.papermc.paper.registry.TypedKey;
import net.kyori.adventure.key.Key; import net.kyori.adventure.key.Key;
import org.bukkit.JukeboxSong; import org.bukkit.JukeboxSong;
import org.jetbrains.annotations.ApiStatus;
import org.jspecify.annotations.NullMarked; import org.jspecify.annotations.NullMarked;
/** /**
@@ -25,7 +24,6 @@ import org.jspecify.annotations.NullMarked;
}) })
@GeneratedFrom("1.21.4") @GeneratedFrom("1.21.4")
@NullMarked @NullMarked
@ApiStatus.Experimental
public final class JukeboxSongKeys { public final class JukeboxSongKeys {
/** /**
* {@code minecraft:11} * {@code minecraft:11}
@@ -169,7 +167,6 @@ public final class JukeboxSongKeys {
* @param key the value's key in the registry * @param key the value's key in the registry
* @return a new typed key * @return a new typed key
*/ */
@ApiStatus.Experimental
public static TypedKey<JukeboxSong> create(final Key key) { public static TypedKey<JukeboxSong> create(final Key key) {
return TypedKey.create(RegistryKey.JUKEBOX_SONG, key); return TypedKey.create(RegistryKey.JUKEBOX_SONG, key);
} }

View File

@@ -7,7 +7,6 @@ import io.papermc.paper.registry.RegistryKey;
import io.papermc.paper.registry.TypedKey; import io.papermc.paper.registry.TypedKey;
import net.kyori.adventure.key.Key; import net.kyori.adventure.key.Key;
import org.bukkit.map.MapCursor; import org.bukkit.map.MapCursor;
import org.jetbrains.annotations.ApiStatus;
import org.jspecify.annotations.NullMarked; import org.jspecify.annotations.NullMarked;
/** /**
@@ -25,7 +24,6 @@ import org.jspecify.annotations.NullMarked;
}) })
@GeneratedFrom("1.21.4") @GeneratedFrom("1.21.4")
@NullMarked @NullMarked
@ApiStatus.Experimental
public final class MapDecorationTypeKeys { public final class MapDecorationTypeKeys {
/** /**
* {@code minecraft:banner_black} * {@code minecraft:banner_black}

View File

@@ -7,7 +7,6 @@ import io.papermc.paper.registry.RegistryKey;
import io.papermc.paper.registry.TypedKey; import io.papermc.paper.registry.TypedKey;
import net.kyori.adventure.key.Key; import net.kyori.adventure.key.Key;
import org.bukkit.inventory.MenuType; import org.bukkit.inventory.MenuType;
import org.jetbrains.annotations.ApiStatus;
import org.jspecify.annotations.NullMarked; import org.jspecify.annotations.NullMarked;
/** /**
@@ -25,7 +24,6 @@ import org.jspecify.annotations.NullMarked;
}) })
@GeneratedFrom("1.21.4") @GeneratedFrom("1.21.4")
@NullMarked @NullMarked
@ApiStatus.Experimental
public final class MenuTypeKeys { public final class MenuTypeKeys {
/** /**
* {@code minecraft:anvil} * {@code minecraft:anvil}

View File

@@ -7,7 +7,6 @@ import io.papermc.paper.registry.RegistryKey;
import io.papermc.paper.registry.TypedKey; import io.papermc.paper.registry.TypedKey;
import net.kyori.adventure.key.Key; import net.kyori.adventure.key.Key;
import org.bukkit.potion.PotionEffectType; import org.bukkit.potion.PotionEffectType;
import org.jetbrains.annotations.ApiStatus;
import org.jspecify.annotations.NullMarked; import org.jspecify.annotations.NullMarked;
/** /**
@@ -25,7 +24,6 @@ import org.jspecify.annotations.NullMarked;
}) })
@GeneratedFrom("1.21.4") @GeneratedFrom("1.21.4")
@NullMarked @NullMarked
@ApiStatus.Experimental
public final class MobEffectKeys { public final class MobEffectKeys {
/** /**
* {@code minecraft:absorption} * {@code minecraft:absorption}

View File

@@ -7,7 +7,6 @@ import io.papermc.paper.registry.RegistryKey;
import io.papermc.paper.registry.TypedKey; import io.papermc.paper.registry.TypedKey;
import net.kyori.adventure.key.Key; import net.kyori.adventure.key.Key;
import org.bukkit.Art; import org.bukkit.Art;
import org.jetbrains.annotations.ApiStatus;
import org.jspecify.annotations.NullMarked; import org.jspecify.annotations.NullMarked;
/** /**
@@ -25,7 +24,6 @@ import org.jspecify.annotations.NullMarked;
}) })
@GeneratedFrom("1.21.4") @GeneratedFrom("1.21.4")
@NullMarked @NullMarked
@ApiStatus.Experimental
public final class PaintingVariantKeys { public final class PaintingVariantKeys {
/** /**
* {@code minecraft:alban} * {@code minecraft:alban}
@@ -386,7 +384,6 @@ public final class PaintingVariantKeys {
* @param key the value's key in the registry * @param key the value's key in the registry
* @return a new typed key * @return a new typed key
*/ */
@ApiStatus.Experimental
public static TypedKey<Art> create(final Key key) { public static TypedKey<Art> create(final Key key) {
return TypedKey.create(RegistryKey.PAINTING_VARIANT, key); return TypedKey.create(RegistryKey.PAINTING_VARIANT, key);
} }

View File

@@ -7,7 +7,6 @@ import io.papermc.paper.registry.RegistryKey;
import io.papermc.paper.registry.TypedKey; import io.papermc.paper.registry.TypedKey;
import net.kyori.adventure.key.Key; import net.kyori.adventure.key.Key;
import org.bukkit.Sound; import org.bukkit.Sound;
import org.jetbrains.annotations.ApiStatus;
import org.jspecify.annotations.NullMarked; import org.jspecify.annotations.NullMarked;
/** /**
@@ -25,7 +24,6 @@ import org.jspecify.annotations.NullMarked;
}) })
@GeneratedFrom("1.21.4") @GeneratedFrom("1.21.4")
@NullMarked @NullMarked
@ApiStatus.Experimental
public final class SoundEventKeys { public final class SoundEventKeys {
/** /**
* {@code minecraft:ambient.basalt_deltas.additions} * {@code minecraft:ambient.basalt_deltas.additions}

View File

@@ -7,7 +7,6 @@ import io.papermc.paper.registry.RegistryKey;
import io.papermc.paper.registry.TypedKey; import io.papermc.paper.registry.TypedKey;
import net.kyori.adventure.key.Key; import net.kyori.adventure.key.Key;
import org.bukkit.generator.structure.Structure; import org.bukkit.generator.structure.Structure;
import org.jetbrains.annotations.ApiStatus;
import org.jspecify.annotations.NullMarked; import org.jspecify.annotations.NullMarked;
/** /**
@@ -25,7 +24,6 @@ import org.jspecify.annotations.NullMarked;
}) })
@GeneratedFrom("1.21.4") @GeneratedFrom("1.21.4")
@NullMarked @NullMarked
@ApiStatus.Experimental
public final class StructureKeys { public final class StructureKeys {
/** /**
* {@code minecraft:ancient_city} * {@code minecraft:ancient_city}
@@ -274,7 +272,6 @@ public final class StructureKeys {
* @param key the value's key in the registry * @param key the value's key in the registry
* @return a new typed key * @return a new typed key
*/ */
@ApiStatus.Experimental
public static TypedKey<Structure> create(final Key key) { public static TypedKey<Structure> create(final Key key) {
return TypedKey.create(RegistryKey.STRUCTURE, key); return TypedKey.create(RegistryKey.STRUCTURE, key);
} }

View File

@@ -7,7 +7,6 @@ import io.papermc.paper.registry.RegistryKey;
import io.papermc.paper.registry.TypedKey; import io.papermc.paper.registry.TypedKey;
import net.kyori.adventure.key.Key; import net.kyori.adventure.key.Key;
import org.bukkit.generator.structure.StructureType; import org.bukkit.generator.structure.StructureType;
import org.jetbrains.annotations.ApiStatus;
import org.jspecify.annotations.NullMarked; import org.jspecify.annotations.NullMarked;
/** /**
@@ -25,7 +24,6 @@ import org.jspecify.annotations.NullMarked;
}) })
@GeneratedFrom("1.21.4") @GeneratedFrom("1.21.4")
@NullMarked @NullMarked
@ApiStatus.Experimental
public final class StructureTypeKeys { public final class StructureTypeKeys {
/** /**
* {@code minecraft:buried_treasure} * {@code minecraft:buried_treasure}

View File

@@ -7,7 +7,6 @@ import io.papermc.paper.registry.RegistryKey;
import io.papermc.paper.registry.TypedKey; import io.papermc.paper.registry.TypedKey;
import net.kyori.adventure.key.Key; import net.kyori.adventure.key.Key;
import org.bukkit.inventory.meta.trim.TrimMaterial; import org.bukkit.inventory.meta.trim.TrimMaterial;
import org.jetbrains.annotations.ApiStatus;
import org.jspecify.annotations.NullMarked; import org.jspecify.annotations.NullMarked;
/** /**
@@ -25,7 +24,6 @@ import org.jspecify.annotations.NullMarked;
}) })
@GeneratedFrom("1.21.4") @GeneratedFrom("1.21.4")
@NullMarked @NullMarked
@ApiStatus.Experimental
public final class TrimMaterialKeys { public final class TrimMaterialKeys {
/** /**
* {@code minecraft:amethyst} * {@code minecraft:amethyst}
@@ -113,7 +111,6 @@ public final class TrimMaterialKeys {
* @param key the value's key in the registry * @param key the value's key in the registry
* @return a new typed key * @return a new typed key
*/ */
@ApiStatus.Experimental
public static TypedKey<TrimMaterial> create(final Key key) { public static TypedKey<TrimMaterial> create(final Key key) {
return TypedKey.create(RegistryKey.TRIM_MATERIAL, key); return TypedKey.create(RegistryKey.TRIM_MATERIAL, key);
} }

View File

@@ -7,7 +7,6 @@ import io.papermc.paper.registry.RegistryKey;
import io.papermc.paper.registry.TypedKey; import io.papermc.paper.registry.TypedKey;
import net.kyori.adventure.key.Key; import net.kyori.adventure.key.Key;
import org.bukkit.inventory.meta.trim.TrimPattern; import org.bukkit.inventory.meta.trim.TrimPattern;
import org.jetbrains.annotations.ApiStatus;
import org.jspecify.annotations.NullMarked; import org.jspecify.annotations.NullMarked;
/** /**
@@ -25,7 +24,6 @@ import org.jspecify.annotations.NullMarked;
}) })
@GeneratedFrom("1.21.4") @GeneratedFrom("1.21.4")
@NullMarked @NullMarked
@ApiStatus.Experimental
public final class TrimPatternKeys { public final class TrimPatternKeys {
/** /**
* {@code minecraft:bolt} * {@code minecraft:bolt}
@@ -162,7 +160,6 @@ public final class TrimPatternKeys {
* @param key the value's key in the registry * @param key the value's key in the registry
* @return a new typed key * @return a new typed key
*/ */
@ApiStatus.Experimental
public static TypedKey<TrimPattern> create(final Key key) { public static TypedKey<TrimPattern> create(final Key key) {
return TypedKey.create(RegistryKey.TRIM_PATTERN, key); return TypedKey.create(RegistryKey.TRIM_PATTERN, key);
} }

View File

@@ -7,7 +7,6 @@ import io.papermc.paper.registry.RegistryKey;
import io.papermc.paper.registry.TypedKey; import io.papermc.paper.registry.TypedKey;
import net.kyori.adventure.key.Key; import net.kyori.adventure.key.Key;
import org.bukkit.entity.Villager; import org.bukkit.entity.Villager;
import org.jetbrains.annotations.ApiStatus;
import org.jspecify.annotations.NullMarked; import org.jspecify.annotations.NullMarked;
/** /**
@@ -25,7 +24,6 @@ import org.jspecify.annotations.NullMarked;
}) })
@GeneratedFrom("1.21.4") @GeneratedFrom("1.21.4")
@NullMarked @NullMarked
@ApiStatus.Experimental
public final class VillagerProfessionKeys { public final class VillagerProfessionKeys {
/** /**
* {@code minecraft:armorer} * {@code minecraft:armorer}

View File

@@ -7,7 +7,6 @@ import io.papermc.paper.registry.RegistryKey;
import io.papermc.paper.registry.TypedKey; import io.papermc.paper.registry.TypedKey;
import net.kyori.adventure.key.Key; import net.kyori.adventure.key.Key;
import org.bukkit.entity.Villager; import org.bukkit.entity.Villager;
import org.jetbrains.annotations.ApiStatus;
import org.jspecify.annotations.NullMarked; import org.jspecify.annotations.NullMarked;
/** /**
@@ -25,7 +24,6 @@ import org.jspecify.annotations.NullMarked;
}) })
@GeneratedFrom("1.21.4") @GeneratedFrom("1.21.4")
@NullMarked @NullMarked
@ApiStatus.Experimental
public final class VillagerTypeKeys { public final class VillagerTypeKeys {
/** /**
* {@code minecraft:desert} * {@code minecraft:desert}

View File

@@ -7,7 +7,6 @@ import io.papermc.paper.registry.RegistryKey;
import io.papermc.paper.registry.TypedKey; import io.papermc.paper.registry.TypedKey;
import net.kyori.adventure.key.Key; import net.kyori.adventure.key.Key;
import org.bukkit.entity.Wolf; import org.bukkit.entity.Wolf;
import org.jetbrains.annotations.ApiStatus;
import org.jspecify.annotations.NullMarked; import org.jspecify.annotations.NullMarked;
/** /**
@@ -25,7 +24,6 @@ import org.jspecify.annotations.NullMarked;
}) })
@GeneratedFrom("1.21.4") @GeneratedFrom("1.21.4")
@NullMarked @NullMarked
@ApiStatus.Experimental
public final class WolfVariantKeys { public final class WolfVariantKeys {
/** /**
* {@code minecraft:ashen} * {@code minecraft:ashen}
@@ -99,7 +97,6 @@ public final class WolfVariantKeys {
* @param key the value's key in the registry * @param key the value's key in the registry
* @return a new typed key * @return a new typed key
*/ */
@ApiStatus.Experimental
public static TypedKey<Wolf.Variant> create(final Key key) { public static TypedKey<Wolf.Variant> create(final Key key) {
return TypedKey.create(RegistryKey.WOLF_VARIANT, key); return TypedKey.create(RegistryKey.WOLF_VARIANT, key);
} }

View File

@@ -1,6 +1,7 @@
package io.papermc.paper.registry; package io.papermc.paper.registry;
import io.papermc.paper.datacomponent.DataComponentType; import io.papermc.paper.datacomponent.DataComponentType;
import io.papermc.paper.registry.tag.TagKey;
import net.kyori.adventure.key.Key; import net.kyori.adventure.key.Key;
import net.kyori.adventure.key.KeyPattern; import net.kyori.adventure.key.KeyPattern;
import net.kyori.adventure.key.Keyed; import net.kyori.adventure.key.Keyed;
@@ -209,7 +210,6 @@ public sealed interface RegistryKey<T> extends Keyed permits RegistryKeyImpl {
* @param key the key of the typed key. * @param key the key of the typed key.
* @return the constructed typed key. * @return the constructed typed key.
*/ */
@ApiStatus.Experimental
default TypedKey<T> typedKey(final Key key) { default TypedKey<T> typedKey(final Key key) {
return TypedKey.create(this, key); return TypedKey.create(this, key);
} }
@@ -220,8 +220,29 @@ public sealed interface RegistryKey<T> extends Keyed permits RegistryKeyImpl {
* @param key the string representation of the key that will be passed to {@link Key#key(String)}. * @param key the string representation of the key that will be passed to {@link Key#key(String)}.
* @return the constructed typed key. * @return the constructed typed key.
*/ */
@ApiStatus.Experimental default TypedKey<T> typedKey(@KeyPattern final String key) {
default TypedKey<T> typedKey(final @KeyPattern String key) {
return TypedKey.create(this, 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<T> 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<T> tagKey(@KeyPattern final String key) {
return TagKey.create(this, key);
}
} }

View File

@@ -11,7 +11,6 @@ import org.jspecify.annotations.NullMarked;
* *
* @param <T> the value type for the registry * @param <T> the value type for the registry
*/ */
@ApiStatus.Experimental
@NullMarked @NullMarked
public sealed interface TypedKey<T> extends Key permits TypedKeyImpl { public sealed interface TypedKey<T> extends Key permits TypedKeyImpl {
@@ -39,7 +38,6 @@ public sealed interface TypedKey<T> extends Key permits TypedKeyImpl {
* @param <T> value type * @param <T> value type
* @return a new key for the value key and registry key * @return a new key for the value key and registry key
*/ */
@ApiStatus.Experimental
static <T> TypedKey<T> create(final RegistryKey<T> registryKey, final Key key) { static <T> TypedKey<T> create(final RegistryKey<T> registryKey, final Key key) {
return new TypedKeyImpl<>(key, registryKey); return new TypedKeyImpl<>(key, registryKey);
} }
@@ -53,8 +51,7 @@ public sealed interface TypedKey<T> extends Key permits TypedKeyImpl {
* @return a new key for the value key and registry key * @return a new key for the value key and registry key
* @see Key#key(String) * @see Key#key(String)
*/ */
@ApiStatus.Experimental static <T> TypedKey<T> create(final RegistryKey<T> registryKey, @KeyPattern final String key) {
static <T> TypedKey<T> create(final RegistryKey<T> registryKey, final @KeyPattern String key) {
return create(registryKey, Key.key(key)); return create(registryKey, Key.key(key));
} }
} }

View File

@@ -1,7 +1,9 @@
package io.papermc.paper.registry.tag; package io.papermc.paper.registry.tag;
import io.papermc.paper.registry.RegistryKey; import io.papermc.paper.registry.RegistryKey;
import io.papermc.paper.registry.TypedKey;
import net.kyori.adventure.key.Key; import net.kyori.adventure.key.Key;
import net.kyori.adventure.key.KeyPattern;
import net.kyori.adventure.key.Keyed; import net.kyori.adventure.key.Keyed;
import org.jetbrains.annotations.ApiStatus; import org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.Contract; import org.jetbrains.annotations.Contract;
@@ -16,14 +18,28 @@ public sealed interface TagKey<T> extends Keyed permits TagKeyImpl {
* *
* @param registryKey the registry for the tag * @param registryKey the registry for the tag
* @param key the specific key for the tag * @param key the specific key for the tag
* @return a new tag key
* @param <T> the registry value type * @param <T> the registry value type
* @return a new tag key
*/ */
@Contract(value = "_, _ -> new", pure = true) @Contract(value = "_, _ -> new", pure = true)
static <T> TagKey<T> create(final RegistryKey<T> registryKey, final Key key) { static <T> TagKey<T> create(final RegistryKey<T> registryKey, final Key key) {
return new TagKeyImpl<>(registryKey, 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 <T> the registry value type
* @return a new tag key
* @see Key#key(String)
*/
@ApiStatus.Experimental
static <T> TagKey<T> create(final RegistryKey<T> registryKey, @KeyPattern final String key) {
return create(registryKey, Key.key(key));
}
/** /**
* Get the registry key for this tag key. * Get the registry key for this tag key.
* *