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

@@ -19,8 +19,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+import org.bukkit.event.player.PlayerEvent;
+import org.bukkit.inventory.ItemStack;
+import org.jetbrains.annotations.ApiStatus;
+import org.jetbrains.annotations.NotNull;
+import org.jspecify.annotations.NullMarked;
+
+@NullMarked
+public class PlayerLecternPageChangeEvent extends PlayerEvent implements Cancellable {
+
+ private static final HandlerList HANDLER_LIST = new HandlerList();
@@ -34,7 +35,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ private boolean cancelled;
+
+ @ApiStatus.Internal
+ public PlayerLecternPageChangeEvent(@NotNull Player player, @NotNull Lectern lectern, @NotNull ItemStack book, @NotNull PageChangeDirection pageChangeDirection, int oldPage, int newPage) {
+ public PlayerLecternPageChangeEvent(final Player player, final Lectern lectern, final ItemStack book, final PageChangeDirection pageChangeDirection, final int oldPage, final int newPage) {
+ super(player);
+ this.lectern = lectern;
+ this.book = book;
@@ -48,7 +49,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ *
+ * @return the Lectern
+ */
+ @NotNull
+ public Lectern getLectern() {
+ return this.lectern;
+ }
@@ -58,7 +58,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ *
+ * @return the ItemStack on the Lectern
+ */
+ @NotNull
+ public ItemStack getBook() {
+ return this.book;
+ }
@@ -68,7 +67,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ *
+ * @return the page change direction
+ */
+ @NotNull
+ public PageChangeDirection getPageChangeDirection() {
+ return this.pageChangeDirection;
+ }
@@ -97,7 +95,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ *
+ * @param newPage the new paged changed to
+ */
+ public void setNewPage(int newPage) {
+ public void setNewPage(final int newPage) {
+ this.newPage = newPage;
+ }
+
@@ -107,17 +105,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;
+ }