Begin switching to JSpecify annotations (#11448)

* Begin switching to JSpecify annotations

* more

* fixes
This commit is contained in:
Jake Potrebic 2024-09-29 12:52:13 -07:00 committed by GitHub
parent 6d7a438fad
commit f9c7f2a5c1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
66 changed files with 750 additions and 920 deletions

View file

@ -48,7 +48,7 @@ index 0000000000000000000000000000000000000000..f75933948cdf0aa0c9bb2f06da5418f1
+}
diff --git a/src/main/java/com/destroystokyo/paper/event/inventory/PrepareResultEvent.java b/src/main/java/com/destroystokyo/paper/event/inventory/PrepareResultEvent.java
new file mode 100644
index 0000000000000000000000000000000000000000..c305c606bef93866993095cec5f50e191c5a382a
index 0000000000000000000000000000000000000000..5ae8b843f78b22e300de0202fb800fcae6ff49b0
--- /dev/null
+++ b/src/main/java/com/destroystokyo/paper/event/inventory/PrepareResultEvent.java
@@ -0,0 +1,40 @@
@ -58,18 +58,19 @@ index 0000000000000000000000000000000000000000..c305c606bef93866993095cec5f50e19
+import org.bukkit.inventory.InventoryView;
+import org.bukkit.inventory.ItemStack;
+import org.jetbrains.annotations.ApiStatus;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+import org.jspecify.annotations.NullMarked;
+import org.jspecify.annotations.Nullable;
+
+/**
+ * Called when an item is put in an inventory containing a result slot
+ */
+@NullMarked
+public class PrepareResultEvent extends PrepareInventoryResultEvent {
+
+ // HandlerList on PrepareInventoryResultEvent to ensure api compat
+
+ @ApiStatus.Internal
+ public PrepareResultEvent(@NotNull InventoryView inventory, @Nullable ItemStack result) {
+ public PrepareResultEvent(final InventoryView inventory, final @Nullable ItemStack result) {
+ super(inventory, result);
+ }
+
@ -78,8 +79,7 @@ index 0000000000000000000000000000000000000000..c305c606bef93866993095cec5f50e19
+ *
+ * @return result item
+ */
+ @Nullable
+ public ItemStack getResult() {
+ public @Nullable ItemStack getResult() {
+ return super.getResult();
+ }
+
@ -88,7 +88,7 @@ index 0000000000000000000000000000000000000000..c305c606bef93866993095cec5f50e19
+ *
+ * @param result result item
+ */
+ public void setResult(@Nullable ItemStack result) {
+ public void setResult(final @Nullable ItemStack result) {
+ super.setResult(result);
+ }
+}