From a6f495af8b9ad96e45b6ce19636345c4235cfbda Mon Sep 17 00:00:00 2001 From: Simon Brodtmann Date: Fri, 12 Dec 2025 18:36:15 +0100 Subject: [PATCH 1/2] Add Item:defaultImportLocation --- cf-lib/data/Item.lua | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/cf-lib/data/Item.lua b/cf-lib/data/Item.lua index 1cfffcf..5934a72 100644 --- a/cf-lib/data/Item.lua +++ b/cf-lib/data/Item.lua @@ -57,4 +57,11 @@ function Item:itemsPerRocket(count) return self end +--- Sets the default import location for space platforms +--- @param planetName string The name of the planet +function Item:defaultImportLocation(planetName) + self.prototype.default_import_location = planetName + return self +end + return Item \ No newline at end of file From 6de1a8f1c770a3bb4acb1f26ec1a7cad1b206359 Mon Sep 17 00:00:00 2001 From: Simon Brodtmann Date: Fri, 12 Dec 2025 18:36:25 +0100 Subject: [PATCH 2/2] Add Recipe:addCategory --- cf-lib/data/Recipe.lua | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/cf-lib/data/Recipe.lua b/cf-lib/data/Recipe.lua index 199005c..213aa14 100644 --- a/cf-lib/data/Recipe.lua +++ b/cf-lib/data/Recipe.lua @@ -187,6 +187,17 @@ function Recipe:removeResult(resultName) return self end +--- Adds an additional crafting category +--- @param categoryName string The name of the crafting category +function Recipe:addCategory(categoryName) + local categories = self.prototype.additional_categories or {} + self.prototype.additional_categories = categories + if not table.contains(categories, categoryName) then + table.insert(categories, categoryName) + end + return self +end + --- Adds the recipe to a technology --- @param technology string|table The name of the technology or the technology table function Recipe:unlockedByTechnology(technology)