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,20 +6,19 @@ Subject: [PATCH] Add PlayerSignCommandPreprocessEvent
diff --git a/src/main/java/io/papermc/paper/event/player/PlayerSignCommandPreprocessEvent.java b/src/main/java/io/papermc/paper/event/player/PlayerSignCommandPreprocessEvent.java
new file mode 100644
index 0000000000000000000000000000000000000000..dc774403749633a1bf8e8088b8c7b402b0e43863
index 0000000000000000000000000000000000000000..220f950ab804d756e89760c341aafe868b2b6ad0
--- /dev/null
+++ b/src/main/java/io/papermc/paper/event/player/PlayerSignCommandPreprocessEvent.java
@@ -0,0 +1,47 @@
+package io.papermc.paper.event.player;
+
+import java.util.Set;
+import org.bukkit.block.Sign;
+import org.bukkit.block.sign.Side;
+import org.bukkit.entity.Player;
+import org.bukkit.event.player.PlayerCommandPreprocessEvent;
+import org.jetbrains.annotations.ApiStatus;
+import org.jetbrains.annotations.NotNull;
+
+import java.util.Set;
+import org.jspecify.annotations.NullMarked;
+
+/**
+ * Called when a {@link Player} clicks a side on a sign that causes a command to run.
@ -27,13 +26,14 @@ index 0000000000000000000000000000000000000000..dc774403749633a1bf8e8088b8c7b402
+ * This command is run with elevated permissions which allows players to access commands on signs they wouldn't
+ * normally be able to run.
+ */
+@NullMarked
+public class PlayerSignCommandPreprocessEvent extends PlayerCommandPreprocessEvent {
+
+ private final Sign sign;
+ private final Side side;
+
+ @ApiStatus.Internal
+ public PlayerSignCommandPreprocessEvent(@NotNull Player player, @NotNull String message, @NotNull Set<Player> recipients, @NotNull Sign sign, @NotNull Side side) {
+ public PlayerSignCommandPreprocessEvent(final Player player, final String message, final Set<Player> recipients, final Sign sign, final Side side) {
+ super(player, message, recipients);
+ this.sign = sign;
+ this.side = side;
@ -44,7 +44,7 @@ index 0000000000000000000000000000000000000000..dc774403749633a1bf8e8088b8c7b402
+ *
+ * @return the sign
+ */
+ public @NotNull Sign getSign() {
+ public Sign getSign() {
+ return this.sign;
+ }
+
@ -53,7 +53,7 @@ index 0000000000000000000000000000000000000000..dc774403749633a1bf8e8088b8c7b402
+ *
+ * @return the sign side
+ */
+ public @NotNull Side getSide() {
+ public Side getSide() {
+ return this.side;
+ }
+}