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
parent fa1f6a5d78
commit 64e918335c
62 changed files with 580 additions and 750 deletions

View File

@@ -18,8 +18,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+import org.bukkit.event.block.BlockEvent;
+import org.bukkit.inventory.ItemStack;
+import org.jetbrains.annotations.ApiStatus;
+import org.jetbrains.annotations.NotNull;
+import org.jspecify.annotations.NullMarked;
+
+@NullMarked
+public class BlockPreDispenseEvent extends BlockEvent implements Cancellable {
+
+ private static final HandlerList HANDLER_LIST = new HandlerList();
@@ -30,7 +31,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ private boolean cancelled;
+
+ @ApiStatus.Internal
+ public BlockPreDispenseEvent(@NotNull Block block, @NotNull ItemStack itemStack, int slot) {
+ public BlockPreDispenseEvent(final Block block, final ItemStack itemStack, final int slot) {
+ super(block);
+ this.itemStack = itemStack;
+ this.slot = slot;
@@ -41,7 +42,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ *
+ * @return The item to be dispensed
+ */
+ @NotNull
+ public ItemStack getItemStack() {
+ return this.itemStack;
+ }
@@ -61,16 +61,14 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ }
+
+ @Override
+ public void setCancelled(boolean cancel) {
+ public void setCancelled(final boolean cancel) {
+ this.cancelled = cancel;
+ }
+
+ @NotNull
+ public HandlerList getHandlers() {
+ return HANDLER_LIST;
+ }
+
+ @NotNull
+ public static HandlerList getHandlerList() {
+ return HANDLER_LIST;
+ }