Switch Impl types to Holderable (#11662)

* Switch Impl types to Holderable

* Fix compile issues

* more improvements

* compile fixes

* remove unneeded unwrapAndConvertHolder call

---------

Co-authored-by: Bjarne Koll <git@lynxplay.dev>
This commit is contained in:
Jake Potrebic
2024-12-08 12:50:55 -08:00
parent e7ac163b76
commit a53051b155
10 changed files with 917 additions and 288 deletions

View File

@@ -45,14 +45,12 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+import org.jetbrains.annotations.Contract;
+import org.jetbrains.annotations.Range;
+import org.jetbrains.annotations.Unmodifiable;
+import org.jspecify.annotations.NullMarked;
+import org.jspecify.annotations.Nullable;
+
+/**
+ * A data-centric version-specific registry entry for the {@link Enchantment} type.
+ */
+@ApiStatus.Experimental
+@NullMarked
+@ApiStatus.NonExtendable
+public interface EnchantmentRegistryEntry {
+
@@ -372,13 +370,11 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+import org.jetbrains.annotations.ApiStatus;
+import org.jetbrains.annotations.Contract;
+import org.jetbrains.annotations.Range;
+import org.jspecify.annotations.NullMarked;
+
+/**
+ * A data-centric version-specific registry entry for the {@link GameEvent} type.
+ */
+@ApiStatus.Experimental
+@NullMarked
+@ApiStatus.NonExtendable
+public interface GameEventRegistryEntry {
+
@@ -423,21 +419,18 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+package io.papermc.paper.registry.data;
+
+import io.papermc.paper.registry.RegistryBuilder;
+import java.util.Optional;
+import net.kyori.adventure.key.Key;
+import net.kyori.adventure.text.Component;
+import org.bukkit.Art;
+import org.jetbrains.annotations.ApiStatus;
+import org.jetbrains.annotations.Contract;
+import org.jetbrains.annotations.Range;
+import org.jspecify.annotations.NullMarked;
+import org.jspecify.annotations.Nullable;
+
+/**
+ * A data-centric version-specific registry entry for the {@link Art} type.
+ */
+@ApiStatus.Experimental
+@NullMarked
+@ApiStatus.NonExtendable
+public interface PaintingVariantRegistryEntry {
+
@@ -565,7 +558,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ * Registry entries are not expected to be used during plugin runtime interactions with the API but are mostly
+ * exposed during registry creation/modification.
+ */
+@NullMarked
+package io.papermc.paper.registry.data;
+
+import org.jspecify.annotations.NullMarked;
diff --git a/src/main/java/io/papermc/paper/registry/event/RegistryEvents.java b/src/main/java/io/papermc/paper/registry/event/RegistryEvents.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/io/papermc/paper/registry/event/RegistryEvents.java