diff options
author | Jake Potrebic <[email protected]> | 2024-09-29 16:48:34 -0700 |
---|---|---|
committer | Jake Potrebic <[email protected]> | 2024-09-29 19:13:41 -0700 |
commit | ba3c29b92ec29c8c321f7e6160a4a25f65f18088 (patch) | |
tree | 822022fb0a406a3c23533578de55ab8bcf5bd3e5 /patches/api/0259-Added-PlayerDeepSleepEvent.patch | |
parent | ea00be3aaa1a5727151db9cd82d876613c99e727 (diff) | |
download | Paper-ba3c29b92ec29c8c321f7e6160a4a25f65f18088.tar.gz Paper-ba3c29b92ec29c8c321f7e6160a4a25f65f18088.zip |
Finish converting all events to jspecify annotations
Diffstat (limited to 'patches/api/0259-Added-PlayerDeepSleepEvent.patch')
-rw-r--r-- | patches/api/0259-Added-PlayerDeepSleepEvent.patch | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/patches/api/0259-Added-PlayerDeepSleepEvent.patch b/patches/api/0259-Added-PlayerDeepSleepEvent.patch index b333894788..73c3ea9004 100644 --- a/patches/api/0259-Added-PlayerDeepSleepEvent.patch +++ b/patches/api/0259-Added-PlayerDeepSleepEvent.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Added PlayerDeepSleepEvent diff --git a/src/main/java/io/papermc/paper/event/player/PlayerDeepSleepEvent.java b/src/main/java/io/papermc/paper/event/player/PlayerDeepSleepEvent.java new file mode 100644 -index 0000000000000000000000000000000000000000..54cf2ec5e025fac9a0c8f151ff4f8c83a62b8405 +index 0000000000000000000000000000000000000000..2d4b15ded1e9aa00f21ca0b412e6b6ac333e5e02 --- /dev/null +++ b/src/main/java/io/papermc/paper/event/player/PlayerDeepSleepEvent.java -@@ -0,0 +1,48 @@ +@@ -0,0 +1,47 @@ +package io.papermc.paper.event.player; + +import org.bukkit.entity.Player; @@ -17,7 +17,7 @@ index 0000000000000000000000000000000000000000..54cf2ec5e025fac9a0c8f151ff4f8c83 +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 has slept long enough @@ -26,6 +26,7 @@ index 0000000000000000000000000000000000000000..54cf2ec5e025fac9a0c8f151ff4f8c83 + * Cancelling this event will prevent the player from being counted as deeply sleeping + * unless they exit and re-enter the bed. + */ ++@NullMarked +public class PlayerDeepSleepEvent extends PlayerEvent implements Cancellable { + + private static final HandlerList HANDLER_LIST = new HandlerList(); @@ -33,7 +34,7 @@ index 0000000000000000000000000000000000000000..54cf2ec5e025fac9a0c8f151ff4f8c83 + private boolean cancelled; + + @ApiStatus.Internal -+ public PlayerDeepSleepEvent(@NotNull Player player) { ++ public PlayerDeepSleepEvent(final Player player) { + super(player); + } + @@ -43,17 +44,15 @@ index 0000000000000000000000000000000000000000..54cf2ec5e025fac9a0c8f151ff4f8c83 + } + + @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; + } |