Table of Contents

Class CraftDataHandler

Namespace
Nautilus.Handlers
Assembly
Nautilus.dll
A handler class for adding and editing crafted items.
public static class CraftDataHandler
Inheritance
CraftDataHandler
Inherited Members

Methods

AddBuildable(TechType)

Allows you to add items to the buildable list.
public static void AddBuildable(TechType techType)

Parameters

techType TechType
The TechType which you want to add to the buildable list.

AddToGroup(TechGroup, TechCategory, TechType)

Allows you to add items to the game's internal grouping system. Required if you want to make buildable items show up in the Habitat Builder or show in the Blueprints Tab of the PDA.
public static void AddToGroup(TechGroup group, TechCategory category, TechType techType)

Parameters

group TechGroup
The TechGroup you want to add your TechType to.
category TechCategory
The TechCategory (in the TechGroup) you want to add your TechType to.
techType TechType
The TechType you want to add.

AddToGroup(TechGroup, TechCategory, TechType, TechType, bool)

Allows you to add items to the game's internal grouping system. Required if you want to make buildable items show up in the Habitat Builder or show in the Blueprints Tab of the PDA.
public static void AddToGroup(TechGroup group, TechCategory category, TechType techType, TechType target = TechType.None, bool after = true)

Parameters

group TechGroup
The TechGroup you want to add your TechType to.
category TechCategory
The TechCategory (in the TechGroup) you want to add your TechType to.
techType TechType
The TechType you want to add.
target TechType
The icon in the blueprints tab of the PDA will be added next to this item or at the end/beginning if not found.
after bool
Whether to append after (true) or insert before (false) the target, for sorting purposes.

ConvertToRecipeData(ITechData)

Converts the games ITechData into Nautilus RecipeData.
public static RecipeData ConvertToRecipeData(ITechData iTechData)

Parameters

iTechData ITechData

Returns

RecipeData

GetModdedRecipeData(TechType)

Safely accesses the crafting data from a modded item.

WARNING: This method is highly dependent on mod load order. Make sure your mod is loading after the mod whose RecipeData you are trying to access.
public static RecipeData GetModdedRecipeData(TechType techType)

Parameters

techType TechType
The TechType whose RecipeData you want to access.

Returns

RecipeData
The RecipeData from the modded item if it exists; Otherwise, returns null.

GetRecipeData(TechType)

Safely accesses the crafting data from any item.

WARNING: This method is highly dependent on mod load order. Make sure your mod is loading after the mod whose RecipeData you are trying to access.
public static RecipeData GetRecipeData(TechType techType)

Parameters

techType TechType
The TechType whose RecipeData you want to access.

Returns

RecipeData
Returns RecipeData if it exists; Otherwise, returns null.

RemoveFromGroup(TechGroup, TechCategory, TechType)

Allows you to remove an existing TechType from the game's internal group system.
public static void RemoveFromGroup(TechGroup group, TechCategory category, TechType techType)

Parameters

group TechGroup
The TechGroup in which the TechType is located.
category TechCategory
The TechCategory in which the TechType is located.
techType TechType
The TechType which you want to remove.

SetBackgroundType(TechType, BackgroundType)

Allows you to edit inventory background colors for TechTypes.

public static void SetBackgroundType(TechType techType, CraftData.BackgroundType backgroundColor)

Parameters

techType TechType
The TechType whose BackgroundType you want to edit.
backgroundColor CraftData.BackgroundType
The background color for that TechType.
See Also
CraftData.BackgroundType

SetCookedVariant(TechType, TechType)

Allows you to edit the cooked creature list, i.e. associate the unedible TechType to the cooked TechType.

Can be used for existing TechTypes too.

public static void SetCookedVariant(TechType uncooked, TechType cooked)

Parameters

uncooked TechType
The TechType whose cooked creature counterpart to edit.
cooked TechType
The cooked creature counterpart for that TechType.

SetCraftingTime(TechType, float)

Allows you to edit crafting times for TechTypes.

Can be used for existing TechTypes too.

public static void SetCraftingTime(TechType techType, float time)

Parameters

techType TechType
The TechType whose crafting time you want to edit.
time float
The crafting time, in seconds, for that TechType.

SetEatingSound(TechType, string)

Sets the eating sound for the provided TechType.
public static void SetEatingSound(TechType consumable, string soundPath)

