aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/api/0301-Add-Mob-lookAt-API.patch
diff options
context:
space:
mode:
Diffstat (limited to 'patches/api/0301-Add-Mob-lookAt-API.patch')
-rw-r--r--patches/api/0301-Add-Mob-lookAt-API.patch99
1 files changed, 99 insertions, 0 deletions
diff --git a/patches/api/0301-Add-Mob-lookAt-API.patch b/patches/api/0301-Add-Mob-lookAt-API.patch
new file mode 100644
index 0000000000..26177f2369
--- /dev/null
+++ b/patches/api/0301-Add-Mob-lookAt-API.patch
@@ -0,0 +1,99 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: BillyGalbreath <[email protected]>
+Date: Fri, 14 May 2021 13:42:06 -0500
+Subject: [PATCH] Add Mob#lookAt API
+
+
+diff --git a/src/main/java/org/bukkit/entity/Mob.java b/src/main/java/org/bukkit/entity/Mob.java
+index 55c5227a340e34621160afc9fae3ea843492881d..07bedbc15ba2463d3c629ae68d229286d4033f79 100644
+--- a/src/main/java/org/bukkit/entity/Mob.java
++++ b/src/main/java/org/bukkit/entity/Mob.java
+@@ -26,6 +26,88 @@ public interface Mob extends LivingEntity, Lootable {
+ * @return True if mob is exposed to daylight
+ */
+ boolean isInDaylight();
++
++ /**
++ * Instruct this Mob to look at a specific Location
++ * <p>
++ * Useful when implementing custom mob goals
++ *
++ * @param location location to look at
++ */
++ void lookAt(@NotNull org.bukkit.Location location);
++
++ /**
++ * Instruct this Mob to look at a specific Location
++ * <p>
++ * Useful when implementing custom mob goals
++ *
++ * @param location location to look at
++ * @param headRotationSpeed head rotation speed
++ * @param maxHeadPitch max head pitch rotation
++ */
++ void lookAt(@NotNull org.bukkit.Location location, float headRotationSpeed, float maxHeadPitch);
++
++ /**
++ * Instruct this Mob to look at a specific Entity
++ * <p>
++ * If a LivingEntity, look at eye location
++ * <p>
++ * Useful when implementing custom mob goals
++ *
++ * @param entity entity to look at
++ */
++ void lookAt(@NotNull Entity entity);
++
++ /**
++ * Instruct this Mob to look at a specific Entity
++ * <p>
++ * If a LivingEntity, look at eye location
++ * <p>
++ * Useful when implementing custom mob goals
++ *
++ * @param entity entity to look at
++ * @param headRotationSpeed head rotation speed
++ * @param maxHeadPitch max head pitch rotation
++ */
++ void lookAt(@NotNull Entity entity, float headRotationSpeed, float maxHeadPitch);
++
++ /**
++ * Instruct this Mob to look at a specific position
++ * <p>
++ * Useful when implementing custom mob goals
++ *
++ * @param x x coordinate
++ * @param y y coordinate
++ * @param z z coordinate
++ */
++ void lookAt(double x, double y, double z);
++
++ /**
++ * Instruct this Mob to look at a specific position
++ * <p>
++ * Useful when implementing custom mob goals
++ *
++ * @param x x coordinate
++ * @param y y coordinate
++ * @param z z coordinate
++ * @param headRotationSpeed head rotation speed
++ * @param maxHeadPitch max head pitch rotation
++ */
++ void lookAt(double x, double y, double z, float headRotationSpeed, float maxHeadPitch);
++
++ /**
++ * Gets the head rotation speed
++ *
++ * @return the head rotation speed
++ */
++ int getHeadRotationSpeed();
++
++ /**
++ * Gets the max head pitch rotation
++ *
++ * @return the max head pitch rotation
++ */
++ int getMaxHeadPitch();
+ // Paper end
+ /**
+ * Instructs this Mob to set the specified LivingEntity as its target.