Finish converting all events to jspecify annotations

This commit is contained in:
Jake Potrebic 2024-09-29 16:48:34 -07:00
parent ea00be3aaa
commit ba3c29b92e
No known key found for this signature in database
GPG key ID: ECE0B3C133C016C5
82 changed files with 977 additions and 1103 deletions

View file

@ -6,10 +6,10 @@ Subject: [PATCH] Added PlayerLecternPageChangeEvent
diff --git a/src/main/java/io/papermc/paper/event/player/PlayerLecternPageChangeEvent.java b/src/main/java/io/papermc/paper/event/player/PlayerLecternPageChangeEvent.java
new file mode 100644
index 0000000000000000000000000000000000000000..6ed2a6c8c033937d933b6d4834953b8112a98bb3
index 0000000000000000000000000000000000000000..6126182db48dab1286924f9642fb259087efabb3
--- /dev/null
+++ b/src/main/java/io/papermc/paper/event/player/PlayerLecternPageChangeEvent.java
@@ -0,0 +1,117 @@
@@ -0,0 +1,113 @@
+package io.papermc.paper.event.player;
+
+import org.bukkit.block.Lectern;
@ -19,8 +19,9 @@ index 0000000000000000000000000000000000000000..6ed2a6c8c033937d933b6d4834953b81
+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..6ed2a6c8c033937d933b6d4834953b81
+ 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..6ed2a6c8c033937d933b6d4834953b81
+ *
+ * @return the Lectern
+ */
+ @NotNull
+ public Lectern getLectern() {
+ return this.lectern;
+ }
@ -58,7 +58,6 @@ index 0000000000000000000000000000000000000000..6ed2a6c8c033937d933b6d4834953b81
+ *
+ * @return the ItemStack on the Lectern
+ */
+ @NotNull
+ public ItemStack getBook() {
+ return this.book;
+ }
@ -68,7 +67,6 @@ index 0000000000000000000000000000000000000000..6ed2a6c8c033937d933b6d4834953b81
+ *
+ * @return the page change direction
+ */
+ @NotNull
+ public PageChangeDirection getPageChangeDirection() {
+ return this.pageChangeDirection;
+ }
@ -97,7 +95,7 @@ index 0000000000000000000000000000000000000000..6ed2a6c8c033937d933b6d4834953b81
+ *
+ * @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..6ed2a6c8c033937d933b6d4834953b81
+ }
+
+ @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;
+ }