diff options
Diffstat (limited to 'patches/api/0396-Add-event-for-player-editing-sign.patch')
-rw-r--r-- | patches/api/0396-Add-event-for-player-editing-sign.patch | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/patches/api/0396-Add-event-for-player-editing-sign.patch b/patches/api/0396-Add-event-for-player-editing-sign.patch index ec38bf008b..c0b95f9d58 100644 --- a/patches/api/0396-Add-event-for-player-editing-sign.patch +++ b/patches/api/0396-Add-event-for-player-editing-sign.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Add event for player editing sign diff --git a/src/main/java/io/papermc/paper/event/player/PlayerOpenSignEvent.java b/src/main/java/io/papermc/paper/event/player/PlayerOpenSignEvent.java new file mode 100644 -index 0000000000000000000000000000000000000000..c38c32ae349e094ffef84386607f4b9d5fe361f5 +index 0000000000000000000000000000000000000000..0b905aafe5b228993944af1850c93c797f6eaf47 --- /dev/null +++ b/src/main/java/io/papermc/paper/event/player/PlayerOpenSignEvent.java -@@ -0,0 +1,108 @@ +@@ -0,0 +1,105 @@ +package io.papermc.paper.event.player; + +import org.bukkit.block.Sign; @@ -20,13 +20,14 @@ index 0000000000000000000000000000000000000000..c38c32ae349e094ffef84386607f4b9d +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 begins editing a sign's text. + * <p> + * Cancelling this event stops the sign editing menu from opening. + */ ++@NullMarked +public class PlayerOpenSignEvent extends PlayerEvent implements Cancellable { + + private static final HandlerList HANDLER_LIST = new HandlerList(); @@ -38,7 +39,7 @@ index 0000000000000000000000000000000000000000..c38c32ae349e094ffef84386607f4b9d + private boolean cancelled; + + @ApiStatus.Internal -+ public PlayerOpenSignEvent(final @NotNull Player editor, final @NotNull Sign sign, final @NotNull Side side, final @NotNull Cause cause) { ++ public PlayerOpenSignEvent(final Player editor, final Sign sign, final Side side, final Cause cause) { + super(editor); + this.sign = sign; + this.side = side; @@ -50,7 +51,6 @@ index 0000000000000000000000000000000000000000..c38c32ae349e094ffef84386607f4b9d + * + * @return {@link Sign} that was clicked + */ -+ @NotNull + public Sign getSign() { + return this.sign; + } @@ -61,7 +61,6 @@ index 0000000000000000000000000000000000000000..c38c32ae349e094ffef84386607f4b9d + * @return {@link Side} that was clicked + * @see Sign#getSide(Side) + */ -+ @NotNull + public Side getSide() { + return this.side; + } @@ -71,7 +70,7 @@ index 0000000000000000000000000000000000000000..c38c32ae349e094ffef84386607f4b9d + * + * @return the cause + */ -+ public @NotNull Cause getCause() { ++ public Cause getCause() { + return this.cause; + } + @@ -81,17 +80,15 @@ index 0000000000000000000000000000000000000000..c38c32ae349e094ffef84386607f4b9d + } + + @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; + } |