diff --git a/paper-api/src/main/java/io/papermc/paper/registry/data/CatTypeRegistryEntry.java b/paper-api/src/main/java/io/papermc/paper/registry/data/CatTypeRegistryEntry.java new file mode 100644 index 0000000000..b818d61cd6 --- /dev/null +++ b/paper-api/src/main/java/io/papermc/paper/registry/data/CatTypeRegistryEntry.java @@ -0,0 +1,45 @@ +package io.papermc.paper.registry.data; + +import io.papermc.paper.registry.RegistryBuilder; +import io.papermc.paper.registry.data.client.ClientTextureAsset; +import org.bukkit.entity.Cat; +import org.jetbrains.annotations.ApiStatus; +import org.jetbrains.annotations.Contract; + +/** + * A data-centric version-specific registry entry for the {@link Cat.Type} type. + */ +@ApiStatus.Experimental +@ApiStatus.NonExtendable +public interface CatTypeRegistryEntry { + + /** + * Provides the client texture asset of the cat type, which represents the texture to use. + * + * @return the client texture asset. + */ + ClientTextureAsset clientTextureAsset(); + + /** + * A mutable builder for the {@link CatTypeRegistryEntry} plugins may change in applicable registry events. + *
+ * The following values are required for each builder: + *
+ * The following values are required for each builder: + *
+ * The following values are required for each builder: + *
+ * The following values are required for each builder: + *
+ * The following values are required for each builder: + *
+ * The following values are required for each builder: + *
+ * The identifier string must conform to the {@link KeyPattern} format.
+ *
+ * @param identifier the string representation of the asset's identifier.
+ * @return a new {@code ClientAsset} instance.
+ */
+ @Contract("_ -> new")
+ static ClientTextureAsset clientTextureAsset(final @KeyPattern String identifier) {
+ return clientTextureAsset(Key.key(identifier));
+ }
+}
diff --git a/paper-api/src/main/java/io/papermc/paper/registry/data/client/ClientTextureAssetImpl.java b/paper-api/src/main/java/io/papermc/paper/registry/data/client/ClientTextureAssetImpl.java
new file mode 100644
index 0000000000..ad51a33a6f
--- /dev/null
+++ b/paper-api/src/main/java/io/papermc/paper/registry/data/client/ClientTextureAssetImpl.java
@@ -0,0 +1,31 @@
+package io.papermc.paper.registry.data.client;
+
+import net.kyori.adventure.key.Key;
+import org.intellij.lang.annotations.Subst;
+import org.jspecify.annotations.NullMarked;
+
+/**
+ * Package local implementation of the {@link ClientTextureAsset} type.
+ * Chosen over bridging into server internals as no internal types are required for this.
+ */
+@NullMarked
+record ClientTextureAssetImpl(
+ Key identifier,
+ Key texturePath
+) implements ClientTextureAsset {
+
+ /**
+ * Constructs the default asset path from the identifier of the asset.
+ * Mirrors internal logic in net.minecraft.core.ClientAsset
+ *
+ * @param identifier the identifier of the asset.
+ * @return the key/path of the asset.
+ */
+ static Key pathFromIdentifier(@Subst("") final Key identifier) {
+ return Key.key(
+ identifier.namespace(),
+ "textures/" + identifier.value() + ".png"
+ );
+ }
+
+}
diff --git a/paper-api/src/main/java/io/papermc/paper/registry/event/RegistryEvents.java b/paper-api/src/main/java/io/papermc/paper/registry/event/RegistryEvents.java
index 71b2456062..0cf04f0e2b 100644
--- a/paper-api/src/main/java/io/papermc/paper/registry/event/RegistryEvents.java
+++ b/paper-api/src/main/java/io/papermc/paper/registry/event/RegistryEvents.java
@@ -2,15 +2,27 @@ package io.papermc.paper.registry.event;
import io.papermc.paper.registry.RegistryKey;
import io.papermc.paper.registry.data.BannerPatternRegistryEntry;
+import io.papermc.paper.registry.data.CatTypeRegistryEntry;
+import io.papermc.paper.registry.data.ChickenVariantRegistryEntry;
+import io.papermc.paper.registry.data.CowVariantRegistryEntry;
import io.papermc.paper.registry.data.DamageTypeRegistryEntry;
import io.papermc.paper.registry.data.EnchantmentRegistryEntry;
+import io.papermc.paper.registry.data.FrogVariantRegistryEntry;
import io.papermc.paper.registry.data.GameEventRegistryEntry;
import io.papermc.paper.registry.data.PaintingVariantRegistryEntry;
+import io.papermc.paper.registry.data.PigVariantRegistryEntry;
+import io.papermc.paper.registry.data.WolfVariantRegistryEntry;
import org.bukkit.Art;
import org.bukkit.GameEvent;
import org.bukkit.block.banner.PatternType;
import org.bukkit.damage.DamageType;
import org.bukkit.enchantments.Enchantment;
+import org.bukkit.entity.Cat;
+import org.bukkit.entity.Chicken;
+import org.bukkit.entity.Cow;
+import org.bukkit.entity.Frog;
+import org.bukkit.entity.Pig;
+import org.bukkit.entity.Wolf;
import org.jetbrains.annotations.ApiStatus;
import org.jspecify.annotations.NullMarked;
@@ -28,9 +40,15 @@ public final class RegistryEvents {
// @GeneratedFrom 1.21.5
public static final RegistryEventProvider