diff --git a/Nautilus/Assets/Gadgets/CraftingGadget.cs b/Nautilus/Assets/Gadgets/CraftingGadget.cs index 9d84135c3..30eea3e39 100644 --- a/Nautilus/Assets/Gadgets/CraftingGadget.cs +++ b/Nautilus/Assets/Gadgets/CraftingGadget.cs @@ -89,11 +89,8 @@ protected internal override void Build() CraftDataHandler.SetRecipeData(prefab.Info.TechType, RecipeData); - if (FabricatorType == CraftTree.Type.None) - { - InternalLogger.Log($"Prefab '{prefab.Info.ClassID}' was not automatically registered into a crafting tree."); - } - else + + if (FabricatorType is not CraftTree.Type.None) { if (StepsToFabricatorTab == null || StepsToFabricatorTab.Length == 0) { @@ -103,6 +100,11 @@ protected internal override void Build() { CraftTreeHandler.AddCraftingNode(FabricatorType, prefab.Info.TechType, StepsToFabricatorTab); } + + } + else if (!prefab.TryGetGadget(out ScanningGadget scanningGadget) || !scanningGadget.IsBuildable) + { + InternalLogger.Log($"Prefab '{prefab.Info.ClassID}' was not automatically registered into a crafting tree."); } if (CraftingTime >= 0f) diff --git a/Nautilus/Assets/Gadgets/ScanningGadget.cs b/Nautilus/Assets/Gadgets/ScanningGadget.cs index aa7c553b1..6fc595daa 100644 --- a/Nautilus/Assets/Gadgets/ScanningGadget.cs +++ b/Nautilus/Assets/Gadgets/ScanningGadget.cs @@ -14,7 +14,10 @@ namespace Nautilus.Assets.Gadgets; /// public class ScanningGadget : Gadget { - private bool _isBuildable; + /// + /// Classifies this item as buildable via the habitat builder. + /// + public bool IsBuildable { get; set; } /// /// The blueprint that must first be scanned or picked up to unlocked this item. @@ -184,7 +187,7 @@ public ScanningGadget WithPdaGroupCategoryBefore(TechGroup group, TechCategory c /// A reference to this instance after the operation has completed. public ScanningGadget SetBuildable(bool isBuildable = true) { - _isBuildable = isBuildable; + IsBuildable = isBuildable; return this; } @@ -320,7 +323,7 @@ protected internal override void Build() InternalLogger.Error($"Failed to add {prefab.Info.TechType.AsString()} to {GroupForPda}/{CategoryForPda} as it is not a registered combination."); } - if (_isBuildable) + if (IsBuildable) CraftDataHandler.AddBuildable(prefab.Info.TechType); }