diff --git a/Spigot-API-Patches/Flip-some-Spigot-API-null-annotations.patch b/Spigot-API-Patches/Flip-some-Spigot-API-null-annotations.patch index e27d1d267..96ed658a5 100644 --- a/Spigot-API-Patches/Flip-some-Spigot-API-null-annotations.patch +++ b/Spigot-API-Patches/Flip-some-Spigot-API-null-annotations.patch @@ -9,7 +9,7 @@ a ton of noise to plugin developers. These do not help plugin developers if they bring moise noise than value. diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java -index 6b0a09067..5d6c856dd 100644 +index 6b0a09067..5ed9726c8 100644 --- a/src/main/java/org/bukkit/Bukkit.java +++ b/src/main/java/org/bukkit/Bukkit.java @@ -0,0 +0,0 @@ public final class Bukkit { @@ -26,12 +26,12 @@ index 6b0a09067..5d6c856dd 100644 * @return the tag or null */ - @Nullable -+ @Contract("null, null, null -> fail") // Paper ++ @UndefinedNullability // Paper public static Tag getTag(@NotNull String registry, @NotNull NamespacedKey tag, @NotNull Class clazz) { return server.getTag(registry, tag, clazz); } diff --git a/src/main/java/org/bukkit/Location.java b/src/main/java/org/bukkit/Location.java -index 57ce443a5..6b8dde716 100644 +index 57ce443a5..fcb9059d5 100644 --- a/src/main/java/org/bukkit/Location.java +++ b/src/main/java/org/bukkit/Location.java @@ -0,0 +0,0 @@ public class Location implements Cloneable, ConfigurationSerializable { @@ -39,7 +39,7 @@ index 57ce443a5..6b8dde716 100644 * @param z The z-coordinate of this new location */ - public Location(@Nullable final World world, final double x, final double y, final double z) { -+ public Location(@NotNull final World world, final double x, final double y, final double z) { // Paper ++ public Location(@UndefinedNullability final World world, final double x, final double y, final double z) { // Paper this(world, x, y, z, 0, 0); } @@ -48,7 +48,7 @@ index 57ce443a5..6b8dde716 100644 * @param pitch The absolute rotation on the y-plane, in degrees */ - public Location(@Nullable final World world, final double x, final double y, final double z, final float yaw, final float pitch) { -+ public Location(@NotNull final World world, final double x, final double y, final double z, final float yaw, final float pitch) { // Paper ++ public Location(@UndefinedNullability final World world, final double x, final double y, final double z, final float yaw, final float pitch) { // Paper this.world = world; this.x = x; this.y = y; @@ -57,12 +57,12 @@ index 57ce443a5..6b8dde716 100644 * @return World that contains this location */ - @Nullable -+ @NotNull ++ @UndefinedNullability public World getWorld() { return world; } diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java -index 66d22ba79..08cd7cabc 100644 +index 66d22ba79..eb23417b7 100644 --- a/src/main/java/org/bukkit/Server.java +++ b/src/main/java/org/bukkit/Server.java @@ -0,0 +0,0 @@ public interface Server extends PluginMessageRecipient { @@ -79,49 +79,49 @@ index 66d22ba79..08cd7cabc 100644 * @return the tag or null */ - @Nullable -+ @Contract("null, null, null -> fail") // Paper ++ @UndefinedNullability Tag getTag(@NotNull String registry, @NotNull NamespacedKey tag, @NotNull Class clazz); /** diff --git a/src/main/java/org/bukkit/inventory/ItemFactory.java b/src/main/java/org/bukkit/inventory/ItemFactory.java -index dca77bbaf..8335f8a8b 100644 +index dca77bbaf..56734f8ee 100644 --- a/src/main/java/org/bukkit/inventory/ItemFactory.java +++ b/src/main/java/org/bukkit/inventory/ItemFactory.java -@@ -0,0 +0,0 @@ import org.bukkit.Server; +@@ -0,0 +0,0 @@ package org.bukkit.inventory; + import org.bukkit.Color; + import org.bukkit.Material; + import org.bukkit.Server; ++import org.bukkit.UndefinedNullability; import org.bukkit.inventory.meta.BookMeta; import org.bukkit.inventory.meta.ItemMeta; import org.bukkit.inventory.meta.SkullMeta; -+import org.jetbrains.annotations.Contract; - import org.jetbrains.annotations.NotNull; - import org.jetbrains.annotations.Nullable; - @@ -0,0 +0,0 @@ public interface ItemFactory { * @return a new ItemMeta that could be applied to an item stack of the * specified material */ - @Nullable -+ @Contract() // Paper ++ @UndefinedNullability // Paper ItemMeta getItemMeta(@NotNull final Material material); /** diff --git a/src/main/java/org/bukkit/inventory/ItemStack.java b/src/main/java/org/bukkit/inventory/ItemStack.java -index 1b19f8215..4a6dea561 100644 +index 1b19f8215..1d3b0a312 100644 --- a/src/main/java/org/bukkit/inventory/ItemStack.java +++ b/src/main/java/org/bukkit/inventory/ItemStack.java -@@ -0,0 +0,0 @@ import org.bukkit.enchantments.Enchantment; - import org.bukkit.inventory.meta.Damageable; - import org.bukkit.inventory.meta.ItemMeta; - import org.bukkit.material.MaterialData; -+import org.jetbrains.annotations.Contract; - import org.jetbrains.annotations.NotNull; - import org.jetbrains.annotations.Nullable; - +@@ -0,0 +0,0 @@ import java.util.Set; + import org.apache.commons.lang.Validate; + import org.bukkit.Bukkit; + import org.bukkit.Material; ++import org.bukkit.UndefinedNullability; + import org.bukkit.Utility; + import org.bukkit.configuration.serialization.ConfigurationSerializable; + import org.bukkit.enchantments.Enchantment; @@ -0,0 +0,0 @@ public class ItemStack implements Cloneable, ConfigurationSerializable { * * @return a copy of the current ItemStack's ItemData */ - @Nullable -+ @Contract() // Paper ++ @UndefinedNullability // Paper public ItemMeta getItemMeta() { return this.meta == null ? Bukkit.getItemFactory().getItemMeta(this.type) : this.meta.clone(); }