aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/api/0377-Player-Entity-Tracking-Events.patch
diff options
context:
space:
mode:
Diffstat (limited to 'patches/api/0377-Player-Entity-Tracking-Events.patch')
-rw-r--r--patches/api/0377-Player-Entity-Tracking-Events.patch26
1 files changed, 11 insertions, 15 deletions
diff --git a/patches/api/0377-Player-Entity-Tracking-Events.patch b/patches/api/0377-Player-Entity-Tracking-Events.patch
index 3dfa72c922..ff550d451b 100644
--- a/patches/api/0377-Player-Entity-Tracking-Events.patch
+++ b/patches/api/0377-Player-Entity-Tracking-Events.patch
@@ -6,10 +6,10 @@ Subject: [PATCH] Player Entity Tracking Events
diff --git a/src/main/java/io/papermc/paper/event/player/PlayerTrackEntityEvent.java b/src/main/java/io/papermc/paper/event/player/PlayerTrackEntityEvent.java
new file mode 100644
-index 0000000000000000000000000000000000000000..356f8933a7715b4fc123e3a4879bb2cd085835c5
+index 0000000000000000000000000000000000000000..0e37c8c94a77f6f1c2c4f5290722ca02d76ab924
--- /dev/null
+++ b/src/main/java/io/papermc/paper/event/player/PlayerTrackEntityEvent.java
-@@ -0,0 +1,62 @@
+@@ -0,0 +1,60 @@
+package io.papermc.paper.event.player;
+
+import org.bukkit.entity.Entity;
@@ -18,7 +18,7 @@ index 0000000000000000000000000000000000000000..356f8933a7715b4fc123e3a4879bb2cd
+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;
+
+/**
+ * Is called when a {@link Player} tracks an {@link Entity}.
@@ -28,6 +28,7 @@ index 0000000000000000000000000000000000000000..356f8933a7715b4fc123e3a4879bb2cd
+ * Adding or removing entities from the world at the point in time this event is called is completely
+ * unsupported and should be avoided.
+ */
++@NullMarked
+public class PlayerTrackEntityEvent extends PlayerEvent implements Cancellable {
+
+ private static final HandlerList HANDLER_LIST = new HandlerList();
@@ -36,7 +37,7 @@ index 0000000000000000000000000000000000000000..356f8933a7715b4fc123e3a4879bb2cd
+ private boolean cancelled;
+
+ @ApiStatus.Internal
-+ public PlayerTrackEntityEvent(@NotNull Player player, @NotNull Entity entity) {
++ public PlayerTrackEntityEvent(final Player player, final Entity entity) {
+ super(player);
+ this.entity = entity;
+ }
@@ -46,7 +47,6 @@ index 0000000000000000000000000000000000000000..356f8933a7715b4fc123e3a4879bb2cd
+ *
+ * @return the entity tracked
+ */
-+ @NotNull
+ public Entity getEntity() {
+ return this.entity;
+ }
@@ -57,16 +57,14 @@ index 0000000000000000000000000000000000000000..356f8933a7715b4fc123e3a4879bb2cd
+ }
+
+ @Override
-+ public void setCancelled(boolean cancel) {
++ public void setCancelled(final boolean cancel) {
+ this.cancelled = cancel;
+ }
+
-+ @NotNull
+ public static HandlerList getHandlerList() {
+ return HANDLER_LIST;
+ }
+
-+ @NotNull
+ @Override
+ public HandlerList getHandlers() {
+ return HANDLER_LIST;
@@ -74,10 +72,10 @@ index 0000000000000000000000000000000000000000..356f8933a7715b4fc123e3a4879bb2cd
+}
diff --git a/src/main/java/io/papermc/paper/event/player/PlayerUntrackEntityEvent.java b/src/main/java/io/papermc/paper/event/player/PlayerUntrackEntityEvent.java
new file mode 100644
-index 0000000000000000000000000000000000000000..c573eeaeb599ca717b09f9fd3f106a4800e9c386
+index 0000000000000000000000000000000000000000..30e01ffc8b0d4a8e43a046d85f1903cc20e0e84d
--- /dev/null
+++ b/src/main/java/io/papermc/paper/event/player/PlayerUntrackEntityEvent.java
-@@ -0,0 +1,48 @@
+@@ -0,0 +1,46 @@
+package io.papermc.paper.event.player;
+
+import org.bukkit.entity.Entity;
@@ -85,7 +83,7 @@ index 0000000000000000000000000000000000000000..c573eeaeb599ca717b09f9fd3f106a48
+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;
+
+/**
+ * Is called when a {@link Player} untracks an {@link Entity}.
@@ -93,6 +91,7 @@ index 0000000000000000000000000000000000000000..c573eeaeb599ca717b09f9fd3f106a48
+ * Adding or removing entities from the world at the point in time this event is called is completely
+ * unsupported and should be avoided.
+ */
++@NullMarked
+public class PlayerUntrackEntityEvent extends PlayerEvent {
+
+ private static final HandlerList HANDLER_LIST = new HandlerList();
@@ -100,7 +99,7 @@ index 0000000000000000000000000000000000000000..c573eeaeb599ca717b09f9fd3f106a48
+ private final Entity entity;
+
+ @ApiStatus.Internal
-+ public PlayerUntrackEntityEvent(@NotNull Player player, @NotNull Entity entity) {
++ public PlayerUntrackEntityEvent(final Player player, final Entity entity) {
+ super(player);
+ this.entity = entity;
+ }
@@ -110,17 +109,14 @@ index 0000000000000000000000000000000000000000..c573eeaeb599ca717b09f9fd3f106a48
+ *
+ * @return the entity untracked
+ */
-+ @NotNull
+ public Entity getEntity() {
+ return this.entity;
+ }
+
-+ @NotNull
+ public static HandlerList getHandlerList() {
+ return HANDLER_LIST;
+ }
+
-+ @NotNull
+ @Override
+ public HandlerList getHandlers() {
+ return HANDLER_LIST;