Fix recipe being always null in PrepareItemCraftEvent from the api (#12237)
This commit is contained in:
@ -1725,6 +1725,7 @@ public final class CraftServer implements Server {
|
|||||||
|
|
||||||
if (recipe.isPresent()) {
|
if (recipe.isPresent()) {
|
||||||
RecipeHolder<CraftingRecipe> recipeCrafting = recipe.get();
|
RecipeHolder<CraftingRecipe> recipeCrafting = recipe.get();
|
||||||
|
inventoryCrafting.setCurrentRecipe(recipeCrafting);
|
||||||
if (craftResult.setRecipeUsed(craftPlayer.getHandle(), recipeCrafting)) {
|
if (craftResult.setRecipeUsed(craftPlayer.getHandle(), recipeCrafting)) {
|
||||||
itemstack = recipeCrafting.value().assemble(inventoryCrafting.asCraftInput(), craftWorld.getHandle().registryAccess());
|
itemstack = recipeCrafting.value().assemble(inventoryCrafting.asCraftInput(), craftWorld.getHandle().registryAccess());
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user