From 96e09e50c121f5a9066fe490b8f3a7a68b7ab54c Mon Sep 17 00:00:00 2001 From: Parker Hawke Date: Wed, 27 Feb 2019 14:15:48 -0500 Subject: [PATCH] Add love mode API to Animals --- src/main/java/org/bukkit/entity/Animals.java | 26 ++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/src/main/java/org/bukkit/entity/Animals.java b/src/main/java/org/bukkit/entity/Animals.java index 6e214bf4..12a2ab90 100644 --- a/src/main/java/org/bukkit/entity/Animals.java +++ b/src/main/java/org/bukkit/entity/Animals.java @@ -22,4 +22,30 @@ public interface Animals extends Ageable { * @param uuid new uuid, or null */ void setBreedCause(UUID uuid); + + /** + * Get whether or not this entity is in love mode and will produce + * offspring with another entity in love mode. Will return true if + * and only if {@link #getLoveModeTicks()} is greater than 0. + * + * @return true if in love mode, false otherwise + */ + boolean isLoveMode(); + + /** + * Get the amount of ticks remaining for this entity in love mode. + * If the entity is not in love mode, 0 will be returned. + * + * @return the remaining love mode ticks + */ + int getLoveModeTicks(); + + /** + * Set the amount of ticks for which this entity should be in love mode. + * Setting the love mode ticks to 600 is the equivalent of a player + * feeding the entity their breeding item of choice. + * + * @param ticks the love mode ticks. Must be positive + */ + void setLoveModeTicks(int ticks); }