From e1c30137fb1866a663878f0ead7435cb017a7c39 Mon Sep 17 00:00:00 2001 From: Bukkit/Spigot Date: Sun, 13 Jun 2021 08:37:51 +1000 Subject: [PATCH] #622: Add methods to check if item is the breed item for an entity By: Nathat23 --- .../main/java/org/bukkit/entity/Animals.java | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/paper-api/src/main/java/org/bukkit/entity/Animals.java b/paper-api/src/main/java/org/bukkit/entity/Animals.java index 9f4b36cef..235f4023b 100644 --- a/paper-api/src/main/java/org/bukkit/entity/Animals.java +++ b/paper-api/src/main/java/org/bukkit/entity/Animals.java @@ -1,6 +1,9 @@ package org.bukkit.entity; import java.util.UUID; +import org.bukkit.Material; +import org.bukkit.inventory.ItemStack; +import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; /** @@ -50,4 +53,24 @@ public interface Animals extends Breedable { * @param ticks the love mode ticks. Must be positive */ void setLoveModeTicks(int ticks); + + /** + * Check if the provided ItemStack is the correct item used for breeding + * this entity. + * + * @param stack ItemStack to check. + * @return if the provided ItemStack is the correct food item for this + * entity. + */ + boolean isBreedItem(@NotNull ItemStack stack); + + /** + * Check if the provided ItemStack is the correct item used for breeding + * this entity.. + * + * @param material Material to check. + * @return if the provided ItemStack is the correct food item for this + * entity. + */ + boolean isBreedItem(@NotNull Material material); }