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

@@ -17,7 +17,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+import org.bukkit.event.HandlerList;
+import org.bukkit.event.world.ChunkEvent;
+import org.jetbrains.annotations.ApiStatus;
+import org.jetbrains.annotations.NotNull;
+import org.jspecify.annotations.NullMarked;
+
+/**
+ * Is called when a {@link Player} receives a {@link Chunk}
@@ -27,6 +27,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ * Should only be used for packet/clientside related stuff.
+ * Not intended for modifying server side state.
+ */
+@NullMarked
+public class PlayerChunkLoadEvent extends ChunkEvent {
+
+ private static final HandlerList HANDLER_LIST = new HandlerList();
@@ -34,23 +35,20 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ private final Player player;
+
+ @ApiStatus.Internal
+ public PlayerChunkLoadEvent(@NotNull Chunk chunk, @NotNull Player player) {
+ public PlayerChunkLoadEvent(final Chunk chunk, final Player player) {
+ super(chunk);
+ this.player = player;
+ }
+
+ @NotNull
+ public Player getPlayer() {
+ return this.player;
+ }
+
+ @NotNull
+ @Override
+ public HandlerList getHandlers() {
+ return HANDLER_LIST;
+ }
+
+ @NotNull
+ public static HandlerList getHandlerList() {
+ return HANDLER_LIST;
+ }
@@ -68,7 +66,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+import org.bukkit.event.HandlerList;
+import org.bukkit.event.world.ChunkEvent;
+import org.jetbrains.annotations.ApiStatus;
+import org.jetbrains.annotations.NotNull;
+import org.jspecify.annotations.NullMarked;
+
+/**
+ * Is called when a {@link Player} receives a chunk unload packet.
@@ -76,6 +74,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ * Should only be used for packet/clientside related stuff.
+ * Not intended for modifying server side.
+ */
+@NullMarked
+public class PlayerChunkUnloadEvent extends ChunkEvent {
+
+ private static final HandlerList HANDLER_LIST = new HandlerList();
@@ -83,23 +82,20 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ private final Player player;
+
+ @ApiStatus.Internal
+ public PlayerChunkUnloadEvent(@NotNull Chunk chunk, @NotNull Player player) {
+ public PlayerChunkUnloadEvent(final Chunk chunk, final Player player) {
+ super(chunk);
+ this.player = player;
+ }
+
+ @NotNull
+ public Player getPlayer() {
+ return this.player;
+ }
+
+ @NotNull
+ @Override
+ public HandlerList getHandlers() {
+ return HANDLER_LIST;
+ }
+
+ @NotNull
+ public static HandlerList getHandlerList() {
+ return HANDLER_LIST;
+ }