From db73a4b2cfabadf35e0438912679d03d9690f0ce Mon Sep 17 00:00:00 2001 From: Bukkit/Spigot Date: Thu, 2 Jul 2020 09:27:16 +1000 Subject: [PATCH] #507: Add hasDiscoveredRecipe() and getDiscoveredRecipes() By: Parker Hawke --- .../java/org/bukkit/entity/HumanEntity.java | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/paper-api/src/main/java/org/bukkit/entity/HumanEntity.java b/paper-api/src/main/java/org/bukkit/entity/HumanEntity.java index 19424479ca..abe3d91428 100644 --- a/paper-api/src/main/java/org/bukkit/entity/HumanEntity.java +++ b/paper-api/src/main/java/org/bukkit/entity/HumanEntity.java @@ -1,6 +1,7 @@ package org.bukkit.entity; import java.util.Collection; +import java.util.Set; import org.bukkit.GameMode; import org.bukkit.Location; import org.bukkit.Material; @@ -360,6 +361,23 @@ public interface HumanEntity extends LivingEntity, AnimalTamer, InventoryHolder */ public int undiscoverRecipes(@NotNull Collection recipes); + /** + * Check whether or not this entity has discovered the specified recipe. + * + * @param recipe the key of the recipe to check + * + * @return true if discovered, false otherwise + */ + public boolean hasDiscoveredRecipe(@NotNull NamespacedKey recipe); + + /** + * Get an immutable set of recipes this entity has discovered. + * + * @return all discovered recipes + */ + @NotNull + public Set getDiscoveredRecipes(); + /** * Gets the entity currently perched on the left shoulder or null if no * entity.