diff --git a/patches/api/0003-Test-changes.patch b/patches/api/0003-Test-changes.patch index 6b6d57cb77e5..2aa6193edd61 100644 --- a/patches/api/0003-Test-changes.patch +++ b/patches/api/0003-Test-changes.patch @@ -66,7 +66,7 @@ index 0000000000000000000000000000000000000000..77154095cfb8b259bdb318e8ff40cb6f + } +} diff --git a/src/test/java/org/bukkit/AnnotationTest.java b/src/test/java/org/bukkit/AnnotationTest.java -index 64e7aef6220097edefdff3b98a771b988365930d..abadff47166722fdc756afdbc6ac7242b6bd4fb0 100644 +index 64e7aef6220097edefdff3b98a771b988365930d..a899f63eb2ce58b3cf708e91819cbbdeffda5d9f 100644 --- a/src/test/java/org/bukkit/AnnotationTest.java +++ b/src/test/java/org/bukkit/AnnotationTest.java @@ -29,7 +29,13 @@ public class AnnotationTest { @@ -132,8 +132,8 @@ index 64e7aef6220097edefdff3b98a771b988365930d..abadff47166722fdc756afdbc6ac7242 for (int i = 0; i < paramTypes.length; i++) { if (mustBeAnnotated(paramTypes[i]) ^ isWellAnnotated(method.invisibleParameterAnnotations == null ? null : method.invisibleParameterAnnotations[i])) { + // Paper start -+ if (method.invisibleTypeAnnotations != null) { -+ for (final org.objectweb.asm.tree.TypeAnnotationNode invisibleTypeAnnotation : method.invisibleTypeAnnotations) { ++ if (method.invisibleTypeAnnotations != null || method.visibleTypeAnnotations != null) { ++ for (final org.objectweb.asm.tree.TypeAnnotationNode invisibleTypeAnnotation : java.util.Objects.requireNonNullElse(method.invisibleTypeAnnotations, method.visibleTypeAnnotations)) { + final org.objectweb.asm.TypeReference ref = new org.objectweb.asm.TypeReference(invisibleTypeAnnotation.typeRef); + if (ref.getSort() == org.objectweb.asm.TypeReference.METHOD_FORMAL_PARAMETER && ref.getTypeParameterIndex() == i && java.util.Arrays.asList(ACCEPTED_ANNOTATIONS).contains(invisibleTypeAnnotation.desc)) { + continue dancing; diff --git a/patches/api/0480-Add-datapack-registration-lifecycle-event.patch b/patches/api/0481-Add-datapack-registration-lifecycle-event.patch similarity index 89% rename from patches/api/0480-Add-datapack-registration-lifecycle-event.patch rename to patches/api/0481-Add-datapack-registration-lifecycle-event.patch index ee136110105d..e29d40c64183 100644 --- a/patches/api/0480-Add-datapack-registration-lifecycle-event.patch +++ b/patches/api/0481-Add-datapack-registration-lifecycle-event.patch @@ -21,7 +21,7 @@ index 7b2ab0be10a21e0496ad1d485ff8cb2c0b92a2cb..e6037cc5b79b5206e5da8d53c5009932 } diff --git a/src/main/java/io/papermc/paper/datapack/DatapackRegistrar.java b/src/main/java/io/papermc/paper/datapack/DatapackRegistrar.java new file mode 100644 -index 0000000000000000000000000000000000000000..0ba2252d54999108f19a772f65ba75e5cb25b57d +index 0000000000000000000000000000000000000000..cf1fd66e6212b007717e766026b76a5f8040f47a --- /dev/null +++ b/src/main/java/io/papermc/paper/datapack/DatapackRegistrar.java @@ -0,0 +1,122 @@ @@ -33,9 +33,9 @@ index 0000000000000000000000000000000000000000..0ba2252d54999108f19a772f65ba75e5 +import java.nio.file.Path; +import java.util.function.Consumer; +import net.kyori.adventure.text.Component; ++import org.checkerframework.checker.nullness.qual.NonNull; +import org.jetbrains.annotations.ApiStatus; +import org.jetbrains.annotations.Contract; -+import org.jetbrains.annotations.NotNull; + +/** + * The registrar for datapacks. The event for this registrar @@ -44,7 +44,7 @@ index 0000000000000000000000000000000000000000..0ba2252d54999108f19a772f65ba75e5 + * it must always be discovered whenever this event fires. + *

An example of a plugin loading a datapack from within it's own jar is below

+ *
{@code
-+ * class YourPluginBootstrap implements PluginBootstrap {
++ * public class YourPluginBootstrap implements PluginBootstrap {
 + *     @Override
 + *     public void bootstrap(BoostrapContext context) {
 + *         final LifecycleEventManager manager = context.getLifecycleManager();
@@ -74,7 +74,7 @@ index 0000000000000000000000000000000000000000..0ba2252d54999108f19a772f65ba75e5
 +     * @param id a unique id
 +     * @throws IOException if any IO error occurs
 +     */
-+    default void discoverPack(final @NotNull URI uri, final @NotNull String id) throws IOException {
++    default void discoverPack(final @NonNull URI uri, final @NonNull String id) throws IOException {
 +        this.discoverPack(uri, id, c -> {});
 +    }
 +
@@ -86,7 +86,7 @@ index 0000000000000000000000000000000000000000..0ba2252d54999108f19a772f65ba75e5
 +     * @param configurer a configurer for extra options
 +     * @throws IOException if any IO error occurs
 +     */
-+    void discoverPack(@NotNull URI uri, @NotNull String id, Consumer configurer) throws IOException;
++    void discoverPack(@NonNull URI uri, @NonNull String id, @NonNull Consumer configurer) throws IOException;
 +
 +    /**
 +     * Discovers a datapack at the specified {@link Path} with the id.
@@ -95,7 +95,7 @@ index 0000000000000000000000000000000000000000..0ba2252d54999108f19a772f65ba75e5
 +     * @param id a unique id
 +     * @throws IOException if any IO error occurs
 +     */
-+    default void discoverPack(final @NotNull Path path, final @NotNull String id) throws IOException {
++    default void discoverPack(final @NonNull Path path, final @NonNull String id) throws IOException {
 +        this.discoverPack(path, id, c -> {});
 +    }
 +
@@ -107,7 +107,7 @@ index 0000000000000000000000000000000000000000..0ba2252d54999108f19a772f65ba75e5
 +     * @param configurer a configurer for extra options
 +     * @throws IOException if any IO error occurs
 +     */
-+    void discoverPack(@NotNull Path path, @NotNull String id, @NotNull Consumer configurer) throws IOException;
++    void discoverPack(@NonNull Path path, @NonNull String id, @NonNull Consumer configurer) throws IOException;
 +
 +    /**
 +     * Configures additional, optional, details about a datapack.
@@ -123,7 +123,7 @@ index 0000000000000000000000000000000000000000..0ba2252d54999108f19a772f65ba75e5
 +         * @return the configurer for chaining
 +         */
 +        @Contract(value = "_ -> this", mutates = "this")
-+        @NotNull Configurer title(Component title);
++        @NonNull Configurer title(@NonNull Component title);
 +
 +        /**
 +         * Sets if this pack is required. Defaults to false.
@@ -133,7 +133,7 @@ index 0000000000000000000000000000000000000000..0ba2252d54999108f19a772f65ba75e5
 +         * @return the configurer for chaining
 +         */
 +        @Contract(value = "_ -> this", mutates = "this")
-+        @NotNull Configurer required(boolean required);
++        @NonNull Configurer required(boolean required);
 +
 +        /**
 +         * Configures the position in the
@@ -144,7 +144,7 @@ index 0000000000000000000000000000000000000000..0ba2252d54999108f19a772f65ba75e5
 +         * @return the configurer for chaining
 +         */
 +        @Contract(value = "_, _ -> this", mutates = "this")
-+        @NotNull Configurer position(boolean fixed, Datapack.Position position);
++        @NonNull Configurer position(boolean fixed, Datapack.@NonNull Position position);
 +    }
 +}
 diff --git a/src/main/java/io/papermc/paper/plugin/lifecycle/event/types/LifecycleEvents.java b/src/main/java/io/papermc/paper/plugin/lifecycle/event/types/LifecycleEvents.java
diff --git a/patches/server/1049-Add-datapack-registration-lifecycle-event.patch b/patches/server/1051-Add-datapack-registration-lifecycle-event.patch
similarity index 98%
rename from patches/server/1049-Add-datapack-registration-lifecycle-event.patch
rename to patches/server/1051-Add-datapack-registration-lifecycle-event.patch
index 23adb9855f95..f664db75e83f 100644
--- a/patches/server/1049-Add-datapack-registration-lifecycle-event.patch
+++ b/patches/server/1051-Add-datapack-registration-lifecycle-event.patch
@@ -215,10 +215,10 @@ index 6c072e44a8144de6658b4eb818c996f0eac5805b..346c9f8dbeda7c48e88b10964e04a89f
      public static final LifecycleEventRunner INSTANCE = new LifecycleEventRunner();
  
 diff --git a/src/main/java/net/minecraft/server/packs/repository/ServerPacksSource.java b/src/main/java/net/minecraft/server/packs/repository/ServerPacksSource.java
-index def8ed40ef732b512a07fe50449c77a860b97462..72c39887631916a7e448123fa793057779e75c53 100644
+index 1a528e1aa7b12f8b8cffce6c7bc4b5d5865f026b..7fb122b54f365261b95c0ae5e0a91fbedee03b4f 100644
 --- a/src/main/java/net/minecraft/server/packs/repository/ServerPacksSource.java
 +++ b/src/main/java/net/minecraft/server/packs/repository/ServerPacksSource.java
-@@ -82,6 +82,7 @@ public class ServerPacksSource extends BuiltInPackSource {
+@@ -85,6 +85,7 @@ public class ServerPacksSource extends BuiltInPackSource {
      public static PackRepository createPackRepository(Path dataPacksPath, DirectoryValidator symlinkFinder) {
          return new PackRepository(
              new ServerPacksSource(symlinkFinder), new FolderRepositorySource(dataPacksPath, PackType.SERVER_DATA, PackSource.WORLD, symlinkFinder)