{"id":16122025,"url":"https://github.com/foxcapades/vsmod-thrifty-smithing","last_synced_at":"2026-02-17T12:03:38.231Z","repository":{"id":254123384,"uuid":"845554652","full_name":"Foxcapades/vsmod-thrifty-smithing","owner":"Foxcapades","description":"Thrifty Smithing mod for the game Vintage Story","archived":false,"fork":false,"pushed_at":"2024-10-25T00:58:30.000Z","size":164,"stargazers_count":0,"open_issues_count":2,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-10T00:10:50.090Z","etag":null,"topics":["game","mod","smithing","vintage-story","vintagestory","vintagestory-mod"],"latest_commit_sha":null,"homepage":"https://mods.vintagestory.at/thriftysmithing","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Foxcapades.png","metadata":{"files":{"readme":"readme.adoc","changelog":null,"contributing":null,"funding":null,"license":"license","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-08-21T13:27:01.000Z","updated_at":"2024-10-25T00:58:26.000Z","dependencies_parsed_at":"2024-10-27T18:12:30.673Z","dependency_job_id":"5f0cb070-d8ed-4543-bcfe-1faef222d32e","html_url":"https://github.com/Foxcapades/vsmod-thrifty-smithing","commit_stats":{"total_commits":32,"total_committers":1,"mean_commits":32.0,"dds":0.0,"last_synced_commit":"6f2b6a9b03d2823ee616314f4cd40753572b2bcc"},"previous_names":["foxcapades/vsmod-thrifty-smithing"],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/Foxcapades/vsmod-thrifty-smithing","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Foxcapades%2Fvsmod-thrifty-smithing","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Foxcapades%2Fvsmod-thrifty-smithing/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Foxcapades%2Fvsmod-thrifty-smithing/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Foxcapades%2Fvsmod-thrifty-smithing/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Foxcapades","download_url":"https://codeload.github.com/Foxcapades/vsmod-thrifty-smithing/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Foxcapades%2Fvsmod-thrifty-smithing/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29543377,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-17T08:11:05.436Z","status":"ssl_error","status_checked_at":"2026-02-17T08:09:38.860Z","response_time":100,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["game","mod","smithing","vintage-story","vintagestory","vintagestory-mod"],"created_at":"2024-10-09T21:09:06.379Z","updated_at":"2026-02-17T12:03:38.205Z","avatar_url":"https://github.com/Foxcapades.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"= image:assets/icons/icon-32.png[] Thrifty Smithing\n:source-highlighter: highlightjs\n:vs-url: https://www.vintagestory.at/\n\nA link:{vs-url}[VintageStory] mod to recover scrap metal from the smithing\nprocess that would have otherwise gone to waste.\n\nimage:https://img.shields.io/github/v/tag/Foxcapades/vsmod-thrifty-smithing?label=version[GitHub Tag]\nimage:https://img.shields.io/badge/VS-v1.19%2B-rebeccapurple[title=\"Vintage Story v1.19+\", link={vs-url}]\nimage:https://img.shields.io/github/license/Foxcapades/vsmod-thrifty-smithing[GitHub License]\n\nOnce a smithing work is completed, the player who completed it will be given the\namount of whole bits that could be formed from the material removed from the\nwork while it was being crafted.\n\nIf a smithing work is completed by a helve hammer, the scrap bits will be\ndropped to the floor at the base of the anvil.\n\n== Configuration\n\nThe following configuration options are provided in the `thrifty-smithing.json`\nfile, with default values based on the base VintageStory experience.  Most of\nthese should not be changed unless necessitated by changes from other mods.\n\n[source, json]\n----\n{\n  \"voxelsPerIngot\": 42,\n  \"voxelsPerPlate\": 81,\n  \"materialUnitsPerIngot\": 100,\n  \"materialUnitsPerBit\": 5,\n  \"materialUnitsRecoveredModifier\": 1.0,\n  \"disallowedRecipes\": []\n}\n----\n\n[%header, cols=\"2m,2a,6a\"]\n|===\n| Option | Type | Description\n\n| voxelsPerIngot\n| `int`\n| The number of voxels a single ingot should be worth.\n\nValid value range: `[1..255]`\n\n| voxelsPerPlate\n| `int`\n| The number of voxels a single metal plate should be worth.\n\nValid value range: `[1..255]`\n\n| materialUnitsPerIngot\n| `int`\n| The amount of material required to craft an ingot.\n\nValid value range: `[1..65535]`\n\n| materialUnitsPerBit\n| `int`\n| The amount of material represented by a single metal bit.\n\nValid value range: `[1..255]`\n\n| materialUnitsRecoveredModifier\n| `float`\n| Percentage multiplier used to modify the amount of scrap material returned on\ncompletion of a smithing work.\n\nThe default value of `1.0` represents `100%`, a value of `0.75` would represent\n`75%`, `0.5` for `50%` and so on.\n\nValid value range: `[0.0..1.0]` (max precision of ~4 digits)\n\n| disallowedRecipes\n| array of `string`\n| Asset locations for recipes that should not reward any scrap on completion.\n\nFor example setting this to `[\"game:knifeblade-copper\"]` would mean that players\nare not given any scrap metal back when crafting a copper knife blade.\n|===\n\n== Extending / Augmenting Thrifty Smithing\n\nThriftySmithing currently offers a limited mechanism through which other mods\nmay alter the inputs used by ThriftySmithing to calculate metal bits returned as\nscrap after smithing an item.\n\nThriftySmithing looks for `ITreeAttribute` instances in an anvil's work item\n(`BlockEntityAnvil.WorkItemStack`) attributes whose names are prefixed with the\nstring `ef:ts:workData:`.  These `ITreeAttribute` instances may contain\nsub-attributes integer values under the keys `voxels`, `ingots`, and/or `plates`\nwhich may contain positive or negative values that will be applied to the scrap\nbit calculation.\n\n.Example Extension\n[source, csharp]\n----\n// Add a bunch of extra voxels to the scrap bit calculation\nvoid SetThriftySmithingVoxels(BlockEntityAnvil anvil)\n{\n  anvil.WorkItemStack.Attributes[\"ef:ts:workData:myMod\"] = new TreeAttribute\n  {\n      [\"voxels\"] = new IntAttribute(36),\n  }\n}\n----\n\n.Type Spec\n--\n.Root Level\n[%header, cols=\"3m,3m,6\"]\n|===\n| Key | Type | Notes\n\n| ef:ts:workData:*\n| ITreeAttribute\n| A tree attribute that may contain the sub attributes `voxels`, `ingots`,\n`plates`.\n|===\n\n.Sub Attributes\n[%header, cols=\"3m,3m,6\"]\n|===\n| Key | Type | Notes\n\n| voxels\n| IntAttribute\n| A positive or negative value in the range `[-128..127]` that may be provided\nto add or subtract from the scrap voxels for a smithing recipe.\n\n| ingots\n| IntAttribute\n|  A positive or negative value in the range `[-128..127]` that may be provided\nto add or subtract from the count of input ingots for a smithing recipe.\n\n| plates\n| IntAttribute\n| A positive or negative value in the range `[-128..127]` that may be provided\nto add or subtract from the count of input metal plates for a smithing recipe.\n|===\n--\n\n\n== Compatibility\n\n* Thrifty Smithing _should_ be compatible with mod-based smithing recipes that\nuse base game materials.\n* Thrifty Smithing _may_ be compatible with mod-based metals, assuming they\nprovide metal bit items with asset locations matching the base game's\n`metalbit-\\{material}` scheme.\n* Thrifty Smithing is _probably not_ compatible with mods that overhaul or make\nsignificant changes to the smithing system, especially with regard to anvils.\n* Thrifty Smithing is _not_ compatible with mods that allow smithing items\nwithout the use of anvils at all (it shouldn't cause a problem, it just won't\ngive back scrap without an anvil).\n\n=== Known Compatibilities\n\n[cols=\"1,3,6\"]\n|===\n| :green_heart:   | https://mods.vintagestory.at/knapster[Knapster v2.x.x] | No issue!\n| :green_heart:   | https://mods.vintagestory.at/ancientarmory[Ancient Armory v1.x.x] | Works fine!\n| :space_invader: | https://mods.vintagestory.at/amr[Anvil Metal Recovery] | Might work but seems silly.\n|===\n\n== How it Works\n\n=== Calculation\n\nifdef::env-github[]\n++++\n\u003cp align=\"center\"\u003e\n  \u003cimg width=\"329\" height=\"90\" src=\"docs/assets/scrap-calc-1.png\"\u003e\n\u003c/p\u003e\n++++\nendif::[]\n\nifndef::env-github[]\nimage::docs/assets/scrap-calc-1.png[align=\"center\"]\nendif::[]\n\n* `Mi` : material per ingot\n* `Mb` : material per metal bit\n* `Vg` : voxels granted per ingot\n* `Vi` : voxels input into the recipe\n* `Vr` : voxels required by the recipe\n\n=== Explanation\n\nIn base VintageStory it takes 100 units of metal to create an ingot\n(`Mi = 100`).  One ingot, when placed on an anvil, grants 42 workable voxels\n(`Vg = 42`).  This gives us a material to voxel ratio of 100:42 which means\nroughly 2.38095 units of material per voxel.\n\nThe returned scrap is measured in whole metal bits, each of which is worth 5\nunits of material (`Mb = 5`).  Partial bits are not recovered, meaning there is\nstill some material loss.\n\nThe amount of scrap metal recovered after a work is equal to the number of\nvoxels removed during the crafting process (`Vi - Vr`) multiplied by the\nmaterial-per-voxel value divided by the amount of material per bit then rounded\ndown to the nearest whole number.\n\nifdef::env-github[]\n++++\n\u003cp align=\"center\"\u003e\n  \u003cimg width=\"381\" height=\"168\" src=\"docs/assets/scrap-calc-2.png\"\u003e\n\u003c/p\u003e\n++++\nendif::[]\n\nifndef::env-github[]\nimage::docs/assets/scrap-calc-2.png[align=\"center\"]\nendif::[]\n\nAs an example we can use a knife blade.  A knife blade requires 17 voxels to\ncomplete (`Vr = 17`).  Assuming the player placed an ingot instead of a metal\nplate, that would mean 42 voxels went onto the anvil (`Vi = 42`).  42 input\nvoxels minus 17 required voxels leaves 25 voxels of scrap metal.  25 voxels\nwould be worth ~59.5 units of metal, which when divided into bits would give 11\nwhole bits that can be returned to the player and 0.9 bits\n(~4.5 units of material) lost.\n\nifdef::env-github[]\n++++\n\u003cp align=\"center\"\u003e\n  \u003cimg width=\"371\" height=\"306\" src=\"docs/assets/scrap-calc-3.png\"\u003e\n\u003c/p\u003e\n++++\nendif::[]\n\nifndef::env-github[]\nimage::docs/assets/scrap-calc-3.png[align=\"center\"]\nendif::[]\n\n== Credits\n\n* https://www.freepik.com/icon/anvil_1198980[Anvil Icon from Freepik]\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffoxcapades%2Fvsmod-thrifty-smithing","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffoxcapades%2Fvsmod-thrifty-smithing","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffoxcapades%2Fvsmod-thrifty-smithing/lists"}