Search in sources :

Example 6 with ServerRecipeBook

use of net.minecraft.stats.ServerRecipeBook in project Denizen-For-Bukkit by DenizenScript.

the class EntityHelperImpl method getDiscoveredRecipes.

public List<String> getDiscoveredRecipes(Player player) {
    try {
        ServerRecipeBook book = ((CraftPlayer) player).getHandle().getRecipeBook();
        Set<ResourceLocation> set = (Set<ResourceLocation>) RECIPE_BOOK_DISCOVERED_SET.get(book);
        List<String> output = new ArrayList<>();
        for (ResourceLocation key : set) {
            output.add(key.toString());
        }
        return output;
    } catch (Throwable ex) {
        Debug.echoError(ex);
    }
    return null;
}
Also used : ServerRecipeBook(net.minecraft.stats.ServerRecipeBook) ResourceLocation(net.minecraft.resources.ResourceLocation)

Aggregations

ServerRecipeBook (net.minecraft.stats.ServerRecipeBook)6 ResourceLocation (net.minecraft.resources.ResourceLocation)2