From bcc7b10e0c103364e8850828e0c5587101b60aef Mon Sep 17 00:00:00 2001 From: Bukkit/Spigot Date: Sat, 20 Aug 2022 16:28:19 +1000 Subject: [PATCH] #755: Add more Warden methods By: Doc --- .../main/java/org/bukkit/entity/Warden.java | 70 ++++++++++++++++++- 1 file changed, 67 insertions(+), 3 deletions(-) diff --git a/paper-api/src/main/java/org/bukkit/entity/Warden.java b/paper-api/src/main/java/org/bukkit/entity/Warden.java index 25bbecc89b..3794db8867 100644 --- a/paper-api/src/main/java/org/bukkit/entity/Warden.java +++ b/paper-api/src/main/java/org/bukkit/entity/Warden.java @@ -1,6 +1,8 @@ package org.bukkit.entity; +import org.bukkit.Location; import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; /** * A Warden. @@ -13,7 +15,17 @@ public interface Warden extends Monster { * Anger is an integer from 0 to 150. Once a Warden reaches 80 anger at a * target it will actively pursue it. * - * @param entity target + * @return anger level + */ + int getAnger(); + + /** + * Gets the anger level of this warden. + * + * Anger is an integer from 0 to 150. Once a Warden reaches 80 anger at a + * target it will actively pursue it. + * + * @param entity target entity * @return anger level */ int getAnger(@NotNull Entity entity); @@ -21,7 +33,10 @@ public interface Warden extends Monster { /** * Increases the anger level of this warden. * - * @param entity target + * Anger is an integer from 0 to 150. Once a Warden reaches 80 anger at a + * target it will actively pursue it. + * + * @param entity target entity * @param increase number to increase by * @see #getAnger(org.bukkit.entity.Entity) */ @@ -30,9 +45,58 @@ public interface Warden extends Monster { /** * Sets the anger level of this warden. * - * @param entity target + * Anger is an integer from 0 to 150. Once a Warden reaches 80 anger at a + * target it will actively pursue it. + * + * @param entity target entity * @param anger new anger level * @see #getAnger(org.bukkit.entity.Entity) */ void setAnger(@NotNull Entity entity, int anger); + + /** + * Clears the anger level of this warden. + * + * @param entity target entity + */ + void clearAnger(@NotNull Entity entity); + + /** + * Gets the {@link LivingEntity} at which this warden is most angry. + * + * @return The target {@link LivingEntity} or null + */ + @Nullable + LivingEntity getEntityAngryAt(); + + /** + * Make the warden sense a disturbance in the force at the location given. + * + * @param location location of the disturbance + */ + void setDisturbanceLocation(@NotNull Location location); + + /** + * Get the level of anger of this warden. + * + * @return The level of anger + */ + @NotNull + AngerLevel getAngerLevel(); + + public enum AngerLevel { + + /** + * Anger level 0-39. + */ + CALM, + /** + * Anger level 40-79. + */ + AGITATED, + /** + * Anger level 80 or above. + */ + ANGRY; + } }