Finish converting all events to jspecify annotations
This commit is contained in:
parent
ea00be3aaa
commit
ba3c29b92e
82 changed files with 977 additions and 1103 deletions
|
@ -6,10 +6,10 @@ Subject: [PATCH] Add PlayerFailMoveEvent
|
|||
|
||||
diff --git a/src/main/java/io/papermc/paper/event/player/PlayerFailMoveEvent.java b/src/main/java/io/papermc/paper/event/player/PlayerFailMoveEvent.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..c848fa029bac07f80eef870c98eebc2596b90aed
|
||||
index 0000000000000000000000000000000000000000..c7380874f99cd2aa28a24bbb0dd3375e8842dd0d
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/io/papermc/paper/event/player/PlayerFailMoveEvent.java
|
||||
@@ -0,0 +1,118 @@
|
||||
@@ -0,0 +1,113 @@
|
||||
+package io.papermc.paper.event.player;
|
||||
+
|
||||
+import org.bukkit.Location;
|
||||
|
@ -17,11 +17,12 @@ index 0000000000000000000000000000000000000000..c848fa029bac07f80eef870c98eebc25
|
|||
+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;
|
||||
+
|
||||
+/**
|
||||
+ * Runs when a player attempts to move, but is prevented from doing so by the server
|
||||
+ */
|
||||
+@NullMarked
|
||||
+public class PlayerFailMoveEvent extends PlayerEvent {
|
||||
+
|
||||
+ private static final HandlerList HANDLER_LIST = new HandlerList();
|
||||
|
@ -33,8 +34,7 @@ index 0000000000000000000000000000000000000000..c848fa029bac07f80eef870c98eebc25
|
|||
+ private boolean logWarning;
|
||||
+
|
||||
+ @ApiStatus.Internal
|
||||
+ public PlayerFailMoveEvent(@NotNull Player player, @NotNull FailReason failReason, boolean allowed,
|
||||
+ boolean logWarning, @NotNull Location from, @NotNull Location to) {
|
||||
+ public PlayerFailMoveEvent(final Player player, final FailReason failReason, final boolean allowed, final boolean logWarning, final Location from, final Location to) {
|
||||
+ super(player);
|
||||
+ this.failReason = failReason;
|
||||
+ this.allowed = allowed;
|
||||
|
@ -48,7 +48,6 @@ index 0000000000000000000000000000000000000000..c848fa029bac07f80eef870c98eebc25
|
|||
+ *
|
||||
+ * @return The reason the movement was prevented
|
||||
+ */
|
||||
+ @NotNull
|
||||
+ public FailReason getFailReason() {
|
||||
+ return this.failReason;
|
||||
+ }
|
||||
|
@ -58,7 +57,6 @@ index 0000000000000000000000000000000000000000..c848fa029bac07f80eef870c98eebc25
|
|||
+ *
|
||||
+ * @return Location the player moved from
|
||||
+ */
|
||||
+ @NotNull
|
||||
+ public Location getFrom() {
|
||||
+ return this.from.clone();
|
||||
+ }
|
||||
|
@ -68,7 +66,6 @@ index 0000000000000000000000000000000000000000..c848fa029bac07f80eef870c98eebc25
|
|||
+ *
|
||||
+ * @return Location the player tried to move to
|
||||
+ */
|
||||
+ @NotNull
|
||||
+ public Location getTo() {
|
||||
+ return this.to.clone();
|
||||
+ }
|
||||
|
@ -87,7 +84,7 @@ index 0000000000000000000000000000000000000000..c848fa029bac07f80eef870c98eebc25
|
|||
+ *
|
||||
+ * @param allowed whether to bypass the check
|
||||
+ */
|
||||
+ public void setAllowed(boolean allowed) {
|
||||
+ public void setAllowed(final boolean allowed) {
|
||||
+ this.allowed = allowed;
|
||||
+ }
|
||||
+
|
||||
|
@ -105,17 +102,15 @@ index 0000000000000000000000000000000000000000..c848fa029bac07f80eef870c98eebc25
|
|||
+ *
|
||||
+ * @param logWarning whether to log warnings
|
||||
+ */
|
||||
+ public void setLogWarning(boolean logWarning) {
|
||||
+ public void setLogWarning(final boolean logWarning) {
|
||||
+ this.logWarning = logWarning;
|
||||
+ }
|
||||
+
|
||||
+ @NotNull
|
||||
+ @Override
|
||||
+ public HandlerList getHandlers() {
|
||||
+ return HANDLER_LIST;
|
||||
+ }
|
||||
+
|
||||
+ @NotNull
|
||||
+ public static HandlerList getHandlerList() {
|
||||
+ return HANDLER_LIST;
|
||||
+ }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue