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(JsonValue)

Converts the Games JsonValue data into Nautilus RecipeData.
public static RecipeData ConvertToRecipeData(JsonValue techData)

Parameters

techData JsonValue

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 a Modded or Vanilla 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
The RecipeData from the item 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

SetColdResistance(TechType, int)

Allows you to edit the Cold Resistance of a TechType.

Can be used for existing TechTypes too.

public static void SetColdResistance(TechType uncooked, int resistance)

Parameters

uncooked TechType
The TechType whose Cold Resistance to edit.
resistance int
The Cold Resistance for that TechType.

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.

SetDropSound(TechType, string)

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

Parameters

consumable TechType
The item to add the new drop sound to.
soundPath string
The sound path. A list of all sound paths can be viewed on this page.

The default sound is "event:/tools/pda/drop_item".

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.

Valid 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.

SetEnergyCost(TechType, float)

Sets the energy cost.
public static void SetEnergyCost(TechType techType, float energyCost)

Parameters

techType TechType
The TechType whose EnergyCost you want to edit.
energyCost float
The energy cost.

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.

SetIngredients(TechType, ICollection<Ingredient>)

Allows you to edit recipes for TechTypes.

Can be used for existing TechTypes too.

public static void SetIngredients(TechType techType, ICollection<Ingredient> ingredients)

Parameters

techType TechType
The TechType whose RecipeData you want to edit.
ingredients ICollection<Ingredient>
The collection of Ingredients for that TechType.
See Also
Ingredient

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.

SetLinkedItems(TechType, ICollection<TechType>)

Allows you to edit Linked Items for TechTypes.

Can be used for existing TechTypes too.

public static void SetLinkedItems(TechType techType, ICollection<TechType> linkedItems)

Parameters

techType TechType
The TechType whose RecipeData you want to edit.
linkedItems ICollection<TechType>
The collection of Ingredients for that TechType.
See Also
Ingredient

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.

SetMaxCharge(TechType, float)

Sets the maximum charge.
public static void SetMaxCharge(TechType techType, float maxCharge)

Parameters

techType TechType
The TechType whose MaxCharge you want to edit.
maxCharge float
The maximum charge.

SetPickupSound(TechType, string)

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

Parameters

consumable TechType
The item to add the new pickup sound to.
soundPath string
The sound path. A list of all sound paths can be viewed on this page.

The default sound is "event:/loot/pickup_default".

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, 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, RecipeData)

Allows you to add or edit 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