Finish converting all events to jspecify annotations

This commit is contained in:
Jake Potrebic
2024-09-29 16:48:34 -07:00
parent fa97c59a4e
commit 29a25df60e
78 changed files with 757 additions and 883 deletions

View File

@@ -20,13 +20,14 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+import org.bukkit.event.HandlerList;
+import org.bukkit.event.player.PlayerEvent;
+import org.jetbrains.annotations.ApiStatus;
+import org.jetbrains.annotations.NotNull;
+import org.jspecify.annotations.NullMarked;
+
+/**
+ * Called when a player begins editing a sign's text.
+ * <p>
+ * Cancelling this event stops the sign editing menu from opening.
+ */
+@NullMarked
+public class PlayerOpenSignEvent extends PlayerEvent implements Cancellable {
+
+ private static final HandlerList HANDLER_LIST = new HandlerList();
@@ -38,7 +39,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ private boolean cancelled;
+
+ @ApiStatus.Internal
+ public PlayerOpenSignEvent(final @NotNull Player editor, final @NotNull Sign sign, final @NotNull Side side, final @NotNull Cause cause) {
+ public PlayerOpenSignEvent(final Player editor, final Sign sign, final Side side, final Cause cause) {
+ super(editor);
+ this.sign = sign;
+ this.side = side;
@@ -50,7 +51,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ *
+ * @return {@link Sign} that was clicked
+ */
+ @NotNull
+ public Sign getSign() {
+ return this.sign;
+ }
@@ -61,7 +61,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ * @return {@link Side} that was clicked
+ * @see Sign#getSide(Side)
+ */
+ @NotNull
+ public Side getSide() {
+ return this.side;
+ }
@@ -71,7 +70,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ *
+ * @return the cause
+ */
+ public @NotNull Cause getCause() {
+ public Cause getCause() {
+ return this.cause;
+ }
+
@@ -81,17 +80,15 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ }
+
+ @Override
+ public void setCancelled(boolean cancel) {
+ public void setCancelled(final boolean cancel) {
+ this.cancelled = cancel;
+ }
+
+ @NotNull
+ @Override
+ public HandlerList getHandlers() {
+ return HANDLER_LIST;
+ }
+
+ @NotNull
+ public static HandlerList getHandlerList() {
+ return HANDLER_LIST;
+ }