aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorOwen1212055 <[email protected]>2024-06-15 21:43:06 -0400
committerOwen1212055 <[email protected]>2024-06-15 21:43:06 -0400
commit5a5412ca70806523529c74d424623a22e67ceafa (patch)
tree86e0c5d41b81807b07dbaeaf0c868272e876d7d0
parent5e7cd0784b877020c9b418f3d79268ce9bb854fb (diff)
downloadPaper-5a5412ca70806523529c74d424623a22e67ceafa.tar.gz
Paper-5a5412ca70806523529c74d424623a22e67ceafa.zip
Owen fixing stuff!!!
-rw-r--r--patches/api/0477-WIP-Tag-API.patch62
1 files changed, 62 insertions, 0 deletions
diff --git a/patches/api/0477-WIP-Tag-API.patch b/patches/api/0477-WIP-Tag-API.patch
new file mode 100644
index 0000000000..32ed16f1cf
--- /dev/null
+++ b/patches/api/0477-WIP-Tag-API.patch
@@ -0,0 +1,62 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Owen1212055 <[email protected]>
+Date: Sat, 15 Jun 2024 21:42:19 -0400
+Subject: [PATCH] WIP Tag API
+
+
+diff --git a/src/main/java/io/papermc/paper/registry/tag/TagKey.java b/src/main/java/io/papermc/paper/registry/tag/TagKey.java
+new file mode 100644
+index 0000000000000000000000000000000000000000..a49d328e95f7fda6567ee6c4f5f1878a2c187277
+--- /dev/null
++++ b/src/main/java/io/papermc/paper/registry/tag/TagKey.java
+@@ -0,0 +1,32 @@
++package io.papermc.paper.registry.tag;
++
++import io.papermc.paper.registry.RegistryKey;
++import net.kyori.adventure.key.Key;
++import net.kyori.adventure.key.Keyed;
++import org.checkerframework.checker.nullness.qual.NonNull;
++import org.jetbrains.annotations.ApiStatus;
++import org.jetbrains.annotations.Contract;
++
++public sealed interface TagKey<T> 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
++ * @return a new tag key
++ * @param <T> the registry value type
++ */
++ @Contract(value = "_, _ -> new", pure = true)
++ static <T> @NonNull TagKey<T> create(final @NonNull RegistryKey<T> registryKey, final @NonNull Key key) {
++ return new TagKeyImpl<>(registryKey, key);
++ }
++
++ /**
++ * Get the registry key for this tag key.
++ *
++ * @return the registry key
++ */
++ @NonNull RegistryKey<T> registryKey();
++}
+diff --git a/src/main/java/io/papermc/paper/registry/tag/TagKeyImpl.java b/src/main/java/io/papermc/paper/registry/tag/TagKeyImpl.java
+new file mode 100644
+index 0000000000000000000000000000000000000000..11d19e339c7c62f2eb4467277552c27e4e83069c
+--- /dev/null
++++ b/src/main/java/io/papermc/paper/registry/tag/TagKeyImpl.java
+@@ -0,0 +1,12 @@
++package io.papermc.paper.registry.tag;
++
++import io.papermc.paper.registry.RegistryKey;
++import net.kyori.adventure.key.Key;
++import org.checkerframework.checker.nullness.qual.NonNull;
++import org.checkerframework.framework.qual.DefaultQualifier;
++import org.jetbrains.annotations.ApiStatus;
++
++@DefaultQualifier(NonNull.class)
++record TagKeyImpl<T>(RegistryKey<T> registryKey, Key key) implements TagKey<T> {
++}