diff options
Diffstat (limited to 'patches/api/0219-Player-Chunk-Load-Unload-Events.patch')
-rw-r--r-- | patches/api/0219-Player-Chunk-Load-Unload-Events.patch | 24 |
1 files changed, 10 insertions, 14 deletions
diff --git a/patches/api/0219-Player-Chunk-Load-Unload-Events.patch b/patches/api/0219-Player-Chunk-Load-Unload-Events.patch index c1779bb840..bbfe5bf169 100644 --- a/patches/api/0219-Player-Chunk-Load-Unload-Events.patch +++ b/patches/api/0219-Player-Chunk-Load-Unload-Events.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Player Chunk Load/Unload Events diff --git a/src/main/java/io/papermc/paper/event/packet/PlayerChunkLoadEvent.java b/src/main/java/io/papermc/paper/event/packet/PlayerChunkLoadEvent.java new file mode 100644 -index 0000000000000000000000000000000000000000..3ddbc099a13df939b3912f30b54e7635840ba5a4 +index 0000000000000000000000000000000000000000..2815c5802eb38e5a48f9db42b9247e24c27db134 --- /dev/null +++ b/src/main/java/io/papermc/paper/event/packet/PlayerChunkLoadEvent.java -@@ -0,0 +1,45 @@ +@@ -0,0 +1,43 @@ +package io.papermc.paper.event.packet; + +import org.bukkit.Chunk; @@ -17,7 +17,7 @@ index 0000000000000000000000000000000000000000..3ddbc099a13df939b3912f30b54e7635 +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..3ddbc099a13df939b3912f30b54e7635 + * 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,33 +35,30 @@ index 0000000000000000000000000000000000000000..3ddbc099a13df939b3912f30b54e7635 + 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; + } +} diff --git a/src/main/java/io/papermc/paper/event/packet/PlayerChunkUnloadEvent.java b/src/main/java/io/papermc/paper/event/packet/PlayerChunkUnloadEvent.java new file mode 100644 -index 0000000000000000000000000000000000000000..2cac7e27991c04a9ced261f2dd8ad8657ccddf6b +index 0000000000000000000000000000000000000000..3ebb35b680193109cc751398675e935eed746750 --- /dev/null +++ b/src/main/java/io/papermc/paper/event/packet/PlayerChunkUnloadEvent.java -@@ -0,0 +1,43 @@ +@@ -0,0 +1,41 @@ +package io.papermc.paper.event.packet; + +import org.bukkit.Chunk; @@ -68,7 +66,7 @@ index 0000000000000000000000000000000000000000..2cac7e27991c04a9ced261f2dd8ad865 +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..2cac7e27991c04a9ced261f2dd8ad865 + * 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..2cac7e27991c04a9ced261f2dd8ad865 + 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; + } |