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;
}
use of net.minecraft.stats.ServerRecipeBook in project Denizen-For-Bukkit by DenizenScript.
the class PlayerHelperImpl method resendDiscoveredRecipes.
@Override
public void resendDiscoveredRecipes(Player player) {
ServerRecipeBook recipeBook = ((CraftPlayer) player).getHandle().getRecipeBook();
recipeBook.sendInitialRecipeBook(((CraftPlayer) player).getHandle());
}
use of net.minecraft.stats.ServerRecipeBook in project Denizen-For-Bukkit by DenizenScript.
the class PlayerHelperImpl method quietlyAddRecipe.
@Override
public void quietlyAddRecipe(Player player, NamespacedKey key) {
ServerRecipeBook recipeBook = ((CraftPlayer) player).getHandle().getRecipeBook();
Recipe<?> recipe = ItemHelperImpl.getNMSRecipe(key);
if (recipe == null) {
Debug.echoError("Cannot add recipe '" + key + "': it does not exist.");
return;
}
recipeBook.add(recipe);
recipeBook.addHighlight(recipe);
}
use of net.minecraft.stats.ServerRecipeBook in project Denizen-For-Bukkit by DenizenScript.
the class PlayerHelperImpl method resendDiscoveredRecipes.
@Override
public void resendDiscoveredRecipes(Player player) {
ServerRecipeBook recipeBook = ((CraftPlayer) player).getHandle().getRecipeBook();
recipeBook.sendInitialRecipeBook(((CraftPlayer) player).getHandle());
}
use of net.minecraft.stats.ServerRecipeBook in project Denizen-For-Bukkit by DenizenScript.
the class PlayerHelperImpl method quietlyAddRecipe.
@Override
public void quietlyAddRecipe(Player player, NamespacedKey key) {
ServerRecipeBook recipeBook = ((CraftPlayer) player).getHandle().getRecipeBook();
Recipe<?> recipe = ItemHelperImpl.getNMSRecipe(key);
if (recipe == null) {
Debug.echoError("Cannot add recipe '" + key + "': it does not exist.");
return;
}
recipeBook.add(recipe);
recipeBook.addHighlight(recipe);
}
Aggregations