From dfc11648399fb079ac8f6e8fb8725be46a5895e0 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 29 Mar 2026 18:12:01 +0000 Subject: [PATCH] chore: finalize recipe book support polish Agent-Logs-Url: https://github.com/MCCTeam/Minecraft-Console-Client/sessions/00c8527f-5755-43c1-8916-8d571d28860b Co-authored-by: milutinke <441903+milutinke@users.noreply.github.com> --- MinecraftClient/Commands/RecipeBook.cs | 10 +--------- MinecraftClient/McClient.cs | 2 +- MinecraftClient/Protocol/Handlers/Protocol18.cs | 2 ++ 3 files changed, 4 insertions(+), 10 deletions(-) diff --git a/MinecraftClient/Commands/RecipeBook.cs b/MinecraftClient/Commands/RecipeBook.cs index b51d211b..24a56a86 100644 --- a/MinecraftClient/Commands/RecipeBook.cs +++ b/MinecraftClient/Commands/RecipeBook.cs @@ -87,20 +87,12 @@ namespace MinecraftClient.Commands if (handler.GetActiveRecipeBookInventory() is null) return r.SetAndReturn(CmdResult.Status.Fail, Translations.cmd_recipebook_no_active_inventory); - string normalizedRecipeId = NormalizeRecipeId(recipeId); + string normalizedRecipeId = McClient.NormalizeRecipeId(recipeId); string successMessage = string.Format(makeAll ? Translations.cmd_recipebook_craftall_sent : Translations.cmd_recipebook_craft_sent, normalizedRecipeId); return handler.SendPlaceRecipe(recipeId, makeAll) ? r.SetAndReturn(CmdResult.Status.Done, successMessage) : r.SetAndReturn(CmdResult.Status.Fail, string.Format(Translations.cmd_recipebook_craft_failed, normalizedRecipeId)); } - - private static string NormalizeRecipeId(string recipeId) - { - string trimmedRecipeId = recipeId.Trim(); - return trimmedRecipeId.Contains(':') - ? trimmedRecipeId - : "minecraft:" + trimmedRecipeId; - } } } diff --git a/MinecraftClient/McClient.cs b/MinecraftClient/McClient.cs index 751b79e6..906eff74 100644 --- a/MinecraftClient/McClient.cs +++ b/MinecraftClient/McClient.cs @@ -4173,7 +4173,7 @@ namespace MinecraftClient } } - private static string NormalizeRecipeId(string recipeId) + internal static string NormalizeRecipeId(string recipeId) { string trimmedRecipeId = recipeId.Trim(); if (trimmedRecipeId.Length == 0) diff --git a/MinecraftClient/Protocol/Handlers/Protocol18.cs b/MinecraftClient/Protocol/Handlers/Protocol18.cs index c5636cd1..e6518c7b 100644 --- a/MinecraftClient/Protocol/Handlers/Protocol18.cs +++ b/MinecraftClient/Protocol/Handlers/Protocol18.cs @@ -3200,6 +3200,8 @@ namespace MinecraftClient.Protocol.Handlers private bool SkipRecipeBookSettings(Queue packetData) { + // MC 1.13 uses 4 booleans for the crafting/smelting recipe book states. + // MC 1.14+ expands this to 8 booleans by adding blast furnace and smoker states. int boolCount = protocolVersion >= MC_1_14_Version ? 8 : 4; if (packetData.Count < boolCount) return false;