Fix recipe being always null in PrepareItemCraftEvent from the api (#12237)

This commit is contained in:
Lulu13022002
2025-03-08 05:11:12 +01:00
committed by GitHub
parent 0a4eb8f3bb
commit 7a3d0c4e98

View File

@ -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());
} }