aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/api/0032-EntityPathfindEvent.patch
diff options
context:
space:
mode:
Diffstat (limited to 'patches/api/0032-EntityPathfindEvent.patch')
-rw-r--r--patches/api/0032-EntityPathfindEvent.patch26
1 files changed, 11 insertions, 15 deletions
diff --git a/patches/api/0032-EntityPathfindEvent.patch b/patches/api/0032-EntityPathfindEvent.patch
index 3586652e5c..e6ee2e1f3f 100644
--- a/patches/api/0032-EntityPathfindEvent.patch
+++ b/patches/api/0032-EntityPathfindEvent.patch
@@ -7,10 +7,10 @@ Fires when an Entity decides to start moving to a location.
diff --git a/src/main/java/com/destroystokyo/paper/event/entity/EntityPathfindEvent.java b/src/main/java/com/destroystokyo/paper/event/entity/EntityPathfindEvent.java
new file mode 100644
-index 0000000000000000000000000000000000000000..8267e8f1f0ade29a284831069e1268ee4b29e109
+index 0000000000000000000000000000000000000000..2dd25136d81624025244a82de119fbecd0d7224c
--- /dev/null
+++ b/src/main/java/com/destroystokyo/paper/event/entity/EntityPathfindEvent.java
-@@ -0,0 +1,87 @@
+@@ -0,0 +1,83 @@
+package com.destroystokyo.paper.event.entity;
+
+import org.bukkit.Location;
@@ -19,8 +19,8 @@ index 0000000000000000000000000000000000000000..8267e8f1f0ade29a284831069e1268ee
+import org.bukkit.event.HandlerList;
+import org.bukkit.event.entity.EntityEvent;
+import org.jetbrains.annotations.ApiStatus;
-+import org.jetbrains.annotations.NotNull;
-+import org.jetbrains.annotations.Nullable;
++import org.jspecify.annotations.NullMarked;
++import org.jspecify.annotations.Nullable;
+
+/**
+ * Fired when an Entity decides to start moving towards a location.
@@ -28,16 +28,17 @@ index 0000000000000000000000000000000000000000..8267e8f1f0ade29a284831069e1268ee
+ * This event does not fire for the entities actual movement. Only when it
+ * is choosing to start moving to a location.
+ */
++@NullMarked
+public class EntityPathfindEvent extends EntityEvent implements Cancellable {
+
+ private static final HandlerList HANDLER_LIST = new HandlerList();
+
-+ @Nullable private final Entity targetEntity;
-+ @NotNull private final Location location;
++ private final @Nullable Entity targetEntity;
++ private final Location location;
+ private boolean cancelled;
+
+ @ApiStatus.Internal
-+ public EntityPathfindEvent(@NotNull Entity entity, @NotNull Location location, @Nullable Entity targetEntity) {
++ public EntityPathfindEvent(final Entity entity, final Location location, final @Nullable Entity targetEntity) {
+ super(entity);
+ this.targetEntity = targetEntity;
+ this.location = location;
@@ -48,7 +49,6 @@ index 0000000000000000000000000000000000000000..8267e8f1f0ade29a284831069e1268ee
+ *
+ * @return The Entity that is pathfinding.
+ */
-+ @NotNull
+ public Entity getEntity() {
+ return this.entity;
+ }
@@ -56,12 +56,11 @@ index 0000000000000000000000000000000000000000..8267e8f1f0ade29a284831069e1268ee
+ /**
+ * If the Entity is trying to pathfind to an entity, this is the entity in relation.
+ * <br>
-+ * Otherwise this will return {@code null}.
++ * Otherwise, this will return {@code null}.
+ *
+ * @return The entity target or {@code null}
+ */
-+ @Nullable
-+ public Entity getTargetEntity() {
++ public @Nullable Entity getTargetEntity() {
+ return this.targetEntity;
+ }
+
@@ -72,7 +71,6 @@ index 0000000000000000000000000000000000000000..8267e8f1f0ade29a284831069e1268ee
+ *
+ * @return Location of where the entity is trying to pathfind to.
+ */
-+ @NotNull
+ public Location getLoc() {
+ return this.location.clone();
+ }
@@ -83,17 +81,15 @@ index 0000000000000000000000000000000000000000..8267e8f1f0ade29a284831069e1268ee
+ }
+
+ @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;
+ }