From 3ea792555a8a3d81fee68878d57795daa4ad5450 Mon Sep 17 00:00:00 2001 From: jhqwqmc <2110242767@qq.com> Date: Sun, 16 Mar 2025 20:14:31 +0800 Subject: [PATCH] =?UTF-8?q?refactor(item-browser):=20=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ItemRecipeBrowserAdminCommand.java | 5 +- .../ItemRecipeBrowserPlayerCommand.java | 5 +- .../feature/ItemUsageBrowserAdminCommand.java | 2 +- .../ItemUsageBrowserPlayerCommand.java | 2 +- .../core/plugin/command/FlagKeys.java | 2 - .../gui/category/ItemBrowserManager.java | 2 +- .../gui/category/ItemBrowserManagerImpl.java | 66 +++++++++---------- 7 files changed, 38 insertions(+), 46 deletions(-) diff --git a/bukkit/src/main/java/net/momirealms/craftengine/bukkit/plugin/command/feature/ItemRecipeBrowserAdminCommand.java b/bukkit/src/main/java/net/momirealms/craftengine/bukkit/plugin/command/feature/ItemRecipeBrowserAdminCommand.java index 3899a67b0..e59b923aa 100644 --- a/bukkit/src/main/java/net/momirealms/craftengine/bukkit/plugin/command/feature/ItemRecipeBrowserAdminCommand.java +++ b/bukkit/src/main/java/net/momirealms/craftengine/bukkit/plugin/command/feature/ItemRecipeBrowserAdminCommand.java @@ -35,7 +35,6 @@ public class ItemRecipeBrowserAdminCommand extends BukkitCommandFeature assembleCommand(CommandManager manager, Command.Builder builder) { return builder - .flag(FlagKeys.BROWSE_FLAG) .required("player", MultiplePlayerSelectorParser.multiplePlayerSelectorParser(true)) .required("id", NamespacedKeyParser.namespacedKeyComponent().suggestionProvider(new SuggestionProvider<>() { @Override @@ -52,9 +51,7 @@ public class ItemRecipeBrowserAdminCommand extends BukkitCommandFeature> inRecipes = plugin().recipeManager().getRecipeByResult(itemId); if (!inRecipes.isEmpty()) { - plugin().itemBrowserManager().openRecipePage(serverPlayer, null, inRecipes, 0, 0); - } else if (context.flags().hasFlag(FlagKeys.BROWSE)) { - plugin().itemBrowserManager().openNoRecipePage(serverPlayer, itemId, null, 0); + plugin().itemBrowserManager().openRecipePage(serverPlayer, null, inRecipes, 0, 0, false); } else { handleFeedback(context, MessageConstants.COMMAND_ITEM_RECIPE_BROWSER_RECIPE_NO_FOUND); } diff --git a/bukkit/src/main/java/net/momirealms/craftengine/bukkit/plugin/command/feature/ItemRecipeBrowserPlayerCommand.java b/bukkit/src/main/java/net/momirealms/craftengine/bukkit/plugin/command/feature/ItemRecipeBrowserPlayerCommand.java index f65f90f5b..85f69db08 100644 --- a/bukkit/src/main/java/net/momirealms/craftengine/bukkit/plugin/command/feature/ItemRecipeBrowserPlayerCommand.java +++ b/bukkit/src/main/java/net/momirealms/craftengine/bukkit/plugin/command/feature/ItemRecipeBrowserPlayerCommand.java @@ -33,7 +33,6 @@ public class ItemRecipeBrowserPlayerCommand extends BukkitCommandFeature assembleCommand(CommandManager manager, Command.Builder builder) { return builder .senderType(Player.class) - .flag(FlagKeys.BROWSE_FLAG) .required("id", NamespacedKeyParser.namespacedKeyComponent().suggestionProvider(new SuggestionProvider<>() { @Override public @NonNull CompletableFuture> suggestionsFuture(@NonNull CommandContext context, @NonNull CommandInput input) { @@ -47,9 +46,7 @@ public class ItemRecipeBrowserPlayerCommand extends BukkitCommandFeature> inRecipes = plugin().recipeManager().getRecipeByResult(itemId); if (!inRecipes.isEmpty()) { - plugin().itemBrowserManager().openRecipePage(serverPlayer, null, inRecipes, 0, 0); - } else if (context.flags().hasFlag(FlagKeys.BROWSE)) { - plugin().itemBrowserManager().openNoRecipePage(serverPlayer, itemId, null, 0); + plugin().itemBrowserManager().openRecipePage(serverPlayer, null, inRecipes, 0, 0, false); } else { handleFeedback(context, MessageConstants.COMMAND_ITEM_RECIPE_BROWSER_RECIPE_NO_FOUND); } diff --git a/bukkit/src/main/java/net/momirealms/craftengine/bukkit/plugin/command/feature/ItemUsageBrowserAdminCommand.java b/bukkit/src/main/java/net/momirealms/craftengine/bukkit/plugin/command/feature/ItemUsageBrowserAdminCommand.java index b3c0cb244..ba80a1756 100644 --- a/bukkit/src/main/java/net/momirealms/craftengine/bukkit/plugin/command/feature/ItemUsageBrowserAdminCommand.java +++ b/bukkit/src/main/java/net/momirealms/craftengine/bukkit/plugin/command/feature/ItemUsageBrowserAdminCommand.java @@ -50,7 +50,7 @@ public class ItemUsageBrowserAdminCommand extends BukkitCommandFeature> inRecipes = plugin().recipeManager().getRecipeByIngredient(itemId); if (!inRecipes.isEmpty()) { - plugin().itemBrowserManager().openRecipePage(serverPlayer, null, inRecipes, 0, 0); + plugin().itemBrowserManager().openRecipePage(serverPlayer, null, inRecipes, 0, 0, false); } else { handleFeedback(context, MessageConstants.COMMAND_ITEM_USAGE_BROWSER_RECIPE_NO_FOUND); } diff --git a/bukkit/src/main/java/net/momirealms/craftengine/bukkit/plugin/command/feature/ItemUsageBrowserPlayerCommand.java b/bukkit/src/main/java/net/momirealms/craftengine/bukkit/plugin/command/feature/ItemUsageBrowserPlayerCommand.java index d552b51a1..abe4dbfae 100644 --- a/bukkit/src/main/java/net/momirealms/craftengine/bukkit/plugin/command/feature/ItemUsageBrowserPlayerCommand.java +++ b/bukkit/src/main/java/net/momirealms/craftengine/bukkit/plugin/command/feature/ItemUsageBrowserPlayerCommand.java @@ -45,7 +45,7 @@ public class ItemUsageBrowserPlayerCommand extends BukkitCommandFeature> inRecipes = plugin().recipeManager().getRecipeByIngredient(itemId); if (!inRecipes.isEmpty()) { - plugin().itemBrowserManager().openRecipePage(serverPlayer, null, inRecipes, 0, 0); + plugin().itemBrowserManager().openRecipePage(serverPlayer, null, inRecipes, 0, 0, false); } else { handleFeedback(context, MessageConstants.COMMAND_ITEM_USAGE_BROWSER_RECIPE_NO_FOUND); } diff --git a/core/src/main/java/net/momirealms/craftengine/core/plugin/command/FlagKeys.java b/core/src/main/java/net/momirealms/craftengine/core/plugin/command/FlagKeys.java index 6f55a828a..5cde8bd5c 100644 --- a/core/src/main/java/net/momirealms/craftengine/core/plugin/command/FlagKeys.java +++ b/core/src/main/java/net/momirealms/craftengine/core/plugin/command/FlagKeys.java @@ -7,6 +7,4 @@ public final class FlagKeys { public static final CommandFlag SILENT_FLAG = CommandFlag.builder("silent").withAliases("s").build(); public static final String TO_INVENTORY = "to-inventory"; public static final CommandFlag TO_INVENTORY_FLAG = CommandFlag.builder("to-inventory").build(); - public static final String BROWSE = "browse"; - public static final CommandFlag BROWSE_FLAG = CommandFlag.builder("browse").withAliases("b").build(); } diff --git a/core/src/main/java/net/momirealms/craftengine/core/plugin/gui/category/ItemBrowserManager.java b/core/src/main/java/net/momirealms/craftengine/core/plugin/gui/category/ItemBrowserManager.java index 9630e5f03..1a7dd0f63 100644 --- a/core/src/main/java/net/momirealms/craftengine/core/plugin/gui/category/ItemBrowserManager.java +++ b/core/src/main/java/net/momirealms/craftengine/core/plugin/gui/category/ItemBrowserManager.java @@ -35,7 +35,7 @@ public interface ItemBrowserManager extends Reloadable, ConfigSectionParser { void open(Player player); - void openRecipePage(Player player, Gui parentGui, List> recipes, int index, int depth); + void openRecipePage(Player player, Gui parentGui, List> recipes, int index, int depth, boolean canOpenNoRecipePage); void openNoRecipePage(Player player, Key result, Gui parentGui, int depth); diff --git a/core/src/main/java/net/momirealms/craftengine/core/plugin/gui/category/ItemBrowserManagerImpl.java b/core/src/main/java/net/momirealms/craftengine/core/plugin/gui/category/ItemBrowserManagerImpl.java index 379706da0..e1b1392b2 100644 --- a/core/src/main/java/net/momirealms/craftengine/core/plugin/gui/category/ItemBrowserManagerImpl.java +++ b/core/src/main/java/net/momirealms/craftengine/core/plugin/gui/category/ItemBrowserManagerImpl.java @@ -141,7 +141,7 @@ public class ItemBrowserManagerImpl implements ItemBrowserManager { return new ItemWithAction(item, (element, click) -> { click.cancel(); player.playSound(Constants.SOUND_CLICK_BUTTON); - openCategoryPage(click.clicker(), it.id(), element.gui()); + openCategoryPage(click.clicker(), it.id(), element.gui(), true); }); }).filter(Objects::nonNull).toList(); @@ -159,7 +159,7 @@ public class ItemBrowserManagerImpl implements ItemBrowserManager { .open(player); } - public void openCategoryPage(Player player, Key categoryId, Gui parentGui) { + public void openCategoryPage(Player player, Key categoryId, Gui parentGui, boolean canOpenNoRecipePage) { GuiLayout layout = new GuiLayout( "AAAAAAAAA", "AAAAAAAAA", @@ -227,7 +227,7 @@ public class ItemBrowserManagerImpl implements ItemBrowserManager { return new ItemWithAction(item, (element, click) -> { click.cancel(); player.playSound(Constants.SOUND_CLICK_BUTTON); - openCategoryPage(click.clicker(), subCategory.id(), element.gui()); + openCategoryPage(click.clicker(), subCategory.id(), element.gui(), canOpenNoRecipePage); }); } else { Key itemId = Key.of(it); @@ -245,7 +245,7 @@ public class ItemBrowserManagerImpl implements ItemBrowserManager { List> inRecipes = this.plugin.recipeManager().getRecipeByResult(itemId); player.playSound(Constants.SOUND_CLICK_BUTTON); if (!inRecipes.isEmpty()) { - openRecipePage(c.clicker(), e.gui(), inRecipes, 0, 0); + openRecipePage(c.clicker(), e.gui(), inRecipes, 0, 0, canOpenNoRecipePage); } else { openNoRecipePage(player, itemId, e.gui(), 0); } @@ -253,7 +253,7 @@ public class ItemBrowserManagerImpl implements ItemBrowserManager { List> inRecipes = this.plugin.recipeManager().getRecipeByIngredient(itemId); player.playSound(Constants.SOUND_CLICK_BUTTON); if (!inRecipes.isEmpty()) { - openRecipePage(c.clicker(), e.gui(), inRecipes, 0, 0); + openRecipePage(c.clicker(), e.gui(), inRecipes, 0, 0, canOpenNoRecipePage); } } }); @@ -294,7 +294,7 @@ public class ItemBrowserManagerImpl implements ItemBrowserManager { List> inRecipes = this.plugin.recipeManager().getRecipeByIngredient(result); player.playSound(Constants.SOUND_CLICK_BUTTON); if (!inRecipes.isEmpty()) { - openRecipePage(c.clicker(), e.gui(), inRecipes, 0, depth + 1); + openRecipePage(c.clicker(), e.gui(), inRecipes, 0, depth + 1, true); } } })) @@ -336,26 +336,26 @@ public class ItemBrowserManagerImpl implements ItemBrowserManager { } @Override - public void openRecipePage(Player player, Gui parentGui, List> recipes, int index, int depth) { + public void openRecipePage(Player player, Gui parentGui, List> recipes, int index, int depth, boolean canOpenNoRecipePage) { if (index >= recipes.size()) return; if (depth > MAX_RECIPE_DEPTH) return; Recipe recipe = recipes.get(index); Key recipeType = recipe.type(); if (recipeType == RecipeTypes.SHAPELESS || recipeType == RecipeTypes.SHAPED) { - openCraftingRecipePage(player, (CustomCraftingTableRecipe) recipe, parentGui, recipes, index, depth); + openCraftingRecipePage(player, (CustomCraftingTableRecipe) recipe, parentGui, recipes, index, depth, canOpenNoRecipePage); return; } if (recipeType == RecipeTypes.BLASTING || recipeType == RecipeTypes.CAMPFIRE_COOKING || recipeType == RecipeTypes.SMOKING || recipeType == RecipeTypes.SMELTING) { - openCookingRecipePage(player, (CustomCookingRecipe) recipe, parentGui, recipes, index, depth); + openCookingRecipePage(player, (CustomCookingRecipe) recipe, parentGui, recipes, index, depth, canOpenNoRecipePage); return; } if (recipeType == RecipeTypes.STONE_CUTTING) { - openStoneCuttingRecipePage(player, (CustomStoneCuttingRecipe) recipe, parentGui, recipes, index, depth); + openStoneCuttingRecipePage(player, (CustomStoneCuttingRecipe) recipe, parentGui, recipes, index, depth, canOpenNoRecipePage); return; } } - public void openStoneCuttingRecipePage(Player player, CustomStoneCuttingRecipe recipe, Gui parentGui, List> recipes, int index, int depth) { + public void openStoneCuttingRecipePage(Player player, CustomStoneCuttingRecipe recipe, Gui parentGui, List> recipes, int index, int depth, boolean canOpenNoRecipePage) { Key previous = index > 0 ? Constants.RECIPE_PREVIOUS_PAGE_AVAILABLE : Constants.RECIPE_PREVIOUS_PAGE_BLOCK; Key next = index + 1 < recipes.size() ? Constants.RECIPE_NEXT_PAGE_AVAILABLE : Constants.RECIPE_NEXT_PAGE_BLOCK; Key result = recipe.result().item().id(); @@ -386,7 +386,7 @@ public class ItemBrowserManagerImpl implements ItemBrowserManager { if (inRecipes == recipes) return; player.playSound(Constants.SOUND_CLICK_BUTTON); if (!inRecipes.isEmpty()) { - openRecipePage(c.clicker(), e.gui(), inRecipes, 0, 0); + openRecipePage(c.clicker(), e.gui(), inRecipes, 0, 0, canOpenNoRecipePage); } else { openNoRecipePage(player, result, e.gui(), 0); } @@ -395,7 +395,7 @@ public class ItemBrowserManagerImpl implements ItemBrowserManager { if (inRecipes == recipes) return; player.playSound(Constants.SOUND_CLICK_BUTTON); if (!inRecipes.isEmpty()) { - openRecipePage(c.clicker(), e.gui(), inRecipes, 0, 0); + openRecipePage(c.clicker(), e.gui(), inRecipes, 0, 0, canOpenNoRecipePage); } } })) @@ -422,7 +422,7 @@ public class ItemBrowserManagerImpl implements ItemBrowserManager { if (inRecipes == recipes) return; player.playSound(Constants.SOUND_CLICK_BUTTON); if (!inRecipes.isEmpty()) { - openRecipePage(c.clicker(), e.gui(), inRecipes, 0, 0); + openRecipePage(c.clicker(), e.gui(), inRecipes, 0, 0, canOpenNoRecipePage); } else { openNoRecipePage(player, e.item().id(), e.gui(), 0); } @@ -431,7 +431,7 @@ public class ItemBrowserManagerImpl implements ItemBrowserManager { if (inRecipes == recipes) return; player.playSound(Constants.SOUND_CLICK_BUTTON); if (!inRecipes.isEmpty()) { - openRecipePage(c.clicker(), e.gui(), inRecipes, 0, 0); + openRecipePage(c.clicker(), e.gui(), inRecipes, 0, 0, canOpenNoRecipePage); } } })) @@ -458,7 +458,7 @@ public class ItemBrowserManagerImpl implements ItemBrowserManager { c.cancel(); if (index + 1 < recipes.size()) { player.playSound(Constants.SOUND_CHANGE_PAGE, 0.25f, 1); - openRecipePage(player, parentGui, recipes, index + 1, depth); + openRecipePage(player, parentGui, recipes, index + 1, depth, canOpenNoRecipePage); } })) .addIngredient('<', GuiElement.constant(this.plugin.itemManager() @@ -471,7 +471,7 @@ public class ItemBrowserManagerImpl implements ItemBrowserManager { c.cancel(); if (index > 0) { player.playSound(Constants.SOUND_CHANGE_PAGE, 0.25f, 1); - openRecipePage(player, parentGui, recipes, index - 1, depth); + openRecipePage(player, parentGui, recipes, index - 1, depth, canOpenNoRecipePage); } })); @@ -488,7 +488,7 @@ public class ItemBrowserManagerImpl implements ItemBrowserManager { .open(player); } - public void openCookingRecipePage(Player player, CustomCookingRecipe recipe, Gui parentGui, List> recipes, int index, int depth) { + public void openCookingRecipePage(Player player, CustomCookingRecipe recipe, Gui parentGui, List> recipes, int index, int depth, boolean canOpenNoRecipePage) { Key previous = index > 0 ? Constants.RECIPE_PREVIOUS_PAGE_AVAILABLE : Constants.RECIPE_PREVIOUS_PAGE_BLOCK; Key next = index + 1 < recipes.size() ? Constants.RECIPE_NEXT_PAGE_AVAILABLE : Constants.RECIPE_NEXT_PAGE_BLOCK; Key result = recipe.result().item().id(); @@ -519,7 +519,7 @@ public class ItemBrowserManagerImpl implements ItemBrowserManager { if (inRecipes == recipes) return; player.playSound(Constants.SOUND_CLICK_BUTTON); if (!inRecipes.isEmpty()) { - openRecipePage(c.clicker(), e.gui(), inRecipes, 0, 0); + openRecipePage(c.clicker(), e.gui(), inRecipes, 0, 0, canOpenNoRecipePage); } else { openNoRecipePage(player, result, e.gui(), 0); } @@ -528,7 +528,7 @@ public class ItemBrowserManagerImpl implements ItemBrowserManager { if (inRecipes == recipes) return; player.playSound(Constants.SOUND_CLICK_BUTTON); if (!inRecipes.isEmpty()) { - openRecipePage(c.clicker(), e.gui(), inRecipes, 0, 0); + openRecipePage(c.clicker(), e.gui(), inRecipes, 0, 0, canOpenNoRecipePage); } } })) @@ -561,7 +561,7 @@ public class ItemBrowserManagerImpl implements ItemBrowserManager { if (inRecipes == recipes) return; player.playSound(Constants.SOUND_CLICK_BUTTON); if (!inRecipes.isEmpty()) { - openRecipePage(c.clicker(), e.gui(), inRecipes, 0, 0); + openRecipePage(c.clicker(), e.gui(), inRecipes, 0, 0, canOpenNoRecipePage); } else { openNoRecipePage(player, e.item().id(), e.gui(), 0); } @@ -570,7 +570,7 @@ public class ItemBrowserManagerImpl implements ItemBrowserManager { if (inRecipes == recipes) return; player.playSound(Constants.SOUND_CLICK_BUTTON); if (!inRecipes.isEmpty()) { - openRecipePage(c.clicker(), e.gui(), inRecipes, 0, 0); + openRecipePage(c.clicker(), e.gui(), inRecipes, 0, 0, canOpenNoRecipePage); } } })) @@ -597,7 +597,7 @@ public class ItemBrowserManagerImpl implements ItemBrowserManager { c.cancel(); if (index + 1 < recipes.size()) { player.playSound(Constants.SOUND_CHANGE_PAGE, 0.25f, 1); - openRecipePage(player, parentGui, recipes, index + 1, depth); + openRecipePage(player, parentGui, recipes, index + 1, depth, canOpenNoRecipePage); } })) .addIngredient('<', GuiElement.constant(this.plugin.itemManager() @@ -610,7 +610,7 @@ public class ItemBrowserManagerImpl implements ItemBrowserManager { c.cancel(); if (index > 0) { player.playSound(Constants.SOUND_CHANGE_PAGE, 0.25f, 1); - openRecipePage(player, parentGui, recipes, index - 1, depth); + openRecipePage(player, parentGui, recipes, index - 1, depth, canOpenNoRecipePage); } })); @@ -638,7 +638,7 @@ public class ItemBrowserManagerImpl implements ItemBrowserManager { .open(player); } - public void openCraftingRecipePage(Player player, CustomCraftingTableRecipe recipe, Gui parentGui, List> recipes, int index, int depth) { + public void openCraftingRecipePage(Player player, CustomCraftingTableRecipe recipe, Gui parentGui, List> recipes, int index, int depth, boolean canOpenNoRecipePage) { Key previous = index > 0 ? Constants.RECIPE_PREVIOUS_PAGE_AVAILABLE : Constants.RECIPE_PREVIOUS_PAGE_BLOCK; Key next = index + 1 < recipes.size() ? Constants.RECIPE_NEXT_PAGE_AVAILABLE : Constants.RECIPE_NEXT_PAGE_BLOCK; Key result = recipe.result().item().id(); @@ -664,7 +664,7 @@ public class ItemBrowserManagerImpl implements ItemBrowserManager { if (inRecipes == recipes) return; player.playSound(Constants.SOUND_CLICK_BUTTON); if (!inRecipes.isEmpty()) { - openRecipePage(c.clicker(), e.gui(), inRecipes, 0, 0); + openRecipePage(c.clicker(), e.gui(), inRecipes, 0, 0, canOpenNoRecipePage); } else { openNoRecipePage(player, result, e.gui(), 0); } @@ -673,7 +673,7 @@ public class ItemBrowserManagerImpl implements ItemBrowserManager { if (inRecipes == recipes) return; player.playSound(Constants.SOUND_CLICK_BUTTON); if (!inRecipes.isEmpty()) { - openRecipePage(c.clicker(), e.gui(), inRecipes, 0, 0); + openRecipePage(c.clicker(), e.gui(), inRecipes, 0, 0, canOpenNoRecipePage); } } })) @@ -710,7 +710,7 @@ public class ItemBrowserManagerImpl implements ItemBrowserManager { c.cancel(); if (index + 1 < recipes.size()) { player.playSound(Constants.SOUND_CHANGE_PAGE, 0.25f, 1); - openRecipePage(player, parentGui, recipes, index + 1, depth); + openRecipePage(player, parentGui, recipes, index + 1, depth, canOpenNoRecipePage); } })) .addIngredient('<', GuiElement.constant(this.plugin.itemManager() @@ -723,7 +723,7 @@ public class ItemBrowserManagerImpl implements ItemBrowserManager { c.cancel(); if (index > 0) { player.playSound(Constants.SOUND_CHANGE_PAGE, 0.25f, 1); - openRecipePage(player, parentGui, recipes, index - 1, depth); + openRecipePage(player, parentGui, recipes, index - 1, depth, canOpenNoRecipePage); } })); @@ -756,7 +756,7 @@ public class ItemBrowserManagerImpl implements ItemBrowserManager { if (inRecipes == recipes) return; player.playSound(Constants.SOUND_CLICK_BUTTON); if (!inRecipes.isEmpty()) { - openRecipePage(c.clicker(), e.gui(), inRecipes, 0, 0); + openRecipePage(c.clicker(), e.gui(), inRecipes, 0, 0, canOpenNoRecipePage); } else { openNoRecipePage(player, e.item().id(), e.gui(), 0); } @@ -765,7 +765,7 @@ public class ItemBrowserManagerImpl implements ItemBrowserManager { if (inRecipes == recipes) return; player.playSound(Constants.SOUND_CLICK_BUTTON); if (!inRecipes.isEmpty()) { - openRecipePage(c.clicker(), e.gui(), inRecipes, 0, 0); + openRecipePage(c.clicker(), e.gui(), inRecipes, 0, 0, canOpenNoRecipePage); } } })); @@ -799,7 +799,7 @@ public class ItemBrowserManagerImpl implements ItemBrowserManager { if (inRecipes == recipes) return; player.playSound(Constants.SOUND_CLICK_BUTTON); if (!inRecipes.isEmpty()) { - openRecipePage(c.clicker(), e.gui(), inRecipes, 0, 0); + openRecipePage(c.clicker(), e.gui(), inRecipes, 0, 0, canOpenNoRecipePage); } else { openNoRecipePage(player, e.item().id(), e.gui(), 0); } @@ -808,7 +808,7 @@ public class ItemBrowserManagerImpl implements ItemBrowserManager { if (inRecipes == recipes) return; player.playSound(Constants.SOUND_CLICK_BUTTON); if (!inRecipes.isEmpty()) { - openRecipePage(c.clicker(), e.gui(), inRecipes, 0, 0); + openRecipePage(c.clicker(), e.gui(), inRecipes, 0, 0, canOpenNoRecipePage); } } }));