Crafting revamp
This commit is contained in:
@@ -43,8 +43,9 @@ public class CraftingHandler
|
||||
// Build ingredient hash lookup for recipe discovery
|
||||
foreach (var recipe in recipes)
|
||||
{
|
||||
var hash = GetIngredientHash(recipe.Ingredients.OrderBy(i => i.SlotOrder).ToList());
|
||||
var hash = GetIngredientHash(recipe.Ingredients.ToList());
|
||||
_ingredientHashToRecipeId[hash] = recipe.Id;
|
||||
_log.LogDebug("Recipe {Name} (ID {Id}) hash: {Hash}", recipe.Name, recipe.Id, hash);
|
||||
}
|
||||
|
||||
_recipesLoaded = true;
|
||||
@@ -143,8 +144,13 @@ public class CraftingHandler
|
||||
var sortedIngredients = ingredients.OrderBy(i => i.ItemDefinitionId).ThenBy(i => i.Quantity).ToList();
|
||||
var hash = GetIngredientHashFromInput(sortedIngredients);
|
||||
|
||||
_log.LogInformation("Discovery attempt - Hash: {Hash}, SkillFilter: {Skill}, Ingredients: {Ing}",
|
||||
hash, skillTypeFilter, string.Join(", ", ingredients.Select(i => $"{i.ItemDefinitionId}x{i.Quantity}")));
|
||||
|
||||
if (!_ingredientHashToRecipeId.TryGetValue(hash, out var recipeId))
|
||||
{
|
||||
_log.LogInformation("No recipe found for hash {Hash}. Known hashes: {Hashes}",
|
||||
hash, string.Join(", ", _ingredientHashToRecipeId.Keys.Take(10)));
|
||||
return (null, false, "No recipe found for these ingredients");
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user