fix(cheatenabler): keep the rare-recipe preference for belt statistics

The planner migration switched belt-signal upstream statistics to each item's
standard recipe. Capture the native RecipeProto.Explicit flag in the production
catalog and let the belt preset prefer explicit recipes again, which include the
rare-resource alternatives such as Graphene from Fire Ice and Diamond from
Kimberlite Ore. As before, explicit recipes that consume their own product
(X-ray Cracking and Reforming Refine) never supply an item, and natural items
stay raw. Proliferation modes now follow the selected recipe.
This commit is contained in:
soarqin committed 2026-10-25 22:01:05 +08:00
1 parent 6d86e1f5dd
commit a6225cf750
6 files changed
+51 -8

No files matched your search

@@ -69,7 +69,8 @@ public static class ProductionCatalogReader
recipe.Results.Length != recipe.ResultCounts.Length) continue;
recipes.Add(new ProductionRecipe(recipe.ID, MapCategory(recipe.Type), recipe.TimeSpend, recipe.productive,
PairFlows(recipe.Items, recipe.ItemCounts), PairFlows(recipe.Results, recipe.ResultCounts)));
PairFlows(recipe.Items, recipe.ItemCounts), PairFlows(recipe.Results, recipe.ResultCounts),
recipe.Explicit));
// Follow native maincraft selection (lowest result index, then recipe order), but skip recipes such as
// Reforming Refine that consume their own product and so cannot start its production chain.
for (var resultIndex = 0; resultIndex < recipe.Results.Length; resultIndex++)
+5 -1
View File
@@ -180,16 +180,20 @@ public sealed class ProductionRecipe
public ProductionRecipeCategory Category { get; }
public int TimeTicks { get; }
public bool Productive { get; }
// Native RecipeProto.Explicit, set for named recipes such as the rare-resource alternatives.
public bool Explicit { get; }
public IReadOnlyDictionary<int, double> Inputs { get; }
public IReadOnlyDictionary<int, double> Outputs { get; }
public ProductionRecipe(int id, ProductionRecipeCategory category, int timeTicks, bool productive,
IEnumerable<KeyValuePair<int, double>> inputs, IEnumerable<KeyValuePair<int, double>> outputs)
IEnumerable<KeyValuePair<int, double>> inputs, IEnumerable<KeyValuePair<int, double>> outputs,
bool explicitRecipe = false)
{
Id = id;
Category = category;
TimeTicks = timeTicks;
Productive = productive;
Explicit = explicitRecipe;
Inputs = CopyFlows(inputs);
Outputs = CopyFlows(outputs);
}