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:
@@ -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
|
||||
|
||||
@@ -223,6 +223,25 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
}
|
||||
|
||||
private static void collectClasses(@NotNull File from, @NotNull Map<String, ClassNode> to) throws IOException {
|
||||
if (from.isDirectory()) {
|
||||
+ // Paper start - skip packages with @NullMarked
|
||||
+ final File packageInfo = new File(from, "package-info.class");
|
||||
+ if (packageInfo.exists()) {
|
||||
+ try (final FileInputStream in = new FileInputStream(packageInfo)) {
|
||||
+ final ClassReader cr = new ClassReader(in);
|
||||
+
|
||||
+ final ClassNode node = new ClassNode();
|
||||
+ cr.accept(node, ClassReader.SKIP_CODE | ClassReader.SKIP_DEBUG | ClassReader.SKIP_FRAMES);
|
||||
+
|
||||
+ if (isClassNullMarked0(node)) {
|
||||
+ return; // skip packages with @NullMarked
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+ // Paper end - skip packages with @NullMarked
|
||||
final File[] files = from.listFiles();
|
||||
assert files != null;
|
||||
|
||||
@@ -0,0 +0,0 @@ public class AnnotationTest {
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user