Parameters

consumable TechType
The item being consumed during Survival.Eat(UnityEngine.GameObject).
soundPath string
The sound path.

Value values are - "event:/player/drink" - "event:/player/drink_stillsuit" - "event:/player/use_first_aid" - "event:/player/eat" (default)

SetEnergyCost(TechType, double)

Allows you to edit EnergyCost for TechTypes. Can be used for existing TechTypes too.

Careful: This has to be called after SetRecipeData(TechType, RecipeData).

public static void SetEnergyCost(TechType techType, double energyCost)

Parameters

techType TechType
The TechType wose EnergyCost you want to edit
energyCost double
The EnergyCost for that TechType.

SetEquipmentType(TechType, EquipmentType)

Allows you to edit EquipmentTypes for TechTypes.

Can be used for existing TechTypes too.

public static void SetEquipmentType(TechType techType, EquipmentType equipmentType)

Parameters

techType TechType
The TechType whose EqiupmentType you want to edit.
equipmentType EquipmentType
The EquipmentType for that TechType.

SetHarvestFinalCutBonus(TechType, int)

Allows you to edit how much additional slices/seeds are given upon last knife hit.

Can be used for existing TechTypes too.

public static void SetHarvestFinalCutBonus(TechType techType, int bonus)

Parameters

techType TechType
The TechType whose final cut bonus you want to edit.
bonus int
The number of additional slices/seeds you'll receive on last cut.

SetHarvestOutput(TechType, TechType)

Allows you to edit harvest output, i.e. what TechType you get when you "harvest" a TechType.

Can be used for existing TechTypes too.

public static void SetHarvestOutput(TechType techType, TechType harvestOutput)

Parameters

techType TechType
The TechType whose harvest output you want to edit.
harvestOutput TechType
The harvest output for that TechType.

SetHarvestType(TechType, HarvestType)

Allows you to edit how TechTypes are harvested.

Can be used for existing TechTypes too.

public static void SetHarvestType(TechType techType, HarvestType harvestType)

Parameters

techType TechType
The TechType whose HarvestType you want to edit.
harvestType HarvestType
The HarvestType for that TechType.

SetItemSize(TechType, int, int)

Allows you to edit item sizes for TechTypes.

Can be used for existing TechTypes too.

public static void SetItemSize(TechType techType, int x, int y)

Parameters

techType TechType
The TechType whose item size you want to edit.
x int
The width of the item
y int
The height of the item

SetItemSize(TechType, Vector2int)

Allows you to edit item sizes for TechTypes.

Can be used for existing TechTypes too.

public static void SetItemSize(TechType techType, Vector2int size)

Parameters

techType TechType
The TechType whose item size you want to edit.
size Vector2int
The item size for that TechType.

SetMaxCharge(TechType, double)

Allows you to edit MaxCharge for TechTypes. Can be used for existing TechTypes too.

Careful: This has to be called after SetRecipeData(TechType, RecipeData).

public static void SetMaxCharge(TechType techType, double maxCharge)

Parameters

techType TechType
The TechType whose MaxCharge you want to edit.
maxCharge double
The MaxCharge for that TechType.

SetQuickSlotType(TechType, QuickSlotType)

Allows you to edit QuickSlotType for TechTypes. Can be used for existing TechTypes too.

Careful: This has to be called after SetRecipeData(TechType, ITechData) and SetRecipeData(TechType, RecipeData).

public static void SetQuickSlotType(TechType techType, QuickSlotType slotType)

Parameters

techType TechType
The TechType whose QuickSlotType you want to edit.
slotType QuickSlotType
The QuickSlotType for that TechType.

SetRecipeData(TechType, ITechData)

Allows you to edit recipes, i.e. RecipeData for TechTypes.

Can be used for existing TechTypes too.

public static void SetRecipeData(TechType techType, ITechData techData)

Parameters

techType TechType
The TechType whose RecipeData you want to edit.
techData ITechData
The ITechData for that TechType.
See Also

SetRecipeData(TechType, RecipeData)

Allows you to edit recipes, i.e. RecipeData for TechTypes.

Can be used for existing TechTypes too.

public static void SetRecipeData(TechType techType, RecipeData recipeData)

Parameters

techType TechType
The TechType whose RecipeData you want to edit.
recipeData RecipeData
The RecipeData for that TechType.
See Also