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

@@ -15,12 +15,14 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+import org.bukkit.block.Block;
+import org.bukkit.event.HandlerList;
+import org.bukkit.event.block.BlockEvent;
+import org.checkerframework.checker.nullness.qual.NonNull;
+import org.jetbrains.annotations.ApiStatus;
+import org.jetbrains.annotations.NotNull;
+import org.jspecify.annotations.NullMarked;
+
+/**
+ * Called when a block tries to dispense an item, but its inventory is empty.
+ */
+@NullMarked
+public class BlockFailedDispenseEvent extends BlockEvent {
+
+ private static final HandlerList HANDLER_LIST = new HandlerList();
@@ -28,7 +30,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ private boolean shouldPlayEffect = true;
+
+ @ApiStatus.Internal
+ public BlockFailedDispenseEvent(@NotNull Block theBlock) {
+ public BlockFailedDispenseEvent(final Block theBlock) {
+ super(theBlock);
+ }
+
@@ -44,7 +46,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ *
+ * @param playEffect if the effect should be played
+ */
+ public void shouldPlayEffect(boolean playEffect) {
+ public void shouldPlayEffect(final boolean playEffect) {
+ this.shouldPlayEffect = playEffect;
+ }
+
@@ -58,11 +60,11 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ }
+
+ @Override
+ public @NotNull HandlerList getHandlers() {
+ public HandlerList getHandlers() {
+ return HANDLER_LIST;
+ }
+
+ public static @NotNull HandlerList getHandlerList() {
+ public static HandlerList getHandlerList() {
+ return HANDLER_LIST;
+ }
+}