package net.minecraft.world.inventory; import net.minecraft.recipebook.ServerPlaceRecipe; import net.minecraft.server.level.ServerPlayer; import net.minecraft.world.entity.player.StackedContents; import net.minecraft.world.item.crafting.Recipe; import net.minecraft.world.item.crafting.RecipeHolder; import net.minecraft.world.item.crafting.RecipeInput; public abstract class RecipeBookMenu> extends AbstractContainerMenu { public RecipeBookMenu(MenuType menuType, int containerId) { super(menuType, containerId); } public void handlePlacement(boolean placeAll, RecipeHolder recipe, ServerPlayer player) { RecipeHolder recipeHolder = (RecipeHolder)recipe; this.beginPlacingRecipe(); try { new ServerPlaceRecipe<>(this).recipeClicked(player, recipeHolder, placeAll); } finally { this.finishPlacingRecipe((RecipeHolder)recipe); } } protected void beginPlacingRecipe() { } protected void finishPlacingRecipe(RecipeHolder recipe) { } public abstract void fillCraftSlotsStackedContents(StackedContents itemHelper); public abstract void clearCraftingContent(); public abstract boolean recipeMatches(RecipeHolder recipe); public abstract int getResultSlotIndex(); public abstract int getGridWidth(); public abstract int getGridHeight(); public abstract int getSize(); public abstract RecipeBookType getRecipeBookType(); public abstract boolean shouldMoveToInventory(int slotIndex); }